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/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
9 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
10 #include "bindings/core/v8/V8ThrowException.h" | 10 #include "bindings/core/v8/V8ThrowException.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 ScriptPromise Body::text(ScriptState* scriptState) | 90 ScriptPromise Body::text(ScriptState* scriptState) |
91 { | 91 { |
92 return readAsync(scriptState, ResponseAsText); | 92 return readAsync(scriptState, ResponseAsText); |
93 } | 93 } |
94 | 94 |
95 bool Body::bodyUsed() const | 95 bool Body::bodyUsed() const |
96 { | 96 { |
97 return m_bodyUsed; | 97 return m_bodyUsed; |
98 } | 98 } |
99 | 99 |
| 100 void Body::setBodyUsed() |
| 101 { |
| 102 m_bodyUsed = true; |
| 103 } |
| 104 |
100 void Body::stop() | 105 void Body::stop() |
101 { | 106 { |
102 // Canceling the load will call didFail which will remove the resolver. | 107 // Canceling the load will call didFail which will remove the resolver. |
103 if (m_resolver) | 108 if (m_resolver) |
104 m_loader->cancel(); | 109 m_loader->cancel(); |
105 } | 110 } |
106 | 111 |
107 bool Body::hasPendingActivity() const | 112 bool Body::hasPendingActivity() const |
108 { | 113 { |
109 return m_resolver; | 114 return m_resolver; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 { | 178 { |
174 ASSERT(m_resolver); | 179 ASSERT(m_resolver); |
175 if (!m_resolver->executionContext() || m_resolver->executionContext()->activ
eDOMObjectsAreStopped()) | 180 if (!m_resolver->executionContext() || m_resolver->executionContext()->activ
eDOMObjectsAreStopped()) |
176 return; | 181 return; |
177 | 182 |
178 m_resolver->resolve(""); | 183 m_resolver->resolve(""); |
179 m_resolver.clear(); | 184 m_resolver.clear(); |
180 } | 185 } |
181 | 186 |
182 } // namespace blink | 187 } // namespace blink |
OLD | NEW |