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

Unified Diff: Source/bindings/v8/ScriptWrappable.h

Issue 14443007: Get rid of usages of ScriptWrappable::wrapper(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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/bindings/v8/V8GCController.cpp » ('j') | Source/bindings/v8/V8GCController.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/ScriptWrappable.h
diff --git a/Source/bindings/v8/ScriptWrappable.h b/Source/bindings/v8/ScriptWrappable.h
index 45f3e7c002b3404ac4ab68a40cf5ca8f42b48393..85eb194f35affde04e8821ceeea7679605544289 100644
--- a/Source/bindings/v8/ScriptWrappable.h
+++ b/Source/bindings/v8/ScriptWrappable.h
@@ -99,6 +99,8 @@ public:
info.ignoreMember(m_maskedStorage);
}
+ bool containsWrapper() const { return (m_maskedStorage & 1) == 1; }
+
static bool wrapperCanBeStoredInObject(const void*) { return false; }
static bool wrapperCanBeStoredInObject(const ScriptWrappable*) { return true; }
@@ -152,7 +154,15 @@ protected:
}
private:
- inline bool containsWrapper() const { return (m_maskedStorage & 1) == 1; }
+ friend class MinorGCWrapperVisitor; // For calling rawWrapper().
haraken 2013/04/26 13:42:23 Is this the only function we need to make a friend
marja 2013/04/26 13:48:17 Afaics, the only other use of wrapper() is in DOMD
+
+ v8::Object* rawWrapper() const
+ {
+ if (!containsWrapper())
+ return NULL;
haraken 2013/04/26 13:42:23 NULL => 0
marja 2013/04/26 13:48:17 Done.
+ return reinterpret_cast<v8::Object*>(maskOrUnmaskValue(m_maskedStorage));
+ }
+
inline bool containsTypeInfo() const { return m_maskedStorage && ((m_maskedStorage & 1) == 0); }
static inline uintptr_t maskOrUnmaskValue(uintptr_t value)
« no previous file with comments | « no previous file | Source/bindings/v8/V8GCController.cpp » ('j') | Source/bindings/v8/V8GCController.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698