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

Side by Side Diff: third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp

Issue 2629593004: Disambiguate LifecycleObserver::contextDestroyed (Closed)
Patch Set: temp Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "modules/fetch/BlobBytesConsumer.h" 5 #include "modules/fetch/BlobBytesConsumer.h"
6 6
7 #include "core/fetch/FetchInitiatorTypeNames.h" 7 #include "core/fetch/FetchInitiatorTypeNames.h"
8 #include "core/loader/ThreadableLoader.h" 8 #include "core/loader/ThreadableLoader.h"
9 #include "modules/fetch/BytesConsumerForDataConsumerHandle.h" 9 #include "modules/fetch/BytesConsumerForDataConsumerHandle.h"
10 #include "platform/blob/BlobData.h" 10 #include "platform/blob/BlobData.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 BytesConsumer::Error BlobBytesConsumer::getError() const { 157 BytesConsumer::Error BlobBytesConsumer::getError() const {
158 DCHECK_EQ(PublicState::Errored, m_state); 158 DCHECK_EQ(PublicState::Errored, m_state);
159 return Error("Failed to load a blob."); 159 return Error("Failed to load a blob.");
160 } 160 }
161 161
162 BytesConsumer::PublicState BlobBytesConsumer::getPublicState() const { 162 BytesConsumer::PublicState BlobBytesConsumer::getPublicState() const {
163 return m_state; 163 return m_state;
164 } 164 }
165 165
166 void BlobBytesConsumer::contextDestroyed() { 166 void BlobBytesConsumer::contextDestroyed(ExecutionContext*) {
167 if (m_state != PublicState::ReadableOrWaiting) 167 if (m_state != PublicState::ReadableOrWaiting)
168 return; 168 return;
169 169
170 BytesConsumer::Client* client = m_client; 170 BytesConsumer::Client* client = m_client;
171 error(); 171 error();
172 if (client) 172 if (client)
173 client->onStateChange(); 173 client->onStateChange();
174 } 174 }
175 175
176 void BlobBytesConsumer::onStateChange() { 176 void BlobBytesConsumer::onStateChange() {
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 void BlobBytesConsumer::clear() { 297 void BlobBytesConsumer::clear() {
298 DCHECK_NE(m_state, PublicState::ReadableOrWaiting); 298 DCHECK_NE(m_state, PublicState::ReadableOrWaiting);
299 if (m_loader) { 299 if (m_loader) {
300 m_loader->cancel(); 300 m_loader->cancel();
301 m_loader = nullptr; 301 m_loader = nullptr;
302 } 302 }
303 m_client = nullptr; 303 m_client = nullptr;
304 } 304 }
305 305
306 } // namespace blink 306 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698