diff options
author | hush <hush@chromium.org> | 2014-10-06 19:13:54 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-07 02:14:11 +0000 |
commit | fdb00d529bf47bffd9a4342aae15d001b70a2c71 (patch) | |
tree | 33530f94f3cc41374a0c3c1f79d16f360bddd982 /android_webview/browser | |
parent | 48d951c6936168b4d7d30628e2116745845e55b5 (diff) | |
download | chromium_src-fdb00d529bf47bffd9a4342aae15d001b70a2c71.zip chromium_src-fdb00d529bf47bffd9a4342aae15d001b70a2c71.tar.gz chromium_src-fdb00d529bf47bffd9a4342aae15d001b70a2c71.tar.bz2 |
Fix race condition in DRP
There is a race condition between the IO thread and the UI thread when
DataReductionProxyAuthRequestHandler is constructed on the IO thread and
WebView tries to set the DRP key on the UI thread.
This CL also makes DataReductionProxyAuthRequestHandler ignore empty
DRP key.
BUG=418344
Review URL: https://codereview.chromium.org/614603004
Cr-Commit-Position: refs/heads/master@{#298325}
Diffstat (limited to 'android_webview/browser')
-rw-r--r-- | android_webview/browser/net/aw_url_request_context_getter.cc | 5 | ||||
-rw-r--r-- | android_webview/browser/net/aw_url_request_context_getter.h | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/android_webview/browser/net/aw_url_request_context_getter.cc b/android_webview/browser/net/aw_url_request_context_getter.cc index 9487bde..bd6312e 100644 --- a/android_webview/browser/net/aw_url_request_context_getter.cc +++ b/android_webview/browser/net/aw_url_request_context_getter.cc @@ -283,4 +283,9 @@ net::NetLog* AwURLRequestContextGetter::GetNetLog() { return net_log_.get(); } +void AwURLRequestContextGetter::SetKeyOnIO(const std::string& key) { + DCHECK(data_reduction_proxy_auth_request_handler_); + data_reduction_proxy_auth_request_handler_->InitAuthentication(key); +} + } // namespace android_webview diff --git a/android_webview/browser/net/aw_url_request_context_getter.h b/android_webview/browser/net/aw_url_request_context_getter.h index 122cde7..3154b52 100644 --- a/android_webview/browser/net/aw_url_request_context_getter.h +++ b/android_webview/browser/net/aw_url_request_context_getter.h @@ -52,6 +52,10 @@ class AwURLRequestContextGetter : public net::URLRequestContextGetter { // threads (UI and IO). net::NetLog* GetNetLog(); + // This should be called before the network stack is ever used. It can be + // called again afterwards if the key updates. + void SetKeyOnIO(const std::string& key); + private: friend class AwBrowserContext; virtual ~AwURLRequestContextGetter(); |