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

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

Issue 14362015: WIP enum / V8PerContextData solution (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Crash during GC 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
Index: Source/bindings/v8/V8PerContextData.h
diff --git a/Source/bindings/v8/V8PerContextData.h b/Source/bindings/v8/V8PerContextData.h
index 1dd1de0222eb4b0dd24c192a13fb516c172907b2..7719358c514066d2b46c41221d1daf08b7d2a795 100644
--- a/Source/bindings/v8/V8PerContextData.h
+++ b/Source/bindings/v8/V8PerContextData.h
@@ -33,6 +33,7 @@
#include "ScopedPersistent.h"
#include "V8DOMActivityLogger.h"
+#include "V8PerContextDebugData.h"
#include "WrapperTypeInfo.h"
#include <v8.h>
#include <wtf/HashMap.h>
@@ -45,14 +46,6 @@ struct V8NPObject;
typedef WTF::Vector<V8NPObject*> V8NPObjectVector;
typedef WTF::HashMap<int, V8NPObjectVector> V8NPObjectMap;
-enum V8ContextEmbedderDataField {
- v8ContextDebugIdIndex,
- v8ContextPerContextDataIndex,
- v8ContextIsolatedWorld,
- // Rather than adding more embedder data fields to v8::Context,
- // consider adding the data to V8PerContextData instead.
-};
-
class V8PerContextData {
public:
static PassOwnPtr<V8PerContextData> create(v8::Persistent<v8::Context> context)
@@ -103,10 +96,14 @@ public:
{
m_activityLogger = logger;
}
-
+
private:
explicit V8PerContextData(v8::Persistent<v8::Context> context)
- : m_context(context)
+ : m_context(context),
+ m_originCategory(CompilationOriginUnset),
+ m_contextCategory(CompilationContextUnset),
+ m_restrictions(CompilationRestrictionsNone),
+ m_debugId(0)
{
}
@@ -131,12 +128,13 @@ private:
v8::Persistent<v8::Context> m_context;
ScopedPersistent<v8::Value> m_errorPrototype;
ScopedPersistent<v8::Value> m_objectPrototype;
-};
-
-class V8PerContextDebugData {
-public:
- static bool setContextDebugData(v8::Handle<v8::Context>, const char* worldName, int debugId);
- static int contextDebugId(v8::Handle<v8::Context>);
+ // Transient values set during compilation into the Context for devtools
+ friend class V8PerContextDebugData;
+ friend class V8ScopedCompilation;
+ CompilationOriginCategory m_originCategory;
+ CompilationContextCategory m_contextCategory;
+ CompilationRestrictions m_restrictions;
+ int m_debugId;
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698