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

Unified Diff: third_party/WebKit/Source/modules/fetch/FetchManager.cpp

Issue 2141383002: [Fetch API] Remove HandleScope to protect local handles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 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
Index: third_party/WebKit/Source/modules/fetch/FetchManager.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
index 0d53af6eea1422e49cd15b984f541ed9efeca5c8..0acdab59700c33ad0442203cb2f7cc1eeb594da2 100644
--- a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
+++ b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
@@ -143,6 +143,8 @@ public:
private:
std::unique_ptr<WebDataConsumerHandle> m_handle;
Member<CompositeDataConsumerHandle::Updater> m_updater;
+ // We cannot store a Response because its JS wrapper can be collected.
+ // TODO(yhirano): Fix this.
Member<Response> m_response;
Member<FetchManager::Loader> m_loader;
String m_integrityMetadata;
@@ -209,6 +211,8 @@ DEFINE_TRACE(FetchManager::Loader)
void FetchManager::Loader::didReceiveResponse(unsigned long, const ResourceResponse& response, std::unique_ptr<WebDataConsumerHandle> handle)
{
ASSERT(handle);
+ ScriptState* scriptState = m_resolver->getScriptState();
+ ScriptState::Scope scope(scriptState);
if (response.url().protocolIs("blob") && response.httpStatusCode() == 404) {
// "If |blob| is null, return a network error."
@@ -290,7 +294,6 @@ void FetchManager::Loader::didReceiveResponse(unsigned long, const ResourceRespo
}
}
- ScriptState* scriptState = m_resolver->getScriptState();
FetchResponseData* responseData = nullptr;
CompositeDataConsumerHandle::Updater* updater = nullptr;
if (m_request->integrity().isEmpty())
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/BodyStreamBufferTest.cpp ('k') | third_party/WebKit/Source/modules/fetch/Request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698