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

Unified Diff: Source/core/workers/WorkerScriptLoader.h

Issue 1322523002: Make WorkerScriptLoader back to RefCounted class (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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 | « Source/core/workers/WorkerGlobalScope.cpp ('k') | Source/core/workers/WorkerScriptLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/workers/WorkerScriptLoader.h
diff --git a/Source/core/workers/WorkerScriptLoader.h b/Source/core/workers/WorkerScriptLoader.h
index e0603352933a4102af8b6e94bb333200ae1a832f..c138b46524e5ff13da735dd582488fe64e49fb02 100644
--- a/Source/core/workers/WorkerScriptLoader.h
+++ b/Source/core/workers/WorkerScriptLoader.h
@@ -37,6 +37,7 @@
#include "wtf/FastAllocBase.h"
#include "wtf/Functional.h"
#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
#include "wtf/text/StringBuilder.h"
namespace blink {
@@ -47,11 +48,13 @@ class ResourceResponse;
class ExecutionContext;
class TextResourceDecoder;
-class CORE_EXPORT WorkerScriptLoader final : public ThreadableLoaderClient {
+class CORE_EXPORT WorkerScriptLoader final : public RefCounted<WorkerScriptLoader>, public ThreadableLoaderClient {
WTF_MAKE_FAST_ALLOCATED(WorkerScriptLoader);
public:
- WorkerScriptLoader();
- ~WorkerScriptLoader() override;
+ static PassRefPtr<WorkerScriptLoader> create()
+ {
+ return adoptRef(new WorkerScriptLoader());
+ }
void loadSynchronously(ExecutionContext&, const KURL&, CrossOriginRequestPolicy);
// TODO: |finishedCallback| is not currently guaranteed to be invoked if
@@ -88,6 +91,11 @@ public:
void setRequestContext(WebURLRequest::RequestContext requestContext) { m_requestContext = requestContext; }
private:
+ friend class WTF::RefCounted<WorkerScriptLoader>;
+
+ WorkerScriptLoader();
+ ~WorkerScriptLoader() override;
+
PassOwnPtr<ResourceRequest> createResourceRequest();
void notifyError();
void notifyFinished();
« no previous file with comments | « Source/core/workers/WorkerGlobalScope.cpp ('k') | Source/core/workers/WorkerScriptLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698