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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // This class represent a collection of DOM wrappers for a specific world. | 58 // This class represent a collection of DOM wrappers for a specific world. |
59 class DOMWrapperWorld : public RefCounted<DOMWrapperWorld> { | 59 class DOMWrapperWorld : public RefCounted<DOMWrapperWorld> { |
60 public: | 60 public: |
61 static PassRefPtr<DOMWrapperWorld> create(int worldId = -1, int extensionGro
up = -1); | 61 static PassRefPtr<DOMWrapperWorld> create(int worldId = -1, int extensionGro
up = -1); |
62 | 62 |
63 static const int mainWorldExtensionGroup = 0; | 63 static const int mainWorldExtensionGroup = 0; |
64 static PassRefPtr<DOMWrapperWorld> ensureIsolatedWorld(int worldId, int exte
nsionGroup); | 64 static PassRefPtr<DOMWrapperWorld> ensureIsolatedWorld(int worldId, int exte
nsionGroup); |
65 ~DOMWrapperWorld(); | 65 ~DOMWrapperWorld(); |
66 | 66 |
67 static bool isolatedWorldsExist() { return isolatedWorldCount; } | 67 static bool isolatedWorldsExist() { return isolatedWorldCount; } |
68 static void allWorldsInMainThread(Vector<RefPtr<DOMWrapperWorld> >& worlds); | 68 static void allWorldsInMainThread(Vector<DOMWrapperWorld*>& worlds); |
69 | 69 |
70 static DOMWrapperWorld* world(v8::Handle<v8::Context> context) | 70 static DOMWrapperWorld* world(v8::Handle<v8::Context> context) |
71 { | 71 { |
72 ASSERT(contextHasCorrectPrototype(context)); | 72 ASSERT(contextHasCorrectPrototype(context)); |
73 return V8PerContextData::world(context); | 73 return V8PerContextData::world(context); |
74 } | 74 } |
75 | 75 |
76 // Will return null if there is no DOMWrapperWorld for the current v8::Conte
xt | 76 // Will return null if there is no DOMWrapperWorld for the current v8::Conte
xt |
77 static DOMWrapperWorld* current(v8::Isolate*); | 77 static DOMWrapperWorld* current(v8::Isolate*); |
78 static DOMWrapperWorld* mainWorld(); | 78 static DOMWrapperWorld* mainWorld(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 static bool contextHasCorrectPrototype(v8::Handle<v8::Context>); | 111 static bool contextHasCorrectPrototype(v8::Handle<v8::Context>); |
112 | 112 |
113 const int m_worldId; | 113 const int m_worldId; |
114 const int m_extensionGroup; | 114 const int m_extensionGroup; |
115 OwnPtr<DOMDataStore> m_domDataStore; | 115 OwnPtr<DOMDataStore> m_domDataStore; |
116 }; | 116 }; |
117 | 117 |
118 } // namespace WebCore | 118 } // namespace WebCore |
119 | 119 |
120 #endif // DOMWrapperWorld_h | 120 #endif // DOMWrapperWorld_h |
OLD | NEW |