| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 if (doNotPauseOnExceptionsAndMuteConsole.fromMaybe(false)) | 100 if (doNotPauseOnExceptionsAndMuteConsole.fromMaybe(false)) |
| 101 scope.ignoreExceptionsAndMuteConsole(); | 101 scope.ignoreExceptionsAndMuteConsole(); |
| 102 | 102 |
| 103 if (includeCommandLineAPI.fromMaybe(false) && !scope.installCommandLineAPI()
) | 103 if (includeCommandLineAPI.fromMaybe(false) && !scope.installCommandLineAPI()
) |
| 104 return; | 104 return; |
| 105 | 105 |
| 106 bool evalIsDisabled = !scope.context()->IsCodeGenerationFromStringsAllowed()
; | 106 bool evalIsDisabled = !scope.context()->IsCodeGenerationFromStringsAllowed()
; |
| 107 // Temporarily enable allow evals for inspector. | 107 // Temporarily enable allow evals for inspector. |
| 108 if (evalIsDisabled) | 108 if (evalIsDisabled) |
| 109 scope.context()->AllowCodeGenerationFromStrings(true); | 109 scope.context()->AllowCodeGenerationFromStrings(true); |
| 110 v8::MaybeLocal<v8::Value> maybeResultValue = m_debugger->compileAndRunIntern
alScript(scope.context(), toV8String(m_debugger->isolate(), expression)); | 110 |
| 111 v8::MaybeLocal<v8::Value> maybeResultValue; |
| 112 v8::Local<v8::Script> script = m_debugger->compileInternalScript(scope.conte
xt(), toV8String(m_debugger->isolate(), expression), String16()); |
| 113 if (!script.IsEmpty()) |
| 114 maybeResultValue = m_debugger->runCompiledScript(scope.context(), script
); |
| 115 |
| 111 if (evalIsDisabled) | 116 if (evalIsDisabled) |
| 112 scope.context()->AllowCodeGenerationFromStrings(false); | 117 scope.context()->AllowCodeGenerationFromStrings(false); |
| 113 | 118 |
| 114 // Re-initialize after running client's code, as it could have destroyed con
text or session. | 119 // Re-initialize after running client's code, as it could have destroyed con
text or session. |
| 115 if (!scope.initialize()) | 120 if (!scope.initialize()) |
| 116 return; | 121 return; |
| 117 scope.injectedScript()->wrapEvaluateResult(errorString, | 122 scope.injectedScript()->wrapEvaluateResult(errorString, |
| 118 maybeResultValue, | 123 maybeResultValue, |
| 119 scope.tryCatch(), | 124 scope.tryCatch(), |
| 120 objectGroup.fromMaybe(""), | 125 objectGroup.fromMaybe(""), |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 } | 422 } |
| 418 } | 423 } |
| 419 | 424 |
| 420 void V8RuntimeAgentImpl::inspect(PassOwnPtr<protocol::Runtime::RemoteObject> obj
ectToInspect, PassOwnPtr<protocol::DictionaryValue> hints) | 425 void V8RuntimeAgentImpl::inspect(PassOwnPtr<protocol::Runtime::RemoteObject> obj
ectToInspect, PassOwnPtr<protocol::DictionaryValue> hints) |
| 421 { | 426 { |
| 422 if (m_enabled) | 427 if (m_enabled) |
| 423 m_frontend->inspectRequested(std::move(objectToInspect), std::move(hints
)); | 428 m_frontend->inspectRequested(std::move(objectToInspect), std::move(hints
)); |
| 424 } | 429 } |
| 425 | 430 |
| 426 } // namespace blink | 431 } // namespace blink |
| OLD | NEW |