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

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

Issue 815293002: Support unprefixed EME in HTMLViewer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only Created 6 years 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/html_viewer.cc » ('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 a99ec7d4a3c2c736758d1d4e6a48ffeb124a1c8d..3a7b151c5dccfd8b2e442bba26c41799e6cf4a5f 100644
--- a/mojo/services/html_viewer/html_document.cc
+++ b/mojo/services/html_viewer/html_document.cc
@@ -6,11 +6,14 @@
#include "base/bind.h"
#include "base/location.h"
+#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop_proxy.h"
#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/thread_task_runner_handle.h"
+#include "media/blink/webencryptedmediaclient_impl.h"
+#include "media/cdm/default_cdm_factory.h"
#include "mojo/public/cpp/application/connect.h"
#include "mojo/public/cpp/system/data_pipe.h"
#include "mojo/public/interfaces/application/shell.mojom.h"
@@ -100,11 +103,12 @@ HTMLDocument::HTMLDocument(
WebMediaPlayerFactory* web_media_player_factory)
: response_(response.Pass()),
shell_(shell),
- web_view_(NULL),
- root_(NULL),
+ web_view_(nullptr),
+ root_(nullptr),
view_manager_client_factory_(shell_, this),
compositor_thread_(compositor_thread),
- web_media_player_factory_(web_media_player_factory) {
+ web_media_player_factory_(web_media_player_factory),
+ web_encrypted_media_client_(nullptr) {
exported_services_.AddService(this);
exported_services_.AddService(&view_manager_client_factory_);
WeakBindToPipe(&exported_services_, provider.PassMessagePipe());
@@ -196,8 +200,7 @@ blink::WebMediaPlayer* HTMLDocument::createMediaPlayer(
blink::WebLocalFrame* frame,
const blink::WebURL& url,
blink::WebMediaPlayerClient* client) {
- return web_media_player_factory_->CreateMediaPlayer(frame, url, client,
- shell_);
+ return createMediaPlayer(frame, url, client, nullptr);
}
blink::WebMediaPlayer* HTMLDocument::createMediaPlayer(
@@ -205,7 +208,8 @@ blink::WebMediaPlayer* HTMLDocument::createMediaPlayer(
const blink::WebURL& url,
blink::WebMediaPlayerClient* client,
blink::WebContentDecryptionModule* initial_cdm) {
- return createMediaPlayer(frame, url, client);
+ return web_media_player_factory_->CreateMediaPlayer(frame, url, client,
+ initial_cdm, shell_);
}
blink::WebFrame* HTMLDocument::createChildFrame(
@@ -261,6 +265,14 @@ void HTMLDocument::didNavigateWithinPage(
navigator_host_->DidNavigateLocally(history_item.urlString().utf8());
}
+blink::WebEncryptedMediaClient* HTMLDocument::encryptedMediaClient() {
+ if (!web_encrypted_media_client_) {
+ web_encrypted_media_client_ = new media::WebEncryptedMediaClientImpl(
+ make_scoped_ptr(new media::DefaultCdmFactory()));
+ }
+ return web_encrypted_media_client_;
+}
+
void HTMLDocument::OnViewBoundsChanged(View* view,
const Rect& old_bounds,
const Rect& new_bounds) {
« no previous file with comments | « mojo/services/html_viewer/html_document.h ('k') | mojo/services/html_viewer/html_viewer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698