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

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

Issue 143003031: Allow retrieval of media device ID salt even after ResourceContext has gone away. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test. Created 6 years, 10 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 | Annotate | Revision Log
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 <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // Returns true if microphone access is allowed for |origin|. Used to 61 // Returns true if microphone access is allowed for |origin|. Used to
62 // determine what level of authorization is given to |origin| to access 62 // determine what level of authorization is given to |origin| to access
63 // resource metadata. 63 // resource metadata.
64 virtual bool AllowMicAccess(const GURL& origin) = 0; 64 virtual bool AllowMicAccess(const GURL& origin) = 0;
65 65
66 // Returns true if web camera access is allowed for |origin|. Used to 66 // Returns true if web camera access is allowed for |origin|. Used to
67 // determine what level of authorization is given to |origin| to access 67 // determine what level of authorization is given to |origin| to access
68 // resource metadata. 68 // resource metadata.
69 virtual bool AllowCameraAccess(const GURL& origin) = 0; 69 virtual bool AllowCameraAccess(const GURL& origin) = 0;
70 70
71 // Returns a random salt string that is used for creating media device IDs. 71 // Returns a callback that can be invoked to get a random salt
72 // The salt should be stored in the current user profile and should be reset 72 // string that is used for creating media device IDs. The salt
73 // if cookies are cleared. Returns an empty string per default. 73 // should be stored in the current user profile and should be reset
74 // TODO(perkj): Make this method pure virtual when crbug/315022 is fixed. 74 // if cookies are cleared. The default is an empty string.
75 virtual std::string GetMediaDeviceIDSalt(); 75 //
76 // It is safe to hold on to the callback returned and use it without
77 // regard to the lifetime of ResourceContext, although in general
78 // you should not use it long after the profile has been destroyed.
79 //
80 // TODO(perkj): Make this method pure virtual when crbug/315022 is
81 // fixed.
82 typedef base::Callback<std::string()> SaltCallback;
83 virtual SaltCallback GetMediaDeviceIDSalt();
76 }; 84 };
77 85
78 } // namespace content 86 } // namespace content
79 87
80 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_CONTEXT_H_ 88 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698