| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 m_defersLoading = defers; | 173 m_defersLoading = defers; |
| 173 if (m_loader) | 174 if (m_loader) |
| 174 m_loader->setDefersLoading(defers); | 175 m_loader->setDefersLoading(defers); |
| 175 if (!defers && !m_deferredRequest.isNull()) { | 176 if (!defers && !m_deferredRequest.isNull()) { |
| 176 m_request = m_deferredRequest; | 177 m_request = m_deferredRequest; |
| 177 m_deferredRequest = ResourceRequest(); | 178 m_deferredRequest = ResourceRequest(); |
| 178 start(); | 179 start(); |
| 179 } | 180 } |
| 180 } | 181 } |
| 181 | 182 |
| 183 PassOwnPtr<blink::WebThreadedResourceProvider> ResourceLoader::createThreadedRes
ourceProvider() |
| 184 { |
| 185 if (m_loader) |
| 186 return adoptPtr(m_loader->createThreadedResourceProvider()); |
| 187 |
| 188 return nullptr; |
| 189 } |
| 190 |
| 182 void ResourceLoader::didDownloadData(blink::WebURLLoader*, int length, int encod
edDataLength) | 191 void ResourceLoader::didDownloadData(blink::WebURLLoader*, int length, int encod
edDataLength) |
| 183 { | 192 { |
| 184 RefPtr<ResourceLoader> protect(this); | 193 RefPtr<ResourceLoader> protect(this); |
| 185 RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse); | 194 RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse); |
| 186 m_host->didDownloadData(m_resource, length, encodedDataLength); | 195 m_host->didDownloadData(m_resource, length, encodedDataLength); |
| 187 m_resource->didDownloadData(length); | 196 m_resource->didDownloadData(length); |
| 188 } | 197 } |
| 189 | 198 |
| 190 void ResourceLoader::didFinishLoadingOnePart(double finishTime) | 199 void ResourceLoader::didFinishLoadingOnePart(double finishTime) |
| 191 { | 200 { |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 didReceiveResponse(0, responseOut); | 442 didReceiveResponse(0, responseOut); |
| 434 if (m_state == Terminated) | 443 if (m_state == Terminated) |
| 435 return; | 444 return; |
| 436 RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse()
.resourceLoadInfo(); | 445 RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse()
.resourceLoadInfo(); |
| 437 m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), resourceL
oadInfo ? resourceLoadInfo->encodedDataLength : -1); | 446 m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), resourceL
oadInfo ? resourceLoadInfo->encodedDataLength : -1); |
| 438 m_resource->setResourceBuffer(dataOut); | 447 m_resource->setResourceBuffer(dataOut); |
| 439 didFinishLoading(0, monotonicallyIncreasingTime()); | 448 didFinishLoading(0, monotonicallyIncreasingTime()); |
| 440 } | 449 } |
| 441 | 450 |
| 442 } | 451 } |
| OLD | NEW |