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

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

Issue 1262593004: Prevent ThreadableLoaderClient methods from being called after failure notification (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Don't clear the resource in didFinishLoading 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
Index: Source/core/loader/ThreadableLoader.h
diff --git a/Source/core/loader/ThreadableLoader.h b/Source/core/loader/ThreadableLoader.h
index dc8f3ef02e9da2a4776cb0e5e284f45cf2d0d75c..44b8fd73dd29f19808b360b7b340545ace314a3c 100644
--- a/Source/core/loader/ThreadableLoader.h
+++ b/Source/core/loader/ThreadableLoader.h
@@ -115,16 +115,25 @@ namespace blink {
// Useful for doing loader operations from any thread (not threadsafe,
// just able to run on threads other than the main thread).
+ //
+ // Arguments common to both loadResourceSynchronously() and create():
+ //
+ // - ThreadableLoaderOptions argument configures this ThreadableLoader's
+ // behavior.
+ //
+ // - ResourceLoaderOptions argument will be passed to the FetchRequest
+ // that this ThreadableLoader creates. It can be altered e.g. when
+ // redirect happens.
class CORE_EXPORT ThreadableLoader : public RefCounted<ThreadableLoader> {
WTF_MAKE_NONCOPYABLE(ThreadableLoader);
public:
- // ThreadableLoaderOptions argument configures this ThreadableLoader's
- // behavior.
- //
- // ResourceLoaderOptions argument will be passed to the FetchRequest
- // that this ThreadableLoader creates. It can be altered e.g. when
- // redirect happens.
static void loadResourceSynchronously(ExecutionContext&, const ResourceRequest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&, const ResourceLoaderOptions&);
+ // The following ThreadableLoaderClient methods may destroy the
+ // ThreadableLoader instance in them.
+ // - didFinishLoading()
+ // - didFail()
+ // - didFailAccessControlCheck()
+ // - didFailRedirectCheck()
static PassRefPtr<ThreadableLoader> create(ExecutionContext&, ThreadableLoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&, const ResourceLoaderOptions&);
// A ThreadableLoader may have a timeout specified. It is possible, in some cases, for

Powered by Google App Engine
This is Rietveld 408576698