OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 } | 178 } |
179 if (context.IsEmpty()) | 179 if (context.IsEmpty()) |
180 return false; | 180 return false; |
181 | 181 |
182 m_scriptState = ScriptState::create(context, m_world); | 182 m_scriptState = ScriptState::create(context, m_world); |
183 | 183 |
184 ScriptState::Scope scope(m_scriptState.get()); | 184 ScriptState::Scope scope(m_scriptState.get()); |
185 | 185 |
186 // Name new context for debugging. For main thread worklet global scopes | 186 // Name new context for debugging. For main thread worklet global scopes |
187 // this is done once the context is initialized. | 187 // this is done once the context is initialized. |
188 if (m_globalScope->isWorkerGlobalScope()) { | 188 if (m_globalScope->isWorkerGlobalScope() || m_globalScope->isThreadedWorklet
GlobalScope()) { |
189 WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(m_isolate); | 189 WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(m_isolate); |
190 if (debugger) | 190 if (debugger) |
191 debugger->contextCreated(context); | 191 debugger->contextCreated(context); |
192 } | 192 } |
193 | 193 |
194 // The global proxy object. Note this is not the global object. | 194 // The global proxy object. Note this is not the global object. |
195 v8::Local<v8::Object> globalProxy = context->Global(); | 195 v8::Local<v8::Object> globalProxy = context->Global(); |
196 // The global object, aka worker/worklet wrapper object. | 196 // The global object, aka worker/worklet wrapper object. |
197 v8::Local<v8::Object> globalObject = globalProxy->GetPrototype().As<v8::Obje
ct>(); | 197 v8::Local<v8::Object> globalObject = globalProxy->GetPrototype().As<v8::Obje
ct>(); |
198 globalObject = V8DOMWrapper::associateObjectWithWrapper(m_isolate, scriptWra
ppable, wrapperTypeInfo, globalObject); | 198 globalObject = V8DOMWrapper::associateObjectWithWrapper(m_isolate, scriptWra
ppable, wrapperTypeInfo, globalObject); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 m_executionState->m_errorEventFromImportedScript = errorEvent; | 318 m_executionState->m_errorEventFromImportedScript = errorEvent; |
319 exceptionState.rethrowV8Exception(V8ThrowException::createError(m_isolate, e
rrorMessage)); | 319 exceptionState.rethrowV8Exception(V8ThrowException::createError(m_isolate, e
rrorMessage)); |
320 } | 320 } |
321 | 321 |
322 DEFINE_TRACE(WorkerOrWorkletScriptController) | 322 DEFINE_TRACE(WorkerOrWorkletScriptController) |
323 { | 323 { |
324 visitor->trace(m_globalScope); | 324 visitor->trace(m_globalScope); |
325 } | 325 } |
326 | 326 |
327 } // namespace blink | 327 } // namespace blink |
OLD | NEW |