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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // Associate a logger with the world identified by worldId (worlId may be 0 | 96 // Associate a logger with the world identified by worldId (worlId may be 0 |
97 // identifying the main world). | 97 // identifying the main world). |
98 static void setActivityLogger(int worldId, PassOwnPtr<V8DOMActivityLogger>); | 98 static void setActivityLogger(int worldId, PassOwnPtr<V8DOMActivityLogger>); |
99 static V8DOMActivityLogger* activityLogger(int worldId); | 99 static V8DOMActivityLogger* activityLogger(int worldId); |
100 | 100 |
101 bool isMainWorld() const { return m_worldId == MainWorldId; } | 101 bool isMainWorld() const { return m_worldId == MainWorldId; } |
102 bool isIsolatedWorld() const { return isIsolatedWorldId(m_worldId); } | 102 bool isIsolatedWorld() const { return isIsolatedWorldId(m_worldId); } |
103 | 103 |
104 int worldId() const { return m_worldId; } | 104 int worldId() const { return m_worldId; } |
105 int extensionGroup() const { return m_extensionGroup; } | 105 int extensionGroup() const { return m_extensionGroup; } |
106 DOMDataStore* isolatedWorldDOMDataStore() const | 106 DOMDataStore& isolatedWorldDOMDataStore() const |
107 { | 107 { |
108 ASSERT(isIsolatedWorld()); | 108 ASSERT(isIsolatedWorld()); |
109 return m_domDataStore.get(); | 109 return *m_domDataStore; |
110 } | 110 } |
111 v8::Handle<v8::Context> context(ScriptController&); | 111 v8::Handle<v8::Context> context(ScriptController&); |
112 | 112 |
113 static void setInitializingWindow(bool); | 113 static void setInitializingWindow(bool); |
114 | 114 |
115 private: | 115 private: |
116 static int isolatedWorldCount; | 116 static int isolatedWorldCount; |
117 static PassRefPtr<DOMWrapperWorld> createMainWorld(); | 117 static PassRefPtr<DOMWrapperWorld> createMainWorld(); |
118 static bool contextHasCorrectPrototype(v8::Handle<v8::Context>); | 118 static bool contextHasCorrectPrototype(v8::Handle<v8::Context>); |
119 | 119 |
120 DOMWrapperWorld(int worldId, int extensionGroup); | 120 DOMWrapperWorld(int worldId, int extensionGroup); |
121 | 121 |
122 const int m_worldId; | 122 const int m_worldId; |
123 const int m_extensionGroup; | 123 const int m_extensionGroup; |
124 OwnPtr<DOMDataStore> m_domDataStore; | 124 OwnPtr<DOMDataStore> m_domDataStore; |
125 | 125 |
126 friend DOMWrapperWorld* mainThreadNormalWorld(); | 126 friend DOMWrapperWorld* mainThreadNormalWorld(); |
127 friend DOMWrapperWorld* existingWindowShellWorkaroundWorld(); | 127 friend DOMWrapperWorld* existingWindowShellWorkaroundWorld(); |
128 }; | 128 }; |
129 | 129 |
130 DOMWrapperWorld* mainThreadNormalWorld(); | 130 DOMWrapperWorld* mainThreadNormalWorld(); |
131 | 131 |
132 // FIXME: this is a workaround for a problem in ScriptController | 132 // FIXME: this is a workaround for a problem in ScriptController |
133 // Do not use this anywhere else!! | 133 // Do not use this anywhere else!! |
134 DOMWrapperWorld* existingWindowShellWorkaroundWorld(); | 134 DOMWrapperWorld* existingWindowShellWorkaroundWorld(); |
135 | 135 |
136 } // namespace WebCore | 136 } // namespace WebCore |
137 | 137 |
138 #endif // DOMWrapperWorld_h | 138 #endif // DOMWrapperWorld_h |
OLD | NEW |