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

Side by Side Diff: third_party/WebKit/Source/core/workers/ThreadedWorkletTest.cpp

Issue 2956583002: Removed usage of RefPtr::Release in unit tests (Closed)
Patch Set: Created 3 years, 6 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "core/dom/TaskRunnerHelper.h" 5 #include "core/dom/TaskRunnerHelper.h"
6 #include "core/inspector/ConsoleMessageStorage.h" 6 #include "core/inspector/ConsoleMessageStorage.h"
7 #include "core/testing/DummyPageHolder.h" 7 #include "core/testing/DummyPageHolder.h"
8 #include "core/workers/ThreadedWorkletGlobalScope.h" 8 #include "core/workers/ThreadedWorkletGlobalScope.h"
9 #include "core/workers/ThreadedWorkletMessagingProxy.h" 9 #include "core/workers/ThreadedWorkletMessagingProxy.h"
10 #include "core/workers/ThreadedWorkletObjectProxy.h" 10 #include "core/workers/ThreadedWorkletObjectProxy.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 63 }
64 64
65 void ClearWorkerBackingThread() override {} 65 void ClearWorkerBackingThread() override {}
66 66
67 WorkerOrWorkletGlobalScope* CreateWorkerGlobalScope( 67 WorkerOrWorkletGlobalScope* CreateWorkerGlobalScope(
68 std::unique_ptr<WorkerThreadStartupData> startup_data) final { 68 std::unique_ptr<WorkerThreadStartupData> startup_data) final {
69 RefPtr<SecurityOrigin> security_origin = 69 RefPtr<SecurityOrigin> security_origin =
70 SecurityOrigin::Create(startup_data->script_url_); 70 SecurityOrigin::Create(startup_data->script_url_);
71 return new ThreadedWorkletGlobalScope( 71 return new ThreadedWorkletGlobalScope(
72 startup_data->script_url_, startup_data->user_agent_, 72 startup_data->script_url_, startup_data->user_agent_,
73 security_origin.Release(), this->GetIsolate(), this, 73 std::move(security_origin), this->GetIsolate(), this,
74 startup_data->worker_clients_); 74 startup_data->worker_clients_);
75 } 75 }
76 76
77 bool IsOwningBackingThread() const final { return false; } 77 bool IsOwningBackingThread() const final { return false; }
78 78
79 static void EnsureSharedBackingThread() { 79 static void EnsureSharedBackingThread() {
80 DCHECK(IsMainThread()); 80 DCHECK(IsMainThread());
81 WorkletThreadHolder<ThreadedWorkletThreadForTest>::CreateForTest( 81 WorkletThreadHolder<ThreadedWorkletThreadForTest>::CreateForTest(
82 "ThreadedWorkletThreadForTest"); 82 "ThreadedWorkletThreadForTest");
83 } 83 }
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 // ThreadedWorkletGlobalScopeForTest::CountDeprecation. 231 // ThreadedWorkletGlobalScopeForTest::CountDeprecation.
232 TaskRunnerHelper::Get(TaskType::kUnspecedTimer, GetWorkerThread()) 232 TaskRunnerHelper::Get(TaskType::kUnspecedTimer, GetWorkerThread())
233 ->PostTask( 233 ->PostTask(
234 BLINK_FROM_HERE, 234 BLINK_FROM_HERE,
235 CrossThreadBind(&ThreadedWorkletThreadForTest::CountDeprecation, 235 CrossThreadBind(&ThreadedWorkletThreadForTest::CountDeprecation,
236 CrossThreadUnretained(GetWorkerThread()), kFeature2)); 236 CrossThreadUnretained(GetWorkerThread()), kFeature2));
237 testing::EnterRunLoop(); 237 testing::EnterRunLoop();
238 } 238 }
239 239
240 } // namespace blink 240 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698