| 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 "modules/serviceworkers/Body.h" | 6 #include "modules/serviceworkers/Body.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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 { | 224 { |
| 225 if (m_resolver) | 225 if (m_resolver) |
| 226 return true; | 226 return true; |
| 227 if (m_streamAccessed && (m_stream->state() == ReadableStream::Readable || m_
stream->state() == ReadableStream::Waiting)) | 227 if (m_streamAccessed && (m_stream->state() == ReadableStream::Readable || m_
stream->state() == ReadableStream::Waiting)) |
| 228 return true; | 228 return true; |
| 229 return false; | 229 return false; |
| 230 } | 230 } |
| 231 | 231 |
| 232 void Body::trace(Visitor* visitor) | 232 void Body::trace(Visitor* visitor) |
| 233 { | 233 { |
| 234 visitor->trace(m_resolver); |
| 234 visitor->trace(m_stream); | 235 visitor->trace(m_stream); |
| 235 visitor->trace(m_streamSource); | 236 visitor->trace(m_streamSource); |
| 236 } | 237 } |
| 237 | 238 |
| 238 Body::Body(ExecutionContext* context) | 239 Body::Body(ExecutionContext* context) |
| 239 : ActiveDOMObject(context) | 240 : ActiveDOMObject(context) |
| 240 , m_bodyUsed(false) | 241 , m_bodyUsed(false) |
| 241 , m_streamAccessed(false) | 242 , m_streamAccessed(false) |
| 242 , m_responseType(ResponseType::ResponseUnknown) | 243 , m_responseType(ResponseType::ResponseUnknown) |
| 243 , m_streamSource(new ReadableStreamSource(this)) | 244 , m_streamSource(new ReadableStreamSource(this)) |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 | 369 |
| 369 if (m_resolver) { | 370 if (m_resolver) { |
| 370 // FIXME: We should reject the promise. | 371 // FIXME: We should reject the promise. |
| 371 m_resolver->resolve(""); | 372 m_resolver->resolve(""); |
| 372 m_resolver.clear(); | 373 m_resolver.clear(); |
| 373 } | 374 } |
| 374 m_stream->error(DOMException::create(NetworkError, "network error")); | 375 m_stream->error(DOMException::create(NetworkError, "network error")); |
| 375 } | 376 } |
| 376 | 377 |
| 377 } // namespace blink | 378 } // namespace blink |
| OLD | NEW |