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

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

Issue 15863002: Fix ResourceLoadTiming Resolution Issue 3rd step - remove old fields (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 7 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 | « Source/core/core.gypi ('k') | Source/core/page/PerformanceResourceTiming.h » ('j') | 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 { 101 {
102 RefPtr<InspectorObject> headersObject = InspectorObject::create(); 102 RefPtr<InspectorObject> headersObject = InspectorObject::create();
103 HTTPHeaderMap::const_iterator end = headers.end(); 103 HTTPHeaderMap::const_iterator end = headers.end();
104 for (HTTPHeaderMap::const_iterator it = headers.begin(); it != end; ++it) 104 for (HTTPHeaderMap::const_iterator it = headers.begin(); it != end; ++it)
105 headersObject->setString(it->key.string(), it->value); 105 headersObject->setString(it->key.string(), it->value);
106 return headersObject; 106 return headersObject;
107 } 107 }
108 108
109 static PassRefPtr<TypeBuilder::Network::ResourceTiming> buildObjectForTiming(con st ResourceLoadTiming& timing, DocumentLoader* loader) 109 static PassRefPtr<TypeBuilder::Network::ResourceTiming> buildObjectForTiming(con st ResourceLoadTiming& timing, DocumentLoader* loader)
110 { 110 {
111 #ifdef ENABLE_DOUBLE_RESOURCE_LOAD_TIMING
112 double requestTime = timing.requestTime;
113 return TypeBuilder::Network::ResourceTiming::create() 111 return TypeBuilder::Network::ResourceTiming::create()
114 .setRequestTime(loader->timing()->monotonicTimeToPseudoWallTime(requestT ime)) 112 .setRequestTime(loader->timing()->monotonicTimeToPseudoWallTime(timing.r equestTime))
115 .setProxyStart(timing.calculateMillisecondDelta(timing.proxyStart)) 113 .setProxyStart(timing.calculateMillisecondDelta(timing.proxyStart))
116 .setProxyEnd(timing.calculateMillisecondDelta(timing.proxyEnd)) 114 .setProxyEnd(timing.calculateMillisecondDelta(timing.proxyEnd))
117 .setDnsStart(timing.calculateMillisecondDelta(timing.dnsStart)) 115 .setDnsStart(timing.calculateMillisecondDelta(timing.dnsStart))
118 .setDnsEnd(timing.calculateMillisecondDelta(timing.dnsEnd)) 116 .setDnsEnd(timing.calculateMillisecondDelta(timing.dnsEnd))
119 .setConnectStart(timing.calculateMillisecondDelta(timing.connectStart)) 117 .setConnectStart(timing.calculateMillisecondDelta(timing.connectStart))
120 .setConnectEnd(timing.calculateMillisecondDelta(timing.connectEnd)) 118 .setConnectEnd(timing.calculateMillisecondDelta(timing.connectEnd))
121 .setSslStart(timing.calculateMillisecondDelta(timing.sslStart)) 119 .setSslStart(timing.calculateMillisecondDelta(timing.sslStart))
122 .setSslEnd(timing.calculateMillisecondDelta(timing.sslEnd)) 120 .setSslEnd(timing.calculateMillisecondDelta(timing.sslEnd))
123 .setSendStart(timing.calculateMillisecondDelta(timing.sendStart)) 121 .setSendStart(timing.calculateMillisecondDelta(timing.sendStart))
124 .setSendEnd(timing.calculateMillisecondDelta(timing.sendEnd)) 122 .setSendEnd(timing.calculateMillisecondDelta(timing.sendEnd))
125 .setReceiveHeadersEnd(timing.calculateMillisecondDelta(timing.receiveHea dersEnd)) 123 .setReceiveHeadersEnd(timing.calculateMillisecondDelta(timing.receiveHea dersEnd))
126 .release(); 124 .release();
127 #else
128 return TypeBuilder::Network::ResourceTiming::create()
129 .setRequestTime(loader->timing()->monotonicTimeToPseudoWallTime(timing.c onvertResourceLoadTimeToMonotonicTime(0)))
130 .setProxyStart(timing.proxyStart)
131 .setProxyEnd(timing.proxyEnd)
132 .setDnsStart(timing.dnsStart)
133 .setDnsEnd(timing.dnsEnd)
134 .setConnectStart(timing.connectStart)
135 .setConnectEnd(timing.connectEnd)
136 .setSslStart(timing.sslStart)
137 .setSslEnd(timing.sslEnd)
138 .setSendStart(timing.sendStart)
139 .setSendEnd(timing.sendEnd)
140 .setReceiveHeadersEnd(timing.receiveHeadersEnd)
141 .release();
142 #endif
143 } 125 }
144 126
145 static PassRefPtr<TypeBuilder::Network::Request> buildObjectForResourceRequest(c onst ResourceRequest& request) 127 static PassRefPtr<TypeBuilder::Network::Request> buildObjectForResourceRequest(c onst ResourceRequest& request)
146 { 128 {
147 RefPtr<TypeBuilder::Network::Request> requestObject = TypeBuilder::Network:: Request::create() 129 RefPtr<TypeBuilder::Network::Request> requestObject = TypeBuilder::Network:: Request::create()
148 .setUrl(request.url().string()) 130 .setUrl(request.url().string())
149 .setMethod(request.httpMethod()) 131 .setMethod(request.httpMethod())
150 .setHeaders(buildObjectForHeaders(request.httpHeaderFields())); 132 .setHeaders(buildObjectForHeaders(request.httpHeaderFields()));
151 if (request.httpBody() && !request.httpBody()->isEmpty()) 133 if (request.httpBody() && !request.httpBody()->isEmpty())
152 requestObject->setPostData(request.httpBody()->flattenToString()); 134 requestObject->setPostData(request.httpBody()->flattenToString());
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 , m_client(client) 673 , m_client(client)
692 , m_frontend(0) 674 , m_frontend(0)
693 , m_resourcesData(adoptPtr(new NetworkResourcesData())) 675 , m_resourcesData(adoptPtr(new NetworkResourcesData()))
694 , m_loadingXHRSynchronously(false) 676 , m_loadingXHRSynchronously(false)
695 , m_isRecalculatingStyle(false) 677 , m_isRecalculatingStyle(false)
696 { 678 {
697 } 679 }
698 680
699 } // namespace WebCore 681 } // namespace WebCore
700 682
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/page/PerformanceResourceTiming.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698