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

Side by Side Diff: content/shell/renderer/shell_content_renderer_client.cc

Issue 2445433003: media: Enable encrypted media content browsertests when MojoCdm is used (Closed)
Patch Set: media: Enable encrypted media content browsertests when MojoCdm is used Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/renderer/shell_content_renderer_client.h" 5 #include "content/shell/renderer/shell_content_renderer_client.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "components/cdm/renderer/external_clear_key_key_system_properties.h" 13 #include "components/cdm/renderer/external_clear_key_key_system_properties.h"
14 #include "components/web_cache/renderer/web_cache_impl.h" 14 #include "components/web_cache/renderer/web_cache_impl.h"
15 #include "content/public/test/test_service.mojom.h" 15 #include "content/public/test/test_service.mojom.h"
16 #include "content/shell/common/shell_switches.h" 16 #include "content/shell/common/shell_switches.h"
17 #include "content/shell/renderer/shell_render_view_observer.h" 17 #include "content/shell/renderer/shell_render_view_observer.h"
18 #include "mojo/public/cpp/bindings/binding.h" 18 #include "mojo/public/cpp/bindings/binding.h"
19 #include "mojo/public/cpp/system/message_pipe.h" 19 #include "mojo/public/cpp/system/message_pipe.h"
20 #include "services/shell/public/cpp/interface_registry.h" 20 #include "services/shell/public/cpp/interface_registry.h"
21 #include "third_party/WebKit/public/web/WebTestingSupport.h" 21 #include "third_party/WebKit/public/web/WebTestingSupport.h"
22 #include "third_party/WebKit/public/web/WebView.h" 22 #include "third_party/WebKit/public/web/WebView.h"
23 #include "v8/include/v8.h" 23 #include "v8/include/v8.h"
24 24
25 #if defined(ENABLE_PLUGINS) 25 #if defined(ENABLE_PLUGINS)
26 #include "ppapi/shared_impl/ppapi_switches.h" 26 #include "ppapi/shared_impl/ppapi_switches.h"
27 #endif 27 #endif
28 28
29 #if defined(OS_ANDROID) 29 #if defined(ENABLE_MOJO_CDM)
ddorwin 2016/10/28 19:03:47 These should be converted to build features (separ
xhwang 2016/11/03 07:14:44 Acknowledged.
30 #include "base/feature_list.h" 30 #include "base/feature_list.h"
31 #include "media/base/media_switches.h" 31 #include "media/base/media_switches.h"
32 #endif 32 #endif
33 33
34 namespace content { 34 namespace content {
35 35
36 namespace { 36 namespace {
37 37
38 // A test service which can be driven by browser tests for various reasons. 38 // A test service which can be driven by browser tests for various reasons.
39 class TestServiceImpl : public mojom::TestService { 39 class TestServiceImpl : public mojom::TestService {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 blink::WebTestingSupport::injectInternalsObject(context); 133 blink::WebTestingSupport::injectInternalsObject(context);
134 } 134 }
135 } 135 }
136 136
137 void ShellContentRendererClient::ExposeInterfacesToBrowser( 137 void ShellContentRendererClient::ExposeInterfacesToBrowser(
138 shell::InterfaceRegistry* interface_registry) { 138 shell::InterfaceRegistry* interface_registry) {
139 interface_registry->AddInterface<mojom::TestService>( 139 interface_registry->AddInterface<mojom::TestService>(
140 base::Bind(&CreateTestService)); 140 base::Bind(&CreateTestService));
141 } 141 }
142 142
143 #if defined(OS_ANDROID) 143 #if defined(ENABLE_MOJO_CDM)
ddorwin 2016/10/28 19:03:47 This isn't going to be correct for desktop.
xhwang 2016/11/03 07:14:44 This shell is the content embedder only used for c
ddorwin 2016/11/10 01:24:29 I meant when SoDo is enabled.
xhwang 2016/11/10 07:11:28 My original plan was that when SoDo is enabled, we
144 void ShellContentRendererClient::AddSupportedKeySystems( 144 void ShellContentRendererClient::AddSupportedKeySystems(
145 std::vector<std::unique_ptr<media::KeySystemProperties>>* key_systems) { 145 std::vector<std::unique_ptr<media::KeySystemProperties>>* key_systems) {
146 if (!base::FeatureList::IsEnabled(media::kExternalClearKeyForTesting)) 146 if (!base::FeatureList::IsEnabled(media::kExternalClearKeyForTesting))
147 return; 147 return;
148 148
149 static const char kExternalClearKeyKeySystem[] = 149 static const char kExternalClearKeyKeySystem[] =
150 "org.chromium.externalclearkey"; 150 "org.chromium.externalclearkey";
151 key_systems->emplace_back( 151 key_systems->emplace_back(
152 new cdm::ExternalClearKeyProperties(kExternalClearKeyKeySystem)); 152 new cdm::ExternalClearKeyProperties(kExternalClearKeyKeySystem));
153 } 153 }
154 #endif 154 #endif
155 155
156 } // namespace content 156 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698