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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 if (context.IsEmpty()) | 548 if (context.IsEmpty()) |
549 return v8::Local<v8::Value>(); | 549 return v8::Local<v8::Value>(); |
550 | 550 |
551 ScriptState* scriptState = ScriptState::from(context); | 551 ScriptState* scriptState = ScriptState::from(context); |
552 ScriptState::Scope scope(scriptState); | 552 ScriptState::Scope scope(scriptState); |
553 | 553 |
554 RefPtrWillBeRawPtr<LocalFrame> protect(frame()); | 554 RefPtrWillBeRawPtr<LocalFrame> protect(frame()); |
555 if (frame()->loader().stateMachine()->isDisplayingInitialEmptyDocument()) | 555 if (frame()->loader().stateMachine()->isDisplayingInitialEmptyDocument()) |
556 frame()->loader().didAccessInitialDocument(); | 556 frame()->loader().didAccessInitialDocument(); |
557 | 557 |
558 ScriptSourceCode maybeProcessedSourceCode = InspectorInstrumentation::prepro
cess(frame(), sourceCode); | 558 v8::Local<v8::Value> object = executeScriptAndReturnValue(scriptState->conte
xt(), sourceCode, corsStatus, compilationFinishTime); |
559 const ScriptSourceCode& sourceCodeToCompile = maybeProcessedSourceCode.isNul
l() ? sourceCode : maybeProcessedSourceCode; | |
560 | |
561 v8::Local<v8::Value> object = executeScriptAndReturnValue(scriptState->conte
xt(), sourceCodeToCompile, corsStatus, compilationFinishTime); | |
562 m_sourceURL = savedSourceURL; | 559 m_sourceURL = savedSourceURL; |
563 | 560 |
564 if (object.IsEmpty()) | 561 if (object.IsEmpty()) |
565 return v8::Local<v8::Value>(); | 562 return v8::Local<v8::Value>(); |
566 | 563 |
567 return handleScope.Escape(object); | 564 return handleScope.Escape(object); |
568 } | 565 } |
569 | 566 |
570 void ScriptController::executeScriptInIsolatedWorld(int worldID, const WillBeHea
pVector<ScriptSourceCode>& sources, int extensionGroup, Vector<v8::Local<v8::Val
ue>>* results) | 567 void ScriptController::executeScriptInIsolatedWorld(int worldID, const WillBeHea
pVector<ScriptSourceCode>& sources, int extensionGroup, Vector<v8::Local<v8::Val
ue>>* results) |
571 { | 568 { |
(...skipping 15 matching lines...) Expand all Loading... |
587 resultArray->Set(i, evaluationResult); | 584 resultArray->Set(i, evaluationResult); |
588 } | 585 } |
589 | 586 |
590 if (results) { | 587 if (results) { |
591 for (size_t i = 0; i < resultArray->Length(); ++i) | 588 for (size_t i = 0; i < resultArray->Length(); ++i) |
592 results->append(resultArray->Get(i)); | 589 results->append(resultArray->Get(i)); |
593 } | 590 } |
594 } | 591 } |
595 | 592 |
596 } // namespace blink | 593 } // namespace blink |
OLD | NEW |