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

Unified Diff: Source/core/inspector/InjectedScript.cpp

Issue 1307363006: DevTools: move instrumentation of v8 calls into V8ScriptRunner (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressed comments Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/inspector/InjectedScript.cpp
diff --git a/Source/core/inspector/InjectedScript.cpp b/Source/core/inspector/InjectedScript.cpp
index c6c60548a54dcdbbea5484f9db9625c0ce8680f7..076bb237009d7fed429cac889f72ca8f55ce3cac 100644
--- a/Source/core/inspector/InjectedScript.cpp
+++ b/Source/core/inspector/InjectedScript.cpp
@@ -36,7 +36,6 @@
#include "bindings/core/v8/ScriptFunctionCall.h"
#include "bindings/core/v8/V8Binding.h"
#include "core/inspector/InjectedScriptHost.h"
-#include "core/inspector/InspectorInstrumentation.h"
#include "core/inspector/InspectorTraceEvents.h"
#include "core/inspector/JSONParser.h"
#include "core/inspector/RemoteObjectId.h"
@@ -444,27 +443,19 @@ const ScriptValue& InjectedScript::injectedScriptObject() const
ScriptValue InjectedScript::callFunctionWithEvalEnabled(ScriptFunctionCall& function, bool& hadException) const
{
ASSERT(!isEmpty());
- ExecutionContext* executionContext = m_injectedScriptObject.scriptState()->executionContext();
- ScriptState::Scope scope(m_injectedScriptObject.scriptState());
- v8::Local<v8::Function> functionObj = function.function();
- DevToolsFunctionInfo info(functionObj);
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::willCallFunction(executionContext, info);
ScriptState* scriptState = m_injectedScriptObject.scriptState();
- bool evalIsDisabled = false;
- if (scriptState) {
- evalIsDisabled = !scriptState->evalEnabled();
- // Temporarily enable allow evals for inspector.
- if (evalIsDisabled)
- scriptState->setEvalEnabled(true);
- }
+ ScriptState::Scope scope(scriptState);
+ bool evalIsDisabled = !scriptState->evalEnabled();
+ // Temporarily enable allow evals for inspector.
+ if (evalIsDisabled)
+ scriptState->setEvalEnabled(true);
ScriptValue resultValue = function.call(hadException);
if (evalIsDisabled)
scriptState->setEvalEnabled(false);
- InspectorInstrumentation::didCallFunction(cookie);
TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "UpdateCounters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::data());
return resultValue;
}
@@ -539,4 +530,3 @@ void InjectedScript::makeCallWithExceptionDetails(ScriptFunctionCall& function,
}
} // namespace blink
-
« no previous file with comments | « Source/bindings/core/v8/V8WorkerGlobalScopeEventListener.cpp ('k') | Source/core/inspector/InspectorDebuggerAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698