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

Side by Side Diff: content/browser/compositor/image_transport_factory.cc

Issue 1874893002: Convert //content/browser from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 "content/browser/compositor/image_transport_factory.h" 5 #include "content/browser/compositor/image_transport_factory.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "content/browser/compositor/gpu_process_transport_factory.h" 8 #include "content/browser/compositor/gpu_process_transport_factory.h"
9 #include "ui/compositor/compositor.h" 9 #include "ui/compositor/compositor.h"
10 #include "ui/compositor/compositor_switches.h" 10 #include "ui/compositor/compositor_switches.h"
(...skipping 14 matching lines...) Expand all
25 25
26 // static 26 // static
27 void ImageTransportFactory::Initialize() { 27 void ImageTransportFactory::Initialize() {
28 DCHECK(!g_factory || g_initialized_for_unit_tests); 28 DCHECK(!g_factory || g_initialized_for_unit_tests);
29 if (g_initialized_for_unit_tests) 29 if (g_initialized_for_unit_tests)
30 return; 30 return;
31 SetFactory(new GpuProcessTransportFactory); 31 SetFactory(new GpuProcessTransportFactory);
32 } 32 }
33 33
34 void ImageTransportFactory::InitializeForUnitTests( 34 void ImageTransportFactory::InitializeForUnitTests(
35 scoped_ptr<ImageTransportFactory> factory) { 35 std::unique_ptr<ImageTransportFactory> factory) {
36 DCHECK(!g_factory); 36 DCHECK(!g_factory);
37 DCHECK(!g_initialized_for_unit_tests); 37 DCHECK(!g_initialized_for_unit_tests);
38 g_initialized_for_unit_tests = true; 38 g_initialized_for_unit_tests = true;
39 39
40 const base::CommandLine* command_line = 40 const base::CommandLine* command_line =
41 base::CommandLine::ForCurrentProcess(); 41 base::CommandLine::ForCurrentProcess();
42 if (command_line->HasSwitch(switches::kEnablePixelOutputInTests)) 42 if (command_line->HasSwitch(switches::kEnablePixelOutputInTests))
43 g_disable_null_draw = new gfx::DisableNullDrawGLBindings; 43 g_disable_null_draw = new gfx::DisableNullDrawGLBindings;
44 44
45 SetFactory(factory.release()); 45 SetFactory(factory.release());
46 } 46 }
47 47
48 // static 48 // static
49 void ImageTransportFactory::Terminate() { 49 void ImageTransportFactory::Terminate() {
50 delete g_factory; 50 delete g_factory;
51 g_factory = NULL; 51 g_factory = NULL;
52 delete g_disable_null_draw; 52 delete g_disable_null_draw;
53 g_disable_null_draw = NULL; 53 g_disable_null_draw = NULL;
54 g_initialized_for_unit_tests = false; 54 g_initialized_for_unit_tests = false;
55 } 55 }
56 56
57 // static 57 // static
58 ImageTransportFactory* ImageTransportFactory::GetInstance() { 58 ImageTransportFactory* ImageTransportFactory::GetInstance() {
59 return g_factory; 59 return g_factory;
60 } 60 }
61 61
62 } // namespace content 62 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698