Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / inspector / InspectorInstrumentation.cpp
index cf70689..8116492 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "core/events/EventTarget.h"
 #include "core/fetch/FetchInitiatorInfo.h"
+#include "core/frame/FrameHost.h"
 #include "core/inspector/InspectorCSSAgent.h"
 #include "core/inspector/InspectorConsoleAgent.h"
 #include "core/inspector/InspectorController.h"
 #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 +109,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 +147,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);
@@ -221,6 +229,11 @@ InstrumentingAgents* instrumentingAgentsFor(WorkerGlobalScope* workerGlobalScope
     return instrumentationForWorkerGlobalScope(workerGlobalScope);
 }
 
+InstrumentingAgents* instrumentingAgentsFor(FrameHost* host)
+{
+    return instrumentationForPage(&host->page());
+}
+
 InstrumentingAgents* instrumentingAgentsForNonDocumentContext(ExecutionContext* context)
 {
     if (context->isWorkerGlobalScope())
@@ -263,5 +276,5 @@ InstrumentingAgents* instrumentationForWorkerGlobalScope(WorkerGlobalScope* work
     return 0;
 }
 
-} // namespace WebCore
+} // namespace blink