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

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

Issue 2484953002: Eliminate quit closure argument to embedded service factories (Closed)
Patch Set: . Created 4 years, 1 month 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 | « no previous file | content/common/service_manager/embedded_service_runner.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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 #else 71 #else
72 #include "chromecast/media/cdm/cast_cdm_factory.h" 72 #include "chromecast/media/cdm/cast_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> CreateMediaService( 80 static std::unique_ptr<service_manager::Service> CreateMediaService(
81 CastContentBrowserClient* browser_client, 81 CastContentBrowserClient* browser_client) {
82 const base::Closure& quit_closure) {
83 std::unique_ptr<media::CastMojoMediaClient> mojo_media_client( 82 std::unique_ptr<media::CastMojoMediaClient> mojo_media_client(
84 new media::CastMojoMediaClient( 83 new media::CastMojoMediaClient(
85 base::Bind(&CastContentBrowserClient::CreateMediaPipelineBackend, 84 base::Bind(&CastContentBrowserClient::CreateMediaPipelineBackend,
86 base::Unretained(browser_client)), 85 base::Unretained(browser_client)),
87 base::Bind(&CastContentBrowserClient::CreateCdmFactory, 86 base::Bind(&CastContentBrowserClient::CreateCdmFactory,
88 base::Unretained(browser_client)), 87 base::Unretained(browser_client)),
89 browser_client->GetVideoResolutionPolicy(), 88 browser_client->GetVideoResolutionPolicy(),
90 browser_client->media_resource_tracker())); 89 browser_client->media_resource_tracker()));
91 return std::unique_ptr<service_manager::Service>( 90 return std::unique_ptr<service_manager::Service>(
92 new ::media::MediaService(std::move(mojo_media_client), quit_closure)); 91 new ::media::MediaService(std::move(mojo_media_client)));
93 } 92 }
94 #endif // defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) 93 #endif // defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
95 94
96 } // namespace 95 } // namespace
97 96
98 CastContentBrowserClient::CastContentBrowserClient() 97 CastContentBrowserClient::CastContentBrowserClient()
99 : cast_browser_main_parts_(nullptr), 98 : cast_browser_main_parts_(nullptr),
100 url_request_context_factory_(new URLRequestContextFactory()) {} 99 url_request_context_factory_(new URLRequestContextFactory()) {}
101 100
102 CastContentBrowserClient::~CastContentBrowserClient() { 101 CastContentBrowserClient::~CastContentBrowserClient() {
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 process_type, dumps_path, false /* upload */); 546 process_type, dumps_path, false /* upload */);
548 // StartUploaderThread() even though upload is diferred. 547 // StartUploaderThread() even though upload is diferred.
549 // Breakpad-related memory is freed in the uploader thread. 548 // Breakpad-related memory is freed in the uploader thread.
550 crash_handler->StartUploaderThread(); 549 crash_handler->StartUploaderThread();
551 return crash_handler; 550 return crash_handler;
552 } 551 }
553 #endif // !defined(OS_ANDROID) 552 #endif // !defined(OS_ANDROID)
554 553
555 } // namespace shell 554 } // namespace shell
556 } // namespace chromecast 555 } // namespace chromecast
OLDNEW
« no previous file with comments | « no previous file | content/common/service_manager/embedded_service_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698