| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 return false; | 164 return false; |
| 165 } | 165 } |
| 166 | 166 |
| 167 jsGlobalScope = V8DOMWrapper::associateObjectWithWrapper(m_isolate, m_global
Scope->scriptWrappable(), wrapperTypeInfo, jsGlobalScope); | 167 jsGlobalScope = V8DOMWrapper::associateObjectWithWrapper(m_isolate, m_global
Scope->scriptWrappable(), wrapperTypeInfo, jsGlobalScope); |
| 168 | 168 |
| 169 // Insert the object instance as the prototype of the shadow object. | 169 // Insert the object instance as the prototype of the shadow object. |
| 170 v8::Local<v8::Object> globalObject = v8::Local<v8::Object>::Cast(m_scriptSta
te->context()->Global()->GetPrototype()); | 170 v8::Local<v8::Object> globalObject = v8::Local<v8::Object>::Cast(m_scriptSta
te->context()->Global()->GetPrototype()); |
| 171 return v8CallBoolean(globalObject->SetPrototype(context, jsGlobalScope)); | 171 return v8CallBoolean(globalObject->SetPrototype(context, jsGlobalScope)); |
| 172 } | 172 } |
| 173 | 173 |
| 174 ScriptValue WorkerOrWorkletScriptController::evaluate(const String& script, cons
t String& fileName, const TextPosition& scriptStartPosition, CachedMetadataHandl
er* cacheHandler, V8CacheOptions v8CacheOptions) | 174 ScriptValue WorkerOrWorkletScriptController::evaluate(const CompressibleString&
script, const String& fileName, const TextPosition& scriptStartPosition, CachedM
etadataHandler* cacheHandler, V8CacheOptions v8CacheOptions) |
| 175 { | 175 { |
| 176 if (!initializeContextIfNeeded()) | 176 if (!initializeContextIfNeeded()) |
| 177 return ScriptValue(); | 177 return ScriptValue(); |
| 178 | 178 |
| 179 ScriptState::Scope scope(m_scriptState.get()); | 179 ScriptState::Scope scope(m_scriptState.get()); |
| 180 | 180 |
| 181 if (!m_disableEvalPending.isEmpty()) { | 181 if (!m_disableEvalPending.isEmpty()) { |
| 182 m_scriptState->context()->AllowCodeGenerationFromStrings(false); | 182 m_scriptState->context()->AllowCodeGenerationFromStrings(false); |
| 183 m_scriptState->context()->SetErrorMessageForCodeGenerationFromStrings(v8
String(m_isolate, m_disableEvalPending)); | 183 m_scriptState->context()->SetErrorMessageForCodeGenerationFromStrings(v8
String(m_isolate, m_disableEvalPending)); |
| 184 m_disableEvalPending = String(); | 184 m_disableEvalPending = String(); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 m_executionState->m_errorEventFromImportedScript = errorEvent; | 298 m_executionState->m_errorEventFromImportedScript = errorEvent; |
| 299 exceptionState.rethrowV8Exception(V8ThrowException::createGeneralError(m_iso
late, errorMessage)); | 299 exceptionState.rethrowV8Exception(V8ThrowException::createGeneralError(m_iso
late, errorMessage)); |
| 300 } | 300 } |
| 301 | 301 |
| 302 DEFINE_TRACE(WorkerOrWorkletScriptController) | 302 DEFINE_TRACE(WorkerOrWorkletScriptController) |
| 303 { | 303 { |
| 304 visitor->trace(m_globalScope); | 304 visitor->trace(m_globalScope); |
| 305 } | 305 } |
| 306 | 306 |
| 307 } // namespace blink | 307 } // namespace blink |
| OLD | NEW |