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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 { | 278 { |
279 if (m_resolver) | 279 if (m_resolver) |
280 return true; | 280 return true; |
281 if (m_streamAccessed && (m_stream->state() == ReadableStream::Readable || m_
stream->state() == ReadableStream::Waiting)) | 281 if (m_streamAccessed && (m_stream->state() == ReadableStream::Readable || m_
stream->state() == ReadableStream::Waiting)) |
282 return true; | 282 return true; |
283 return false; | 283 return false; |
284 } | 284 } |
285 | 285 |
286 void Body::trace(Visitor* visitor) | 286 void Body::trace(Visitor* visitor) |
287 { | 287 { |
| 288 visitor->trace(m_resolver); |
288 visitor->trace(m_stream); | 289 visitor->trace(m_stream); |
289 visitor->trace(m_streamSource); | 290 visitor->trace(m_streamSource); |
290 } | 291 } |
291 | 292 |
292 Body::Body(ExecutionContext* context) | 293 Body::Body(ExecutionContext* context) |
293 : ActiveDOMObject(context) | 294 : ActiveDOMObject(context) |
294 , m_bodyUsed(false) | 295 , m_bodyUsed(false) |
295 , m_streamAccessed(false) | 296 , m_streamAccessed(false) |
296 , m_responseType(ResponseType::ResponseUnknown) | 297 , m_responseType(ResponseType::ResponseUnknown) |
297 , m_streamSource(new ReadableStreamSource(this)) | 298 , m_streamSource(new ReadableStreamSource(this)) |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 | 431 |
431 void Body::didBlobHandleReceiveError(PassRefPtrWillBeRawPtr<DOMException> except
ion) | 432 void Body::didBlobHandleReceiveError(PassRefPtrWillBeRawPtr<DOMException> except
ion) |
432 { | 433 { |
433 if (!m_resolver) | 434 if (!m_resolver) |
434 return; | 435 return; |
435 m_resolver->reject(exception); | 436 m_resolver->reject(exception); |
436 m_resolver.clear(); | 437 m_resolver.clear(); |
437 } | 438 } |
438 | 439 |
439 } // namespace blink | 440 } // namespace blink |
OLD | NEW |