| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2014 Opera Software ASA. All rights reserved. | 4 * Copyright (C) 2014 Opera Software ASA. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions are | 7 * modification, are permitted provided that the following conditions are |
| 8 * met: | 8 * met: |
| 9 * | 9 * |
| 10 * * Redistributions of source code must retain the above copyright | 10 * * Redistributions of source code must retain the above copyright |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 v8::Local<v8::Value> ScriptController::evaluateScriptInMainWorld( | 300 v8::Local<v8::Value> ScriptController::evaluateScriptInMainWorld( |
| 301 const ScriptSourceCode& sourceCode, | 301 const ScriptSourceCode& sourceCode, |
| 302 AccessControlStatus accessControlStatus, | 302 AccessControlStatus accessControlStatus, |
| 303 ExecuteScriptPolicy policy) { | 303 ExecuteScriptPolicy policy) { |
| 304 if (policy == DoNotExecuteScriptWhenScriptsDisabled && | 304 if (policy == DoNotExecuteScriptWhenScriptsDisabled && |
| 305 !frame()->document()->canExecuteScripts(AboutToExecuteScript)) | 305 !frame()->document()->canExecuteScripts(AboutToExecuteScript)) |
| 306 return v8::Local<v8::Value>(); | 306 return v8::Local<v8::Value>(); |
| 307 | 307 |
| 308 // TODO(dcheng): Clean this up to not use ScriptState, to match | 308 // TODO(dcheng): Clean this up to not use ScriptState, to match |
| 309 // executeScriptInIsolatedWorld. | 309 // executeScriptInIsolatedWorld. |
| 310 ScriptState* scriptState = ScriptState::forMainWorld(frame()); | 310 ScriptState* scriptState = toScriptStateForMainWorld(frame()); |
| 311 if (!scriptState) | 311 if (!scriptState) |
| 312 return v8::Local<v8::Value>(); | 312 return v8::Local<v8::Value>(); |
| 313 v8::EscapableHandleScope handleScope(isolate()); | 313 v8::EscapableHandleScope handleScope(isolate()); |
| 314 ScriptState::Scope scope(scriptState); | 314 ScriptState::Scope scope(scriptState); |
| 315 | 315 |
| 316 if (frame()->loader().stateMachine()->isDisplayingInitialEmptyDocument()) | 316 if (frame()->loader().stateMachine()->isDisplayingInitialEmptyDocument()) |
| 317 frame()->loader().didAccessInitialDocument(); | 317 frame()->loader().didAccessInitialDocument(); |
| 318 | 318 |
| 319 v8::Local<v8::Value> object = executeScriptAndReturnValue( | 319 v8::Local<v8::Value> object = executeScriptAndReturnValue( |
| 320 scriptState->context(), sourceCode, accessControlStatus); | 320 scriptState->context(), sourceCode, accessControlStatus); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 for (size_t i = 0; i < resultArray->Length(); ++i) { | 358 for (size_t i = 0; i < resultArray->Length(); ++i) { |
| 359 v8::Local<v8::Value> value; | 359 v8::Local<v8::Value> value; |
| 360 if (!resultArray->Get(context, i).ToLocal(&value)) | 360 if (!resultArray->Get(context, i).ToLocal(&value)) |
| 361 return; | 361 return; |
| 362 results->push_back(value); | 362 results->push_back(value); |
| 363 } | 363 } |
| 364 } | 364 } |
| 365 } | 365 } |
| 366 | 366 |
| 367 } // namespace blink | 367 } // namespace blink |
| OLD | NEW |