Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp

Issue 1940783002: [DevTools] Don't run microtasks after call to InjectedScript (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/v8_inspector/V8FunctionCall.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 v8::MaybeLocal<v8::Object> commandLineAPI = includeCommandLineAPI.fromMaybe( false) ? injectedScript->commandLineAPI(errorString) : v8::MaybeLocal<v8::Object >(); 115 v8::MaybeLocal<v8::Object> commandLineAPI = includeCommandLineAPI.fromMaybe( false) ? injectedScript->commandLineAPI(errorString) : v8::MaybeLocal<v8::Object >();
116 if (includeCommandLineAPI.fromMaybe(false) && commandLineAPI.IsEmpty()) 116 if (includeCommandLineAPI.fromMaybe(false) && commandLineAPI.IsEmpty())
117 return; 117 return;
118 InjectedScript::ScopedGlobalObjectExtension scopeExtension(injectedScript, c ommandLineAPI); 118 InjectedScript::ScopedGlobalObjectExtension scopeExtension(injectedScript, c ommandLineAPI);
119 119
120 bool evalIsDisabled = !context->IsCodeGenerationFromStringsAllowed(); 120 bool evalIsDisabled = !context->IsCodeGenerationFromStringsAllowed();
121 // Temporarily enable allow evals for inspector. 121 // Temporarily enable allow evals for inspector.
122 if (evalIsDisabled) 122 if (evalIsDisabled)
123 context->AllowCodeGenerationFromStrings(true); 123 context->AllowCodeGenerationFromStrings(true);
124 v8::MaybeLocal<v8::Value> maybeResultValue = m_debugger->compileAndRunIntern alScript(injectedScript->context()->context(), toV8String(injectedScript->isolat e(), expression)); 124
125 v8::MaybeLocal<v8::Value> maybeResultValue;
126 v8::Local<v8::Script> script = m_debugger->compileInternalScript(context, to V8String(m_debugger->isolate(), expression), String16());
127 if (!script.IsEmpty())
128 maybeResultValue = m_debugger->runCompiledScript(context, script);
129
125 if (evalIsDisabled) 130 if (evalIsDisabled)
126 context->AllowCodeGenerationFromStrings(false); 131 context->AllowCodeGenerationFromStrings(false);
127 // InjectedScript may be gone after any evaluate call - find it again. 132 // InjectedScript may be gone after any evaluate call - find it again.
128 injectedScript = m_session->findInjectedScript(errorString, contextId); 133 injectedScript = m_session->findInjectedScript(errorString, contextId);
129 if (!injectedScript) 134 if (!injectedScript)
130 return; 135 return;
131 136
132 injectedScript->wrapEvaluateResult(errorString, 137 injectedScript->wrapEvaluateResult(errorString,
133 maybeResultValue, 138 maybeResultValue,
134 tryCatch, 139 tryCatch,
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 } 546 }
542 } 547 }
543 548
544 void V8RuntimeAgentImpl::inspect(PassOwnPtr<protocol::Runtime::RemoteObject> obj ectToInspect, PassOwnPtr<protocol::DictionaryValue> hints) 549 void V8RuntimeAgentImpl::inspect(PassOwnPtr<protocol::Runtime::RemoteObject> obj ectToInspect, PassOwnPtr<protocol::DictionaryValue> hints)
545 { 550 {
546 if (m_enabled) 551 if (m_enabled)
547 m_frontend->inspectRequested(objectToInspect, hints); 552 m_frontend->inspectRequested(objectToInspect, hints);
548 } 553 }
549 554
550 } // namespace blink 555 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/v8_inspector/V8FunctionCall.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698