Chromium Code Reviews

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

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.
Jump to:
View unified diff |
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 #ifndef ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_ 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_
6 #define ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_ 6 #define ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/synchronization/lock.h" 12 #include "base/synchronization/lock.h"
13 #include "content/public/browser/resource_context.h" 13 #include "content/public/browser/resource_context.h"
14 14
15 class PrefService;
16
15 namespace net { 17 namespace net {
16 class URLRequestContextGetter; 18 class URLRequestContextGetter;
17 } 19 }
18 20
21 namespace media_device_id_salt {
22 class MediaDeviceIDSalt;
23 }
24
19 namespace android_webview { 25 namespace android_webview {
20 26
21 class AwResourceContext : public content::ResourceContext { 27 class AwResourceContext : public content::ResourceContext {
22 public: 28 public:
23 explicit AwResourceContext(net::URLRequestContextGetter* getter); 29 AwResourceContext(net::URLRequestContextGetter* getter,
30 PrefService* pref_service,
31 bool incognito);
24 ~AwResourceContext() override; 32 ~AwResourceContext() override;
25 33
26 void SetExtraHeaders(const GURL& url, const std::string& headers); 34 void SetExtraHeaders(const GURL& url, const std::string& headers);
27 std::string GetExtraHeaders(const GURL& url); 35 std::string GetExtraHeaders(const GURL& url);
28 36
29 // content::ResourceContext implementation. 37 // content::ResourceContext implementation.
30 net::HostResolver* GetHostResolver() override; 38 net::HostResolver* GetHostResolver() override;
31 net::URLRequestContext* GetRequestContext() override; 39 net::URLRequestContext* GetRequestContext() override;
40 SaltCallback GetMediaDeviceIDSalt() override;
32 41
33 private: 42 private:
34 net::URLRequestContextGetter* getter_; 43 net::URLRequestContextGetter* getter_;
35 44
36 base::Lock extra_headers_lock_; 45 base::Lock extra_headers_lock_;
37 std::map<std::string, std::string> extra_headers_; 46 std::map<std::string, std::string> extra_headers_;
47 scoped_refptr<media_device_id_salt::MediaDeviceIDSalt> media_device_id_salt_;
38 48
39 DISALLOW_COPY_AND_ASSIGN(AwResourceContext); 49 DISALLOW_COPY_AND_ASSIGN(AwResourceContext);
40 }; 50 };
41 51
42 } // namespace android_webview 52 } // namespace android_webview
43 53
44 #endif // ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_ 54 #endif // ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_CONTEXT_H_
OLDNEW
« no previous file with comments | « android_webview/browser/aw_browser_context.cc ('k') | android_webview/browser/aw_resource_context.cc » ('j') | no next file with comments »

Powered by Google App Engine