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

Side by Side Diff: Source/core/inspector/InspectorResourceAgent.cpp

Issue 416843002: DevTools: Send async stack trace with Network.Initiator. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 5 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 | Annotate | Revision Log
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 30 matching lines...) Expand all
41 #include "core/fetch/Resource.h" 41 #include "core/fetch/Resource.h"
42 #include "core/fetch/ResourceFetcher.h" 42 #include "core/fetch/ResourceFetcher.h"
43 #include "core/fetch/ResourceLoader.h" 43 #include "core/fetch/ResourceLoader.h"
44 #include "core/frame/LocalFrame.h" 44 #include "core/frame/LocalFrame.h"
45 #include "core/inspector/IdentifiersFactory.h" 45 #include "core/inspector/IdentifiersFactory.h"
46 #include "core/inspector/InspectorOverlay.h" 46 #include "core/inspector/InspectorOverlay.h"
47 #include "core/inspector/InspectorPageAgent.h" 47 #include "core/inspector/InspectorPageAgent.h"
48 #include "core/inspector/InspectorState.h" 48 #include "core/inspector/InspectorState.h"
49 #include "core/inspector/InstrumentingAgents.h" 49 #include "core/inspector/InstrumentingAgents.h"
50 #include "core/inspector/NetworkResourcesData.h" 50 #include "core/inspector/NetworkResourcesData.h"
51 #include "core/inspector/ScriptAsyncCallStack.h"
51 #include "core/inspector/ScriptCallStack.h" 52 #include "core/inspector/ScriptCallStack.h"
52 #include "core/loader/DocumentLoader.h" 53 #include "core/loader/DocumentLoader.h"
53 #include "core/loader/DocumentThreadableLoader.h" 54 #include "core/loader/DocumentThreadableLoader.h"
54 #include "core/loader/FrameLoader.h" 55 #include "core/loader/FrameLoader.h"
55 #include "core/loader/ThreadableLoader.h" 56 #include "core/loader/ThreadableLoader.h"
56 #include "core/loader/ThreadableLoaderClient.h" 57 #include "core/loader/ThreadableLoaderClient.h"
57 #include "core/page/Page.h" 58 #include "core/page/Page.h"
58 #include "core/xml/XMLHttpRequest.h" 59 #include "core/xml/XMLHttpRequest.h"
59 #include "platform/JSONValues.h" 60 #include "platform/JSONValues.h"
60 #include "platform/network/HTTPHeaderMap.h" 61 #include "platform/network/HTTPHeaderMap.h"
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 m_styleRecalculationInitiator = buildInitiatorObject(document, FetchInit iatorInfo()); 542 m_styleRecalculationInitiator = buildInitiatorObject(document, FetchInit iatorInfo());
542 } 543 }
543 544
544 PassRefPtr<TypeBuilder::Network::Initiator> InspectorResourceAgent::buildInitiat orObject(Document* document, const FetchInitiatorInfo& initiatorInfo) 545 PassRefPtr<TypeBuilder::Network::Initiator> InspectorResourceAgent::buildInitiat orObject(Document* document, const FetchInitiatorInfo& initiatorInfo)
545 { 546 {
546 RefPtrWillBeRawPtr<ScriptCallStack> stackTrace = createScriptCallStack(Scrip tCallStack::maxCallStackSizeToCapture, true); 547 RefPtrWillBeRawPtr<ScriptCallStack> stackTrace = createScriptCallStack(Scrip tCallStack::maxCallStackSizeToCapture, true);
547 if (stackTrace && stackTrace->size() > 0) { 548 if (stackTrace && stackTrace->size() > 0) {
548 RefPtr<TypeBuilder::Network::Initiator> initiatorObject = TypeBuilder::N etwork::Initiator::create() 549 RefPtr<TypeBuilder::Network::Initiator> initiatorObject = TypeBuilder::N etwork::Initiator::create()
549 .setType(TypeBuilder::Network::Initiator::Type::Script); 550 .setType(TypeBuilder::Network::Initiator::Type::Script);
550 initiatorObject->setStackTrace(stackTrace->buildInspectorArray()); 551 initiatorObject->setStackTrace(stackTrace->buildInspectorArray());
552 RefPtrWillBeRawPtr<ScriptAsyncCallStack> asyncStackTrace = stackTrace->a syncCallStack();
553 if (asyncStackTrace)
554 initiatorObject->setAsyncStackTrace(asyncStackTrace->buildInspectorO bject());
551 return initiatorObject; 555 return initiatorObject;
552 } 556 }
553 557
554 if (document && document->scriptableDocumentParser()) { 558 if (document && document->scriptableDocumentParser()) {
555 RefPtr<TypeBuilder::Network::Initiator> initiatorObject = TypeBuilder::N etwork::Initiator::create() 559 RefPtr<TypeBuilder::Network::Initiator> initiatorObject = TypeBuilder::N etwork::Initiator::create()
556 .setType(TypeBuilder::Network::Initiator::Type::Parser); 560 .setType(TypeBuilder::Network::Initiator::Type::Parser);
557 initiatorObject->setUrl(urlWithoutFragment(document->url()).string()); 561 initiatorObject->setUrl(urlWithoutFragment(document->url()).string());
558 if (TextPosition::belowRangePosition() != initiatorInfo.position) 562 if (TextPosition::belowRangePosition() != initiatorInfo.position)
559 initiatorObject->setLineNumber(initiatorInfo.position.m_line.oneBase dInt()); 563 initiatorObject->setLineNumber(initiatorInfo.position.m_line.oneBase dInt());
560 else 564 else
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 : InspectorBaseAgent<InspectorResourceAgent>("Network") 867 : InspectorBaseAgent<InspectorResourceAgent>("Network")
864 , m_pageAgent(pageAgent) 868 , m_pageAgent(pageAgent)
865 , m_frontend(0) 869 , m_frontend(0)
866 , m_resourcesData(adoptPtr(new NetworkResourcesData())) 870 , m_resourcesData(adoptPtr(new NetworkResourcesData()))
867 , m_isRecalculatingStyle(false) 871 , m_isRecalculatingStyle(false)
868 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish edReplayXHRFired) 872 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish edReplayXHRFired)
869 { 873 {
870 } 874 }
871 875
872 } // namespace blink 876 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698