diff options
author | yzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-27 07:18:46 +0000 |
---|---|---|
committer | yzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-27 07:18:46 +0000 |
commit | 1a559448088694cd4dc077c7a14436942fda5061 (patch) | |
tree | c539c7259f878cf6c43bbbbc2515eaa46b0f4f45 /chrome/browser/pepper_flash_settings_manager.h | |
parent | 3f84377fbfae99a755a20f8a9a5390526cec9ce1 (diff) | |
download | chromium_src-1a559448088694cd4dc077c7a14436942fda5061.zip chromium_src-1a559448088694cd4dc077c7a14436942fda5061.tar.gz chromium_src-1a559448088694cd4dc077c7a14436942fda5061.tar.bz2 |
Pepper Flash settings integration: implement "deauthorize content licenses".
A few notes about PepperFlashSettingsManager:
- It doesn't re-establish a channel for each request. It might seem unnecessary at this point. But that is needed for implementing content settings (camera/mic and peer networking), which requires more interactions with the broker process.
- Similarly, the support of multiple in-flight requests isn't very useful for deauthorizing content licenses, but that is useful for content settings, e.g., sending multiple GetPermissionSettings requests for different setting types.
BUG=112190
TEST=None
Review URL: https://chromiumcodereview.appspot.com/10391173
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139210 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/pepper_flash_settings_manager.h')
-rw-r--r-- | chrome/browser/pepper_flash_settings_manager.h | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/chrome/browser/pepper_flash_settings_manager.h b/chrome/browser/pepper_flash_settings_manager.h index 88bd1b0..4a20df3 100644 --- a/chrome/browser/pepper_flash_settings_manager.h +++ b/chrome/browser/pepper_flash_settings_manager.h @@ -7,10 +7,15 @@ #pragma once #include "base/basictypes.h" +#include "base/memory/ref_counted.h" class PluginPrefs; class PrefService; +namespace content { +class BrowserContext; +} + namespace webkit { struct WebPluginInfo; } @@ -19,6 +24,20 @@ struct WebPluginInfo; // read/write Pepper Flash settings. class PepperFlashSettingsManager { public: + class Client { + public: + virtual ~Client() {} + + virtual void OnDeauthorizeContentLicensesCompleted(uint32 request_id, + bool success) = 0; + }; + + // |client| must outlive this object. It is guaranteed that |client| won't + // receive any notifications after this object goes away. + PepperFlashSettingsManager(Client* client, + content::BrowserContext* browser_context); + ~PepperFlashSettingsManager(); + // |plugin_info| will be updated if it is not NULL and the method returns // true. static bool IsPepperFlashInUse(PluginPrefs* plugin_prefs, @@ -26,8 +45,40 @@ class PepperFlashSettingsManager { static void RegisterUserPrefs(PrefService* prefs); + // Requests to deauthorize content licenses. + // Client::OnDeauthorizeContentLicensesCompleted() will be called when the + // operation is completed. + // The return value is the same as the request ID passed into + // Client::OnDeauthorizeContentLicensesCompleted(). + uint32 DeauthorizeContentLicenses(); + private: - DISALLOW_IMPLICIT_CONSTRUCTORS(PepperFlashSettingsManager); + // Core does most of the work. It is ref-counted so that its lifespan can be + // independent of the containing object's: + // - The manager can be deleted on the UI thread while the core still being + // used on the I/O thread. + // - The manager can delete the core when it encounters errors and create + // another one to handle new requests. + class Core; + + uint32 GetNextRequestId(); + + void EnsureCoreExists(); + + // Notified by |core_| when an error occurs. + void OnError(); + + // |client_| is not owned by this object and must outlive it. + Client* client_; + + // The browser context for the profile. + content::BrowserContext* browser_context_; + + scoped_refptr<Core> core_; + + uint32 next_request_id_; + + DISALLOW_COPY_AND_ASSIGN(PepperFlashSettingsManager); }; #endif // CHROME_BROWSER_PEPPER_FLASH_SETTINGS_MANAGER_H_ |