| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef DartDOMData_h | 31 #ifndef DartDOMData_h |
| 32 #define DartDOMData_h | 32 #define DartDOMData_h |
| 33 | 33 |
| 34 #include "DartJsInteropData.h" | 34 #include "DartJsInteropData.h" |
| 35 #include "DartWebkitClassIds.h" | 35 #include "DartWebkitClassIds.h" |
| 36 | 36 |
| 37 #include "bindings/common/StackTrace.h" |
| 37 #include "bindings/dart/DartCustomElementBinding.h" | 38 #include "bindings/dart/DartCustomElementBinding.h" |
| 38 #include "bindings/dart/DartLibraryIds.h" | 39 #include "bindings/dart/DartLibraryIds.h" |
| 39 #include "bindings/dart/DartScriptState.h" | 40 #include "bindings/dart/DartScriptState.h" |
| 40 #include "bindings/dart/DartStringCache.h" | 41 #include "bindings/dart/DartStringCache.h" |
| 41 | 42 |
| 42 #include "wtf/HashMap.h" | 43 #include "wtf/HashMap.h" |
| 43 #include "wtf/HashSet.h" | 44 #include "wtf/HashSet.h" |
| 44 #include "wtf/RefPtr.h" | 45 #include "wtf/RefPtr.h" |
| 45 #include "wtf/Threading.h" | 46 #include "wtf/Threading.h" |
| 46 #include "wtf/ThreadingPrimitives.h" | 47 #include "wtf/ThreadingPrimitives.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 74 class DartDOMData { | 75 class DartDOMData { |
| 75 public: | 76 public: |
| 76 DartDOMData(ExecutionContext*, bool isDOMEnabled); | 77 DartDOMData(ExecutionContext*, bool isDOMEnabled); |
| 77 ~DartDOMData(); | 78 ~DartDOMData(); |
| 78 | 79 |
| 79 static DartDOMData* current(); | 80 static DartDOMData* current(); |
| 80 | 81 |
| 81 ExecutionContext* scriptExecutionContext() { return m_scriptExecutionContext
; } | 82 ExecutionContext* scriptExecutionContext() { return m_scriptExecutionContext
; } |
| 82 bool isDOMEnabled() { return m_isDOMEnabled; } | 83 bool isDOMEnabled() { return m_isDOMEnabled; } |
| 83 | 84 |
| 84 // We track the Dart specific recursion level here as well as the global | 85 // Track Dart stack trace depth and timestamp pairs so that we can |
| 85 // recursion level tracked by m_recursionScope due to dartbug.com/14183. | 86 // correctly interleave Dart and JavaScript stack traces. |
| 86 int* recursion() { return &m_recursion; } | 87 StackTraceTimestampTracker* stackTraceTimestampTracker() { return &m_stackTr
aceTimestampTracker; } |
| 88 |
| 87 DartStringCache& stringCache() { return m_stringCache; } | 89 DartStringCache& stringCache() { return m_stringCache; } |
| 88 | 90 |
| 89 void setThreadSafeIsolateWrapper(PassRefPtr<ThreadSafeDartIsolateWrapper>); | 91 void setThreadSafeIsolateWrapper(PassRefPtr<ThreadSafeDartIsolateWrapper>); |
| 90 PassRefPtr<ThreadSafeDartIsolateWrapper> threadSafeIsolateWrapper(); | 92 PassRefPtr<ThreadSafeDartIsolateWrapper> threadSafeIsolateWrapper(); |
| 91 | 93 |
| 92 void setApplicationLoader(PassRefPtr<DartApplicationLoader>); | 94 void setApplicationLoader(PassRefPtr<DartApplicationLoader>); |
| 93 PassRefPtr<DartApplicationLoader> applicationLoader(); | 95 PassRefPtr<DartApplicationLoader> applicationLoader(); |
| 94 | 96 |
| 95 Vector<uint8_t>* applicationSnapshot() { return &m_applicationSnapshot; } | 97 Vector<uint8_t>* applicationSnapshot() { return &m_applicationSnapshot; } |
| 96 | 98 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 { | 230 { |
| 229 m_isObservatoryFakeDartDOMData = isObservatoryFakeDartDOMData; | 231 m_isObservatoryFakeDartDOMData = isObservatoryFakeDartDOMData; |
| 230 } | 232 } |
| 231 | 233 |
| 232 private: | 234 private: |
| 233 Dart_PersistentHandle getLibrary(int libraryId, const char* name); | 235 Dart_PersistentHandle getLibrary(int libraryId, const char* name); |
| 234 | 236 |
| 235 ExecutionContext* m_scriptExecutionContext; | 237 ExecutionContext* m_scriptExecutionContext; |
| 236 bool m_isDOMEnabled; | 238 bool m_isDOMEnabled; |
| 237 int m_recursion; | 239 int m_recursion; |
| 240 StackTraceTimestampTracker m_stackTraceTimestampTracker; |
| 238 DartStringCache m_stringCache; | 241 DartStringCache m_stringCache; |
| 239 RefPtr<ThreadSafeDartIsolateWrapper> m_threadSafeIsolateWrapper; | 242 RefPtr<ThreadSafeDartIsolateWrapper> m_threadSafeIsolateWrapper; |
| 240 Mutex m_isolateWrapperMutex; | 243 Mutex m_isolateWrapperMutex; |
| 241 RefPtr<DartApplicationLoader> m_applicationLoader; | 244 RefPtr<DartApplicationLoader> m_applicationLoader; |
| 242 Vector<uint8_t> m_applicationSnapshot; | 245 Vector<uint8_t> m_applicationSnapshot; |
| 243 Dart_WeakPersistentHandle m_reachableWeakHandle; | 246 Dart_WeakPersistentHandle m_reachableWeakHandle; |
| 244 | 247 |
| 245 DartJsInteropData m_jsInteropData; | 248 DartJsInteropData m_jsInteropData; |
| 246 DartDOMObjectMap m_objectMap; | 249 DartDOMObjectMap m_objectMap; |
| 247 DartMessagePortMap m_messagePortMap; | 250 DartMessagePortMap m_messagePortMap; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 258 Dart_WeakReferenceSetBuilder m_weakReferenceSetBuilder; | 261 Dart_WeakReferenceSetBuilder m_weakReferenceSetBuilder; |
| 259 | 262 |
| 260 // FIXME(dartbug.com/20303): remove this field once we support service | 263 // FIXME(dartbug.com/20303): remove this field once we support service |
| 261 // isolates. | 264 // isolates. |
| 262 bool m_isObservatoryFakeDartDOMData; | 265 bool m_isObservatoryFakeDartDOMData; |
| 263 }; | 266 }; |
| 264 | 267 |
| 265 } | 268 } |
| 266 | 269 |
| 267 #endif // DartDOMData_h | 270 #endif // DartDOMData_h |
| OLD | NEW |