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

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

Issue 2258493003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 "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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 121 }
122 122
123 void CastContentBrowserClient::PreCreateThreads() { 123 void CastContentBrowserClient::PreCreateThreads() {
124 } 124 }
125 125
126 std::unique_ptr<CastService> CastContentBrowserClient::CreateCastService( 126 std::unique_ptr<CastService> CastContentBrowserClient::CreateCastService(
127 content::BrowserContext* browser_context, 127 content::BrowserContext* browser_context,
128 PrefService* pref_service, 128 PrefService* pref_service,
129 net::URLRequestContextGetter* request_context_getter, 129 net::URLRequestContextGetter* request_context_getter,
130 media::VideoPlaneController* video_plane_controller) { 130 media::VideoPlaneController* video_plane_controller) {
131 return base::WrapUnique(new CastServiceSimple(browser_context, pref_service)); 131 return base::MakeUnique<CastServiceSimple>(browser_context, pref_service);
132 } 132 }
133 133
134 #if !defined(OS_ANDROID) 134 #if !defined(OS_ANDROID)
135 scoped_refptr<base::SingleThreadTaskRunner> 135 scoped_refptr<base::SingleThreadTaskRunner>
136 CastContentBrowserClient::GetMediaTaskRunner() { 136 CastContentBrowserClient::GetMediaTaskRunner() {
137 DCHECK(cast_browser_main_parts_); 137 DCHECK(cast_browser_main_parts_);
138 return cast_browser_main_parts_->GetMediaTaskRunner(); 138 return cast_browser_main_parts_->GetMediaTaskRunner();
139 } 139 }
140 140
141 std::unique_ptr<media::MediaPipelineBackend> 141 std::unique_ptr<media::MediaPipelineBackend>
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 // true: 478 // true:
479 // (1) When we are using the CMA pipeline (by setting the cmdline switch). 479 // (1) When we are using the CMA pipeline (by setting the cmdline switch).
480 // (2) When we are using Mojo browser-side CDM (by setting GN args) 480 // (2) When we are using Mojo browser-side CDM (by setting GN args)
481 // If neither of these are true, this function should return nullptr. 481 // If neither of these are true, this function should return nullptr.
482 #if !defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) 482 #if !defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
483 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 483 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
484 switches::kEnableCmaMediaPipeline)) 484 switches::kEnableCmaMediaPipeline))
485 return nullptr; 485 return nullptr;
486 #endif // !defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) 486 #endif // !defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
487 487
488 return base::WrapUnique(new media::CastBrowserCdmFactory( 488 return base::MakeUnique<media::CastBrowserCdmFactory>(
489 GetMediaTaskRunner(), media_resource_tracker())); 489 GetMediaTaskRunner(), media_resource_tracker());
490 } 490 }
491 491
492 void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess( 492 void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
493 const base::CommandLine& command_line, 493 const base::CommandLine& command_line,
494 int child_process_id, 494 int child_process_id,
495 content::FileDescriptorInfo* mappings) { 495 content::FileDescriptorInfo* mappings) {
496 int crash_signal_fd = GetCrashSignalFD(command_line); 496 int crash_signal_fd = GetCrashSignalFD(command_line);
497 if (crash_signal_fd >= 0) { 497 if (crash_signal_fd >= 0) {
498 mappings->Share(kCrashDumpSignal, crash_signal_fd); 498 mappings->Share(kCrashDumpSignal, crash_signal_fd);
499 } 499 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 process_type, dumps_path, false /* upload */); 550 process_type, dumps_path, false /* upload */);
551 // StartUploaderThread() even though upload is diferred. 551 // StartUploaderThread() even though upload is diferred.
552 // Breakpad-related memory is freed in the uploader thread. 552 // Breakpad-related memory is freed in the uploader thread.
553 crash_handler->StartUploaderThread(); 553 crash_handler->StartUploaderThread();
554 return crash_handler; 554 return crash_handler;
555 } 555 }
556 #endif // !defined(OS_ANDROID) 556 #endif // !defined(OS_ANDROID)
557 557
558 } // namespace shell 558 } // namespace shell
559 } // namespace chromecast 559 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/browser/cast_browser_main_parts.cc ('k') | chromecast/browser/test/chromecast_browser_test_helper_default.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698