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

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

Issue 1578473002: Pass application ids via AcceptConnection & ConnectToApplication callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 10 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 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 <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // media::Renderer implementation. 43 // media::Renderer implementation.
44 // TODO(xhwang): Move this to media_switches.h. 44 // TODO(xhwang): Move this to media_switches.h.
45 const char kEnableMojoMediaRenderer[] = "enable-mojo-media-renderer"; 45 const char kEnableMojoMediaRenderer[] = "enable-mojo-media-renderer";
46 46
47 bool AreSecureCodecsSupported() { 47 bool AreSecureCodecsSupported() {
48 // Hardware-secure codecs are not currently supported by HTML Viewer on any 48 // Hardware-secure codecs are not currently supported by HTML Viewer on any
49 // platform. 49 // platform.
50 return false; 50 return false;
51 } 51 }
52 52
53 void OnGotContentHandlerID(uint32_t content_handler_id) {} 53 void OnGotRemoteIDs(uint32_t remote_id, uint32_t content_handler_id) {}
54 54
55 } // namespace 55 } // namespace
56 56
57 MediaFactory::MediaFactory( 57 MediaFactory::MediaFactory(
58 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, 58 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner,
59 mojo::Shell* shell) 59 mojo::Shell* shell)
60 : 60 :
61 #if !defined(OS_ANDROID) 61 #if !defined(OS_ANDROID)
62 media_thread_("Media"), 62 media_thread_("Media"),
63 audio_manager_(media::AudioManager::Create(&fake_audio_log_factory_)), 63 audio_manager_(media::AudioManager::Create(&fake_audio_log_factory_)),
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 return web_encrypted_media_client_.get(); 128 return web_encrypted_media_client_.get();
129 } 129 }
130 130
131 media::interfaces::ServiceFactory* MediaFactory::GetMediaServiceFactory() { 131 media::interfaces::ServiceFactory* MediaFactory::GetMediaServiceFactory() {
132 if (!media_service_factory_) { 132 if (!media_service_factory_) {
133 mojo::ServiceProviderPtr service_provider; 133 mojo::ServiceProviderPtr service_provider;
134 mojo::URLRequestPtr request(mojo::URLRequest::New()); 134 mojo::URLRequestPtr request(mojo::URLRequest::New());
135 request->url = mojo::String::From("mojo:media"); 135 request->url = mojo::String::From("mojo:media");
136 shell_->ConnectToApplication(std::move(request), 136 shell_->ConnectToApplication(std::move(request),
137 GetProxy(&service_provider), nullptr, nullptr, 137 GetProxy(&service_provider), nullptr, nullptr,
138 base::Bind(&OnGotContentHandlerID)); 138 base::Bind(&OnGotRemoteIDs));
139 mojo::ConnectToService(service_provider.get(), &media_service_factory_); 139 mojo::ConnectToService(service_provider.get(), &media_service_factory_);
140 } 140 }
141 141
142 return media_service_factory_.get(); 142 return media_service_factory_.get();
143 } 143 }
144 144
145 media::MediaPermission* MediaFactory::GetMediaPermission() { 145 media::MediaPermission* MediaFactory::GetMediaPermission() {
146 // TODO(xhwang): Replace DefaultMediaPermission with something real when 146 // TODO(xhwang): Replace DefaultMediaPermission with something real when
147 // permissions are supported in html_viewer. 147 // permissions are supported in html_viewer.
148 NOTIMPLEMENTED(); 148 NOTIMPLEMENTED();
(...skipping 29 matching lines...) Expand all
178 scoped_refptr<base::SingleThreadTaskRunner> 178 scoped_refptr<base::SingleThreadTaskRunner>
179 MediaFactory::GetMediaThreadTaskRunner() { 179 MediaFactory::GetMediaThreadTaskRunner() {
180 if (!media_thread_.IsRunning()) 180 if (!media_thread_.IsRunning())
181 media_thread_.Start(); 181 media_thread_.Start();
182 182
183 return media_thread_.task_runner(); 183 return media_thread_.task_runner();
184 } 184 }
185 #endif // !defined(OS_ANDROID) 185 #endif // !defined(OS_ANDROID)
186 186
187 } // namespace html_viewer 187 } // namespace html_viewer
OLDNEW
« no previous file with comments | « components/font_service/public/cpp/font_loader.cc ('k') | components/web_view/frame_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698