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

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

Issue 1987643002: Make default media device ID salts random by default (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
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
7 #include "content/public/browser/browser_thread.h" 7 #include "content/public/browser/browser_thread.h"
8 #include "net/url_request/url_request_context.h" 8 #include "net/url_request/url_request_context.h"
9 #include "net/url_request/url_request_context_getter.h" 9 #include "net/url_request/url_request_context_getter.h"
10 10
11 using content::BrowserThread; 11 using content::BrowserThread;
12 12
13 namespace android_webview { 13 namespace android_webview {
14 14
15 AwResourceContext::AwResourceContext(net::URLRequestContextGetter* getter) 15 AwResourceContext::AwResourceContext(net::URLRequestContextGetter* getter)
16 : getter_(getter) { 16 : getter_(getter), media_device_id_salt_(CreateRandomMediaDeviceIDSalt()) {
17 DCHECK(getter_); 17 DCHECK(getter_);
18 } 18 }
19 19
20 AwResourceContext::~AwResourceContext() { 20 AwResourceContext::~AwResourceContext() {
21 } 21 }
22 22
23 void AwResourceContext::SetExtraHeaders( 23 void AwResourceContext::SetExtraHeaders(
24 const GURL& url, const std::string& headers) { 24 const GURL& url, const std::string& headers) {
25 DCHECK_CURRENTLY_ON(BrowserThread::UI); 25 DCHECK_CURRENTLY_ON(BrowserThread::UI);
26 if (!url.is_valid()) return; 26 if (!url.is_valid()) return;
(...skipping 16 matching lines...) Expand all
43 net::HostResolver* AwResourceContext::GetHostResolver() { 43 net::HostResolver* AwResourceContext::GetHostResolver() {
44 DCHECK_CURRENTLY_ON(BrowserThread::IO); 44 DCHECK_CURRENTLY_ON(BrowserThread::IO);
45 return getter_->GetURLRequestContext()->host_resolver(); 45 return getter_->GetURLRequestContext()->host_resolver();
46 } 46 }
47 47
48 net::URLRequestContext* AwResourceContext::GetRequestContext() { 48 net::URLRequestContext* AwResourceContext::GetRequestContext() {
49 DCHECK_CURRENTLY_ON(BrowserThread::IO); 49 DCHECK_CURRENTLY_ON(BrowserThread::IO);
50 return getter_->GetURLRequestContext(); 50 return getter_->GetURLRequestContext();
51 } 51 }
52 52
53 content::ResourceContext::SaltCallback
54 AwResourceContext::GetMediaDeviceIDSalt() {
55 return CreateSaltCallback(media_device_id_salt_);
56 }
57
53 } // namespace android_webview 58 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698