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

Side by Side Diff: components/cronet/android/java/src/org/chromium/net/ChromiumUrlRequestContext.java

Issue 617393005: Make URLRequestContextAdapter initialization asynchronous (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.net; 5 package org.chromium.net;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.os.ConditionVariable; 8 import android.os.ConditionVariable;
9 import android.os.Process; 9 import android.os.Process;
10 import android.util.Log; 10 import android.util.Log;
(...skipping 19 matching lines...) Expand all
30 private final ConditionVariable mStarted = new ConditionVariable(); 30 private final ConditionVariable mStarted = new ConditionVariable();
31 31
32 /** 32 /**
33 * Constructor. 33 * Constructor.
34 * 34 *
35 */ 35 */
36 protected ChromiumUrlRequestContext(Context context, String userAgent, 36 protected ChromiumUrlRequestContext(Context context, String userAgent,
37 String config) { 37 String config) {
38 mChromiumUrlRequestContextAdapter = nativeCreateRequestContextAdapter( 38 mChromiumUrlRequestContextAdapter = nativeCreateRequestContextAdapter(
39 context, userAgent, getLoggingLevel(), config); 39 context, userAgent, getLoggingLevel(), config);
40 if (mChromiumUrlRequestContextAdapter == 0) 40 if (mChromiumUrlRequestContextAdapter == 0) {
41 throw new NullPointerException("Context Adapter creation failed"); 41 throw new NullPointerException("Context Adapter creation failed");
42 42 }
43 // TODO(mef): Revisit the need of block here.
44 mStarted.block(2000);
45 } 43 }
46 44
47 /** 45 /**
48 * Returns the version of this network stack formatted as N.N.N.N/X where 46 * Returns the version of this network stack formatted as N.N.N.N/X where
49 * N.N.N.N is the version of Chromium and X is the revision number. 47 * N.N.N.N is the version of Chromium and X is the revision number.
50 */ 48 */
51 public static String getVersion() { 49 public static String getVersion() {
52 return Version.getVersion(); 50 return Version.getVersion();
53 } 51 }
54 52
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 127
130 private native void nativeInitializeStatistics(); 128 private native void nativeInitializeStatistics();
131 129
132 private native String nativeGetStatisticsJSON(String filter); 130 private native String nativeGetStatisticsJSON(String filter);
133 131
134 private native void nativeStartNetLogToFile( 132 private native void nativeStartNetLogToFile(
135 long chromiumUrlRequestContextAdapter, String fileName); 133 long chromiumUrlRequestContextAdapter, String fileName);
136 134
137 private native void nativeStopNetLog(long chromiumUrlRequestContextAdapter); 135 private native void nativeStopNetLog(long chromiumUrlRequestContextAdapter);
138 } 136 }
OLDNEW
« no previous file with comments | « no previous file | components/cronet/android/url_request_adapter.cc » ('j') | components/cronet/android/url_request_adapter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698