| 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/WebThreadedResourceProvider.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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 m_defersLoading = defers; | 174 m_defersLoading = defers; |
| 174 if (m_loader) | 175 if (m_loader) |
| 175 m_loader->setDefersLoading(defers); | 176 m_loader->setDefersLoading(defers); |
| 176 if (!defers && !m_deferredRequest.isNull()) { | 177 if (!defers && !m_deferredRequest.isNull()) { |
| 177 m_request = m_deferredRequest; | 178 m_request = m_deferredRequest; |
| 178 m_deferredRequest = ResourceRequest(); | 179 m_deferredRequest = ResourceRequest(); |
| 179 start(); | 180 start(); |
| 180 } | 181 } |
| 181 } | 182 } |
| 182 | 183 |
| 184 PassOwnPtr<blink::WebThreadedResourceProvider> ResourceLoader::createThreadedRes
ourceProvider() |
| 185 { |
| 186 if (m_loader) |
| 187 return adoptPtr(m_loader->createThreadedResourceProvider()); |
| 188 |
| 189 return nullptr; |
| 190 } |
| 191 |
| 183 void ResourceLoader::didDownloadData(blink::WebURLLoader*, int length, int encod
edDataLength) | 192 void ResourceLoader::didDownloadData(blink::WebURLLoader*, int length, int encod
edDataLength) |
| 184 { | 193 { |
| 185 RefPtr<ResourceLoader> protect(this); | 194 RefPtr<ResourceLoader> protect(this); |
| 186 RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse); | 195 RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse); |
| 187 m_host->didDownloadData(m_resource, length, encodedDataLength); | 196 m_host->didDownloadData(m_resource, length, encodedDataLength); |
| 188 m_resource->didDownloadData(length); | 197 m_resource->didDownloadData(length); |
| 189 } | 198 } |
| 190 | 199 |
| 191 void ResourceLoader::didFinishLoadingOnePart(double finishTime) | 200 void ResourceLoader::didFinishLoadingOnePart(double finishTime) |
| 192 { | 201 { |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 didReceiveResponse(0, responseOut); | 477 didReceiveResponse(0, responseOut); |
| 469 if (m_state == Terminated) | 478 if (m_state == Terminated) |
| 470 return; | 479 return; |
| 471 RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse()
.resourceLoadInfo(); | 480 RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse()
.resourceLoadInfo(); |
| 472 m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), resourceL
oadInfo ? resourceLoadInfo->encodedDataLength : -1); | 481 m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), resourceL
oadInfo ? resourceLoadInfo->encodedDataLength : -1); |
| 473 m_resource->setResourceBuffer(dataOut); | 482 m_resource->setResourceBuffer(dataOut); |
| 474 didFinishLoading(0, monotonicallyIncreasingTime()); | 483 didFinishLoading(0, monotonicallyIncreasingTime()); |
| 475 } | 484 } |
| 476 | 485 |
| 477 } | 486 } |
| OLD | NEW |