| 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 #include "core/streams/ReadableStreamOperations.h" | 5 #include "core/streams/ReadableStreamOperations.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
| 8 #include "bindings/core/v8/ScriptFunction.h" | 8 #include "bindings/core/v8/ScriptFunction.h" |
| 9 #include "bindings/core/v8/ScriptValue.h" | 9 #include "bindings/core/v8/ScriptValue.h" |
| 10 #include "bindings/core/v8/V8BindingForCore.h" | 10 #include "bindings/core/v8/V8BindingForCore.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 ScriptValue NotReached::Call(ScriptValue) { | 41 ScriptValue NotReached::Call(ScriptValue) { |
| 42 EXPECT_TRUE(false) << "'Unreachable' code was reached"; | 42 EXPECT_TRUE(false) << "'Unreachable' code was reached"; |
| 43 return ScriptValue(); | 43 return ScriptValue(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 class Iteration final : public GarbageCollectedFinalized<Iteration> { | 46 class Iteration final : public GarbageCollectedFinalized<Iteration> { |
| 47 public: | 47 public: |
| 48 Iteration() : is_set_(false), is_done_(false), is_valid_(true) {} | 48 Iteration() : is_set_(false), is_done_(false), is_valid_(true) {} |
| 49 | 49 |
| 50 void Set(ScriptValue v) { | 50 void Set(ScriptValue v) { |
| 51 ASSERT(!v.IsEmpty()); | 51 DCHECK(!v.IsEmpty()); |
| 52 is_set_ = true; | 52 is_set_ = true; |
| 53 v8::TryCatch block(v.GetScriptState()->GetIsolate()); | 53 v8::TryCatch block(v.GetScriptState()->GetIsolate()); |
| 54 v8::Local<v8::Value> value; | 54 v8::Local<v8::Value> value; |
| 55 v8::Local<v8::Value> item = v.V8Value(); | 55 v8::Local<v8::Value> item = v.V8Value(); |
| 56 if (!item->IsObject() || | 56 if (!item->IsObject() || |
| 57 !V8UnpackIteratorResult(v.GetScriptState(), item.As<v8::Object>(), | 57 !V8UnpackIteratorResult(v.GetScriptState(), item.As<v8::Object>(), |
| 58 &is_done_) | 58 &is_done_) |
| 59 .ToLocal(&value)) { | 59 .ToLocal(&value)) { |
| 60 is_valid_ = false; | 60 is_valid_ = false; |
| 61 return; | 61 return; |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 EXPECT_EQ("hello", it1->Value()); | 494 EXPECT_EQ("hello", it1->Value()); |
| 495 EXPECT_TRUE(it2->IsSet()); | 495 EXPECT_TRUE(it2->IsSet()); |
| 496 EXPECT_TRUE(it2->IsValid()); | 496 EXPECT_TRUE(it2->IsValid()); |
| 497 EXPECT_FALSE(it2->IsDone()); | 497 EXPECT_FALSE(it2->IsDone()); |
| 498 EXPECT_EQ("hello", it2->Value()); | 498 EXPECT_EQ("hello", it2->Value()); |
| 499 } | 499 } |
| 500 | 500 |
| 501 } // namespace | 501 } // namespace |
| 502 | 502 |
| 503 } // namespace blink | 503 } // namespace blink |
| OLD | NEW |