| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 KeyType key; | 57 KeyType key; |
| 58 ValueType value; | 58 ValueType value; |
| 59 | 59 |
| 60 if (!source->next(scriptState, key, value, exceptionState)) | 60 if (!source->next(scriptState, key, value, exceptionState)) |
| 61 return; | 61 return; |
| 62 | 62 |
| 63 ASSERT(!exceptionState.hadException()); | 63 ASSERT(!exceptionState.hadException()); |
| 64 | 64 |
| 65 args[0] = toV8(value, creationContext, isolate); | 65 args[0] = toV8(value, creationContext, isolate); |
| 66 args[1] = toV8(key, creationContext, isolate); | 66 args[1] = toV8(key, creationContext, isolate); |
| 67 if (args[0].IsEmpty() || args[1].IsEmpty()) { | |
| 68 if (tryCatch.HasCaught()) | |
| 69 exceptionState.rethrowV8Exception(tryCatch.Exception()); | |
| 70 return; | |
| 71 } | |
| 72 | |
| 73 v8::Local<v8::Value> result; | 67 v8::Local<v8::Value> result; |
| 74 if (!V8ScriptRunner::callFunction(v8Callback, scriptState->getExecut
ionContext(), v8ThisArg, 3, args, isolate).ToLocal(&result)) { | 68 if (!V8ScriptRunner::callFunction(v8Callback, scriptState->getExecut
ionContext(), v8ThisArg, 3, args, isolate).ToLocal(&result)) { |
| 75 exceptionState.rethrowV8Exception(tryCatch.Exception()); | 69 exceptionState.rethrowV8Exception(tryCatch.Exception()); |
| 76 return; | 70 return; |
| 77 } | 71 } |
| 78 } | 72 } |
| 79 } | 73 } |
| 80 | 74 |
| 81 class IterationSource : public GarbageCollectedFinalized<IterationSource> { | 75 class IterationSource : public GarbageCollectedFinalized<IterationSource> { |
| 82 public: | 76 public: |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 public: | 193 public: |
| 200 Iterator* iterator(ScriptState* scriptState, ExceptionState& exceptionState) | 194 Iterator* iterator(ScriptState* scriptState, ExceptionState& exceptionState) |
| 201 { | 195 { |
| 202 return this->entriesForBinding(scriptState, exceptionState); | 196 return this->entriesForBinding(scriptState, exceptionState); |
| 203 } | 197 } |
| 204 }; | 198 }; |
| 205 | 199 |
| 206 } // namespace blink | 200 } // namespace blink |
| 207 | 201 |
| 208 #endif // Iterable_h | 202 #endif // Iterable_h |
| OLD | NEW |