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

Unified Diff: Source/modules/serviceworkers/FetchBodyStream.cpp

Issue 390673002: Replace uses of {un}setPendingActivity() in FetchBodyStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/serviceworkers/FetchBodyStream.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/FetchBodyStream.cpp
diff --git a/Source/modules/serviceworkers/FetchBodyStream.cpp b/Source/modules/serviceworkers/FetchBodyStream.cpp
index 6fa418fa56aaf1c5eba35fb8e6656fafa4fe4b82..1798b0e532142179a611d52f0fe5c40585687cd0 100644
--- a/Source/modules/serviceworkers/FetchBodyStream.cpp
+++ b/Source/modules/serviceworkers/FetchBodyStream.cpp
@@ -20,7 +20,7 @@ namespace WebCore {
PassRefPtrWillBeRawPtr<FetchBodyStream> FetchBodyStream::create(ExecutionContext* context, PassRefPtr<BlobDataHandle> blobDataHandle)
{
- RefPtrWillBeRawPtr<FetchBodyStream> fetchBodyStream(adoptRefWillBeRefCountedGarbageCollected(new FetchBodyStream(context, blobDataHandle)));
+ RefPtrWillBeRawPtr<FetchBodyStream> fetchBodyStream(adoptRefWillBeNoop(new FetchBodyStream(context, blobDataHandle)));
fetchBodyStream->suspendIfNeeded();
return fetchBodyStream.release();
}
@@ -58,7 +58,6 @@ ScriptPromise FetchBodyStream::readAsync(ScriptState* scriptState, ResponseType
ASSERT_NOT_REACHED();
}
- setPendingActivity(this);
m_loader = adoptPtr(new FileReaderLoader(readType, this));
m_loader->start(scriptState->executionContext(), m_blobDataHandle);
@@ -97,6 +96,11 @@ void FetchBodyStream::stop()
m_loader->cancel();
}
+bool FetchBodyStream::hasPendingActivity() const
+{
+ return m_resolver;
+}
+
FetchBodyStream::FetchBodyStream(ExecutionContext* context, PassRefPtr<BlobDataHandle> blobDataHandle)
: ActiveDOMObject(context)
, m_blobDataHandle(blobDataHandle)
@@ -149,8 +153,6 @@ void FetchBodyStream::didFinishLoading()
ASSERT_NOT_REACHED();
}
m_resolver.clear();
- unsetPendingActivity(this);
- return;
}
void FetchBodyStream::didFail(FileError::ErrorCode code)
@@ -158,7 +160,6 @@ void FetchBodyStream::didFail(FileError::ErrorCode code)
ASSERT(m_resolver);
m_resolver->resolve("");
m_resolver.clear();
- unsetPendingActivity(this);
}
} // namespace WebCore
« no previous file with comments | « Source/modules/serviceworkers/FetchBodyStream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698