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

Unified Diff: mojo/services/html_viewer/html_document.cc

Issue 887873003: media: Add DefaultMediaPermission. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only Created 5 years, 11 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
« no previous file with comments | « mojo/services/html_viewer/html_document.h ('k') | mojo/services/html_viewer/webmediaplayer_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/html_viewer/html_document.cc
diff --git a/mojo/services/html_viewer/html_document.cc b/mojo/services/html_viewer/html_document.cc
index 701860a69570fe3bc5e28bf7b6f8e035473cc0d7..cbcfdf5fbe66fe051248973568fe89da9e377108 100644
--- a/mojo/services/html_viewer/html_document.cc
+++ b/mojo/services/html_viewer/html_document.cc
@@ -14,6 +14,7 @@
#include "base/thread_task_runner_handle.h"
#include "media/blink/webencryptedmediaclient_impl.h"
#include "media/cdm/default_cdm_factory.h"
+#include "media/filters/default_media_permission.h"
#include "mojo/services/html_viewer/blink_input_events_type_converters.h"
#include "mojo/services/html_viewer/blink_url_request_type_converters.h"
#include "mojo/services/html_viewer/weblayertreeview_impl.h"
@@ -207,8 +208,11 @@ blink::WebMediaPlayer* HTMLDocument::createMediaPlayer(
const blink::WebURL& url,
blink::WebMediaPlayerClient* client,
blink::WebContentDecryptionModule* initial_cdm) {
- return web_media_player_factory_->CreateMediaPlayer(frame, url, client,
- initial_cdm, shell_);
+ if (!media_permission_)
+ media_permission_.reset(new media::DefaultMediaPermission(true));
+
+ return web_media_player_factory_->CreateMediaPlayer(
+ frame, url, client, media_permission_.get(), initial_cdm, shell_);
}
blink::WebFrame* HTMLDocument::createChildFrame(
@@ -270,10 +274,11 @@ void HTMLDocument::didNavigateWithinPage(
blink::WebEncryptedMediaClient* HTMLDocument::encryptedMediaClient() {
if (!web_encrypted_media_client_) {
- // TODO(xhwang): Hook up permission services and add a MediaPermission
- // implementation for HTMLDocument.
+ if (!media_permission_)
+ media_permission_.reset(new media::DefaultMediaPermission(true));
web_encrypted_media_client_.reset(new media::WebEncryptedMediaClientImpl(
- make_scoped_ptr(new media::DefaultCdmFactory()), nullptr));
+ make_scoped_ptr(new media::DefaultCdmFactory()),
+ media_permission_.get()));
}
return web_encrypted_media_client_.get();
}
« no previous file with comments | « mojo/services/html_viewer/html_document.h ('k') | mojo/services/html_viewer/webmediaplayer_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698