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

Side by Side Diff: third_party/WebKit/Source/core/testing/WorkerInternals.cpp

Issue 2811863002: Move ScriptState::GetExecutionContext (Part 4) (Closed)
Patch Set: Fix Document.cpp Created 3 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 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/testing/WorkerInternals.h" 5 #include "core/testing/WorkerInternals.h"
6 6
7 #include "bindings/core/v8/ScriptState.h" 7 #include "bindings/core/v8/ScriptState.h"
8 #include "core/dom/ExecutionContext.h"
8 #include "core/frame/Deprecation.h" 9 #include "core/frame/Deprecation.h"
9 #include "core/frame/UseCounter.h" 10 #include "core/frame/UseCounter.h"
10 #include "core/testing/OriginTrialsTest.h" 11 #include "core/testing/OriginTrialsTest.h"
11 12
12 namespace blink { 13 namespace blink {
13 14
14 WorkerInternals::~WorkerInternals() {} 15 WorkerInternals::~WorkerInternals() {}
15 16
16 WorkerInternals::WorkerInternals() {} 17 WorkerInternals::WorkerInternals() {}
17 18
18 OriginTrialsTest* WorkerInternals::originTrialsTest() const { 19 OriginTrialsTest* WorkerInternals::originTrialsTest() const {
19 return OriginTrialsTest::Create(); 20 return OriginTrialsTest::Create();
20 } 21 }
21 22
22 void WorkerInternals::countFeature(ScriptState* script_state, 23 void WorkerInternals::countFeature(ScriptState* script_state,
23 uint32_t feature) { 24 uint32_t feature) {
24 UseCounter::Count(script_state->GetExecutionContext(), 25 UseCounter::Count(ExecutionContext::From(script_state),
25 static_cast<UseCounter::Feature>(feature)); 26 static_cast<UseCounter::Feature>(feature));
26 } 27 }
27 28
28 void WorkerInternals::countDeprecation(ScriptState* script_state, 29 void WorkerInternals::countDeprecation(ScriptState* script_state,
29 uint32_t feature) { 30 uint32_t feature) {
30 Deprecation::CountDeprecation(script_state->GetExecutionContext(), 31 Deprecation::CountDeprecation(ExecutionContext::From(script_state),
31 static_cast<UseCounter::Feature>(feature)); 32 static_cast<UseCounter::Feature>(feature));
32 } 33 }
33 34
34 void WorkerInternals::collectGarbage(ScriptState* script_state) { 35 void WorkerInternals::collectGarbage(ScriptState* script_state) {
35 script_state->GetIsolate()->RequestGarbageCollectionForTesting( 36 script_state->GetIsolate()->RequestGarbageCollectionForTesting(
36 v8::Isolate::kFullGarbageCollection); 37 v8::Isolate::kFullGarbageCollection);
37 } 38 }
38 39
39 } // namespace blink 40 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698