Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(814)

Side by Side Diff: Source/modules/serviceworkers/Body.cpp

Issue 562413003: Request construction spec changes to use the 'used' flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed method name & step number fixes Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/modules/serviceworkers/Body.h ('k') | Source/modules/serviceworkers/Request.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/Body.h ('k') | Source/modules/serviceworkers/Request.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698