OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 #ifndef V8PerIsolateData_h | 26 #ifndef V8PerIsolateData_h |
27 #define V8PerIsolateData_h | 27 #define V8PerIsolateData_h |
28 | 28 |
29 #include "bindings/core/v8/ScopedPersistent.h" | 29 #include "bindings/core/v8/ScopedPersistent.h" |
30 #include "bindings/core/v8/ScriptState.h" | 30 #include "bindings/core/v8/ScriptState.h" |
31 #include "bindings/core/v8/V8HiddenValue.h" | 31 #include "bindings/core/v8/V8HiddenValue.h" |
32 #include "bindings/core/v8/WrapperTypeInfo.h" | 32 #include "bindings/core/v8/WrapperTypeInfo.h" |
33 #include "gin/public/gin_embedders.h" | 33 #include "gin/public/gin_embedders.h" |
34 #include "gin/public/isolate_holder.h" | 34 #include "gin/public/isolate_holder.h" |
| 35 #include "modules/indexeddb/IDBPendingTransactionMonitor.h" |
35 #include "wtf/Forward.h" | 36 #include "wtf/Forward.h" |
36 #include "wtf/HashMap.h" | 37 #include "wtf/HashMap.h" |
37 #include "wtf/OwnPtr.h" | 38 #include "wtf/OwnPtr.h" |
38 #include "wtf/Vector.h" | 39 #include "wtf/Vector.h" |
39 #include <v8.h> | 40 #include <v8.h> |
40 | 41 |
41 namespace blink { | 42 namespace blink { |
42 | 43 |
43 class DOMDataStore; | 44 class DOMDataStore; |
44 class GCEventData; | 45 class GCEventData; |
45 class StringCache; | 46 class StringCache; |
46 struct WrapperTypeInfo; | 47 struct WrapperTypeInfo; |
47 | 48 |
48 class ExternalStringVisitor; | 49 class ExternalStringVisitor; |
49 | 50 |
50 typedef WTF::Vector<DOMDataStore*> DOMDataStoreList; | 51 typedef WTF::Vector<DOMDataStore*> DOMDataStoreList; |
51 | 52 |
52 class V8PerIsolateData { | 53 class V8PerIsolateData { |
53 public: | 54 public: |
54 static v8::Isolate* initialize(); | 55 static v8::Isolate* initialize(); |
55 static V8PerIsolateData* from(v8::Isolate* isolate) | 56 static V8PerIsolateData* from(v8::Isolate* isolate) |
56 { | 57 { |
57 ASSERT(isolate); | 58 ASSERT(isolate); |
58 ASSERT(isolate->GetData(gin::kEmbedderBlink)); | 59 ASSERT(isolate->GetData(gin::kEmbedderBlink)); |
59 return static_cast<V8PerIsolateData*>(isolate->GetData(gin::kEmbedderBli
nk)); | 60 return static_cast<V8PerIsolateData*>(isolate->GetData(gin::kEmbedderBli
nk)); |
60 } | 61 } |
61 static void dispose(v8::Isolate*); | 62 |
| 63 static void willBeDestroyed(v8::Isolate*); |
| 64 static void destroy(v8::Isolate*); |
62 static v8::Isolate* mainThreadIsolate(); | 65 static v8::Isolate* mainThreadIsolate(); |
63 | 66 |
64 v8::Isolate* isolate() { return m_isolateHolder->isolate(); } | 67 v8::Isolate* isolate() { return m_isolateHolder->isolate(); } |
65 | 68 |
66 v8::Handle<v8::FunctionTemplate> toStringTemplate(); | 69 v8::Handle<v8::FunctionTemplate> toStringTemplate(); |
67 | 70 |
68 StringCache* stringCache() { return m_stringCache.get(); } | 71 StringCache* stringCache() { return m_stringCache.get(); } |
69 | 72 |
70 v8::Persistent<v8::Value>& ensureLiveRoot(); | 73 v8::Persistent<v8::Value>& ensureLiveRoot(); |
71 | 74 |
(...skipping 20 matching lines...) Expand all Loading... |
92 void setDOMTemplate(void* domTemplateKey, v8::Handle<v8::FunctionTemplate>); | 95 void setDOMTemplate(void* domTemplateKey, v8::Handle<v8::FunctionTemplate>); |
93 | 96 |
94 bool hasInstance(const WrapperTypeInfo*, v8::Handle<v8::Value>); | 97 bool hasInstance(const WrapperTypeInfo*, v8::Handle<v8::Value>); |
95 v8::Handle<v8::Object> findInstanceInPrototypeChain(const WrapperTypeInfo*,
v8::Handle<v8::Value>); | 98 v8::Handle<v8::Object> findInstanceInPrototypeChain(const WrapperTypeInfo*,
v8::Handle<v8::Value>); |
96 | 99 |
97 v8::Local<v8::Context> ensureScriptRegexpContext(); | 100 v8::Local<v8::Context> ensureScriptRegexpContext(); |
98 | 101 |
99 const char* previousSamplingState() const { return m_previousSamplingState;
} | 102 const char* previousSamplingState() const { return m_previousSamplingState;
} |
100 void setPreviousSamplingState(const char* name) { m_previousSamplingState =
name; } | 103 void setPreviousSamplingState(const char* name) { m_previousSamplingState =
name; } |
101 | 104 |
| 105 IDBPendingTransactionMonitor* ensureIDBPendingTransactionMonitor(); |
| 106 |
102 private: | 107 private: |
103 V8PerIsolateData(); | 108 V8PerIsolateData(); |
104 ~V8PerIsolateData(); | 109 ~V8PerIsolateData(); |
105 | 110 |
106 typedef HashMap<const void*, v8::Eternal<v8::FunctionTemplate> > DOMTemplate
Map; | 111 typedef HashMap<const void*, v8::Eternal<v8::FunctionTemplate> > DOMTemplate
Map; |
107 DOMTemplateMap& currentDOMTemplateMap(); | 112 DOMTemplateMap& currentDOMTemplateMap(); |
108 bool hasInstance(const WrapperTypeInfo*, v8::Handle<v8::Value>, DOMTemplateM
ap&); | 113 bool hasInstance(const WrapperTypeInfo*, v8::Handle<v8::Value>, DOMTemplateM
ap&); |
109 v8::Handle<v8::Object> findInstanceInPrototypeChain(const WrapperTypeInfo*,
v8::Handle<v8::Value>, DOMTemplateMap&); | 114 v8::Handle<v8::Object> findInstanceInPrototypeChain(const WrapperTypeInfo*,
v8::Handle<v8::Value>, DOMTemplateMap&); |
110 | 115 |
111 OwnPtr<gin::IsolateHolder> m_isolateHolder; | 116 OwnPtr<gin::IsolateHolder> m_isolateHolder; |
(...skipping 11 matching lines...) Expand all Loading... |
123 friend class ConstructorMode; | 128 friend class ConstructorMode; |
124 | 129 |
125 int m_recursionLevel; | 130 int m_recursionLevel; |
126 bool m_isHandlingRecursionLevelError; | 131 bool m_isHandlingRecursionLevelError; |
127 | 132 |
128 #if ENABLE(ASSERT) | 133 #if ENABLE(ASSERT) |
129 int m_internalScriptRecursionLevel; | 134 int m_internalScriptRecursionLevel; |
130 #endif | 135 #endif |
131 OwnPtr<GCEventData> m_gcEventData; | 136 OwnPtr<GCEventData> m_gcEventData; |
132 bool m_performingMicrotaskCheckpoint; | 137 bool m_performingMicrotaskCheckpoint; |
| 138 |
| 139 OwnPtr<IDBPendingTransactionMonitor> m_idbPendingTransactionMonitor; |
133 }; | 140 }; |
134 | 141 |
135 } // namespace blink | 142 } // namespace blink |
136 | 143 |
137 #endif // V8PerIsolateData_h | 144 #endif // V8PerIsolateData_h |
OLD | NEW |