Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. |
| 3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com) | 3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com) |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 #include "core/fetch/Resource.h" | 33 #include "core/fetch/Resource.h" |
| 34 #include "core/fetch/ResourceLoaderHost.h" | 34 #include "core/fetch/ResourceLoaderHost.h" |
| 35 #include "core/fetch/ResourcePtr.h" | 35 #include "core/fetch/ResourcePtr.h" |
| 36 #include "platform/Logging.h" | 36 #include "platform/Logging.h" |
| 37 #include "platform/SharedBuffer.h" | 37 #include "platform/SharedBuffer.h" |
| 38 #include "platform/exported/WrappedResourceRequest.h" | 38 #include "platform/exported/WrappedResourceRequest.h" |
| 39 #include "platform/exported/WrappedResourceResponse.h" | 39 #include "platform/exported/WrappedResourceResponse.h" |
| 40 #include "platform/network/ResourceError.h" | 40 #include "platform/network/ResourceError.h" |
| 41 #include "public/platform/Platform.h" | 41 #include "public/platform/Platform.h" |
| 42 #include "public/platform/WebData.h" | 42 #include "public/platform/WebData.h" |
| 43 #include "public/platform/WebParserResourceBridge.h" | |
| 43 #include "public/platform/WebURLError.h" | 44 #include "public/platform/WebURLError.h" |
| 44 #include "public/platform/WebURLRequest.h" | 45 #include "public/platform/WebURLRequest.h" |
| 45 #include "public/platform/WebURLResponse.h" | 46 #include "public/platform/WebURLResponse.h" |
| 46 #include "wtf/Assertions.h" | 47 #include "wtf/Assertions.h" |
| 47 #include "wtf/CurrentTime.h" | 48 #include "wtf/CurrentTime.h" |
| 48 | 49 |
| 49 namespace WebCore { | 50 namespace WebCore { |
| 50 | 51 |
| 51 ResourceLoader::RequestCountTracker::RequestCountTracker(ResourceLoaderHost* hos t, Resource* resource) | 52 ResourceLoader::RequestCountTracker::RequestCountTracker(ResourceLoaderHost* hos t, Resource* resource) |
| 52 : m_host(host) | 53 : m_host(host) |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 m_defersLoading = defers; | 172 m_defersLoading = defers; |
| 172 if (m_loader) | 173 if (m_loader) |
| 173 m_loader->setDefersLoading(defers); | 174 m_loader->setDefersLoading(defers); |
| 174 if (!defers && !m_deferredRequest.isNull()) { | 175 if (!defers && !m_deferredRequest.isNull()) { |
| 175 m_request = m_deferredRequest; | 176 m_request = m_deferredRequest; |
| 176 m_deferredRequest = ResourceRequest(); | 177 m_deferredRequest = ResourceRequest(); |
| 177 start(); | 178 start(); |
| 178 } | 179 } |
| 179 } | 180 } |
| 180 | 181 |
| 182 PassOwnPtr<blink::WebParserResourceBridge> ResourceLoader::constructParserResour ceBridge() | |
| 183 { | |
| 184 if (m_loader) | |
| 185 return adoptPtr(m_loader->constructParserResourceBridge()); | |
| 186 | |
| 187 return OwnPtr<blink::WebParserResourceBridge>().release(); | |
|
abarth-chromium
2013/12/18 18:28:49
return nullptr
| |
| 188 } | |
| 189 | |
| 181 void ResourceLoader::didDownloadData(blink::WebURLLoader*, int length, int encod edDataLength) | 190 void ResourceLoader::didDownloadData(blink::WebURLLoader*, int length, int encod edDataLength) |
| 182 { | 191 { |
| 183 RefPtr<ResourceLoader> protect(this); | 192 RefPtr<ResourceLoader> protect(this); |
| 184 RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse); | 193 RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse); |
| 185 m_host->didDownloadData(m_resource, length, encodedDataLength, m_options); | 194 m_host->didDownloadData(m_resource, length, encodedDataLength, m_options); |
| 186 m_resource->didDownloadData(length); | 195 m_resource->didDownloadData(length); |
| 187 } | 196 } |
| 188 | 197 |
| 189 void ResourceLoader::didFinishLoadingOnePart(double finishTime) | 198 void ResourceLoader::didFinishLoadingOnePart(double finishTime) |
| 190 { | 199 { |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 393 return; | 402 return; |
| 394 | 403 |
| 395 if (!m_notifiedLoadComplete) { | 404 if (!m_notifiedLoadComplete) { |
| 396 m_notifiedLoadComplete = true; | 405 m_notifiedLoadComplete = true; |
| 397 m_host->didFailLoading(m_resource, error, m_options); | 406 m_host->didFailLoading(m_resource, error, m_options); |
| 398 } | 407 } |
| 399 | 408 |
| 400 releaseResources(); | 409 releaseResources(); |
| 401 } | 410 } |
| 402 | 411 |
| 412 void ResourceLoader::didAddParserResourceMessageFilter() | |
| 413 { | |
| 414 if (m_state == Terminated) | |
| 415 return; | |
| 416 | |
| 417 m_resource->didAddParserResourceMessageFilter(); | |
| 418 } | |
| 419 | |
| 403 bool ResourceLoader::isLoadedBy(ResourceLoaderHost* loader) const | 420 bool ResourceLoader::isLoadedBy(ResourceLoaderHost* loader) const |
| 404 { | 421 { |
| 405 return m_host->isLoadedBy(loader); | 422 return m_host->isLoadedBy(loader); |
| 406 } | 423 } |
| 407 | 424 |
| 408 void ResourceLoader::requestSynchronously() | 425 void ResourceLoader::requestSynchronously() |
| 409 { | 426 { |
| 410 OwnPtr<blink::WebURLLoader> loader = adoptPtr(blink::Platform::current()->cr eateURLLoader()); | 427 OwnPtr<blink::WebURLLoader> loader = adoptPtr(blink::Platform::current()->cr eateURLLoader()); |
| 411 ASSERT(loader); | 428 ASSERT(loader); |
| 412 | 429 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 431 didReceiveResponse(0, responseOut); | 448 didReceiveResponse(0, responseOut); |
| 432 if (m_state == Terminated) | 449 if (m_state == Terminated) |
| 433 return; | 450 return; |
| 434 RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse() .resourceLoadInfo(); | 451 RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse() .resourceLoadInfo(); |
| 435 m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), resourceL oadInfo ? resourceLoadInfo->encodedDataLength : -1, m_options); | 452 m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), resourceL oadInfo ? resourceLoadInfo->encodedDataLength : -1, m_options); |
| 436 m_resource->setResourceBuffer(dataOut); | 453 m_resource->setResourceBuffer(dataOut); |
| 437 didFinishLoading(0, monotonicallyIncreasingTime()); | 454 didFinishLoading(0, monotonicallyIncreasingTime()); |
| 438 } | 455 } |
| 439 | 456 |
| 440 } | 457 } |
| OLD | NEW |