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

Unified Diff: Source/bindings/core/v8/ScriptStreamer.h

Issue 847803002: Make ScriptStreamer and dependents Oilpan friendly. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add ScriptSourceCode::isNull() comment Created 5 years, 11 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/bindings/core/v8/ScriptSourceCode.cpp ('k') | Source/bindings/core/v8/ScriptStreamer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/ScriptStreamer.h
diff --git a/Source/bindings/core/v8/ScriptStreamer.h b/Source/bindings/core/v8/ScriptStreamer.h
index b052376517a497e97303aaedcb7ade6da3e3fbd6..08d3644ae44058e64578658494a47247359188e9 100644
--- a/Source/bindings/core/v8/ScriptStreamer.h
+++ b/Source/bindings/core/v8/ScriptStreamer.h
@@ -7,6 +7,7 @@
#include "bindings/core/v8/ScriptStreamingMode.h"
#include "core/dom/PendingScript.h"
+#include "platform/heap/Handle.h"
#include "wtf/RefCounted.h"
#include <v8.h>
@@ -28,9 +29,17 @@ class SourceStream;
// streaming. It is possible, though, that Document and the PendingScript are
// destroyed while the streaming is in progress, and ScriptStreamer handles it
// gracefully.
-class ScriptStreamer : public RefCounted<ScriptStreamer> {
+class ScriptStreamer final : public RefCountedWillBeRefCountedGarbageCollected<ScriptStreamer> {
WTF_MAKE_NONCOPYABLE(ScriptStreamer);
public:
+ static PassRefPtrWillBeRawPtr<ScriptStreamer> create(ScriptResource* resource, PendingScript::Type scriptType, ScriptStreamingMode mode, ScriptState* scriptState, v8::ScriptCompiler::CompileOptions compileOptions)
+ {
+ return adoptRefWillBeNoop(new ScriptStreamer(resource, scriptType, mode, scriptState, compileOptions));
+ }
+
+ ~ScriptStreamer();
+ void trace(Visitor*);
+
// Launches a task (on a background thread) which will stream the given
// PendingScript into V8 as it loads. It's also possible that V8 cannot
// stream the given script; in that case this function returns
@@ -122,7 +131,7 @@ private:
// This pointer is weak. If PendingScript and its Resource are deleted
// before ScriptStreamer, PendingScript will notify ScriptStreamer of its
// deletion by calling cancel().
- ScriptResource* m_resource;
+ RawPtrWillBeMember<ScriptResource> m_resource;
// Whether ScriptStreamer is detached from the Resource. In those cases, the
// script data is not needed any more, and the client won't get notified
// when the loading and streaming are done.
« no previous file with comments | « Source/bindings/core/v8/ScriptSourceCode.cpp ('k') | Source/bindings/core/v8/ScriptStreamer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698