Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1268)

Side by Side Diff: Source/core/fetch/ResourceLoader.cpp

Issue 23444058: Use downloadToFile option when XHR downloads a Blob (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase test style and XHR Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/fetch/ResourceLoaderHost.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 m_request = m_deferredRequest; 175 m_request = m_deferredRequest;
176 m_deferredRequest = ResourceRequest(); 176 m_deferredRequest = ResourceRequest();
177 start(); 177 start();
178 } 178 }
179 } 179 }
180 180
181 void ResourceLoader::didDownloadData(blink::WebURLLoader*, int length, int encod edDataLength) 181 void ResourceLoader::didDownloadData(blink::WebURLLoader*, int length, int encod edDataLength)
182 { 182 {
183 RefPtr<ResourceLoader> protect(this); 183 RefPtr<ResourceLoader> protect(this);
184 RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse); 184 RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse);
185 m_host->didDownloadData(m_resource, length, encodedDataLength, m_options);
185 m_resource->didDownloadData(length); 186 m_resource->didDownloadData(length);
186 } 187 }
187 188
188 void ResourceLoader::didFinishLoadingOnePart(double finishTime) 189 void ResourceLoader::didFinishLoadingOnePart(double finishTime)
189 { 190 {
190 // If load has been cancelled after finishing (which could happen with a 191 // If load has been cancelled after finishing (which could happen with a
191 // JavaScript that changes the window location), do nothing. 192 // JavaScript that changes the window location), do nothing.
192 if (m_state == Terminated) 193 if (m_state == Terminated)
193 return; 194 return;
194 195
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 didReceiveResponse(0, responseOut); 431 didReceiveResponse(0, responseOut);
431 if (m_state == Terminated) 432 if (m_state == Terminated)
432 return; 433 return;
433 RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse() .resourceLoadInfo(); 434 RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse() .resourceLoadInfo();
434 m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), resourceL oadInfo ? resourceLoadInfo->encodedDataLength : -1, m_options); 435 m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), resourceL oadInfo ? resourceLoadInfo->encodedDataLength : -1, m_options);
435 m_resource->setResourceBuffer(dataOut); 436 m_resource->setResourceBuffer(dataOut);
436 didFinishLoading(0, monotonicallyIncreasingTime()); 437 didFinishLoading(0, monotonicallyIncreasingTime());
437 } 438 }
438 439
439 } 440 }
OLDNEW
« no previous file with comments | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/fetch/ResourceLoaderHost.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698