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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 namespace WebCore { | 43 namespace WebCore { |
44 | 44 |
45 class DOMDataStore; | 45 class DOMDataStore; |
46 class ScriptController; | 46 class ScriptController; |
47 class ExecutionContext; | 47 class ExecutionContext; |
48 | 48 |
49 enum WorldIdConstants { | 49 enum WorldIdConstants { |
50 MainWorldId = 0, | 50 MainWorldId = 0, |
51 EmbedderWorldIdLimit = (1 << 29), | 51 EmbedderWorldIdLimit = (1 << 29), |
52 ScriptPreprocessorIsolatedWorldId | 52 ScriptPreprocessorIsolatedWorldId, |
| 53 BlinkInJavaScriptIsolatedWorldId, |
53 }; | 54 }; |
54 | 55 |
55 // This class represent a collection of DOM wrappers for a specific world. | 56 // This class represent a collection of DOM wrappers for a specific world. |
56 class DOMWrapperWorld : public RefCounted<DOMWrapperWorld> { | 57 class DOMWrapperWorld : public RefCounted<DOMWrapperWorld> { |
57 public: | 58 public: |
58 static const int mainWorldExtensionGroup = 0; | 59 static const int mainWorldExtensionGroup = 0; |
| 60 static const int blinkInJavaScriptWorldExtensionGroup = 1; |
59 static PassRefPtr<DOMWrapperWorld> ensureIsolatedWorld(int worldId, int exte
nsionGroup); | 61 static PassRefPtr<DOMWrapperWorld> ensureIsolatedWorld(int worldId, int exte
nsionGroup); |
60 ~DOMWrapperWorld(); | 62 ~DOMWrapperWorld(); |
61 | 63 |
62 static bool isolatedWorldsExist() { return isolatedWorldCount; } | 64 static bool isolatedWorldsExist() { return isolatedWorldCount; } |
63 static bool isIsolatedWorldId(int worldId) { return worldId > MainWorldId; } | 65 static bool isIsolatedWorldId(int worldId) { return worldId > MainWorldId; } |
64 static void getAllWorlds(Vector<RefPtr<DOMWrapperWorld> >& worlds); | 66 static void getAllWorlds(Vector<RefPtr<DOMWrapperWorld> >& worlds); |
65 | 67 |
66 void setIsolatedWorldField(v8::Handle<v8::Context>); | 68 void setIsolatedWorldField(v8::Handle<v8::Context>); |
67 | 69 |
68 static DOMWrapperWorld* isolatedWorld(v8::Handle<v8::Context> context) | 70 static DOMWrapperWorld* isolatedWorld(v8::Handle<v8::Context> context) |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 OwnPtr<DOMDataStore> m_domDataStore; | 126 OwnPtr<DOMDataStore> m_domDataStore; |
125 | 127 |
126 friend DOMWrapperWorld* mainThreadNormalWorld(); | 128 friend DOMWrapperWorld* mainThreadNormalWorld(); |
127 }; | 129 }; |
128 | 130 |
129 DOMWrapperWorld* mainThreadNormalWorld(); | 131 DOMWrapperWorld* mainThreadNormalWorld(); |
130 | 132 |
131 } // namespace WebCore | 133 } // namespace WebCore |
132 | 134 |
133 #endif // DOMWrapperWorld_h | 135 #endif // DOMWrapperWorld_h |
OLD | NEW |