| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 // Wrap the object. | 192 // Wrap the object. |
| 193 V8Proxy::SetDOMWrapper(jsWorkerContext, V8ClassIndex::ToInt(V8ClassIndex::WO
RKERCONTEXT), m_workerContext); | 193 V8Proxy::SetDOMWrapper(jsWorkerContext, V8ClassIndex::ToInt(V8ClassIndex::WO
RKERCONTEXT), m_workerContext); |
| 194 | 194 |
| 195 V8Proxy::SetJSWrapperForDOMObject(m_workerContext, v8::Persistent<v8::Object
>::New(jsWorkerContext)); | 195 V8Proxy::SetJSWrapperForDOMObject(m_workerContext, v8::Persistent<v8::Object
>::New(jsWorkerContext)); |
| 196 m_workerContext->ref(); | 196 m_workerContext->ref(); |
| 197 | 197 |
| 198 // Insert the object instance as the prototype of the shadow object. | 198 // Insert the object instance as the prototype of the shadow object. |
| 199 v8::Handle<v8::Object> globalObject = m_context->Global(); | 199 v8::Handle<v8::Object> globalObject = m_context->Global(); |
| 200 globalObject->Set(implicitProtoString, jsWorkerContext); | 200 globalObject->Set(implicitProtoString, jsWorkerContext); |
| 201 | 201 |
| 202 m_listeners.set(new V8EventListenerList("m_listeners")); | 202 m_listeners.set(new V8EventListenerList()); |
| 203 } | 203 } |
| 204 | 204 |
| 205 v8::Local<v8::Function> WorkerContextExecutionProxy::GetConstructor(V8ClassIndex
::V8WrapperType type) | 205 v8::Local<v8::Function> WorkerContextExecutionProxy::GetConstructor(V8ClassIndex
::V8WrapperType type) |
| 206 { | 206 { |
| 207 // Enter the context of the proxy to make sure that the function is | 207 // Enter the context of the proxy to make sure that the function is |
| 208 // constructed in the context corresponding to this proxy. | 208 // constructed in the context corresponding to this proxy. |
| 209 v8::Context::Scope scope(m_context); | 209 v8::Context::Scope scope(m_context); |
| 210 v8::Handle<v8::FunctionTemplate> functionTemplate = V8Proxy::GetTemplate(typ
e); | 210 v8::Handle<v8::FunctionTemplate> functionTemplate = V8Proxy::GetTemplate(typ
e); |
| 211 | 211 |
| 212 // Getting the function might fail if we're running out of stack or memory. | 212 // Getting the function might fail if we're running out of stack or memory. |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 } | 414 } |
| 415 | 415 |
| 416 void WorkerContextExecutionProxy::trackEvent(Event* event) | 416 void WorkerContextExecutionProxy::trackEvent(Event* event) |
| 417 { | 417 { |
| 418 m_events.append(event); | 418 m_events.append(event); |
| 419 } | 419 } |
| 420 | 420 |
| 421 } // namespace WebCore | 421 } // namespace WebCore |
| 422 | 422 |
| 423 #endif // ENABLE(WORKERS) | 423 #endif // ENABLE(WORKERS) |
| OLD | NEW |