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

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

Issue 827933002: DevTools: NetworkPanel: detect iframe (parser) initiator. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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 | « LayoutTests/http/tests/inspector/network/resources/network-initiator-frame.html ('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 26 matching lines...) Expand all
37 #include "core/dom/Document.h" 37 #include "core/dom/Document.h"
38 #include "core/dom/ScriptableDocumentParser.h" 38 #include "core/dom/ScriptableDocumentParser.h"
39 #include "core/fetch/FetchInitiatorInfo.h" 39 #include "core/fetch/FetchInitiatorInfo.h"
40 #include "core/fetch/MemoryCache.h" 40 #include "core/fetch/MemoryCache.h"
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/fileapi/FileReaderLoader.h" 44 #include "core/fileapi/FileReaderLoader.h"
45 #include "core/fileapi/FileReaderLoaderClient.h" 45 #include "core/fileapi/FileReaderLoaderClient.h"
46 #include "core/frame/LocalFrame.h" 46 #include "core/frame/LocalFrame.h"
47 #include "core/html/HTMLFrameOwnerElement.h"
47 #include "core/inspector/IdentifiersFactory.h" 48 #include "core/inspector/IdentifiersFactory.h"
48 #include "core/inspector/InspectorOverlay.h" 49 #include "core/inspector/InspectorOverlay.h"
49 #include "core/inspector/InspectorPageAgent.h" 50 #include "core/inspector/InspectorPageAgent.h"
50 #include "core/inspector/InspectorState.h" 51 #include "core/inspector/InspectorState.h"
51 #include "core/inspector/InstrumentingAgents.h" 52 #include "core/inspector/InstrumentingAgents.h"
52 #include "core/inspector/NetworkResourcesData.h" 53 #include "core/inspector/NetworkResourcesData.h"
53 #include "core/inspector/ScriptAsyncCallStack.h" 54 #include "core/inspector/ScriptAsyncCallStack.h"
54 #include "core/inspector/ScriptCallStack.h" 55 #include "core/inspector/ScriptCallStack.h"
55 #include "core/loader/DocumentLoader.h" 56 #include "core/loader/DocumentLoader.h"
56 #include "core/loader/DocumentThreadableLoader.h" 57 #include "core/loader/DocumentThreadableLoader.h"
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 if (stackTrace && stackTrace->size() > 0) { 669 if (stackTrace && stackTrace->size() > 0) {
669 RefPtr<TypeBuilder::Network::Initiator> initiatorObject = TypeBuilder::N etwork::Initiator::create() 670 RefPtr<TypeBuilder::Network::Initiator> initiatorObject = TypeBuilder::N etwork::Initiator::create()
670 .setType(TypeBuilder::Network::Initiator::Type::Script); 671 .setType(TypeBuilder::Network::Initiator::Type::Script);
671 initiatorObject->setStackTrace(stackTrace->buildInspectorArray()); 672 initiatorObject->setStackTrace(stackTrace->buildInspectorArray());
672 RefPtrWillBeRawPtr<ScriptAsyncCallStack> asyncStackTrace = stackTrace->a syncCallStack(); 673 RefPtrWillBeRawPtr<ScriptAsyncCallStack> asyncStackTrace = stackTrace->a syncCallStack();
673 if (asyncStackTrace) 674 if (asyncStackTrace)
674 initiatorObject->setAsyncStackTrace(asyncStackTrace->buildInspectorO bject()); 675 initiatorObject->setAsyncStackTrace(asyncStackTrace->buildInspectorO bject());
675 return initiatorObject; 676 return initiatorObject;
676 } 677 }
677 678
679 while (document && !document->scriptableDocumentParser())
680 document = document->ownerElement() ? document->ownerElement()->ownerDoc ument() : nullptr;
678 if (document && document->scriptableDocumentParser()) { 681 if (document && document->scriptableDocumentParser()) {
679 RefPtr<TypeBuilder::Network::Initiator> initiatorObject = TypeBuilder::N etwork::Initiator::create() 682 RefPtr<TypeBuilder::Network::Initiator> initiatorObject = TypeBuilder::N etwork::Initiator::create()
680 .setType(TypeBuilder::Network::Initiator::Type::Parser); 683 .setType(TypeBuilder::Network::Initiator::Type::Parser);
681 initiatorObject->setUrl(urlWithoutFragment(document->url()).string()); 684 initiatorObject->setUrl(urlWithoutFragment(document->url()).string());
682 if (TextPosition::belowRangePosition() != initiatorInfo.position) 685 if (TextPosition::belowRangePosition() != initiatorInfo.position)
683 initiatorObject->setLineNumber(initiatorInfo.position.m_line.oneBase dInt()); 686 initiatorObject->setLineNumber(initiatorInfo.position.m_line.oneBase dInt());
684 else 687 else
685 initiatorObject->setLineNumber(document->scriptableDocumentParser()- >lineNumber().oneBasedInt()); 688 initiatorObject->setLineNumber(document->scriptableDocumentParser()- >lineNumber().oneBasedInt());
686 return initiatorObject; 689 return initiatorObject;
687 } 690 }
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish edReplayXHRFired) 1003 , m_removeFinishedReplayXHRTimer(this, &InspectorResourceAgent::removeFinish edReplayXHRFired)
1001 { 1004 {
1002 } 1005 }
1003 1006
1004 bool InspectorResourceAgent::shouldForceCORSPreflight() 1007 bool InspectorResourceAgent::shouldForceCORSPreflight()
1005 { 1008 {
1006 return m_state->getBoolean(ResourceAgentState::cacheDisabled); 1009 return m_state->getBoolean(ResourceAgentState::cacheDisabled);
1007 } 1010 }
1008 1011
1009 } // namespace blink 1012 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/inspector/network/resources/network-initiator-frame.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698