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

Side by Side Diff: chromecast/browser/cast_content_browser_client.cc

Issue 2434673002: media: Rename MojoMediaApplication to MediaService (Closed)
Patch Set: media: Rename MojoMediaApplication to MediaService 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
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | content/gpu/gpu_service_factory.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 "chromecast/browser/cast_content_browser_client.h" 5 #include "chromecast/browser/cast_content_browser_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 #include "net/ssl/ssl_cert_request_info.h" 56 #include "net/ssl/ssl_cert_request_info.h"
57 #include "net/url_request/url_request_context_getter.h" 57 #include "net/url_request/url_request_context_getter.h"
58 #include "services/service_manager/public/cpp/interface_registry.h" 58 #include "services/service_manager/public/cpp/interface_registry.h"
59 #include "ui/base/resource/resource_bundle.h" 59 #include "ui/base/resource/resource_bundle.h"
60 #include "ui/display/display.h" 60 #include "ui/display/display.h"
61 #include "ui/display/screen.h" 61 #include "ui/display/screen.h"
62 #include "ui/gl/gl_switches.h" 62 #include "ui/gl/gl_switches.h"
63 63
64 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) 64 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
65 #include "chromecast/browser/media/cast_mojo_media_client.h" 65 #include "chromecast/browser/media/cast_mojo_media_client.h"
66 #include "media/mojo/services/mojo_media_application.h" // nogncheck 66 #include "media/mojo/services/media_service.h" // nogncheck
67 #endif // ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS 67 #endif // ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS
68 68
69 #if defined(OS_ANDROID) 69 #if defined(OS_ANDROID)
70 #include "components/crash/content/browser/crash_dump_manager_android.h" 70 #include "components/crash/content/browser/crash_dump_manager_android.h"
71 #else 71 #else
72 #include "chromecast/browser/media/cast_browser_cdm_factory.h" 72 #include "chromecast/browser/media/cast_browser_cdm_factory.h"
73 #endif // defined(OS_ANDROID) 73 #endif // defined(OS_ANDROID)
74 74
75 namespace chromecast { 75 namespace chromecast {
76 namespace shell { 76 namespace shell {
77 77
78 namespace { 78 namespace {
79 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) 79 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
80 static std::unique_ptr<service_manager::Service> CreateMojoMediaApplication( 80 static std::unique_ptr<service_manager::Service> CreateMediaService(
81 CastContentBrowserClient* browser_client, 81 CastContentBrowserClient* browser_client,
82 const base::Closure& quit_closure) { 82 const base::Closure& quit_closure) {
83 std::unique_ptr<media::CastMojoMediaClient> mojo_media_client( 83 std::unique_ptr<media::CastMojoMediaClient> mojo_media_client(
84 new media::CastMojoMediaClient( 84 new media::CastMojoMediaClient(
85 base::Bind(&CastContentBrowserClient::CreateMediaPipelineBackend, 85 base::Bind(&CastContentBrowserClient::CreateMediaPipelineBackend,
86 base::Unretained(browser_client)), 86 base::Unretained(browser_client)),
87 base::Bind(&CastContentBrowserClient::CreateCdmFactory, 87 base::Bind(&CastContentBrowserClient::CreateCdmFactory,
88 base::Unretained(browser_client)), 88 base::Unretained(browser_client)),
89 browser_client->GetVideoResolutionPolicy(), 89 browser_client->GetVideoResolutionPolicy(),
90 browser_client->media_resource_tracker())); 90 browser_client->media_resource_tracker()));
91 return std::unique_ptr<service_manager::Service>( 91 return std::unique_ptr<service_manager::Service>(
92 new ::media::MojoMediaApplication(std::move(mojo_media_client), 92 new ::media::MediaService(std::move(mojo_media_client), quit_closure));
93 quit_closure));
94 } 93 }
95 #endif // defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) 94 #endif // defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
96 95
97 } // namespace 96 } // namespace
98 97
99 CastContentBrowserClient::CastContentBrowserClient() 98 CastContentBrowserClient::CastContentBrowserClient()
100 : cast_browser_main_parts_(nullptr), 99 : cast_browser_main_parts_(nullptr),
101 url_request_context_factory_(new URLRequestContextFactory()) {} 100 url_request_context_factory_(new URLRequestContextFactory()) {}
102 101
103 CastContentBrowserClient::~CastContentBrowserClient() { 102 CastContentBrowserClient::~CastContentBrowserClient() {
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 registry->AddInterface( 420 registry->AddInterface(
422 base::Bind(&media::MediaCapsImpl::AddBinding, 421 base::Bind(&media::MediaCapsImpl::AddBinding,
423 base::Unretained(cast_browser_main_parts_->media_caps())), 422 base::Unretained(cast_browser_main_parts_->media_caps())),
424 base::ThreadTaskRunnerHandle::Get()); 423 base::ThreadTaskRunnerHandle::Get());
425 } 424 }
426 425
427 void CastContentBrowserClient::RegisterInProcessServices( 426 void CastContentBrowserClient::RegisterInProcessServices(
428 StaticServiceMap* services) { 427 StaticServiceMap* services) {
429 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) 428 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
430 content::ServiceInfo info; 429 content::ServiceInfo info;
431 info.factory = 430 info.factory = base::Bind(&CreateMediaService, base::Unretained(this));
432 base::Bind(&CreateMojoMediaApplication, base::Unretained(this));
433 info.task_runner = GetMediaTaskRunner(); 431 info.task_runner = GetMediaTaskRunner();
434 services->insert(std::make_pair("service:media", info)); 432 services->insert(std::make_pair("service:media", info));
435 #endif 433 #endif
436 } 434 }
437 435
438 std::unique_ptr<base::Value> 436 std::unique_ptr<base::Value>
439 CastContentBrowserClient::GetServiceManifestOverlay( 437 CastContentBrowserClient::GetServiceManifestOverlay(
440 const std::string& service_name) { 438 const std::string& service_name) {
441 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 439 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
442 if (service_name != content::kBrowserServiceName) 440 if (service_name != content::kBrowserServiceName)
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 process_type, dumps_path, false /* upload */); 547 process_type, dumps_path, false /* upload */);
550 // StartUploaderThread() even though upload is diferred. 548 // StartUploaderThread() even though upload is diferred.
551 // Breakpad-related memory is freed in the uploader thread. 549 // Breakpad-related memory is freed in the uploader thread.
552 crash_handler->StartUploaderThread(); 550 crash_handler->StartUploaderThread();
553 return crash_handler; 551 return crash_handler;
554 } 552 }
555 #endif // !defined(OS_ANDROID) 553 #endif // !defined(OS_ANDROID)
556 554
557 } // namespace shell 555 } // namespace shell
558 } // namespace chromecast 556 } // namespace chromecast
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | content/gpu/gpu_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698