OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 }; | 60 }; |
61 | 61 |
62 class V8PerContextData { | 62 class V8PerContextData { |
63 public: | 63 public: |
64 static PassOwnPtr<V8PerContextData> create(v8::Handle<v8::Context> context,
PassRefPtr<DOMWrapperWorld> world) | 64 static PassOwnPtr<V8PerContextData> create(v8::Handle<v8::Context> context,
PassRefPtr<DOMWrapperWorld> world) |
65 { | 65 { |
66 return adoptPtr(new V8PerContextData(context, world)); | 66 return adoptPtr(new V8PerContextData(context, world)); |
67 } | 67 } |
68 | 68 |
69 static V8PerContextData* from(v8::Handle<v8::Context>); | 69 static V8PerContextData* from(v8::Handle<v8::Context>); |
70 static DOMWrapperWorld& world(v8::Handle<v8::Context>); | 70 static DOMWrapperWorld* world(v8::Handle<v8::Context>); |
71 | 71 |
72 ~V8PerContextData(); | 72 ~V8PerContextData(); |
73 | 73 |
74 v8::Handle<v8::Context> context() { return m_context.newLocal(m_isolate); } | 74 v8::Handle<v8::Context> context() { return m_context.newLocal(m_isolate); } |
75 | 75 |
76 // To create JS Wrapper objects, we create a cache of a 'boiler plate' | 76 // To create JS Wrapper objects, we create a cache of a 'boiler plate' |
77 // object, and then simply Clone that object each time we need a new one. | 77 // object, and then simply Clone that object each time we need a new one. |
78 // This is faster than going through the full object creation process. | 78 // This is faster than going through the full object creation process. |
79 v8::Local<v8::Object> createWrapperFromCache(const WrapperTypeInfo* type) | 79 v8::Local<v8::Object> createWrapperFromCache(const WrapperTypeInfo* type) |
80 { | 80 { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 class V8PerContextDebugData { | 133 class V8PerContextDebugData { |
134 public: | 134 public: |
135 static bool setContextDebugData(v8::Handle<v8::Context>, const char* worldNa
me, int debugId); | 135 static bool setContextDebugData(v8::Handle<v8::Context>, const char* worldNa
me, int debugId); |
136 static int contextDebugId(v8::Handle<v8::Context>); | 136 static int contextDebugId(v8::Handle<v8::Context>); |
137 }; | 137 }; |
138 | 138 |
139 } // namespace WebCore | 139 } // namespace WebCore |
140 | 140 |
141 #endif // V8PerContextData_h | 141 #endif // V8PerContextData_h |
OLD | NEW |