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

Side by Side Diff: WebCore/inspector/InspectorResource.cpp

Issue 3441018: Merge 67709 - 2010-09-17 Pavel Feldman <pfeldman@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/517/
Patch Set: Created 10 years, 3 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 | « WebCore/inspector/InspectorResource.h ('k') | WebCore/loader/FrameLoader.cpp » ('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) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
4 * Copyright (C) 2009 Google Inc. All rights reserved. 4 * Copyright (C) 2009 Google Inc. All rights reserved.
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 void InspectorResource::updateRequest(const ResourceRequest& request) 110 void InspectorResource::updateRequest(const ResourceRequest& request)
111 { 111 {
112 m_requestHeaderFields = request.httpHeaderFields(); 112 m_requestHeaderFields = request.httpHeaderFields();
113 m_requestMethod = request.httpMethod(); 113 m_requestMethod = request.httpMethod();
114 if (request.httpBody() && !request.httpBody()->isEmpty()) 114 if (request.httpBody() && !request.httpBody()->isEmpty())
115 m_requestFormData = request.httpBody()->flattenToString(); 115 m_requestFormData = request.httpBody()->flattenToString();
116 116
117 m_changes.set(RequestChange); 117 m_changes.set(RequestChange);
118 } 118 }
119 119
120 void InspectorResource::markAsCached()
121 {
122 m_cached = true;
123 }
124
120 void InspectorResource::updateResponse(const ResourceResponse& response) 125 void InspectorResource::updateResponse(const ResourceResponse& response)
121 { 126 {
122 m_expectedContentLength = response.expectedContentLength(); 127 m_expectedContentLength = response.expectedContentLength();
123 m_mimeType = response.mimeType(); 128 m_mimeType = response.mimeType();
124 if (m_mimeType.isEmpty() && response.httpStatusCode() == 304) { 129 if (m_mimeType.isEmpty() && response.httpStatusCode() == 304) {
125 CachedResource* cachedResource = cache()->resourceForURL(response.url(). string()); 130 CachedResource* cachedResource = cache()->resourceForURL(response.url(). string());
126 if (cachedResource) 131 if (cachedResource)
127 m_mimeType = cachedResource->response().mimeType(); 132 m_mimeType = cachedResource->response().mimeType();
128 } 133 }
129 m_responseHeaderFields = response.httpHeaderFields(); 134 m_responseHeaderFields = response.httpHeaderFields();
130 m_responseStatusCode = response.httpStatusCode(); 135 m_responseStatusCode = response.httpStatusCode();
131 m_responseStatusText = response.httpStatusText(); 136 m_responseStatusText = response.httpStatusText();
132 m_suggestedFilename = response.suggestedFilename(); 137 m_suggestedFilename = response.suggestedFilename();
133 138
134 m_connectionID = response.connectionID(); 139 m_connectionID = response.connectionID();
135 m_connectionReused = response.connectionReused(); 140 m_connectionReused = response.connectionReused();
136 m_loadTiming = response.resourceLoadTiming(); 141 m_loadTiming = response.resourceLoadTiming();
137 m_cached = response.wasCached(); 142 m_cached = m_cached || response.wasCached();
138 143
139 if (!m_cached && m_loadTiming && m_loadTiming->requestTime) 144 if (!m_cached && m_loadTiming && m_loadTiming->requestTime)
140 m_responseReceivedTime = m_loadTiming->requestTime + m_loadTiming->recei veHeadersEnd / 1000.0; 145 m_responseReceivedTime = m_loadTiming->requestTime + m_loadTiming->recei veHeadersEnd / 1000.0;
141 else 146 else
142 m_responseReceivedTime = currentTime(); 147 m_responseReceivedTime = currentTime();
143 148
144 m_changes.set(TimingChange); 149 m_changes.set(TimingChange);
145 m_changes.set(ResponseChange); 150 m_changes.set(ResponseChange);
146 m_changes.set(TypeChange); 151 m_changes.set(TypeChange);
147 } 152 }
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 // Update load time, otherwise the resource will 411 // Update load time, otherwise the resource will
407 // have start time == end time and 0 load duration 412 // have start time == end time and 0 load duration
408 // until its loading is completed. 413 // until its loading is completed.
409 m_endTime = currentTime(); 414 m_endTime = currentTime();
410 m_changes.set(TimingChange); 415 m_changes.set(TimingChange);
411 } 416 }
412 417
413 } // namespace WebCore 418 } // namespace WebCore
414 419
415 #endif // ENABLE(INSPECTOR) 420 #endif // ENABLE(INSPECTOR)
OLDNEW
« no previous file with comments | « WebCore/inspector/InspectorResource.h ('k') | WebCore/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698