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:
Adam Barth
2015-02-18 16:53:04 -08:00
parent e72b889e5e
commit 5c1f4d1dab
2 changed files with 7 additions and 0 deletions

View File

@@ -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",
]
}

View File

@@ -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();
}
}