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

Side by Side Diff: components/html_viewer/media_factory.cc

Issue 1311353005: Adds a way to determine id of content handler that created app (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nuke comment Created 5 years, 3 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
« no previous file with comments | « components/font_service/public/cpp/font_loader.cc ('k') | components/pdf_viewer/pdf_viewer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/html_viewer/media_factory.h" 5 #include "components/html_viewer/media_factory.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 26 matching lines...) Expand all
37 // media::Renderer implementation. 37 // media::Renderer implementation.
38 // TODO(xhwang): Move this to media_switches.h. 38 // TODO(xhwang): Move this to media_switches.h.
39 const char kEnableMojoMediaRenderer[] = "enable-mojo-media-renderer"; 39 const char kEnableMojoMediaRenderer[] = "enable-mojo-media-renderer";
40 40
41 bool AreSecureCodecsSupported() { 41 bool AreSecureCodecsSupported() {
42 // Hardware-secure codecs are not currently supported by HTML Viewer on any 42 // Hardware-secure codecs are not currently supported by HTML Viewer on any
43 // platform. 43 // platform.
44 return false; 44 return false;
45 } 45 }
46 46
47 void OnGotContentHandlerID(uint32_t content_handler_id) {}
48
47 } // namespace 49 } // namespace
48 50
49 MediaFactory::MediaFactory( 51 MediaFactory::MediaFactory(
50 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, 52 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner,
51 mojo::Shell* shell) 53 mojo::Shell* shell)
52 : 54 :
53 #if !defined(OS_ANDROID) 55 #if !defined(OS_ANDROID)
54 media_thread_("Media"), 56 media_thread_("Media"),
55 audio_manager_(media::AudioManager::Create(&fake_audio_log_factory_)), 57 audio_manager_(media::AudioManager::Create(&fake_audio_log_factory_)),
56 audio_hardware_config_( 58 audio_hardware_config_(
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 } 115 }
114 return web_encrypted_media_client_.get(); 116 return web_encrypted_media_client_.get();
115 } 117 }
116 118
117 media::interfaces::ServiceFactory* MediaFactory::GetMediaServiceFactory() { 119 media::interfaces::ServiceFactory* MediaFactory::GetMediaServiceFactory() {
118 if (!media_service_factory_) { 120 if (!media_service_factory_) {
119 mojo::ServiceProviderPtr service_provider; 121 mojo::ServiceProviderPtr service_provider;
120 mojo::URLRequestPtr request(mojo::URLRequest::New()); 122 mojo::URLRequestPtr request(mojo::URLRequest::New());
121 request->url = mojo::String::From("mojo:media"); 123 request->url = mojo::String::From("mojo:media");
122 shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), 124 shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider),
123 nullptr, nullptr); 125 nullptr, nullptr,
126 base::Bind(&OnGotContentHandlerID));
124 mojo::ConnectToService(service_provider.get(), &media_service_factory_); 127 mojo::ConnectToService(service_provider.get(), &media_service_factory_);
125 } 128 }
126 129
127 return media_service_factory_.get(); 130 return media_service_factory_.get();
128 } 131 }
129 132
130 media::MediaPermission* MediaFactory::GetMediaPermission() { 133 media::MediaPermission* MediaFactory::GetMediaPermission() {
131 // TODO(xhwang): Replace DefaultMediaPermission with something real when 134 // TODO(xhwang): Replace DefaultMediaPermission with something real when
132 // permissions are supported in html_viewer. 135 // permissions are supported in html_viewer.
133 NOTIMPLEMENTED(); 136 NOTIMPLEMENTED();
(...skipping 29 matching lines...) Expand all
163 scoped_refptr<base::SingleThreadTaskRunner> 166 scoped_refptr<base::SingleThreadTaskRunner>
164 MediaFactory::GetMediaThreadTaskRunner() { 167 MediaFactory::GetMediaThreadTaskRunner() {
165 if (!media_thread_.IsRunning()) 168 if (!media_thread_.IsRunning())
166 media_thread_.Start(); 169 media_thread_.Start();
167 170
168 return media_thread_.task_runner(); 171 return media_thread_.task_runner();
169 } 172 }
170 #endif // !defined(OS_ANDROID) 173 #endif // !defined(OS_ANDROID)
171 174
172 } // namespace html_viewer 175 } // namespace html_viewer
OLDNEW
« no previous file with comments | « components/font_service/public/cpp/font_loader.cc ('k') | components/pdf_viewer/pdf_viewer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698