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

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

Issue 13866038: Revert 148069 and 148060 to see if they were responsible for a perf regression (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « Source/WebCore/WebCore.gypi ('k') | Source/WebCore/loader/DocumentLoader.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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 #include "Page.h" 53 #include "Page.h"
54 #include "ProgressTracker.h" 54 #include "ProgressTracker.h"
55 #include "ResourceBuffer.h" 55 #include "ResourceBuffer.h"
56 #include "ResourceError.h" 56 #include "ResourceError.h"
57 #include "ResourceLoader.h" 57 #include "ResourceLoader.h"
58 #include "ResourceRequest.h" 58 #include "ResourceRequest.h"
59 #include "ResourceResponse.h" 59 #include "ResourceResponse.h"
60 #include "ScriptCallStack.h" 60 #include "ScriptCallStack.h"
61 #include "ScriptCallStackFactory.h" 61 #include "ScriptCallStackFactory.h"
62 #include "ScriptableDocumentParser.h" 62 #include "ScriptableDocumentParser.h"
63 #include "SubresourceLoader.h"
63 #include "WebSocketFrame.h" 64 #include "WebSocketFrame.h"
64 #include "WebSocketHandshakeRequest.h" 65 #include "WebSocketHandshakeRequest.h"
65 #include "WebSocketHandshakeResponse.h" 66 #include "WebSocketHandshakeResponse.h"
66 #include "XMLHttpRequest.h" 67 #include "XMLHttpRequest.h"
67 68
68 #include <wtf/CurrentTime.h> 69 #include <wtf/CurrentTime.h>
69 #include <wtf/HexNumber.h> 70 #include <wtf/HexNumber.h>
70 #include <wtf/ListHashSet.h> 71 #include <wtf/ListHashSet.h>
71 #include <wtf/MemoryInstrumentationHashMap.h> 72 #include <wtf/MemoryInstrumentationHashMap.h>
72 #include <wtf/RefPtr.h> 73 #include <wtf/RefPtr.h>
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 241
241 void InspectorResourceAgent::didReceiveResponse(unsigned long identifier, Docume ntLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoad er) 242 void InspectorResourceAgent::didReceiveResponse(unsigned long identifier, Docume ntLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoad er)
242 { 243 {
243 String requestId = IdentifiersFactory::requestId(identifier); 244 String requestId = IdentifiersFactory::requestId(identifier);
244 RefPtr<TypeBuilder::Network::Response> resourceResponse = buildObjectForReso urceResponse(response, loader); 245 RefPtr<TypeBuilder::Network::Response> resourceResponse = buildObjectForReso urceResponse(response, loader);
245 246
246 bool isNotModified = response.httpStatusCode() == 304; 247 bool isNotModified = response.httpStatusCode() == 304;
247 248
248 CachedResource* cachedResource = 0; 249 CachedResource* cachedResource = 0;
249 if (resourceLoader && !isNotModified) 250 if (resourceLoader && !isNotModified)
250 cachedResource = resourceLoader->cachedResource(); 251 cachedResource = static_cast<SubresourceLoader*>(resourceLoader)->cached Resource();
251 if (!cachedResource) 252 if (!cachedResource)
252 cachedResource = InspectorPageAgent::cachedResource(loader->frame(), res ponse.url()); 253 cachedResource = InspectorPageAgent::cachedResource(loader->frame(), res ponse.url());
253 254
254 if (cachedResource) { 255 if (cachedResource) {
255 // Use mime type from cached resource in case the one in response is emp ty. 256 // Use mime type from cached resource in case the one in response is emp ty.
256 if (resourceResponse && response.mimeType().isEmpty()) 257 if (resourceResponse && response.mimeType().isEmpty())
257 resourceResponse->setString(TypeBuilder::Network::Response::MimeType , cachedResource->response().mimeType()); 258 resourceResponse->setString(TypeBuilder::Network::Response::MimeType , cachedResource->response().mimeType());
258 m_resourcesData->addCachedResource(requestId, cachedResource); 259 m_resourcesData->addCachedResource(requestId, cachedResource);
259 } 260 }
260 261
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 , m_client(client) 667 , m_client(client)
667 , m_frontend(0) 668 , m_frontend(0)
668 , m_resourcesData(adoptPtr(new NetworkResourcesData())) 669 , m_resourcesData(adoptPtr(new NetworkResourcesData()))
669 , m_loadingXHRSynchronously(false) 670 , m_loadingXHRSynchronously(false)
670 , m_isRecalculatingStyle(false) 671 , m_isRecalculatingStyle(false)
671 { 672 {
672 } 673 }
673 674
674 } // namespace WebCore 675 } // namespace WebCore
675 676
OLDNEW
« no previous file with comments | « Source/WebCore/WebCore.gypi ('k') | Source/WebCore/loader/DocumentLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698