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

Side by Side Diff: content/public/browser/resource_context.h

Issue 2820163002: Move MediaDeviceIDSalt from ProfileIOData to ProfileImpl. (Closed)
Patch Set: merge Created 3 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_RESOURCE_CONTEXT_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_CONTEXT_H_
6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_CONTEXT_H_ 6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_CONTEXT_H_
7 7
8 #include <stdint.h>
9
10 #include <memory>
11 #include <string>
12
13 #include "base/callback.h"
14 #include "base/supports_user_data.h" 8 #include "base/supports_user_data.h"
15 #include "build/build_config.h"
16 #include "content/common/content_export.h" 9 #include "content/common/content_export.h"
17 10
18 namespace net { 11 namespace net {
19 class HostResolver; 12 class HostResolver;
20 class URLRequestContext; 13 class URLRequestContext;
21 } 14 }
22 15
23 namespace content { 16 namespace content {
24 17
25 // ResourceContext contains the relevant context information required for 18 // ResourceContext contains the relevant context information required for
26 // resource loading. It lives on the IO thread, although it is constructed on 19 // resource loading. It lives on the IO thread, although it is constructed on
27 // the UI thread. It must be destructed on the IO thread. 20 // the UI thread. It must be destructed on the IO thread.
21 // TODO(mmenke): Get rid of this class.
28 class CONTENT_EXPORT ResourceContext : public base::SupportsUserData { 22 class CONTENT_EXPORT ResourceContext : public base::SupportsUserData {
29 public: 23 public:
30 ResourceContext(); 24 ResourceContext();
31 ~ResourceContext() override; 25 ~ResourceContext() override;
32 virtual net::HostResolver* GetHostResolver() = 0; 26 virtual net::HostResolver* GetHostResolver() = 0;
33 27
34 // DEPRECATED: This is no longer a valid given isolated apps/sites and 28 // DEPRECATED: This is no longer a valid given isolated apps/sites and
35 // storage partitioning. This getter returns the default context associated 29 // storage partitioning. This getter returns the default context associated
36 // with a BrowsingContext. 30 // with a BrowsingContext.
37 virtual net::URLRequestContext* GetRequestContext() = 0; 31 virtual net::URLRequestContext* GetRequestContext() = 0;
38
39 // Returns a random salt string that is used for creating media device IDs.
40 // Returns a random string by default.
41 virtual std::string GetMediaDeviceIDSalt();
42
43 // Utility function useful for embedders. Only needs to be called if
44 // 1) The embedder needs to use a new salt, and
45 // 2) The embedder saves its salt across restarts.
46 static std::string CreateRandomMediaDeviceIDSalt();
47
48 private:
49 const std::string media_device_id_salt_;
50 }; 32 };
51 33
52 } // namespace content 34 } // namespace content
53 35
54 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_CONTEXT_H_ 36 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_CONTEXT_H_
OLDNEW
« no previous file with comments | « content/public/browser/browser_context.h ('k') | extensions/browser/api/webcam_private/webcam_private_api_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698