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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 { | 140 { |
141 V8GCController::checkMemoryUsage(); | 141 V8GCController::checkMemoryUsage(); |
142 | 142 |
143 v8::HandleScope handleScope; | 143 v8::HandleScope handleScope; |
144 | 144 |
145 if (!initializeContextIfNeeded()) | 145 if (!initializeContextIfNeeded()) |
146 return ScriptValue(); | 146 return ScriptValue(); |
147 | 147 |
148 if (!m_disableEvalPending.isEmpty()) { | 148 if (!m_disableEvalPending.isEmpty()) { |
149 m_context->AllowCodeGenerationFromStrings(false); | 149 m_context->AllowCodeGenerationFromStrings(false); |
150 m_context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_disabl
eEvalPending, m_context->GetIsolate())); | 150 m_context->SetErrorMessageForCodeGenerationFromStrings(deprecatedV8Strin
g(m_disableEvalPending)); |
151 m_disableEvalPending = String(); | 151 m_disableEvalPending = String(); |
152 } | 152 } |
153 | 153 |
154 v8::Context::Scope scope(m_context.get()); | 154 v8::Context::Scope scope(m_context.get()); |
155 | 155 |
156 v8::TryCatch block; | 156 v8::TryCatch block; |
157 | 157 |
158 v8::Handle<v8::String> scriptString = v8String(script, m_context->GetIsolate
()); | 158 v8::Handle<v8::String> scriptString = deprecatedV8String(script); |
159 v8::Handle<v8::Script> compiledScript = ScriptSourceCode::compileScript(scri
ptString, fileName, scriptStartPosition); | 159 v8::Handle<v8::Script> compiledScript = ScriptSourceCode::compileScript(scri
ptString, fileName, scriptStartPosition); |
160 v8::Local<v8::Value> result = ScriptRunner::runCompiledScript(compiledScript
, m_workerContext); | 160 v8::Local<v8::Value> result = ScriptRunner::runCompiledScript(compiledScript
, m_workerContext); |
161 | 161 |
162 if (!block.CanContinue()) { | 162 if (!block.CanContinue()) { |
163 m_workerContext->script()->forbidExecution(); | 163 m_workerContext->script()->forbidExecution(); |
164 return ScriptValue(); | 164 return ScriptValue(); |
165 } | 165 } |
166 | 166 |
167 if (block.HasCaught()) { | 167 if (block.HasCaught()) { |
168 v8::Local<v8::Message> message = block.Message(); | 168 v8::Local<v8::Message> message = block.Message(); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 // Return 0 if the current executing context is not the worker context. | 252 // Return 0 if the current executing context is not the worker context. |
253 if (global.IsEmpty()) | 253 if (global.IsEmpty()) |
254 return 0; | 254 return 0; |
255 WorkerContext* workerContext = V8WorkerContext::toNative(global); | 255 WorkerContext* workerContext = V8WorkerContext::toNative(global); |
256 return workerContext->script(); | 256 return workerContext->script(); |
257 } | 257 } |
258 | 258 |
259 } // namespace WebCore | 259 } // namespace WebCore |
260 | 260 |
261 #endif // ENABLE(WORKERS) | 261 #endif // ENABLE(WORKERS) |
OLD | NEW |