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

Side by Side Diff: third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp

Issue 2389973002: Use std::unique_ptr to signal ownership transfer in WebCompositorSupport (Closed)
Patch Set: rebase 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 25 matching lines...) Expand all
36 #include "base/metrics/statistics_recorder.h" 36 #include "base/metrics/statistics_recorder.h"
37 #include "base/test/icu_test_util.h" 37 #include "base/test/icu_test_util.h"
38 #include "base/test/test_discardable_memory_allocator.h" 38 #include "base/test/test_discardable_memory_allocator.h"
39 #include "cc/blink/web_compositor_support_impl.h" 39 #include "cc/blink/web_compositor_support_impl.h"
40 #include "cc/test/ordered_simple_task_runner.h" 40 #include "cc/test/ordered_simple_task_runner.h"
41 #include "platform/HTTPNames.h" 41 #include "platform/HTTPNames.h"
42 #include "platform/heap/Heap.h" 42 #include "platform/heap/Heap.h"
43 #include "platform/scheduler/base/test_time_source.h" 43 #include "platform/scheduler/base/test_time_source.h"
44 #include "platform/scheduler/child/scheduler_tqm_delegate_for_test.h" 44 #include "platform/scheduler/child/scheduler_tqm_delegate_for_test.h"
45 #include "platform/scheduler/renderer/renderer_scheduler_impl.h" 45 #include "platform/scheduler/renderer/renderer_scheduler_impl.h"
46 #include "public/platform/WebContentLayer.h"
47 #include "public/platform/WebExternalTextureLayer.h"
48 #include "public/platform/WebImageLayer.h"
49 #include "public/platform/WebScrollbarLayer.h"
46 #include "wtf/CryptographicallyRandomNumber.h" 50 #include "wtf/CryptographicallyRandomNumber.h"
47 #include "wtf/CurrentTime.h" 51 #include "wtf/CurrentTime.h"
48 #include "wtf/PtrUtil.h" 52 #include "wtf/PtrUtil.h"
49 #include "wtf/WTF.h" 53 #include "wtf/WTF.h"
50 #include "wtf/allocator/Partitions.h" 54 #include "wtf/allocator/Partitions.h"
51 #include <memory> 55 #include <memory>
52 56
53 namespace blink { 57 namespace blink {
54 58
55 namespace { 59 namespace {
56 60
57 double dummyCurrentTime() { 61 double dummyCurrentTime() {
58 return 0.0; 62 return 0.0;
59 } 63 }
60 64
61 class DummyThread final : public blink::WebThread { 65 class DummyThread final : public blink::WebThread {
62 public: 66 public:
63 bool isCurrentThread() const override { return true; } 67 bool isCurrentThread() const override { return true; }
64 blink::WebScheduler* scheduler() const override { return nullptr; } 68 blink::WebScheduler* scheduler() const override { return nullptr; }
65 }; 69 };
66 70
67 } // namespace 71 } // namespace
68 72
73 std::unique_ptr<WebLayer> TestingCompositorSupport::createLayer() {
74 return nullptr;
75 }
76
77 std::unique_ptr<WebLayer> TestingCompositorSupport::createLayerFromCCLayer(
78 cc::Layer*) {
79 return nullptr;
80 }
81
82 std::unique_ptr<WebContentLayer> TestingCompositorSupport::createContentLayer(
83 WebContentLayerClient*) {
84 return nullptr;
85 }
86 std::unique_ptr<WebExternalTextureLayer>
87 TestingCompositorSupport::createExternalTextureLayer(cc::TextureLayerClient*) {
88 return nullptr;
89 }
90
91 std::unique_ptr<WebImageLayer> TestingCompositorSupport::createImageLayer() {
92 return nullptr;
93 }
94
95 std::unique_ptr<WebScrollbarLayer>
96 TestingCompositorSupport::createScrollbarLayer(
97 std::unique_ptr<WebScrollbar>,
98 WebScrollbarThemePainter,
99 std::unique_ptr<WebScrollbarThemeGeometry>) {
100 return nullptr;
101 }
102
103 std::unique_ptr<WebScrollbarLayer>
104 TestingCompositorSupport::createSolidColorScrollbarLayer(
105 WebScrollbar::Orientation,
106 int thumbThickness,
107 int trackStart,
108 bool isLeftSideVerticalScrollbar) {
109 return nullptr;
110 }
111
69 TestingPlatformSupport::TestingPlatformSupport() 112 TestingPlatformSupport::TestingPlatformSupport()
70 : TestingPlatformSupport(TestingPlatformSupport::Config()) {} 113 : TestingPlatformSupport(TestingPlatformSupport::Config()) {}
71 114
72 TestingPlatformSupport::TestingPlatformSupport(const Config& config) 115 TestingPlatformSupport::TestingPlatformSupport(const Config& config)
73 : m_config(config), m_oldPlatform(Platform::current()) { 116 : m_config(config), m_oldPlatform(Platform::current()) {
74 ASSERT(m_oldPlatform); 117 ASSERT(m_oldPlatform);
75 Platform::setCurrentPlatformForTesting(this); 118 Platform::setCurrentPlatformForTesting(this);
76 } 119 }
77 120
78 TestingPlatformSupport::~TestingPlatformSupport() { 121 TestingPlatformSupport::~TestingPlatformSupport() {
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 ProcessHeap::init(); 284 ProcessHeap::init();
242 ThreadState::attachMainThread(); 285 ThreadState::attachMainThread();
243 ThreadState::current()->registerTraceDOMWrappers(nullptr, nullptr, nullptr, 286 ThreadState::current()->registerTraceDOMWrappers(nullptr, nullptr, nullptr,
244 nullptr); 287 nullptr);
245 HTTPNames::init(); 288 HTTPNames::init();
246 } 289 }
247 290
248 ScopedUnittestsEnvironmentSetup::~ScopedUnittestsEnvironmentSetup() {} 291 ScopedUnittestsEnvironmentSetup::~ScopedUnittestsEnvironmentSetup() {}
249 292
250 } // namespace blink 293 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698