Changeset 90375 in webkit
- Timestamp:
- Jul 4, 2011 1:26:37 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 9 deleted
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r90373 r90375 1 2011-07-04 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r90373. 4 http://trac.webkit.org/changeset/90373 5 https://bugs.webkit.org/show_bug.cgi?id=63917 6 7 Breaks Qt Linux Release minimal (Requested by vsevik on 8 #webkit). 9 10 * Source/autotools/symbols.filter: 11 1 12 2011-07-04 Vsevolod Vlasov <vsevik@chromium.org> 2 13 -
trunk/LayoutTests/ChangeLog
r90373 r90375 1 2011-07-04 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r90373. 4 http://trac.webkit.org/changeset/90373 5 https://bugs.webkit.org/show_bug.cgi?id=63917 6 7 Breaks Qt Linux Release minimal (Requested by vsevik on 8 #webkit). 9 10 * http/tests/inspector/network/network-content-replacement-embed-expected.txt: Removed. 11 * http/tests/inspector/network/network-content-replacement-embed.html: Removed. 12 * http/tests/inspector/network/network-content-replacement-xhr-expected.txt: Removed. 13 * http/tests/inspector/network/network-content-replacement-xhr.html: Removed. 14 * http/tests/inspector/network/network-embed-expected.txt: Removed. 15 * http/tests/inspector/network/network-embed.html: Removed. 16 * http/tests/inspector/network/network-xhr-async-expected.txt: 17 * http/tests/inspector/network/network-xhr-async.html: 18 * http/tests/inspector/network/network-xhr-sync-expected.txt: 19 * http/tests/inspector/network/network-xhr-sync.html: 20 * http/tests/inspector/network/resources/cp1251.xml: Removed. 21 * http/tests/inspector/network/resources/plugin-data.php: Removed. 22 * http/tests/inspector/network/resources/resource.php: 23 * http/tests/inspector/network/resources/utf8.xml: Removed. 24 * platform/chromium/test_expectations.txt: 25 1 26 2011-07-04 Vsevolod Vlasov <vsevik@chromium.org> 2 27 -
trunk/LayoutTests/http/tests/inspector/network/network-xhr-async-expected.txt
r90373 r90375 1 CONSOLE MESSAGE: line 21: Done.1 CONSOLE MESSAGE: line 13: Done. 2 2 Tests XHR network resource type and content for asynchronous requests. Bug 61205 3 3 -
trunk/LayoutTests/http/tests/inspector/network/network-xhr-async.html
r90373 r90375 6 6 function loadData() 7 7 { 8 if (!window.internals) {9 console.log("This test can not be run as window.internals is not available.");10 return;11 }12 // Since this test could be run together with other inspector backend cache13 // tests, we need to reset size limits to default ones.14 internals.setInspectorResourcesDataSizeLimits(document, 10 * 1000 * 1000, 1000 * 1000);15 16 8 doXHR("GET", "resources/resource.php", true, resourceLoaded); 17 9 } -
trunk/LayoutTests/http/tests/inspector/network/network-xhr-sync-expected.txt
r90373 r90375 1 CONSOLE MESSAGE: line 21: Done.1 CONSOLE MESSAGE: line 13: Done. 2 2 Tests XHR network resource type and content for synchronous requests. Bug 61205 3 3 -
trunk/LayoutTests/http/tests/inspector/network/network-xhr-sync.html
r90373 r90375 6 6 function loadData() 7 7 { 8 if (!window.internals) {9 console.log("This test can not be run as window.internals is not available.");10 return;11 }12 // Since this test could be run together with other inspector backend cache13 // tests, we need to reset size limits to default ones.14 internals.setInspectorResourcesDataSizeLimits(document, 10 * 1000 * 1000, 1000 * 1000);15 16 8 doXHR("GET", "resources/resource.php", false, resourceLoaded); 17 9 } -
trunk/LayoutTests/http/tests/inspector/network/resources/resource.php
r90373 r90375 27 27 header("Content-Type: image/png"); 28 28 else 29 header("Content-Type: text/ plain");29 header("Content-Type: text/html"); 30 30 31 31 # Flush headers and sleep bofore sending response -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r90373 r90375 656 656 WONTFIX SKIP : http/tests/inspector/extensions-headers.html = FAIL 657 657 WONTFIX SKIP : http/tests/inspector/extensions-resources-redirect.html = FAIL 658 659 // There is no enough plugins support in DRT660 WONTFIX SKIP : http/tests/inspector/network/network-embed.html = FAIL661 WONTFIX SKIP : http/tests/inspector/network/network-content-replacement-embed.html = FAIL662 658 663 659 // Inspector tests in Debug build are very slow. -
trunk/Source/WebCore/ChangeLog
r90373 r90375 1 2011-07-04 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r90373. 4 http://trac.webkit.org/changeset/90373 5 https://bugs.webkit.org/show_bug.cgi?id=63917 6 7 Breaks Qt Linux Release minimal (Requested by vsevik on 8 #webkit). 9 10 * WebCore.exp.in: 11 * inspector/InspectorController.cpp: 12 * inspector/InspectorController.h: 13 * inspector/InspectorInstrumentation.cpp: 14 (WebCore::InspectorInstrumentation::didReceiveContentLengthImpl): 15 * inspector/InspectorInstrumentation.h: 16 (WebCore::InspectorInstrumentation::didReceiveContentLength): 17 * inspector/InspectorResourceAgent.cpp: 18 (WebCore::InspectorResourceAgent::didReceiveResponse): 19 (WebCore::InspectorResourceAgent::didReceiveContentLength): 20 (WebCore::InspectorResourceAgent::didFinishLoading): 21 (WebCore::InspectorResourceAgent::setInitialXHRContent): 22 (WebCore::InspectorResourceAgent::getResourceContent): 23 * inspector/InspectorResourceAgent.h: 24 * inspector/NetworkResourcesData.cpp: 25 (WebCore::NetworkResourcesData::ResourceData::ResourceData): 26 (WebCore::NetworkResourcesData::ResourceData::content): 27 (WebCore::NetworkResourcesData::ResourceData::appendContent): 28 (WebCore::NetworkResourcesData::ResourceData::purgeContent): 29 (WebCore::NetworkResourcesData::NetworkResourcesData): 30 (WebCore::NetworkResourcesData::responseReceived): 31 (WebCore::NetworkResourcesData::addResourceContent): 32 (WebCore::NetworkResourcesData::data): 33 (WebCore::NetworkResourcesData::clear): 34 (WebCore::NetworkResourcesData::ensureNoDataForIdentifier): 35 (WebCore::NetworkResourcesData::ensureFreeSpace): 36 * inspector/NetworkResourcesData.h: 37 (WebCore::NetworkResourcesData::ResourceData::hasContent): 38 (WebCore::NetworkResourcesData::ResourceData::setIsContentPurged): 39 (WebCore::NetworkResourcesData::ResourceData::textEncodingName): 40 (WebCore::NetworkResourcesData::ResourceData::setTextEncodingName): 41 * inspector/front-end/Resource.js: 42 * inspector/front-end/ResourcePreviewView.js: 43 (WebInspector.ResourcePreviewView.prototype.contentLoaded): 44 (WebInspector.ResourcePreviewView.prototype._createInnerView): 45 * inspector/front-end/ResourceView.js: 46 (WebInspector.ResourceView.hasTextContent): 47 * loader/DocumentThreadableLoader.cpp: 48 (WebCore::DocumentThreadableLoader::didReceiveData): 49 * loader/FrameLoader.cpp: 50 (WebCore::FrameLoader::willLoadMediaElementURL): 51 (WebCore::FrameLoader::commitProvisionalLoad): 52 (WebCore::FrameLoader::loadResourceSynchronously): 53 (WebCore::FrameLoader::loadedResourceFromMemoryCache): 54 * loader/ResourceLoadNotifier.cpp: 55 (WebCore::ResourceLoadNotifier::didReceiveData): 56 (WebCore::ResourceLoadNotifier::dispatchDidReceiveContentLength): 57 (WebCore::ResourceLoadNotifier::sendRemainingDelegateMessages): 58 * loader/ResourceLoadNotifier.h: 59 * loader/appcache/ApplicationCacheGroup.cpp: 60 (WebCore::ApplicationCacheGroup::didReceiveData): 61 * testing/Internals.cpp: 62 * testing/Internals.h: 63 * testing/Internals.idl: 64 1 65 2011-07-04 Vsevolod Vlasov <vsevik@chromium.org> 2 66 -
trunk/Source/WebCore/WebCore.exp.in
r90373 r90375 1302 1302 __ZNK7WebCore8Document31displayStringModifiedByEncodingERKN3WTF6StringE 1303 1303 __ZNK7WebCore8Document4bodyEv 1304 __ZNK7WebCore8Document4pageEv1305 1304 __ZNK7WebCore8Document6domainEv 1306 1305 __ZNK7WebCore8Document6loaderEv … … 1583 1582 __ZN7WebCore19InspectorController26stopUserInitiatedProfilingEv 1584 1583 __ZN7WebCore19InspectorController27startUserInitiatedProfilingEv 1585 __ZN7WebCore19InspectorController39setResourcesDataSizeLimitsFromInternalsEii1586 1584 __ZN7WebCore19InspectorController4showEv 1587 1585 __ZN7WebCore19InspectorController5closeEv -
trunk/Source/WebCore/inspector/InspectorController.cpp
r90373 r90375 490 490 #endif 491 491 492 void InspectorController::setResourcesDataSizeLimitsFromInternals(int maximumResourcesContentSize, int maximumSingleResourceContentSize)493 {494 m_resourceAgent->setResourcesDataSizeLimitsFromInternals(maximumResourcesContentSize, maximumSingleResourceContentSize);495 }496 497 492 } // namespace WebCore 498 493 -
trunk/Source/WebCore/inspector/InspectorController.h
r90373 r90375 121 121 #endif 122 122 123 void setResourcesDataSizeLimitsFromInternals(int maximumResourcesContentSize, int maximumSingleResourceContentSize);124 125 123 private: 126 124 friend class PostWorkerNotificationToFrontendTask; -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r90373 r90375 493 493 } 494 494 495 void InspectorInstrumentation::didReceive DataImpl(InstrumentingAgents* instrumentingAgents, unsigned long identifier, const char* data, int dataLength, int encodedDataLength)496 { 497 if (InspectorResourceAgent* resourceAgent = instrumentingAgents->inspectorResourceAgent()) 498 resourceAgent->didReceive Data(identifier, data, dataLength, encodedDataLength);495 void InspectorInstrumentation::didReceiveContentLengthImpl(InstrumentingAgents* instrumentingAgents, unsigned long identifier, int dataLength, int encodedDataLength) 496 { 497 if (InspectorResourceAgent* resourceAgent = instrumentingAgents->inspectorResourceAgent()) 498 resourceAgent->didReceiveContentLength(identifier, dataLength, encodedDataLength); 499 499 } 500 500 -
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
r90373 r90375 127 127 static void continueWithPolicyDownload(Frame*, DocumentLoader*, unsigned long identifier, const ResourceResponse&); 128 128 static void continueWithPolicyIgnore(Frame*, DocumentLoader*, unsigned long identifier, const ResourceResponse&); 129 static void didReceive Data(Frame*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);129 static void didReceiveContentLength(Frame*, unsigned long identifier, int dataLength, int encodedDataLength); 130 130 static void didFinishLoading(Frame*, DocumentLoader*, unsigned long identifier, double finishTime); 131 131 static void didFailLoading(Frame*, DocumentLoader*, unsigned long identifier, const ResourceError&); … … 255 255 static void continueWithPolicyDownloadImpl(Frame*, DocumentLoader*, unsigned long identifier, const ResourceResponse&); 256 256 static void continueWithPolicyIgnoreImpl(Frame*, DocumentLoader*, unsigned long identifier, const ResourceResponse&); 257 static void didReceive DataImpl(InstrumentingAgents*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);257 static void didReceiveContentLengthImpl(InstrumentingAgents*, unsigned long identifier, int dataLength, int encodedDataLength); 258 258 static void didFinishLoadingImpl(InstrumentingAgents*, unsigned long identifier, DocumentLoader*, double finishTime); 259 259 static void didFailLoadingImpl(InstrumentingAgents*, unsigned long identifier, DocumentLoader*, const ResourceError&); … … 765 765 } 766 766 767 inline void InspectorInstrumentation::didReceive Data(Frame* frame, unsigned long identifier, const char* data, int dataLength, int encodedDataLength)768 { 769 #if ENABLE(INSPECTOR) 770 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame)) 771 didReceive DataImpl(instrumentingAgents, identifier, data, dataLength, encodedDataLength);767 inline void InspectorInstrumentation::didReceiveContentLength(Frame* frame, unsigned long identifier, int dataLength, int encodedDataLength) 768 { 769 #if ENABLE(INSPECTOR) 770 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame)) 771 didReceiveContentLengthImpl(instrumentingAgents, identifier, dataLength, encodedDataLength); 772 772 #endif 773 773 } -
trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp
r90373 r90375 252 252 type = InspectorPageAgent::XHRResource; 253 253 254 m_resourcesData->responseReceived(identifier, m_pageAgent->frameId(loader->frame()), response );254 m_resourcesData->responseReceived(identifier, m_pageAgent->frameId(loader->frame()), response.url()); 255 255 } 256 256 m_resourcesData->setResourceType(identifier, type); 257 257 m_frontend->responseReceived(static_cast<int>(identifier), currentTime(), InspectorPageAgent::resourceTypeString(type), resourceResponse); 258 258 // If we revalidated the resource and got Not modified, send content length following didReceiveResponse 259 // as there will be no calls to didReceive Datafrom the network stack.259 // as there will be no calls to didReceiveContentLength from the network stack. 260 260 if (cachedResourceSize && response.httpStatusCode() == 304) 261 didReceiveData(identifier, 0, cachedResourceSize, 0); 262 } 263 264 void InspectorResourceAgent::didReceiveData(unsigned long identifier, const char* data, int dataLength, int encodedDataLength) 265 { 266 if (data && m_resourcesData->resourceType(identifier) == InspectorPageAgent::OtherResource) 267 m_resourcesData->maybeAddResourceData(identifier, data, dataLength); 268 261 didReceiveContentLength(identifier, cachedResourceSize, 0); 262 } 263 264 void InspectorResourceAgent::didReceiveContentLength(unsigned long identifier, int dataLength, int encodedDataLength) 265 { 269 266 m_frontend->dataReceived(static_cast<int>(identifier), currentTime(), dataLength, encodedDataLength); 270 267 } … … 275 272 m_resourcesData->addResourceSharedBuffer(identifier, loader->frameLoader()->documentLoader()->mainResourceData(), loader->frame()->document()->inputEncoding()); 276 273 277 m_resourcesData->maybeDecodeDataToContent(identifier);278 279 274 if (!finishTime) 280 275 finishTime = currentTime(); … … 303 298 void InspectorResourceAgent::setInitialXHRContent(unsigned long identifier, const String& sourceString) 304 299 { 305 m_resourcesData-> setResourceContent(identifier, sourceString);300 m_resourcesData->addResourceContent(identifier, sourceString); 306 301 } 307 302 … … 404 399 } 405 400 406 // called from Internals for layout test purposes.407 void InspectorResourceAgent::setResourcesDataSizeLimitsFromInternals(int maximumResourcesContentSize, int maximumSingleResourceContentSize)408 {409 m_resourcesData->setResourcesDataSizeLimits(maximumResourcesContentSize, maximumSingleResourceContentSize);410 }411 412 401 void InspectorResourceAgent::enable(ErrorString*) 413 402 { … … 449 438 void InspectorResourceAgent::getResourceContent(ErrorString* errorString, unsigned long identifier, String* content, bool* base64Encoded) 450 439 { 451 NetworkResourcesData::ResourceData const* resourceData = m_resourcesData->data(identifier);440 NetworkResourcesData::ResourceData* resourceData = m_resourcesData->data(identifier); 452 441 if (!resourceData) { 453 442 *errorString = "No resource with given identifier found"; -
trunk/Source/WebCore/inspector/InspectorResourceAgent.h
r90373 r90375 91 91 void markResourceAsCached(unsigned long identifier); 92 92 void didReceiveResponse(unsigned long identifier, DocumentLoader* laoder, const ResourceResponse&); 93 void didReceive Data(unsigned long identifier, const char* data, int dataLength, int encodedDataLength);93 void didReceiveContentLength(unsigned long identifier, int dataLength, int encodedDataLength); 94 94 void didFinishLoading(unsigned long identifier, DocumentLoader*, double finishTime); 95 95 void didFailLoading(unsigned long identifier, DocumentLoader*, const ResourceError&); … … 113 113 void isBackgroundEventsCollectionEnabled(ErrorString*, bool* enabled); 114 114 void setBackgroundEventsCollectionEnabled(ErrorString*, bool enabled); 115 116 // called from Internals for layout test purposes.117 void setResourcesDataSizeLimitsFromInternals(int maximumResourcesContentSize, int maximumSingleResourceContentSize);118 115 119 116 // Called from frontend -
trunk/Source/WebCore/inspector/NetworkResourcesData.cpp
r90373 r90375 30 30 #include "NetworkResourcesData.h" 31 31 32 #include "DOMImplementation.h"33 #include "SharedBuffer.h"34 #include "TextResourceDecoder.h"35 36 32 #if ENABLE(INSPECTOR) 37 33 … … 39 35 // 10MB 40 36 static int maximumResourcesContentSize = 10 * 1000 * 1000; 41 42 // 1MB43 static int maximumSingleResourceContentSize = 1000 * 1000;44 37 } 45 38 46 39 namespace WebCore { 47 48 40 49 41 // ResourceData … … 51 43 : m_identifier(identifier) 52 44 , m_loaderId(loaderId) 45 , m_hasContent(false) 53 46 , m_isContentPurged(false) 54 47 , m_type(InspectorPageAgent::OtherResource) … … 56 49 } 57 50 58 void NetworkResourcesData::ResourceData::setContent(const String& content)51 String NetworkResourcesData::ResourceData::content() 59 52 { 60 ASSERT(!hasData()); 61 ASSERT(!hasContent()); 62 m_content = content; 53 return m_hasContent ? m_contentBuilder.toString() : String(); 54 } 55 56 void NetworkResourcesData::ResourceData::appendContent(const String& content) 57 { 58 m_contentBuilder.append(content); 59 m_hasContent = true; 63 60 } 64 61 65 62 unsigned NetworkResourcesData::ResourceData::purgeContent() 66 63 { 67 unsigned result = 0; 68 if (hasData()) { 69 ASSERT(!hasContent()); 70 result = m_dataBuffer->size(); 71 m_dataBuffer = nullptr; 72 } 73 74 if (hasContent()) { 75 ASSERT(!hasData()); 76 result = 2 * m_content.length(); 77 m_content = String(); 78 } 64 unsigned length = m_contentBuilder.toStringPreserveCapacity().length(); 65 m_contentBuilder.clear(); 79 66 m_isContentPurged = true; 80 return result; 81 } 82 83 void NetworkResourcesData::ResourceData::createDecoder(const String& mimeType, const String& textEncodingName) 84 { 85 if (!textEncodingName.isEmpty()) 86 m_decoder = TextResourceDecoder::create("text/plain", textEncodingName); 87 else if (mimeType == "text/plain") 88 m_decoder = TextResourceDecoder::create("text/plain", "ISO-8859-1"); 89 else if (mimeType == "text/html") 90 m_decoder = TextResourceDecoder::create("text/html", "UTF-8"); 91 else if (DOMImplementation::isXMLMIMEType(mimeType)) { 92 m_decoder = TextResourceDecoder::create("application/xml"); 93 m_decoder->useLenientXMLDecoding(); 94 } 95 } 96 97 int NetworkResourcesData::ResourceData::dataLength() const 98 { 99 return m_dataBuffer ? m_dataBuffer->size() : 0; 100 } 101 102 void NetworkResourcesData::ResourceData::appendData(const char* data, int dataLength) 103 { 104 ASSERT(!hasContent()); 105 if (!m_dataBuffer) 106 m_dataBuffer = SharedBuffer::create(data, dataLength); 107 else 108 m_dataBuffer->append(data, dataLength); 109 } 110 111 int NetworkResourcesData::ResourceData::decodeDataToContent() 112 { 113 ASSERT(!hasContent()); 114 int dataLength = m_dataBuffer->size(); 115 m_content = m_decoder->decode(m_dataBuffer->data(), m_dataBuffer->size()); 116 m_dataBuffer = nullptr; 117 return 2 * m_content.length() - dataLength; 67 m_hasContent = false; 68 return length; 118 69 } 119 70 … … 121 72 NetworkResourcesData::NetworkResourcesData() 122 73 : m_contentSize(0) 123 , m_maximumResourcesContentSize(maximumResourcesContentSize)124 , m_maximumSingleResourceContentSize(maximumSingleResourceContentSize)125 74 { 126 75 } … … 137 86 } 138 87 139 void NetworkResourcesData::responseReceived(unsigned long identifier, const String& frameId, const ResourceResponse& response)88 void NetworkResourcesData::responseReceived(unsigned long identifier, const String& frameId, const String& url) 140 89 { 141 90 ResourceData* resourceData = m_identifierToResourceDataMap.get(identifier); … … 143 92 return; 144 93 resourceData->setFrameId(frameId); 145 resourceData->setUrl(response.url()); 146 resourceData->createDecoder(response.mimeType(), response.textEncodingName()); 94 resourceData->setUrl(url); 147 95 } 148 96 … … 163 111 } 164 112 165 void NetworkResourcesData:: setResourceContent(unsigned long identifier, const String& content)113 void NetworkResourcesData::addResourceContent(unsigned long identifier, const String& content) 166 114 { 167 115 ResourceData* resourceData = m_identifierToResourceDataMap.get(identifier); 168 116 if (!resourceData) 169 117 return; 170 int dataLength = 2 * content.length();171 if (dataLength > m_maximumSingleResourceContentSize)172 return;173 118 if (resourceData->isContentPurged()) 174 119 return; 175 if (ensureFreeSpace(dataLength) && !resourceData->isContentPurged()) { 176 m_identifiersDeque.append(identifier); 177 resourceData->setContent(content); 178 m_contentSize += dataLength; 120 if (ensureFreeSpace(content.length()) && !resourceData->isContentPurged()) { 121 if (!resourceData->hasContent()) 122 m_identifiersDeque.append(identifier); 123 resourceData->appendContent(content); 124 m_contentSize += content.length(); 179 125 } 180 }181 182 void NetworkResourcesData::maybeAddResourceData(unsigned long identifier, const char* data, int dataLength)183 {184 ResourceData* resourceData = m_identifierToResourceDataMap.get(identifier);185 if (!resourceData)186 return;187 if (!resourceData->decoder())188 return;189 if (resourceData->dataLength() + dataLength > m_maximumSingleResourceContentSize)190 m_contentSize -= resourceData->purgeContent();191 if (resourceData->isContentPurged())192 return;193 if (ensureFreeSpace(dataLength) && !resourceData->isContentPurged()) {194 m_identifiersDeque.append(identifier);195 resourceData->appendData(data, dataLength);196 m_contentSize += dataLength;197 }198 }199 200 void NetworkResourcesData::maybeDecodeDataToContent(unsigned long identifier)201 {202 ResourceData* resourceData = m_identifierToResourceDataMap.get(identifier);203 if (!resourceData)204 return;205 if (!resourceData->hasData())206 return;207 m_contentSize += resourceData->decodeDataToContent();208 int dataLength = 2 * resourceData->content().length();209 if (dataLength > m_maximumSingleResourceContentSize)210 m_contentSize -= resourceData->purgeContent();211 126 } 212 127 … … 229 144 } 230 145 231 NetworkResourcesData::ResourceData const* NetworkResourcesData::data(unsigned long identifier)146 NetworkResourcesData::ResourceData* NetworkResourcesData::data(unsigned long identifier) 232 147 { 233 148 return m_identifierToResourceDataMap.get(identifier); … … 237 152 { 238 153 m_identifiersDeque.clear(); 239 m_contentSize = 0;240 154 241 155 ResourceDataMap preservedMap; … … 253 167 } 254 168 255 void NetworkResourcesData::setResourcesDataSizeLimits(int maximumResourcesContentSize, int maximumSingleResourceContentSize)256 {257 clear();258 m_maximumResourcesContentSize = maximumResourcesContentSize;259 m_maximumSingleResourceContentSize = maximumSingleResourceContentSize;260 }261 262 263 169 void NetworkResourcesData::ensureNoDataForIdentifier(unsigned long identifier) 264 170 { 265 171 ResourceData* resourceData = m_identifierToResourceDataMap.get(identifier); 266 172 if (resourceData) { 267 if (resourceData->hasContent() || resourceData->hasData())173 if (resourceData->hasContent()) 268 174 m_contentSize -= resourceData->purgeContent(); 269 175 delete resourceData; … … 274 180 bool NetworkResourcesData::ensureFreeSpace(int size) 275 181 { 276 if (size > m _maximumResourcesContentSize)182 if (size > maximumResourcesContentSize) 277 183 return false; 278 184 279 while (size > m _maximumResourcesContentSize - m_contentSize) {185 while (size > maximumResourcesContentSize - m_contentSize) { 280 186 unsigned long identifier = m_identifiersDeque.takeFirst(); 281 187 ResourceData* resourceData = m_identifierToResourceDataMap.get(identifier); -
trunk/Source/WebCore/inspector/NetworkResourcesData.h
r90373 r90375 32 32 #include "CachedResourceHandle.h" 33 33 #include "InspectorPageAgent.h" 34 #include "SharedBuffer.h" 34 35 35 36 #include <wtf/Deque.h> … … 43 44 namespace WebCore { 44 45 46 class SharedBuffer; 45 47 class CachedResource; 46 class SharedBuffer;47 class TextResourceDecoder;48 48 49 49 class NetworkResourcesData { 50 50 public: 51 51 class ResourceData { 52 friend class NetworkResourcesData;53 52 public: 54 53 ResourceData(unsigned long identifier, const String& loaderId); … … 63 62 void setUrl(const String& url) { m_url = url; } 64 63 65 bool hasContent() const { return !m_content.isNull(); }66 String content() const { return m_content; }67 void setContent(const String&);64 bool hasContent() const { return m_hasContent; } 65 String content(); 66 void appendContent(const String&); 68 67 69 68 bool isContentPurged() const { return m_isContentPurged; } 69 void setIsContentPurged(bool isContentPurged) { m_isContentPurged = isContentPurged; } 70 70 unsigned purgeContent(); 71 71 … … 73 73 void setType(InspectorPageAgent::ResourceType type) { m_type = type; } 74 74 75 PassRefPtr<SharedBuffer> buffer() const { return m_buffer; } 76 void setBuffer(PassRefPtr<SharedBuffer> buffer) { m_buffer = buffer; } 77 75 78 String textEncodingName() const { return m_textEncodingName; } 76 79 void setTextEncodingName(const String& textEncodingName) { m_textEncodingName = textEncodingName; } 77 78 TextResourceDecoder* decoder() const { return m_decoder.get(); }79 void createDecoder(const String& mimeType, const String& textEncodingName);80 81 PassRefPtr<SharedBuffer> buffer() const { return m_buffer; }82 void setBuffer(PassRefPtr<SharedBuffer> buffer) { m_buffer = buffer; }83 80 84 81 CachedResource* cachedResource() const { return m_cachedResource.get(); } … … 86 83 87 84 private: 88 bool hasData() const { return m_dataBuffer; }89 int dataLength() const;90 void appendData(const char* data, int dataLength);91 int decodeDataToContent();92 93 85 unsigned long m_identifier; 94 86 String m_loaderId; 95 87 String m_frameId; 96 88 String m_url; 97 String m_content;98 RefPtr<SharedBuffer> m_dataBuffer;89 bool m_hasContent; 90 StringBuilder m_contentBuilder; 99 91 bool m_isContentPurged; 100 92 InspectorPageAgent::ResourceType m_type; 101 93 94 RefPtr<SharedBuffer> m_buffer; 102 95 String m_textEncodingName; 103 RefPtr<TextResourceDecoder> m_decoder;104 105 RefPtr<SharedBuffer> m_buffer;106 96 CachedResourceHandle<CachedResource> m_cachedResource; 107 97 }; … … 112 102 113 103 void resourceCreated(unsigned long identifier, const String& loaderId); 114 void responseReceived(unsigned long identifier, const String& frameId, const ResourceResponse&);104 void responseReceived(unsigned long identifier, const String& frameId, const String& url); 115 105 void setResourceType(unsigned long identifier, InspectorPageAgent::ResourceType); 116 106 InspectorPageAgent::ResourceType resourceType(unsigned long identifier); 117 void setResourceContent(unsigned long identifier, const String& content); 118 void maybeAddResourceData(unsigned long identifier, const char* data, int dataLength); 119 void maybeDecodeDataToContent(unsigned long identifier); 107 void addResourceContent(unsigned long identifier, const String& content); 120 108 void addCachedResource(unsigned long identifier, CachedResource*); 121 109 void addResourceSharedBuffer(unsigned long identifier, PassRefPtr<SharedBuffer>, const String& textEncodingName); 122 ResourceData const* data(unsigned long identifier);110 ResourceData* data(unsigned long identifier); 123 111 void clear(const String& preservedLoaderId = String()); 124 125 void setResourcesDataSizeLimits(int maximumResourcesContentSize, int maximumSingleResourceContentSize);126 112 127 113 private: … … 134 120 ResourceDataMap m_identifierToResourceDataMap; 135 121 int m_contentSize; 136 int m_maximumResourcesContentSize;137 int m_maximumSingleResourceContentSize;138 122 }; 139 123 -
trunk/Source/WebCore/inspector/front-end/Resource.js
r90373 r90375 783 783 }, 784 784 785 get contentEncoded()786 {787 return this._contentEncoded;788 },789 790 785 get contentTimestamp() 791 786 { -
trunk/Source/WebCore/inspector/front-end/ResourcePreviewView.js
r90373 r90375 40 40 if (!this.resource.content) { 41 41 if (!this._emptyView) { 42 this._emptyView = this._createEmptyView();42 this._emptyView = new WebInspector.EmptyView(WebInspector.UIString("This request has no preview available.")); 43 43 this._emptyView.show(this.element); 44 44 } … … 48 48 delete this._emptyView; 49 49 } 50 if (!this._ previewView)51 this._ previewView = this._createPreviewView();52 this._ previewView.show(this.element);50 if (!this._view) 51 this._view = this._createInnerView(); 52 this._view.show(this.element); 53 53 } 54 54 }, 55 55 56 _createEmptyView: function() 57 { 58 return new WebInspector.EmptyView(WebInspector.UIString("This request has no preview available.")); 59 }, 60 61 _createPreviewView: function() 56 _createInnerView: function() 62 57 { 63 58 if (this.resource.hasErrorStatusCode() && this.resource.content) … … 72 67 if (this._responseView.sourceView) 73 68 return this._responseView.sourceView; 74 75 if (this.resource.category === WebInspector.resourceCategories.other)76 return this._createEmptyView();77 69 78 70 return WebInspector.ResourceView.nonSourceViewForResource(this.resource); -
trunk/Source/WebCore/inspector/front-end/ResourceView.js
r90373 r90375 52 52 case WebInspector.resourceCategories.stylesheets: 53 53 return true; 54 case WebInspector.resourceCategories.other:55 return resource.content && !resource.contentEncoded;56 54 default: 57 55 return false; -
trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp
r90373 r90375 230 230 #if ENABLE(INSPECTOR) 231 231 if (m_preflightRequestIdentifier) 232 InspectorInstrumentation::didReceive Data(m_document->frame(), m_preflightRequestIdentifier, 0, 0, dataLength);232 InspectorInstrumentation::didReceiveContentLength(m_document->frame(), m_preflightRequestIdentifier, 0, dataLength); 233 233 #endif 234 234 -
trunk/Source/WebCore/loader/FrameLoader.cpp
r90373 r90375 1383 1383 ResourceError error; 1384 1384 requestFromDelegate(request, identifier, error); 1385 notifier()->sendRemainingDelegateMessages(m_documentLoader.get(), identifier, ResourceResponse(url, String(), -1, String(), String()), 0,-1, -1, error);1385 notifier()->sendRemainingDelegateMessages(m_documentLoader.get(), identifier, ResourceResponse(url, String(), -1, String(), String()), -1, -1, error); 1386 1386 1387 1387 url = request.url(); … … 1781 1781 // However, with today's computers and networking speeds, this won't happen in practice. 1782 1782 // Could be an issue with a giant local file. 1783 notifier()->sendRemainingDelegateMessages(m_documentLoader.get(), identifier, response, 0,static_cast<int>(response.expectedContentLength()), 0, error);1783 notifier()->sendRemainingDelegateMessages(m_documentLoader.get(), identifier, response, static_cast<int>(response.expectedContentLength()), 0, error); 1784 1784 } 1785 1785 … … 2591 2591 } 2592 2592 int encodedDataLength = response.resourceLoadInfo() ? static_cast<int>(response.resourceLoadInfo()->encodedDataLength) : -1; 2593 notifier()->sendRemainingDelegateMessages(m_documentLoader.get(), identifier, response, data. data(), data.size(), encodedDataLength, error);2593 notifier()->sendRemainingDelegateMessages(m_documentLoader.get(), identifier, response, data.size(), encodedDataLength, error); 2594 2594 return identifier; 2595 2595 } … … 2884 2884 requestFromDelegate(request, identifier, error); 2885 2885 InspectorInstrumentation::markResourceAsCached(page, identifier); 2886 notifier()->sendRemainingDelegateMessages(m_documentLoader.get(), identifier, resource->response(), 0,resource->encodedSize(), 0, error);2886 notifier()->sendRemainingDelegateMessages(m_documentLoader.get(), identifier, resource->response(), resource->encodedSize(), 0, error); 2887 2887 } 2888 2888 -
trunk/Source/WebCore/loader/ResourceLoadNotifier.cpp
r90373 r90375 80 80 page->progress()->incrementProgress(loader->identifier(), data, dataLength); 81 81 82 dispatchDidReceive Data(loader->documentLoader(), loader->identifier(), data, dataLength, encodedDataLength);82 dispatchDidReceiveContentLength(loader->documentLoader(), loader->identifier(), dataLength, encodedDataLength); 83 83 } 84 84 … … 131 131 } 132 132 133 void ResourceLoadNotifier::dispatchDidReceive Data(DocumentLoader* loader, unsigned long identifier, const char* data, int dataLength, int encodedDataLength)133 void ResourceLoadNotifier::dispatchDidReceiveContentLength(DocumentLoader* loader, unsigned long identifier, int dataLength, int encodedDataLength) 134 134 { 135 135 m_frame->loader()->client()->dispatchDidReceiveContentLength(loader, identifier, dataLength); 136 136 137 InspectorInstrumentation::didReceive Data(m_frame, identifier, data, dataLength, encodedDataLength);137 InspectorInstrumentation::didReceiveContentLength(m_frame, identifier, dataLength, encodedDataLength); 138 138 } 139 139 … … 153 153 } 154 154 155 void ResourceLoadNotifier::sendRemainingDelegateMessages(DocumentLoader* loader, unsigned long identifier, const ResourceResponse& response, const char* data,int dataLength, int encodedDataLength, const ResourceError& error)155 void ResourceLoadNotifier::sendRemainingDelegateMessages(DocumentLoader* loader, unsigned long identifier, const ResourceResponse& response, int dataLength, int encodedDataLength, const ResourceError& error) 156 156 { 157 157 if (!response.isNull()) … … 159 159 160 160 if (dataLength > 0) 161 dispatchDidReceive Data(loader, identifier, data, dataLength, encodedDataLength);161 dispatchDidReceiveContentLength(loader, identifier, dataLength, encodedDataLength); 162 162 163 163 if (error.isNull()) -
trunk/Source/WebCore/loader/ResourceLoadNotifier.h
r90373 r90375 61 61 void dispatchWillSendRequest(DocumentLoader*, unsigned long identifier, ResourceRequest&, const ResourceResponse& redirectResponse); 62 62 void dispatchDidReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse&); 63 void dispatchDidReceive Data(DocumentLoader*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);63 void dispatchDidReceiveContentLength(DocumentLoader*, unsigned long identifier, int dataLength, int encodedDataLength); 64 64 void dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier, double finishTime); 65 65 void dispatchTransferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, Page*); 66 66 67 void sendRemainingDelegateMessages(DocumentLoader*, unsigned long identifier, const ResourceResponse&, const char* data,int dataLength, int encodedDataLength, const ResourceError&);67 void sendRemainingDelegateMessages(DocumentLoader*, unsigned long identifier, const ResourceResponse&, int dataLength, int encodedDataLength, const ResourceError&); 68 68 69 69 private: -
trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp
r90373 r90375 572 572 573 573 #if ENABLE(INSPECTOR) 574 InspectorInstrumentation::didReceive Data(m_frame, m_currentResourceIdentifier, 0, length, 0);574 InspectorInstrumentation::didReceiveContentLength(m_frame, m_currentResourceIdentifier, length, 0); 575 575 #endif 576 576 -
trunk/Source/WebCore/testing/Internals.cpp
r90373 r90375 31 31 #include "Element.h" 32 32 #include "ExceptionCode.h" 33 #include "InspectorController.h"34 #include "Page.h"35 33 #include "RenderTreeAsText.h" 36 34 #include "ShadowContentElement.h" … … 126 124 } 127 125 128 #if ENABLE(INSPECTOR)129 void Internals::setInspectorResourcesDataSizeLimits(Document* document, int maximumResourcesContentSize, int maximumSingleResourceContentSize, ExceptionCode& ec)130 {131 if (!document || !document->page() || !document->page()->inspectorController()) {132 ec = INVALID_ACCESS_ERR;133 return;134 }135 document->page()->inspectorController()->setResourcesDataSizeLimitsFromInternals(maximumResourcesContentSize, maximumSingleResourceContentSize);136 126 } 137 #endif138 139 } -
trunk/Source/WebCore/testing/Internals.h
r90373 r90375 54 54 PassRefPtr<Element> createShadowContentElement(Document*, ExceptionCode&); 55 55 56 #if ENABLE(INSPECTOR)57 void setInspectorResourcesDataSizeLimits(Document*, int maximumResourcesContentSize, int maximumSingleResourceContentSize, ExceptionCode&);58 #endif59 60 56 private: 61 57 Internals(); -
trunk/Source/WebCore/testing/Internals.idl
r90373 r90375 36 36 DOMString shadowPseudoId(in Element element) raises (DOMException); 37 37 Element createShadowContentElement(in Document document) raises(DOMException); 38 39 void setInspectorResourcesDataSizeLimits(in Document document, in long maximumResourcesContentSize, in long maximumSingleResourceContentSize) raises(DOMException);40 38 }; 41 39 } -
trunk/Source/WebKit2/ChangeLog
r90373 r90375 1 2011-07-04 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r90373. 4 http://trac.webkit.org/changeset/90373 5 https://bugs.webkit.org/show_bug.cgi?id=63917 6 7 Breaks Qt Linux Release minimal (Requested by vsevik on 8 #webkit). 9 10 * win/WebKit2.def: 11 * win/WebKit2CFLite.def: 12 1 13 2011-07-04 Vsevolod Vlasov <vsevik@chromium.org> 2 14 -
trunk/Source/WebKit2/win/WebKit2.def
r90373 r90375 145 145 ?isPreloaded@CachedResourceLoader@WebCore@@QBE_NABVString@WTF@@@Z 146 146 ?jsStringSlowCase@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@AAV?$HashMap@PAVStringImpl@WTF@@V?$Weak@VJSString@JSC@@@JSC@@UStringHash@2@U?$HashTraits@PAVStringImpl@WTF@@@2@U?$HashTraits@V?$Weak@VJSString@JSC@@@JSC@@@2@@WTF@@PAVStringImpl@6@@Z 147 ?page@Document@WebCore@@QBEPAVPage@2@XZ148 147 ?removeShadowRoot@Element@WebCore@@QAEXXZ 149 148 ?setDOMException@WebCore@@YAXPAVExecState@JSC@@H@Z 150 ?setResourcesDataSizeLimitsFromInternals@InspectorController@WebCore@@QAEXHH@Z151 149 ?shadowRoot@Element@WebCore@@QBEPAVShadowRoot@2@XZ 152 150 ?toDocument@WebCore@@YAPAVDocument@1@VJSValue@JSC@@@Z -
trunk/Source/WebKit2/win/WebKit2CFLite.def
r90373 r90375 138 138 ?isPreloaded@CachedResourceLoader@WebCore@@QBE_NABVString@WTF@@@Z 139 139 ?jsStringSlowCase@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@AAV?$HashMap@PAVStringImpl@WTF@@V?$Weak@VJSString@JSC@@@JSC@@UStringHash@2@U?$HashTraits@PAVStringImpl@WTF@@@2@U?$HashTraits@V?$Weak@VJSString@JSC@@@JSC@@@2@@WTF@@PAVStringImpl@6@@Z 140 ?page@Document@WebCore@@QBEPAVPage@2@XZ141 140 ?removeShadowRoot@Element@WebCore@@QAEXXZ 142 141 ?setDOMException@WebCore@@YAXPAVExecState@JSC@@H@Z 143 ?setResourcesDataSizeLimitsFromInternals@InspectorController@WebCore@@QAEXHH@Z144 142 ?shadowRoot@Element@WebCore@@QBEPAVShadowRoot@2@XZ 145 143 ?toDocument@WebCore@@YAPAVDocument@1@VJSValue@JSC@@@Z -
trunk/Source/autotools/symbols.filter
r90373 r90375 37 37 _ZN7WebCore16jsStringSlowCaseEPN3JSC9ExecStateERN3WTF7HashMapIPNS3_10StringImplENS0_4WeakINS0_8JSStringEEENS3_10StringHashENS3_10HashTraitsIS6_EENSB_IS9_EEEES6_; 38 38 _ZN7WebCore17cacheDOMStructureEPNS_17JSDOMGlobalObjectEPN3JSC9StructureEPKNS2_9ClassInfoE; 39 _ZN7WebCore19InspectorController39setResourcesDataSizeLimitsFromInternalsEii;40 39 _ZN7WebCore20ShadowContentElement6createEPNS_8DocumentE; 41 40 _ZN7WebCore21getCachedDOMStructureEPNS_17JSDOMGlobalObjectEPKN3JSC9ClassInfoE; … … 52 51 _ZNK7WebCore6JSNode21pushEventHandlerScopeEPN3JSC9ExecStateEPNS1_14ScopeChainNodeE; 53 52 _ZNK7WebCore7Element10shadowRootEv; 54 _ZNK7WebCore8Document4pageEv;55 53 local: 56 54 _Z*;
Note: See TracChangeset
for help on using the changeset viewer.