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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: content/public/browser/resource_context.h
diff --git a/content/public/browser/resource_context.h b/content/public/browser/resource_context.h
index 1308d7657b9136d3c4a36a73ffb22ba4afd2dda5..36b745e58bbf1e3a8ba98749786d6cfde9157dc1 100644
--- a/content/public/browser/resource_context.h
+++ b/content/public/browser/resource_context.h
@@ -68,11 +68,19 @@ class CONTENT_EXPORT ResourceContext : public base::SupportsUserData {
// resource metadata.
virtual bool AllowCameraAccess(const GURL& origin) = 0;
- // Returns a random salt string that is used for creating media device IDs.
- // The salt should be stored in the current user profile and should be reset
- // if cookies are cleared. Returns an empty string per default.
- // TODO(perkj): Make this method pure virtual when crbug/315022 is fixed.
- virtual std::string GetMediaDeviceIDSalt();
+ // Returns a callback that can be invoked to get a random salt
+ // string that is used for creating media device IDs. The salt
+ // should be stored in the current user profile and should be reset
+ // if cookies are cleared. The default is an empty string.
+ //
+ // It is safe to hold on to the callback returned and use it without
+ // regard to the lifetime of ResourceContext, although in general
+ // you should not use it long after the profile has been destroyed.
+ //
+ // TODO(perkj): Make this method pure virtual when crbug/315022 is
+ // fixed.
+ typedef base::Callback<std::string()> SaltCallback;
+ virtual SaltCallback GetMediaDeviceIDSalt();
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698