| 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/ExecutionContext.h" | 10 #include "core/dom/ExecutionContext.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 args[2] = this_value.V8Value(); | 65 args[2] = this_value.V8Value(); |
| 66 | 66 |
| 67 while (true) { | 67 while (true) { |
| 68 KeyType key; | 68 KeyType key; |
| 69 ValueType value; | 69 ValueType value; |
| 70 | 70 |
| 71 if (!source->Next(script_state, key, value, exception_state)) | 71 if (!source->Next(script_state, key, value, exception_state)) |
| 72 return; | 72 return; |
| 73 | 73 |
| 74 ASSERT(!exception_state.HadException()); | 74 DCHECK(!exception_state.HadException()); |
| 75 | 75 |
| 76 args[0] = ToV8(value, creation_context, isolate); | 76 args[0] = ToV8(value, creation_context, isolate); |
| 77 args[1] = ToV8(key, creation_context, isolate); | 77 args[1] = ToV8(key, creation_context, isolate); |
| 78 if (args[0].IsEmpty() || args[1].IsEmpty()) { | 78 if (args[0].IsEmpty() || args[1].IsEmpty()) { |
| 79 if (try_catch.HasCaught()) | 79 if (try_catch.HasCaught()) |
| 80 exception_state.RethrowV8Exception(try_catch.Exception()); | 80 exception_state.RethrowV8Exception(try_catch.Exception()); |
| 81 return; | 81 return; |
| 82 } | 82 } |
| 83 | 83 |
| 84 v8::Local<v8::Value> result; | 84 v8::Local<v8::Value> result; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 public: | 180 public: |
| 181 Iterator* GetIterator(ScriptState* script_state, | 181 Iterator* GetIterator(ScriptState* script_state, |
| 182 ExceptionState& exception_state) { | 182 ExceptionState& exception_state) { |
| 183 return this->entriesForBinding(script_state, exception_state); | 183 return this->entriesForBinding(script_state, exception_state); |
| 184 } | 184 } |
| 185 }; | 185 }; |
| 186 | 186 |
| 187 } // namespace blink | 187 } // namespace blink |
| 188 | 188 |
| 189 #endif // Iterable_h | 189 #endif // Iterable_h |
| OLD | NEW |