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