OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |