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

Unified Diff: media/blink/webencryptedmediaclient_impl.h

Issue 1052273004: Extract requestMediaKeySystemAccess() algorithm. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 9 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: media/blink/webencryptedmediaclient_impl.h
diff --git a/media/blink/webencryptedmediaclient_impl.h b/media/blink/webencryptedmediaclient_impl.h
index 2d9a6c2237e735744a5147d9eccec38e9f8a864b..cf5b7f2e4806ad723e186b37be571843411151f0 100644
--- a/media/blink/webencryptedmediaclient_impl.h
+++ b/media/blink/webencryptedmediaclient_impl.h
@@ -10,14 +10,21 @@
#include "base/containers/scoped_ptr_hash_map.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
-#include "media/base/cdm_factory.h"
#include "media/base/media_export.h"
-#include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h"
+#include "media/blink/key_system_config_selector.h"
#include "third_party/WebKit/public/platform/WebEncryptedMediaClient.h"
-#include "third_party/WebKit/public/web/WebSecurityOrigin.h"
+
+namespace blink {
+
+class WebContentDecryptionModuleResult;
+class WebMediaKeySystemConfiguration;
+class WebSecurityOrigin;
+
+} // namespace blink
namespace media {
+class CdmFactory;
class KeySystems;
class MediaPermission;
@@ -41,30 +48,32 @@ class MEDIA_EXPORT WebEncryptedMediaClientImpl
blink::WebContentDecryptionModuleResult result);
private:
- // Pick a supported configuration if possible, and complete the request. This
- // method may asynchronously invoke itself after prompting for permissions.
- void SelectSupportedConfiguration(blink::WebEncryptedMediaRequest request,
- bool was_permission_requested,
- bool is_permission_granted);
-
// Report usage of key system to UMA. There are 2 different counts logged:
// 1. The key system is requested.
// 2. The requested key system and options are supported.
// Each stat is only reported once per renderer frame per key system.
class Reporter;
+ // Complete a requestMediaKeySystemAccess() request with a supported
+ // accumulated configuration.
+ void OnRequestSucceeded(
+ blink::WebEncryptedMediaRequest request,
+ const blink::WebMediaKeySystemConfiguration& accumulated_configuration);
+
+ // Complete a requestMediaKeySystemAccess() request with an error message.
+ void OnRequestNotSupported(
+ blink::WebEncryptedMediaRequest request,
+ const blink::WebString& error_message);
+
// Gets the Reporter for |key_system|. If it doesn't already exist,
// create one.
- Reporter* GetReporter(const std::string& key_system);
+ Reporter* GetReporter(const blink::WebString& key_system);
- // Key system <-> Reporter map.
- typedef base::ScopedPtrHashMap<std::string, Reporter> Reporters;
- Reporters reporters_;
+ // Reporter singletons.
+ base::ScopedPtrHashMap<std::string, Reporter> reporters_;
- const KeySystems& key_systems_;
CdmFactory* cdm_factory_;
- MediaPermission* media_permission_;
-
+ KeySystemConfigSelector key_system_config_selector_;
base::WeakPtrFactory<WebEncryptedMediaClientImpl> weak_factory_;
};

Powered by Google App Engine
This is Rietveld 408576698