Commit 76b3a496 authored by bengr's avatar bengr Committed by Commit bot

Hook SetKeyOnIO in Webview to DataReductionProxyIOData

AwURLRequestContextGetter::SetKeyOnIO now calls into the
DataReductionProxyAuthRequestHandler that is managed by
DataReductionProxyIOData.

BUG=453519

Review URL: https://codereview.chromium.org/881893004

Cr-Commit-Position: refs/heads/master@{#315119}
parent 0420f3be
...@@ -19,11 +19,8 @@ ...@@ -19,11 +19,8 @@
#include "base/threading/sequenced_worker_pool.h" #include "base/threading/sequenced_worker_pool.h"
#include "base/threading/worker_pool.h" #include "base/threading/worker_pool.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth_request_handler.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth_request_handler.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h" #include "content/public/browser/content_browser_client.h"
#include "content/public/browser/cookie_store_factory.h" #include "content/public/browser/cookie_store_factory.h"
...@@ -47,7 +44,6 @@ ...@@ -47,7 +44,6 @@
#include "net/url_request/url_request_interceptor.h" #include "net/url_request/url_request_interceptor.h"
using content::BrowserThread; using content::BrowserThread;
using data_reduction_proxy::DataReductionProxySettings;
namespace android_webview { namespace android_webview {
...@@ -271,18 +267,14 @@ void AwURLRequestContextGetter::SetHandlersAndInterceptors( ...@@ -271,18 +267,14 @@ void AwURLRequestContextGetter::SetHandlersAndInterceptors(
request_interceptors_.swap(request_interceptors); request_interceptors_.swap(request_interceptors);
} }
data_reduction_proxy::DataReductionProxyAuthRequestHandler*
AwURLRequestContextGetter::GetDataReductionProxyAuthRequestHandler() const {
return data_reduction_proxy_auth_request_handler_.get();
}
net::NetLog* AwURLRequestContextGetter::GetNetLog() { net::NetLog* AwURLRequestContextGetter::GetNetLog() {
return net_log_.get(); return net_log_.get();
} }
void AwURLRequestContextGetter::SetKeyOnIO(const std::string& key) { void AwURLRequestContextGetter::SetKeyOnIO(const std::string& key) {
DCHECK(data_reduction_proxy_auth_request_handler_); DCHECK(AwBrowserContext::GetDefault()->GetDataReductionProxyIOData());
data_reduction_proxy_auth_request_handler_->InitAuthentication(key); AwBrowserContext::GetDefault()->GetDataReductionProxyIOData()->
auth_request_handler()->InitAuthentication(key);
} }
} // namespace android_webview } // namespace android_webview
...@@ -23,10 +23,6 @@ class URLRequestContext; ...@@ -23,10 +23,6 @@ class URLRequestContext;
class URLRequestJobFactory; class URLRequestJobFactory;
} }
namespace data_reduction_proxy {
class DataReductionProxyAuthRequestHandler;
}
namespace android_webview { namespace android_webview {
class AwNetworkDelegate; class AwNetworkDelegate;
...@@ -43,9 +39,6 @@ class AwURLRequestContextGetter : public net::URLRequestContextGetter { ...@@ -43,9 +39,6 @@ class AwURLRequestContextGetter : public net::URLRequestContextGetter {
scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner()
const override; const override;
data_reduction_proxy::DataReductionProxyAuthRequestHandler*
GetDataReductionProxyAuthRequestHandler() const;
// NetLog is thread-safe, so clients can call this method from arbitrary // NetLog is thread-safe, so clients can call this method from arbitrary
// threads (UI and IO). // threads (UI and IO).
net::NetLog* GetNetLog(); net::NetLog* GetNetLog();
...@@ -75,8 +68,6 @@ class AwURLRequestContextGetter : public net::URLRequestContextGetter { ...@@ -75,8 +68,6 @@ class AwURLRequestContextGetter : public net::URLRequestContextGetter {
scoped_ptr<net::NetLog> net_log_; scoped_ptr<net::NetLog> net_log_;
scoped_ptr<net::URLRequestContext> url_request_context_; scoped_ptr<net::URLRequestContext> url_request_context_;
scoped_ptr<net::ProxyConfigService> proxy_config_service_; scoped_ptr<net::ProxyConfigService> proxy_config_service_;
scoped_ptr<data_reduction_proxy::DataReductionProxyAuthRequestHandler>
data_reduction_proxy_auth_request_handler_;
scoped_ptr<net::URLRequestJobFactory> job_factory_; scoped_ptr<net::URLRequestJobFactory> job_factory_;
scoped_ptr<net::HttpTransactionFactory> main_http_factory_; scoped_ptr<net::HttpTransactionFactory> main_http_factory_;
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "base/android/jni_string.h" #include "base/android/jni_string.h"
#include "base/android/scoped_java_ref.h" #include "base/android/scoped_java_ref.h"
#include "base/callback.h" #include "base/callback.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth_request_handler.h"
#include "content/public/browser/android/synchronous_compositor.h" #include "content/public/browser/android/synchronous_compositor.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/common/url_constants.h" #include "content/public/common/url_constants.h"
...@@ -21,7 +20,6 @@ using base::android::AttachCurrentThread; ...@@ -21,7 +20,6 @@ using base::android::AttachCurrentThread;
using base::android::ConvertJavaStringToUTF8; using base::android::ConvertJavaStringToUTF8;
using base::android::ScopedJavaGlobalRef; using base::android::ScopedJavaGlobalRef;
using content::BrowserThread; using content::BrowserThread;
using data_reduction_proxy::DataReductionProxyAuthRequestHandler;
namespace android_webview { namespace android_webview {
...@@ -59,8 +57,7 @@ void SetDataReductionProxyKey(JNIEnv* env, jclass, jstring key) { ...@@ -59,8 +57,7 @@ void SetDataReductionProxyKey(JNIEnv* env, jclass, jstring key) {
DCHECK(browser_context->GetRequestContext()); DCHECK(browser_context->GetRequestContext());
// The following call to GetRequestContext() could possibly be the first such // The following call to GetRequestContext() could possibly be the first such
// call, which means AwURLRequestContextGetter::InitializeURLRequestContext // call, which means AwURLRequestContextGetter::InitializeURLRequestContext
// will be called on IO thread as a result. InitializeURLRequestContext() // will be called on IO thread as a result.
// will initialize DataReductionProxyAuthRequestHandler.
AwURLRequestContextGetter* aw_url_request_context_getter = AwURLRequestContextGetter* aw_url_request_context_getter =
static_cast<AwURLRequestContextGetter*>( static_cast<AwURLRequestContextGetter*>(
browser_context->GetRequestContext()); browser_context->GetRequestContext());
......
...@@ -85,6 +85,10 @@ class DataReductionProxyIOData { ...@@ -85,6 +85,10 @@ class DataReductionProxyIOData {
return statistics_prefs_.get(); return statistics_prefs_.get();
} }
DataReductionProxyAuthRequestHandler* auth_request_handler() const {
return auth_request_handler_.get();
}
net::ProxyDelegate* proxy_delegate() const { net::ProxyDelegate* proxy_delegate() const {
return proxy_delegate_.get(); return proxy_delegate_.get();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment