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

Side by Side Diff: components/cronet/android/cronet_url_request_context.cc

Issue 726013002: [Cronet] Hook up library loader, system proxy and network change notifier to async api. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self review, cl format Created 5 years, 11 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 #include "components/cronet/android/cronet_url_request_context.h" 5 #include "components/cronet/android/cronet_url_request_context.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 context_adapter->StopNetLog(); 99 context_adapter->StopNetLog();
100 } 100 }
101 101
102 static jint SetMinLogLevel(JNIEnv* env, jobject jcaller, jint jlog_level) { 102 static jint SetMinLogLevel(JNIEnv* env, jobject jcaller, jint jlog_level) {
103 jint old_log_level = static_cast<jint>(logging::GetMinLogLevel()); 103 jint old_log_level = static_cast<jint>(logging::GetMinLogLevel());
104 // MinLogLevel is global, shared by all URLRequestContexts. 104 // MinLogLevel is global, shared by all URLRequestContexts.
105 logging::SetMinLogLevel(static_cast<int>(jlog_level)); 105 logging::SetMinLogLevel(static_cast<int>(jlog_level));
106 return old_log_level; 106 return old_log_level;
107 } 107 }
108 108
109 // Called on application's main Java thread.
110 static void InitRequestContextOnMainThread(JNIEnv* env,
111 jobject jcaller,
112 jlong jurl_request_context_adapter) {
113 if (jurl_request_context_adapter == 0)
114 return;
115 CronetURLRequestContextAdapter* context_adapter =
116 reinterpret_cast<CronetURLRequestContextAdapter*>(
117 jurl_request_context_adapter);
118 context_adapter->InitRequestContextOnMainThread();
119 }
120
109 } // namespace cronet 121 } // namespace cronet
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698