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

Side by Side Diff: third_party/WebKit/Source/core/testing/DictionaryTest.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 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 "core/testing/DictionaryTest.h" 5 #include "core/testing/DictionaryTest.h"
6 6
7 #include "bindings/core/v8/ScriptState.h" 7 #include "bindings/core/v8/ScriptState.h"
8 #include "bindings/core/v8/V8ObjectBuilder.h" 8 #include "bindings/core/v8/V8ObjectBuilder.h"
9 #include "core/dom/ExecutionContext.h"
9 #include "core/testing/InternalDictionary.h" 10 #include "core/testing/InternalDictionary.h"
10 #include "core/testing/InternalDictionaryDerived.h" 11 #include "core/testing/InternalDictionaryDerived.h"
11 #include "core/testing/InternalDictionaryDerivedDerived.h" 12 #include "core/testing/InternalDictionaryDerivedDerived.h"
12 13
13 namespace blink { 14 namespace blink {
14 15
15 DictionaryTest::DictionaryTest() : required_boolean_member_(false) {} 16 DictionaryTest::DictionaryTest() : required_boolean_member_(false) {}
16 17
17 DictionaryTest::~DictionaryTest() {} 18 DictionaryTest::~DictionaryTest() {}
18 19
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 InternalDictionaryDerivedDerived& result) { 167 InternalDictionaryDerivedDerived& result) {
167 getDerived(result); 168 getDerived(result);
168 result.setDerivedDerivedStringMember(derived_derived_string_member_); 169 result.setDerivedDerivedStringMember(derived_derived_string_member_);
169 } 170 }
170 171
171 String DictionaryTest::stringFromIterable( 172 String DictionaryTest::stringFromIterable(
172 ScriptState* script_state, 173 ScriptState* script_state,
173 Dictionary iterable, 174 Dictionary iterable,
174 ExceptionState& exception_state) const { 175 ExceptionState& exception_state) const {
175 StringBuilder result; 176 StringBuilder result;
176 ExecutionContext* execution_context = script_state->GetExecutionContext(); 177 ExecutionContext* execution_context = ExecutionContext::From(script_state);
177 DictionaryIterator iterator = iterable.GetIterator(execution_context); 178 DictionaryIterator iterator = iterable.GetIterator(execution_context);
178 if (iterator.IsNull()) 179 if (iterator.IsNull())
179 return g_empty_string; 180 return g_empty_string;
180 181
181 bool first_loop = true; 182 bool first_loop = true;
182 while (iterator.Next(execution_context, exception_state)) { 183 while (iterator.Next(execution_context, exception_state)) {
183 if (exception_state.HadException()) 184 if (exception_state.HadException())
184 return g_empty_string; 185 return g_empty_string;
185 186
186 if (first_loop) 187 if (first_loop)
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 } 230 }
230 231
231 DEFINE_TRACE(DictionaryTest) { 232 DEFINE_TRACE(DictionaryTest) {
232 visitor->Trace(element_member_); 233 visitor->Trace(element_member_);
233 visitor->Trace(element_or_null_member_); 234 visitor->Trace(element_or_null_member_);
234 visitor->Trace(double_or_string_sequence_member_); 235 visitor->Trace(double_or_string_sequence_member_);
235 visitor->Trace(event_target_or_null_member_); 236 visitor->Trace(event_target_or_null_member_);
236 } 237 }
237 238
238 } // namespace blink 239 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698