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

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: rebased 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 | « Source/bindings/bindings.gypi ('k') | Source/bindings/v8/UnsafePersistent.h » ('j') | no next file with comments »
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 8568b3ee33884709d5823ece80a9277e02f032bd..f0334444fb6ff7fdbfe6b694ae107aa1f25be897 100644
--- a/Source/bindings/v8/ScriptWrappable.h
+++ b/Source/bindings/v8/ScriptWrappable.h
@@ -31,6 +31,7 @@
#ifndef ScriptWrappable_h
#define ScriptWrappable_h
+#include "bindings/v8/UnsafePersistent.h"
#include "bindings/v8/V8Utilities.h"
#include "bindings/v8/WrapperTypeInfo.h"
#include "core/dom/WebCoreMemoryInstrumentation.h"
@@ -152,6 +153,14 @@ protected:
}
private:
+ friend class MinorGCWrapperVisitor; // For calling unsafePersistent.
+
+ UnsafePersistent<v8::Object> unsafePersistent() const
+ {
+ ASSERT(containsWrapper());
+ return UnsafePersistent<v8::Object>(reinterpret_cast<v8::Object*>(maskOrUnmaskValue(m_maskedStorage)));
+ }
+
inline bool containsWrapper() const { return (m_maskedStorage & 1) == 1; }
inline bool containsTypeInfo() const { return m_maskedStorage && ((m_maskedStorage & 1) == 0); }
« no previous file with comments | « Source/bindings/bindings.gypi ('k') | Source/bindings/v8/UnsafePersistent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698