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

Unified Diff: media/base/android/android_cdm_factory.cc

Issue 1427183002: Move MediaDrmBridge provision communication to native side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: AndroidCdmFactory use a fetcher factory instead of a fetcher; addressed more comments Created 5 years, 1 month 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/base/android/android_cdm_factory.cc
diff --git a/media/base/android/android_cdm_factory.cc b/media/base/android/android_cdm_factory.cc
index 45bfad543c7675480e3655a351c739178ea2a4c3..a1beb36e8ac7dc6dd0455b546641273972331e0c 100644
--- a/media/base/android/android_cdm_factory.cc
+++ b/media/base/android/android_cdm_factory.cc
@@ -6,6 +6,7 @@
#include "base/strings/string_number_conversions.h"
#include "media/base/android/media_drm_bridge.h"
+#include "media/base/android/provision_fetcher.h"
#include "media/base/bind_to_current_loop.h"
#include "media/base/cdm_config.h"
#include "media/base/key_systems.h"
@@ -14,7 +15,9 @@
namespace media {
-AndroidCdmFactory::AndroidCdmFactory() {}
+AndroidCdmFactory::AndroidCdmFactory(
+ scoped_ptr<ProvisionFetcherFactory> fetcher_factory)
+ : fetcher_factory_(fetcher_factory.Pass()) {}
AndroidCdmFactory::~AndroidCdmFactory() {}
@@ -45,8 +48,12 @@ void AndroidCdmFactory::Create(
return;
}
+ DCHECK(fetcher_factory_);
+ scoped_ptr<ProvisionFetcher> fetcher = fetcher_factory_->CreateFetcher();
+
scoped_refptr<MediaDrmBridge> cdm(
- MediaDrmBridge::Create(key_system, session_message_cb, session_closed_cb,
+ MediaDrmBridge::Create(key_system, fetcher.Pass(),
xhwang 2015/11/12 22:27:03 nit: you can pass fetcher_factory_->CreateFetcher(
Tima Vaisburd 2015/11/13 03:13:10 Used the callback method instead the factory.
+ session_message_cb, session_closed_cb,
legacy_session_error_cb, session_keys_change_cb,
session_expiration_update_cb));
if (!cdm) {

Powered by Google App Engine
This is Rietveld 408576698