Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1104)

Unified Diff: components/cronet/README.md

Issue 1383023003: [Cronet] Expose HttpURLConnection API from CronetEngine, not classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@builder2
Patch Set: address nits Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/cronet/android/java/package-list » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/README.md
diff --git a/components/cronet/README.md b/components/cronet/README.md
index c917eb2de8cd3d7bf990aa3967f7f5178f74165e..4d23a544fd53f91e72d042d89e55dd7a3b3582c9 100644
--- a/components/cronet/README.md
+++ b/components/cronet/README.md
@@ -144,22 +144,25 @@ Chrome browser.
# Using the java.net.HttpURLConnection API
Cronet offers an implementation of the [java.net.HttpURLConnection] API to make
it easier for apps which rely on this API to use Cronet.
-To use Cronet's implementation instead of the system's default implementation,
-simply do the following:
+To open individual connections using Cronet's implementation, do the following:
- CronetURLStreamHandlerFactory streamHandlerFactory =
- new CronetURLStreamHandlerFactory(engine);
- URL.setURLStreamHandlerFactory(streamHandlerFactory);
+ HttpURLConnection connection =
+ (HttpURLConnection)engine.openConnection(url);
+
+To use Cronet's implementation instead of the system's default implementation
+for all connections established using `URL.openConnection()` do the following:
+
+ URL.setURLStreamHandlerFactory(engine.createURLStreamHandlerFactory());
Cronet's
HttpURLConnection implementation has some limitations as compared to the system
implementation, including not utilizing the default system HTTP cache (Please
-see {@link org.chromium.net.urlconnection.CronetURLStreamHandlerFactory} for
+see {@link org.chromium.net.CronetEngine#createURLStreamHandlerFactory} for
more information).
You can configure Cronet and control caching through the
`CronetEngine.Builder` instance, `engineBuilder`
-(See [Configuring Cronet](#configuring-cronet) section), before you pass it
-into the `CronetURLStreamHandlerFactory` constructor.
+(See [Configuring Cronet](#configuring-cronet) section), before you build the
+`CronetEngine` and then call `CronetEngine.createURLStreamHandlerFactory()`.
[ByteBuffer]: https://developer.android.com/reference/java/nio/ByteBuffer.html
[chrome://net-internals#import]: chrome://net-internals#import
« no previous file with comments | « no previous file | components/cronet/android/java/package-list » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698