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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h

Issue 2265873003: binding: Moves hasPendingActivity from ActiveScriptWrappable to ScriptWrappable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 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: third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h
index b1305caacd5edbb4c0831332d226d127501c04b3..1dd4a60fcbe8b1effd53c190648b8bc6ef69162a 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h
@@ -40,18 +40,10 @@
namespace blink {
-/**
- * ScriptWrappable wraps a V8 object and its WrapperTypeInfo.
- *
- * ScriptWrappable acts much like a v8::Persistent<> in that it keeps a
- * V8 object alive.
- *
- * The state transitions are:
- * - new: an empty ScriptWrappable.
- * - setWrapper: install a v8::Persistent (or empty)
- * - disposeWrapper (via setWeakCallback, triggered by V8 garbage collecter):
- * remove v8::Persistent and become empty.
- */
+// ScriptWrappable wraps a V8 object and its WrapperTypeInfo.
+//
+// ScriptWrappable acts much like a v8::Persistent<> in that it keeps a
+// V8 object alive.
haraken 2016/08/23 07:55:40 This is not really correct. ScriptWrappable keeps
Yuki 2016/08/23 09:49:52 I've rewritten the class comment.
class CORE_EXPORT ScriptWrappable {
WTF_MAKE_NONCOPYABLE(ScriptWrappable);
public:
@@ -90,6 +82,8 @@ public:
// The caller should always use the returned value rather than |wrapper|.
virtual v8::Local<v8::Object> associateWithWrapper(v8::Isolate*, const WrapperTypeInfo*, v8::Local<v8::Object> wrapper) WARN_UNUSED_RETURN;
+ virtual bool hasPendingActivity() const { return false; }
haraken 2016/08/23 07:55:40 Add a comment.
+
// Associates this instance with the given |wrapper| if this instance is not
// yet associated with any wrapper. Returns true if the given wrapper is
// associated with this instance, or false if this instance is already
@@ -144,24 +138,13 @@ public:
bool containsWrapper() const { return !m_mainWorldWrapper.IsEmpty(); }
- /**
- * Mark wrapper of this ScriptWrappable as alive in V8. Only marks
- * wrapper in the main world. To mark wrappers in all worlds call
- * ScriptWrappableVisitor::markWrapper(ScriptWrappable*, v8::Isolate*)
- */
+ // Mark wrapper of this ScriptWrappable as alive in V8. Only marks
+ // wrapper in the main world. To mark wrappers in all worlds call
+ // ScriptWrappableVisitor::markWrapper(ScriptWrappable*, v8::Isolate*)
void markWrapper(const WrapperVisitor*) const;
DECLARE_VIRTUAL_TRACE_WRAPPERS() {};
- // With Oilpan we don't need a ScriptWrappable destructor.
- //
- // 'RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(!containsWrapper())' is not needed
- // because Oilpan is not using reference counting at all. If containsWrapper() is true,
- // it means that ScriptWrappable still has a wrapper. In this case, the destructor
- // must not be called since the wrapper has a persistent handle back to this ScriptWrappable object.
- // Assuming that Oilpan's GC is correct (If we cannot assume this, a lot of more things are
- // already broken), we must not hit the RELEASE_ASSERT.
-
private:
// These classes are exceptionally allowed to use mainWorldWrapper().
friend class DOMDataStore;

Powered by Google App Engine
This is Rietveld 408576698