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

Side by Side Diff: third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp

Issue 2706643002: DevTools: Move network request instrumentation points for timeline down the stack. (Closed)
Patch Set: . Created 3 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013, Intel Corporation 3 * Copyright (C) 2013, Intel Corporation
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 28 matching lines...) Expand all
39 #include "core/inspector/InspectorInstrumentation.h" 39 #include "core/inspector/InspectorInstrumentation.h"
40 #include "core/inspector/InspectorTraceEvents.h" 40 #include "core/inspector/InspectorTraceEvents.h"
41 #include "core/loader/DocumentThreadableLoaderClient.h" 41 #include "core/loader/DocumentThreadableLoaderClient.h"
42 #include "core/loader/FrameLoader.h" 42 #include "core/loader/FrameLoader.h"
43 #include "core/loader/FrameLoaderClient.h" 43 #include "core/loader/FrameLoaderClient.h"
44 #include "core/loader/ThreadableLoaderClient.h" 44 #include "core/loader/ThreadableLoaderClient.h"
45 #include "core/loader/private/CrossOriginPreflightResultCache.h" 45 #include "core/loader/private/CrossOriginPreflightResultCache.h"
46 #include "core/page/ChromeClient.h" 46 #include "core/page/ChromeClient.h"
47 #include "core/page/Page.h" 47 #include "core/page/Page.h"
48 #include "platform/SharedBuffer.h" 48 #include "platform/SharedBuffer.h"
49 #include "platform/instrumentation/inspector/PlatformInspectorTraceEvents.h"
49 #include "platform/loader/fetch/CrossOriginAccessControl.h" 50 #include "platform/loader/fetch/CrossOriginAccessControl.h"
50 #include "platform/loader/fetch/FetchRequest.h" 51 #include "platform/loader/fetch/FetchRequest.h"
51 #include "platform/loader/fetch/FetchUtils.h" 52 #include "platform/loader/fetch/FetchUtils.h"
52 #include "platform/loader/fetch/Resource.h" 53 #include "platform/loader/fetch/Resource.h"
53 #include "platform/loader/fetch/ResourceFetcher.h" 54 #include "platform/loader/fetch/ResourceFetcher.h"
54 #include "platform/network/ResourceRequest.h" 55 #include "platform/network/ResourceRequest.h"
55 #include "platform/weborigin/SchemeRegistry.h" 56 #include "platform/weborigin/SchemeRegistry.h"
56 #include "platform/weborigin/SecurityOrigin.h" 57 #include "platform/weborigin/SecurityOrigin.h"
57 #include "platform/weborigin/SecurityPolicy.h" 58 #include "platform/weborigin/SecurityPolicy.h"
58 #include "public/platform/Platform.h" 59 #include "public/platform/Platform.h"
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 766
766 void DocumentThreadableLoader::reportResponseReceived( 767 void DocumentThreadableLoader::reportResponseReceived(
767 unsigned long identifier, 768 unsigned long identifier,
768 const ResourceResponse& response) { 769 const ResourceResponse& response) {
769 LocalFrame* frame = document().frame(); 770 LocalFrame* frame = document().frame();
770 // We are seeing crashes caused by nullptr (crbug.com/578849). But the frame 771 // We are seeing crashes caused by nullptr (crbug.com/578849). But the frame
771 // must be set here. TODO(horo): Find the root cause of the unset frame. 772 // must be set here. TODO(horo): Find the root cause of the unset frame.
772 DCHECK(frame); 773 DCHECK(frame);
773 if (!frame) 774 if (!frame)
774 return; 775 return;
775 TRACE_EVENT1( 776 TRACE_EVENT1("devtools.timeline", "ResourceReceiveResponse", "data",
776 "devtools.timeline", "ResourceReceiveResponse", "data", 777 InspectorReceiveResponseEvent::data(identifier, response));
777 InspectorReceiveResponseEvent::data(identifier, frame, response));
778 DocumentLoader* loader = frame->loader().documentLoader(); 778 DocumentLoader* loader = frame->loader().documentLoader();
779 InspectorInstrumentation::didReceiveResourceResponse( 779 InspectorInstrumentation::didReceiveResourceResponse(
780 frame, identifier, loader, response, resource()); 780 frame, identifier, loader, response, resource());
781 frame->console().reportResourceResponseReceived(loader, identifier, response); 781 frame->console().reportResourceResponseReceived(loader, identifier, response);
782 } 782 }
783 783
784 void DocumentThreadableLoader::handleResponse( 784 void DocumentThreadableLoader::handleResponse(
785 unsigned long identifier, 785 unsigned long identifier,
786 const ResourceResponse& response, 786 const ResourceResponse& response,
787 std::unique_ptr<WebDataConsumerHandle> handle) { 787 std::unique_ptr<WebDataConsumerHandle> handle) {
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 } 1149 }
1150 1150
1151 DEFINE_TRACE(DocumentThreadableLoader) { 1151 DEFINE_TRACE(DocumentThreadableLoader) {
1152 visitor->trace(m_resource); 1152 visitor->trace(m_resource);
1153 visitor->trace(m_document); 1153 visitor->trace(m_document);
1154 ThreadableLoader::trace(visitor); 1154 ThreadableLoader::trace(visitor);
1155 RawResourceClient::trace(visitor); 1155 RawResourceClient::trace(visitor);
1156 } 1156 }
1157 1157
1158 } // namespace blink 1158 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698