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

Side by Side Diff: Source/core/loader/ResourceLoadNotifier.cpp

Issue 16950017: Reland [Resource Timing] Expose redirect timing information (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 6 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) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 ResourceLoadNotifier::ResourceLoadNotifier(Frame* frame) 45 ResourceLoadNotifier::ResourceLoadNotifier(Frame* frame)
46 : m_frame(frame) 46 : m_frame(frame)
47 { 47 {
48 } 48 }
49 49
50 void ResourceLoadNotifier::dispatchWillSendRequest(DocumentLoader* loader, unsig ned long identifier, ResourceRequest& request, const ResourceResponse& redirectR esponse, const CachedResourceInitiatorInfo& initiatorInfo) 50 void ResourceLoadNotifier::dispatchWillSendRequest(DocumentLoader* loader, unsig ned long identifier, ResourceRequest& request, const ResourceResponse& redirectR esponse, const CachedResourceInitiatorInfo& initiatorInfo)
51 { 51 {
52 m_frame->loader()->applyUserAgent(request); 52 m_frame->loader()->applyUserAgent(request);
53 m_frame->loader()->client()->dispatchWillSendRequest(loader, identifier, req uest, redirectResponse); 53 m_frame->loader()->client()->dispatchWillSendRequest(loader, identifier, req uest, redirectResponse);
54 InspectorInstrumentation::willSendRequest(m_frame, identifier, loader, reque st, redirectResponse, initiatorInfo); 54 InspectorInstrumentation::willSendRequest(m_frame, identifier, loader, reque st, redirectResponse, initiatorInfo);
55 request.setReportLoadTiming(true);
56 } 55 }
57 56
58 void ResourceLoadNotifier::dispatchDidReceiveResponse(DocumentLoader* loader, un signed long identifier, const ResourceResponse& r, ResourceLoader* resourceLoade r) 57 void ResourceLoadNotifier::dispatchDidReceiveResponse(DocumentLoader* loader, un signed long identifier, const ResourceResponse& r, ResourceLoader* resourceLoade r)
59 { 58 {
60 if (Page* page = m_frame->page()) 59 if (Page* page = m_frame->page())
61 page->progress()->incrementProgress(identifier, r); 60 page->progress()->incrementProgress(identifier, r);
62 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiv eResourceResponse(m_frame, identifier, r); 61 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiv eResourceResponse(m_frame, identifier, r);
63 m_frame->loader()->client()->dispatchDidReceiveResponse(loader, identifier, r); 62 m_frame->loader()->client()->dispatchDidReceiveResponse(loader, identifier, r);
64 InspectorInstrumentation::didReceiveResourceResponse(cookie, identifier, loa der, r, resourceLoader); 63 InspectorInstrumentation::didReceiveResourceResponse(cookie, identifier, loa der, r, resourceLoader);
65 } 64 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 if (dataLength > 0) 98 if (dataLength > 0)
100 dispatchDidReceiveData(loader, identifier, data, dataLength, encodedData Length); 99 dispatchDidReceiveData(loader, identifier, data, dataLength, encodedData Length);
101 100
102 if (error.isNull()) 101 if (error.isNull())
103 dispatchDidFinishLoading(loader, identifier, 0); 102 dispatchDidFinishLoading(loader, identifier, 0);
104 else 103 else
105 dispatchDidFail(loader, identifier, error); 104 dispatchDidFail(loader, identifier, error);
106 } 105 }
107 106
108 } // namespace WebCore 107 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698