| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/streams/ReadableStream.h" | 6 #include "core/streams/ReadableStream.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
| 9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 10 #include "bindings/core/v8/ScriptState.h" | 10 #include "bindings/core/v8/ScriptState.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 return value; | 53 return value; |
| 54 } | 54 } |
| 55 | 55 |
| 56 String* m_value; | 56 String* m_value; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 class MockUnderlyingSource : public GarbageCollectedFinalized<MockUnderlyingSour
ce>, public UnderlyingSource { | 59 class MockUnderlyingSource : public GarbageCollectedFinalized<MockUnderlyingSour
ce>, public UnderlyingSource { |
| 60 USING_GARBAGE_COLLECTED_MIXIN(MockUnderlyingSource); | 60 USING_GARBAGE_COLLECTED_MIXIN(MockUnderlyingSource); |
| 61 public: | 61 public: |
| 62 ~MockUnderlyingSource() override { } | 62 ~MockUnderlyingSource() override { } |
| 63 virtual void trace(Visitor* visitor) override |
| 64 { |
| 65 UnderlyingSource::trace(visitor); |
| 66 } |
| 63 | 67 |
| 64 MOCK_METHOD0(pullSource, void()); | 68 MOCK_METHOD0(pullSource, void()); |
| 65 MOCK_METHOD2(cancelSource, ScriptPromise(ScriptState*, ScriptValue)); | 69 MOCK_METHOD2(cancelSource, ScriptPromise(ScriptState*, ScriptValue)); |
| 66 }; | 70 }; |
| 67 | 71 |
| 68 class PermissiveStrategy : public StringStream::Strategy { | 72 class PermissiveStrategy : public StringStream::Strategy { |
| 69 public: | 73 public: |
| 70 bool shouldApplyBackpressure(size_t, ReadableStream*) override { return fals
e; } | 74 bool shouldApplyBackpressure(size_t, ReadableStream*) override { return fals
e; } |
| 71 }; | 75 }; |
| 72 | 76 |
| (...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 stream->enqueue("bar"); | 772 stream->enqueue("bar"); |
| 769 checkpoint.Call(3); | 773 checkpoint.Call(3); |
| 770 EXPECT_TRUE(stream->read(scriptState(), m_exceptionState).toString(chunk)); | 774 EXPECT_TRUE(stream->read(scriptState(), m_exceptionState).toString(chunk)); |
| 771 EXPECT_EQ("foo", chunk); | 775 EXPECT_EQ("foo", chunk); |
| 772 checkpoint.Call(4); | 776 checkpoint.Call(4); |
| 773 | 777 |
| 774 stream->error(DOMException::create(AbortError, "done")); | 778 stream->error(DOMException::create(AbortError, "done")); |
| 775 } | 779 } |
| 776 | 780 |
| 777 } // namespace blink | 781 } // namespace blink |
| OLD | NEW |