Add an implementation of url_loader.mojom using OkHttp
This CL is the beginnings of an implementation of url_loader.mojom using the OkHttp library. OkHttp is a relatively simple HTTP client library for Android that implements HTTP/1.1 and HTTP/2.0. We might want to use OkHttp to bootstrap into a more full-featured network_service implementation based on //net. R=jamesr@chromium.org Review URL: https://codereview.chromium.org/930673002
This commit is contained in:
@@ -85,6 +85,7 @@ android_library("java") {
|
||||
"//mojo/public/java:bindings",
|
||||
"//mojo/public/java:system",
|
||||
"//mojo/services/network/public/interfaces:interfaces_java",
|
||||
"//sky/services/oknet",
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,9 @@ import org.chromium.mojo.system.MessagePipeHandle;
|
||||
import org.chromium.mojo.system.MojoException;
|
||||
import org.chromium.mojo.system.Pair;
|
||||
import org.chromium.mojo.system.impl.CoreImpl;
|
||||
import org.chromium.mojom.mojo.NetworkService;
|
||||
import org.chromium.mojom.mojo.ServiceProvider;
|
||||
import org.domokit.oknet.NetworkServiceImpl;
|
||||
|
||||
/**
|
||||
* A class to intialize the network.
|
||||
@@ -42,6 +44,10 @@ public class JavaServiceProvider implements ServiceProvider {
|
||||
|
||||
@Override
|
||||
public void connectToService(String interfaceName, MessagePipeHandle pipe) {
|
||||
if (interfaceName.equals(NetworkService.MANAGER.getName())) {
|
||||
NetworkService.MANAGER.bind(new NetworkServiceImpl(mCore), pipe);
|
||||
return;
|
||||
}
|
||||
pipe.close();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user