Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / inspector / InspectorInstrumentation.cpp
index cf70689..a5a8a77 100644 (file)
 #include "core/inspector/InspectorResourceAgent.h"
 #include "core/inspector/InspectorTimelineAgent.h"
 #include "core/inspector/InstrumentingAgents.h"
+#include "core/inspector/ScriptAsyncCallStack.h"
+#include "core/inspector/ScriptCallStack.h"
 #include "core/inspector/WorkerInspectorController.h"
+#include "core/page/Page.h"
 #include "core/workers/WorkerGlobalScope.h"
 
-namespace WebCore {
+namespace blink {
 
 namespace {
 static HashSet<InstrumentingAgents*>* instrumentingAgentsSet = 0;
@@ -105,11 +108,6 @@ void continueAfterXFrameOptionsDeniedImpl(LocalFrame* frame, DocumentLoader* loa
     didReceiveResourceResponseButCanceledImpl(frame, loader, identifier, r);
 }
 
-void continueWithPolicyDownloadImpl(LocalFrame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r)
-{
-    didReceiveResourceResponseButCanceledImpl(frame, loader, identifier, r);
-}
-
 void continueWithPolicyIgnoreImpl(LocalFrame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r)
 {
     didReceiveResourceResponseButCanceledImpl(frame, loader, identifier, r);
@@ -148,6 +146,15 @@ String preprocessEventListenerImpl(InstrumentingAgents* instrumentingAgents, Loc
     return source;
 }
 
+void appendAsyncCallStack(ExecutionContext* executionContext, ScriptCallStack* callStack)
+{
+    InstrumentingAgents* instrumentingAgents = instrumentingAgentsFor(executionContext);
+    if (!instrumentingAgents)
+        return;
+    if (InspectorDebuggerAgent* debuggerAgent = instrumentingAgents->inspectorDebuggerAgent())
+        callStack->setAsyncCallStack(debuggerAgent->currentAsyncStackTraceForConsole());
+}
+
 bool canvasAgentEnabled(ExecutionContext* executionContext)
 {
     InstrumentingAgents* instrumentingAgents = instrumentingAgentsFor(executionContext);
@@ -263,5 +270,5 @@ InstrumentingAgents* instrumentationForWorkerGlobalScope(WorkerGlobalScope* work
     return 0;
 }
 
-} // namespace WebCore
+} // namespace blink