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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 m_defersLoading = defers; | 173 m_defersLoading = defers; |
| 174 if (m_loader) | 174 if (m_loader) |
| 175 m_loader->setDefersLoading(defers); | 175 m_loader->setDefersLoading(defers); |
| 176 if (!defers && !m_deferredRequest.isNull()) { | 176 if (!defers && !m_deferredRequest.isNull()) { |
| 177 m_request = m_deferredRequest; | 177 m_request = m_deferredRequest; |
| 178 m_deferredRequest = ResourceRequest(); | 178 m_deferredRequest = ResourceRequest(); |
| 179 start(); | 179 start(); |
| 180 } | 180 } |
| 181 } | 181 } |
| 182 | 182 |
| 183 void ResourceLoader::attachThreadedDataReceiver(blink::WebThreadedDataReceiver* threadedDataReceiver) | |
| 184 { | |
| 185 if (m_loader) | |
|
abarth-chromium
2014/03/10 21:52:20
Should this be an error if m_loader isn't truthy?
oystein (OOO til 10th of July)
2014/03/17 21:19:11
Since the use of a threaded data receiver is an op
| |
| 186 m_loader->attachThreadedDataReceiver(threadedDataReceiver); | |
| 187 } | |
| 188 | |
| 183 void ResourceLoader::didDownloadData(blink::WebURLLoader*, int length, int encod edDataLength) | 189 void ResourceLoader::didDownloadData(blink::WebURLLoader*, int length, int encod edDataLength) |
| 184 { | 190 { |
| 185 RefPtr<ResourceLoader> protect(this); | 191 RefPtr<ResourceLoader> protect(this); |
| 186 RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse); | 192 RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse); |
| 187 m_host->didDownloadData(m_resource, length, encodedDataLength); | 193 m_host->didDownloadData(m_resource, length, encodedDataLength); |
| 188 m_resource->didDownloadData(length); | 194 m_resource->didDownloadData(length); |
| 189 } | 195 } |
| 190 | 196 |
| 191 void ResourceLoader::didFinishLoadingOnePart(double finishTime, int64 encodedDat aLength) | 197 void ResourceLoader::didFinishLoadingOnePart(double finishTime, int64 encodedDat aLength) |
| 192 { | 198 { |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 470 if (m_state == Terminated) | 476 if (m_state == Terminated) |
| 471 return; | 477 return; |
| 472 RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse() .resourceLoadInfo(); | 478 RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse() .resourceLoadInfo(); |
| 473 int64 encodedDataLength = resourceLoadInfo ? resourceLoadInfo->encodedDataLe ngth : blink::WebURLLoaderClient::kUnknownEncodedDataLength; | 479 int64 encodedDataLength = resourceLoadInfo ? resourceLoadInfo->encodedDataLe ngth : blink::WebURLLoaderClient::kUnknownEncodedDataLength; |
| 474 m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), encodedDa taLength); | 480 m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), encodedDa taLength); |
| 475 m_resource->setResourceBuffer(dataOut); | 481 m_resource->setResourceBuffer(dataOut); |
| 476 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); | 482 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); |
| 477 } | 483 } |
| 478 | 484 |
| 479 } | 485 } |
| OLD | NEW |