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

Unified Diff: android_webview/native/aw_contents_statics.cc

Issue 412143009: Moved data reduction proxy initialization logic to ProfileImplIOData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 6 years, 4 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 | « android_webview/browser/net/aw_url_request_context_getter.cc ('k') | chrome/browser/io_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_contents_statics.cc
diff --git a/android_webview/native/aw_contents_statics.cc b/android_webview/native/aw_contents_statics.cc
index 9888aad4109315bf5ed7a5d5c8fafc6437ccb7cc..5a6e1301c64cd4febd37b701cacc766383cb47a4 100644
--- a/android_webview/native/aw_contents_statics.cc
+++ b/android_webview/native/aw_contents_statics.cc
@@ -5,6 +5,7 @@
#include "android_webview/native/aw_contents_statics.h"
#include "android_webview/browser/aw_browser_context.h"
+#include "android_webview/browser/net/aw_url_request_context_getter.h"
#include "base/android/jni_string.h"
#include "base/android/scoped_java_ref.h"
#include "base/callback.h"
@@ -54,11 +55,18 @@ void ClearClientCertPreferences(JNIEnv* env, jclass, jobject callback) {
void SetDataReductionProxyKey(JNIEnv* env, jclass, jstring key) {
AwBrowserContext* browser_context = AwBrowserContext::GetDefault();
DCHECK(browser_context);
- DataReductionProxyAuthRequestHandler* drp_auth_request_handler =
- browser_context->GetDataReductionProxyAuthRequestHandler();
- if (drp_auth_request_handler)
- drp_auth_request_handler->SetKey(
+ DCHECK(browser_context->GetRequestContext());
+ AwURLRequestContextGetter* aw_url_request_context_getter =
+ static_cast<AwURLRequestContextGetter*>(
+ browser_context->GetRequestContext());
+ DataReductionProxyAuthRequestHandler* auth_request_handler =
+ aw_url_request_context_getter->GetDataReductionProxyAuthRequestHandler();
+ if (auth_request_handler) {
+ auth_request_handler->SetKeyOnUI(
ConvertJavaStringToUTF8(env, key));
+ } else {
+ DLOG(ERROR) << "Data reduction proxy auth request handler does not exist";
+ }
}
// static
« no previous file with comments | « android_webview/browser/net/aw_url_request_context_getter.cc ('k') | chrome/browser/io_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698