| 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 // Insert the object instance as the prototype of the shadow object. | 167 // Insert the object instance as the prototype of the shadow object. |
| 168 v8::Local<v8::Object> globalObject = v8::Local<v8::Object>::Cast(m_scriptSta
te->context()->Global()->GetPrototype()); | 168 v8::Local<v8::Object> globalObject = v8::Local<v8::Object>::Cast(m_scriptSta
te->context()->Global()->GetPrototype()); |
| 169 return v8CallBoolean(globalObject->SetPrototype(context, jsWorkerGlobalScope
)); | 169 return v8CallBoolean(globalObject->SetPrototype(context, jsWorkerGlobalScope
)); |
| 170 } | 170 } |
| 171 | 171 |
| 172 v8::Isolate* WorkerOrWorkletScriptController::isolate() const | 172 v8::Isolate* WorkerOrWorkletScriptController::isolate() const |
| 173 { | 173 { |
| 174 return m_workerGlobalScope->thread()->isolate(); | 174 return m_workerGlobalScope->thread()->isolate(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 ScriptValue WorkerOrWorkletScriptController::evaluate(const String& script, cons
t String& fileName, const TextPosition& scriptStartPosition, CachedMetadataHandl
er* cacheHandler, V8CacheOptions v8CacheOptions) | 177 ScriptValue WorkerOrWorkletScriptController::evaluate(const CompressibleString&
script, const String& fileName, const TextPosition& scriptStartPosition, CachedM
etadataHandler* cacheHandler, V8CacheOptions v8CacheOptions) |
| 178 { | 178 { |
| 179 if (!initializeContextIfNeeded()) | 179 if (!initializeContextIfNeeded()) |
| 180 return ScriptValue(); | 180 return ScriptValue(); |
| 181 | 181 |
| 182 ScriptState::Scope scope(m_scriptState.get()); | 182 ScriptState::Scope scope(m_scriptState.get()); |
| 183 | 183 |
| 184 if (!m_disableEvalPending.isEmpty()) { | 184 if (!m_disableEvalPending.isEmpty()) { |
| 185 m_scriptState->context()->AllowCodeGenerationFromStrings(false); | 185 m_scriptState->context()->AllowCodeGenerationFromStrings(false); |
| 186 m_scriptState->context()->SetErrorMessageForCodeGenerationFromStrings(v8
String(isolate(), m_disableEvalPending)); | 186 m_scriptState->context()->SetErrorMessageForCodeGenerationFromStrings(v8
String(isolate(), m_disableEvalPending)); |
| 187 m_disableEvalPending = String(); | 187 m_disableEvalPending = String(); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 exceptionState.rethrowV8Exception(V8ThrowException::createGeneralError(isola
te(), errorMessage)); | 302 exceptionState.rethrowV8Exception(V8ThrowException::createGeneralError(isola
te(), errorMessage)); |
| 303 } | 303 } |
| 304 | 304 |
| 305 DEFINE_TRACE(WorkerOrWorkletScriptController) | 305 DEFINE_TRACE(WorkerOrWorkletScriptController) |
| 306 { | 306 { |
| 307 visitor->trace(m_workerGlobalScope); | 307 visitor->trace(m_workerGlobalScope); |
| 308 visitor->trace(m_rejectedPromises); | 308 visitor->trace(m_rejectedPromises); |
| 309 } | 309 } |
| 310 | 310 |
| 311 } // namespace blink | 311 } // namespace blink |
| OLD | NEW |