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

Unified Diff: Source/core/loader/DocumentLoader.h

Issue 1263363005: Better handle reentrancy into DocumentLoader::dataReceived(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 5 years, 4 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 | « no previous file | Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/DocumentLoader.h
diff --git a/Source/core/loader/DocumentLoader.h b/Source/core/loader/DocumentLoader.h
index 69a160c4a66a272a265db155e0154a06900270a1..4af2c3d0d99c85915077a9c2b0c9c4976bbe5768 100644
--- a/Source/core/loader/DocumentLoader.h
+++ b/Source/core/loader/DocumentLoader.h
@@ -45,8 +45,11 @@
#include "platform/network/ResourceError.h"
#include "platform/network/ResourceRequest.h"
#include "platform/network/ResourceResponse.h"
+#include "wtf/Deque.h"
#include "wtf/HashSet.h"
+#include "wtf/OwnPtr.h"
#include "wtf/RefPtr.h"
+#include "wtf/Vector.h"
namespace blink {
@@ -176,6 +179,7 @@ private:
void updateRequest(Resource*, const ResourceRequest&) final;
void responseReceived(Resource*, const ResourceResponse&, PassOwnPtr<WebDataConsumerHandle>) final;
void dataReceived(Resource*, const char* data, unsigned length) final;
+ void processData(const char* data, unsigned length);
void notifyFinished(Resource*) final;
bool maybeLoadEmpty();
@@ -232,6 +236,10 @@ private:
MainResourceDone
};
State m_state;
+
+ // Used to protect against reentrancy into dataReceived().
+ bool m_inDataReceived;
+ Deque<OwnPtr<Vector<char>>> m_dataQueue;
Nate Chapin 2015/08/05 18:27:06 I assume the OwnPtr here is actually necessary (or
dcheng 2015/08/05 21:57:12 It's to save a copy. If we could use std::move() a
};
DECLARE_WEAK_IDENTIFIER_MAP(DocumentLoader);
« no previous file with comments | « no previous file | Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698