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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/Iterable.h

Issue 1918763002: Use correct creation context during Iterable.forEach iteration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add test Created 4 years, 7 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/fontfaceset-cross-frame.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef Iterable_h 5 #ifndef Iterable_h
6 #define Iterable_h 6 #define Iterable_h
7 7
8 #include "bindings/core/v8/V8IteratorResultValue.h" 8 #include "bindings/core/v8/V8IteratorResultValue.h"
9 #include "bindings/core/v8/V8ScriptRunner.h" 9 #include "bindings/core/v8/V8ScriptRunner.h"
10 #include "core/dom/Iterator.h" 10 #include "core/dom/Iterator.h"
(...skipping 28 matching lines...) Expand all
39 return new IterableIterator<EntrySelector>(source); 39 return new IterableIterator<EntrySelector>(source);
40 } 40 }
41 41
42 void forEachForBinding(ScriptState* scriptState, const ScriptValue& thisValu e, const ScriptValue& callback, const ScriptValue& thisArg, ExceptionState& exce ptionState) 42 void forEachForBinding(ScriptState* scriptState, const ScriptValue& thisValu e, const ScriptValue& callback, const ScriptValue& thisArg, ExceptionState& exce ptionState)
43 { 43 {
44 IterationSource* source = this->startIteration(scriptState, exceptionSta te); 44 IterationSource* source = this->startIteration(scriptState, exceptionSta te);
45 45
46 v8::Isolate* isolate = scriptState->isolate(); 46 v8::Isolate* isolate = scriptState->isolate();
47 v8::TryCatch tryCatch(isolate); 47 v8::TryCatch tryCatch(isolate);
48 48
49 v8::Local<v8::Object> creationContext(scriptState->context()->Global()); 49 v8::Local<v8::Object> creationContext(thisValue.v8Value().As<v8::Object> ());
50 v8::Local<v8::Function> v8Callback(callback.v8Value().As<v8::Function>() ); 50 v8::Local<v8::Function> v8Callback(callback.v8Value().As<v8::Function>() );
51 v8::Local<v8::Value> v8ThisArg(thisArg.v8Value()); 51 v8::Local<v8::Value> v8ThisArg(thisArg.v8Value());
52 v8::Local<v8::Value> args[3]; 52 v8::Local<v8::Value> args[3];
53 53
54 args[2] = thisValue.v8Value(); 54 args[2] = thisValue.v8Value();
55 55
56 while (true) { 56 while (true) {
57 KeyType key; 57 KeyType key;
58 ValueType value; 58 ValueType value;
59 59
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 public: 199 public:
200 Iterator* iterator(ScriptState* scriptState, ExceptionState& exceptionState) 200 Iterator* iterator(ScriptState* scriptState, ExceptionState& exceptionState)
201 { 201 {
202 return this->entriesForBinding(scriptState, exceptionState); 202 return this->entriesForBinding(scriptState, exceptionState);
203 } 203 }
204 }; 204 };
205 205
206 } // namespace blink 206 } // namespace blink
207 207
208 #endif // Iterable_h 208 #endif // Iterable_h
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/fontfaceset-cross-frame.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698