| 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 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 27 matching lines...) Expand all Loading... |
| 38 #include "wtf/RefCounted.h" | 38 #include "wtf/RefCounted.h" |
| 39 #include "wtf/RefPtr.h" | 39 #include "wtf/RefPtr.h" |
| 40 #include "wtf/text/WTFString.h" | 40 #include "wtf/text/WTFString.h" |
| 41 #include <v8.h> | 41 #include <v8.h> |
| 42 | 42 |
| 43 namespace WebCore { | 43 namespace WebCore { |
| 44 | 44 |
| 45 class DOMDataStore; | 45 class DOMDataStore; |
| 46 class ExecutionContext; | 46 class ExecutionContext; |
| 47 class ScriptController; | 47 class ScriptController; |
| 48 class V8DOMActivityLogger; | |
| 49 | 48 |
| 50 enum WorldIdConstants { | 49 enum WorldIdConstants { |
| 51 MainWorldId = 0, | 50 MainWorldId = 0, |
| 52 // Embedder isolated worlds can use IDs in [1, 1<<29). | 51 // Embedder isolated worlds can use IDs in [1, 1<<29). |
| 53 EmbedderWorldIdLimit = (1 << 29), | 52 EmbedderWorldIdLimit = (1 << 29), |
| 54 ScriptPreprocessorIsolatedWorldId, | 53 ScriptPreprocessorIsolatedWorldId, |
| 55 IsolatedWorldIdLimit, | 54 IsolatedWorldIdLimit, |
| 56 WorkerWorldId, | 55 WorkerWorldId, |
| 57 TestingWorldId, | 56 TestingWorldId, |
| 58 }; | 57 }; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 static void setIsolatedWorldContentSecurityPolicy(int worldId, const String&
policy); | 105 static void setIsolatedWorldContentSecurityPolicy(int worldId, const String&
policy); |
| 107 bool isolatedWorldHasContentSecurityPolicy(); | 106 bool isolatedWorldHasContentSecurityPolicy(); |
| 108 | 107 |
| 109 bool isMainWorld() const { return m_worldId == MainWorldId; } | 108 bool isMainWorld() const { return m_worldId == MainWorldId; } |
| 110 bool isWorkerWorld() const { return m_worldId == WorkerWorldId; } | 109 bool isWorkerWorld() const { return m_worldId == WorkerWorldId; } |
| 111 bool isIsolatedWorld() const { return MainWorldId < m_worldId && m_worldId
< IsolatedWorldIdLimit; } | 110 bool isIsolatedWorld() const { return MainWorldId < m_worldId && m_worldId
< IsolatedWorldIdLimit; } |
| 112 | 111 |
| 113 int worldId() const { return m_worldId; } | 112 int worldId() const { return m_worldId; } |
| 114 int extensionGroup() const { return m_extensionGroup; } | 113 int extensionGroup() const { return m_extensionGroup; } |
| 115 DOMDataStore& domDataStore() const { return *m_domDataStore; } | 114 DOMDataStore& domDataStore() const { return *m_domDataStore; } |
| 116 V8DOMActivityLogger* activityLogger() const { return m_activityLogger; } | |
| 117 void setActivityLogger(V8DOMActivityLogger* activityLogger) { m_activityLogg
er = activityLogger; } | |
| 118 | 115 |
| 119 static void setWorldOfInitializingWindow(DOMWrapperWorld* world) | 116 static void setWorldOfInitializingWindow(DOMWrapperWorld* world) |
| 120 { | 117 { |
| 121 ASSERT(isMainThread()); | 118 ASSERT(isMainThread()); |
| 122 worldOfInitializingWindow = world; | 119 worldOfInitializingWindow = world; |
| 123 } | 120 } |
| 124 // FIXME: Remove this method once we fix crbug.com/345014. | 121 // FIXME: Remove this method once we fix crbug.com/345014. |
| 125 static bool windowIsBeingInitialized() { return !!worldOfInitializingWindow;
} | 122 static bool windowIsBeingInitialized() { return !!worldOfInitializingWindow;
} |
| 126 | 123 |
| 127 private: | 124 private: |
| 128 DOMWrapperWorld(int worldId, int extensionGroup); | 125 DOMWrapperWorld(int worldId, int extensionGroup); |
| 129 | 126 |
| 130 static unsigned isolatedWorldCount; | 127 static unsigned isolatedWorldCount; |
| 131 static DOMWrapperWorld* worldOfInitializingWindow; | 128 static DOMWrapperWorld* worldOfInitializingWindow; |
| 132 | 129 |
| 133 const int m_worldId; | 130 const int m_worldId; |
| 134 const int m_extensionGroup; | 131 const int m_extensionGroup; |
| 135 OwnPtr<DOMDataStore> m_domDataStore; | 132 OwnPtr<DOMDataStore> m_domDataStore; |
| 136 // This is owned by a static hash map in V8DOMActivityLogger. | |
| 137 V8DOMActivityLogger* m_activityLogger; | |
| 138 }; | 133 }; |
| 139 | 134 |
| 140 } // namespace WebCore | 135 } // namespace WebCore |
| 141 | 136 |
| 142 #endif // DOMWrapperWorld_h | 137 #endif // DOMWrapperWorld_h |
| OLD | NEW |