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

Side by Side Diff: android_webview/browser/aw_resource_context.cc

Issue 1981913002: *DRAFT* Move MediaDeviceIDSalt from chrome/ to components/ and use it in Android WebView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « android_webview/browser/aw_resource_context.h ('k') | chrome/browser/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "android_webview/browser/aw_resource_context.h" 5 #include "android_webview/browser/aw_resource_context.h"
6 6 #include "components/media_device_id_salt/media_device_id_salt.h"
7 #include "components/prefs/pref_service.h"
7 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
8 #include "net/url_request/url_request_context.h" 9 #include "net/url_request/url_request_context.h"
9 #include "net/url_request/url_request_context_getter.h" 10 #include "net/url_request/url_request_context_getter.h"
10 11
11 using content::BrowserThread; 12 using content::BrowserThread;
13 using media_device_id_salt::MediaDeviceIDSalt;
12 14
13 namespace android_webview { 15 namespace android_webview {
14 16
15 AwResourceContext::AwResourceContext(net::URLRequestContextGetter* getter) 17 AwResourceContext::AwResourceContext(net::URLRequestContextGetter* getter,
16 : getter_(getter) { 18 PrefService* pref_service,
19 bool incognito)
20 : getter_(getter),
21 media_device_id_salt_(new MediaDeviceIDSalt(pref_service, incognito)) {
17 DCHECK(getter_); 22 DCHECK(getter_);
18 } 23 }
19 24
20 AwResourceContext::~AwResourceContext() { 25 AwResourceContext::~AwResourceContext() {
21 } 26 }
22 27
23 void AwResourceContext::SetExtraHeaders( 28 void AwResourceContext::SetExtraHeaders(
24 const GURL& url, const std::string& headers) { 29 const GURL& url, const std::string& headers) {
25 DCHECK_CURRENTLY_ON(BrowserThread::UI); 30 DCHECK_CURRENTLY_ON(BrowserThread::UI);
26 if (!url.is_valid()) return; 31 if (!url.is_valid()) return;
(...skipping 16 matching lines...) Expand all
43 net::HostResolver* AwResourceContext::GetHostResolver() { 48 net::HostResolver* AwResourceContext::GetHostResolver() {
44 DCHECK_CURRENTLY_ON(BrowserThread::IO); 49 DCHECK_CURRENTLY_ON(BrowserThread::IO);
45 return getter_->GetURLRequestContext()->host_resolver(); 50 return getter_->GetURLRequestContext()->host_resolver();
46 } 51 }
47 52
48 net::URLRequestContext* AwResourceContext::GetRequestContext() { 53 net::URLRequestContext* AwResourceContext::GetRequestContext() {
49 DCHECK_CURRENTLY_ON(BrowserThread::IO); 54 DCHECK_CURRENTLY_ON(BrowserThread::IO);
50 return getter_->GetURLRequestContext(); 55 return getter_->GetURLRequestContext();
51 } 56 }
52 57
58 content::ResourceContext::SaltCallback
59 AwResourceContext::GetMediaDeviceIDSalt() {
60 return base::Bind(&MediaDeviceIDSalt::GetSalt, media_device_id_salt_);
61 }
62
53 } // namespace android_webview 63 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/aw_resource_context.h ('k') | chrome/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698