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

Side by Side Diff: ui/ozone/platform/headless/ozone_platform_headless.cc

Issue 2259753003: 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
« no previous file with comments | « ui/ozone/platform/drm/ozone_platform_gbm.cc ('k') | ui/ozone/platform/wayland/fake_server.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/ozone/platform/headless/ozone_platform_headless.h" 5 #include "ui/ozone/platform/headless/ozone_platform_headless.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 return nullptr; // no input injection support. 71 return nullptr; // no input injection support.
72 } 72 }
73 std::unique_ptr<PlatformWindow> CreatePlatformWindow( 73 std::unique_ptr<PlatformWindow> CreatePlatformWindow(
74 PlatformWindowDelegate* delegate, 74 PlatformWindowDelegate* delegate,
75 const gfx::Rect& bounds) override { 75 const gfx::Rect& bounds) override {
76 return base::WrapUnique<PlatformWindow>( 76 return base::WrapUnique<PlatformWindow>(
77 new HeadlessWindow(delegate, window_manager_.get(), bounds)); 77 new HeadlessWindow(delegate, window_manager_.get(), bounds));
78 } 78 }
79 std::unique_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() 79 std::unique_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate()
80 override { 80 override {
81 return base::WrapUnique(new NativeDisplayDelegateOzone()); 81 return base::MakeUnique<NativeDisplayDelegateOzone>();
82 } 82 }
83 83
84 void InitializeUI() override { 84 void InitializeUI() override {
85 window_manager_.reset(new HeadlessWindowManager(file_path_)); 85 window_manager_.reset(new HeadlessWindowManager(file_path_));
86 window_manager_->Initialize(); 86 window_manager_->Initialize();
87 surface_factory_.reset(new HeadlessSurfaceFactory(window_manager_.get())); 87 surface_factory_.reset(new HeadlessSurfaceFactory(window_manager_.get()));
88 // This unbreaks tests that create their own. 88 // This unbreaks tests that create their own.
89 if (!PlatformEventSource::GetInstance()) 89 if (!PlatformEventSource::GetInstance())
90 platform_event_source_.reset(new HeadlessPlatformEventSource); 90 platform_event_source_.reset(new HeadlessPlatformEventSource);
91 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( 91 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(
92 base::WrapUnique(new StubKeyboardLayoutEngine())); 92 base::MakeUnique<StubKeyboardLayoutEngine>());
93 93
94 overlay_manager_.reset(new StubOverlayManager()); 94 overlay_manager_.reset(new StubOverlayManager());
95 input_controller_ = CreateStubInputController(); 95 input_controller_ = CreateStubInputController();
96 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); 96 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone);
97 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); 97 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost());
98 } 98 }
99 99
100 void InitializeGPU() override { 100 void InitializeGPU() override {
101 if (!surface_factory_) 101 if (!surface_factory_)
102 surface_factory_.reset(new HeadlessSurfaceFactory()); 102 surface_factory_.reset(new HeadlessSurfaceFactory());
(...skipping 18 matching lines...) Expand all
121 121
122 OzonePlatform* CreateOzonePlatformHeadless() { 122 OzonePlatform* CreateOzonePlatformHeadless() {
123 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); 123 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
124 base::FilePath location; 124 base::FilePath location;
125 if (cmd->HasSwitch(switches::kOzoneDumpFile)) 125 if (cmd->HasSwitch(switches::kOzoneDumpFile))
126 location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile); 126 location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile);
127 return new OzonePlatformHeadless(location); 127 return new OzonePlatformHeadless(location);
128 } 128 }
129 129
130 } // namespace ui 130 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/ozone_platform_gbm.cc ('k') | ui/ozone/platform/wayland/fake_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698