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

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

Issue 23444058: Use downloadToFile option when XHR downloads a Blob (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 months 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
OLDNEW
1 /* 1 /*
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 void ResourceFetcher::didReceiveData(const Resource* resource, const char* data, int dataLength, int encodedDataLength, const ResourceLoaderOptions& options) 1205 void ResourceFetcher::didReceiveData(const Resource* resource, const char* data, int dataLength, int encodedDataLength, const ResourceLoaderOptions& options)
1206 { 1206 {
1207 // FIXME: use frame of master document for imported documents. 1207 // FIXME: use frame of master document for imported documents.
1208 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiv eResourceData(frame(), resource->identifier(), encodedDataLength); 1208 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiv eResourceData(frame(), resource->identifier(), encodedDataLength);
1209 if (options.sendLoadCallbacks != SendCallbacks) 1209 if (options.sendLoadCallbacks != SendCallbacks)
1210 return; 1210 return;
1211 context().dispatchDidReceiveData(m_documentLoader, resource->identifier(), d ata, dataLength, encodedDataLength); 1211 context().dispatchDidReceiveData(m_documentLoader, resource->identifier(), d ata, dataLength, encodedDataLength);
1212 InspectorInstrumentation::didReceiveResourceData(cookie); 1212 InspectorInstrumentation::didReceiveResourceData(cookie);
1213 } 1213 }
1214 1214
1215 void ResourceFetcher::didDownloadData(const Resource* resource, int dataLength, int encodedDataLength, const ResourceLoaderOptions& options)
1216 {
1217 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiv eResourceData(frame(), resource->identifier(), encodedDataLength);
1218 if (options.sendLoadCallbacks != SendCallbacks)
1219 return;
1220 context().dispatchDidDownloadData(m_documentLoader, resource->identifier(), dataLength, encodedDataLength);
1221 InspectorInstrumentation::didReceiveResourceData(cookie);
1222 }
1223
1215 void ResourceFetcher::subresourceLoaderFinishedLoadingOnePart(ResourceLoader* lo ader) 1224 void ResourceFetcher::subresourceLoaderFinishedLoadingOnePart(ResourceLoader* lo ader)
1216 { 1225 {
1217 if (m_multipartLoaders) 1226 if (m_multipartLoaders)
1218 m_multipartLoaders->add(loader); 1227 m_multipartLoaders->add(loader);
1219 if (m_loaders) 1228 if (m_loaders)
1220 m_loaders->remove(loader); 1229 m_loaders->remove(loader);
1221 if (Frame* frame = this->frame()) 1230 if (Frame* frame = this->frame())
1222 return frame->loader()->checkLoadComplete(m_documentLoader); 1231 return frame->loader()->checkLoadComplete(m_documentLoader);
1223 } 1232 }
1224 1233
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 } 1355 }
1347 #endif 1356 #endif
1348 1357
1349 const ResourceLoaderOptions& ResourceFetcher::defaultResourceOptions() 1358 const ResourceLoaderOptions& ResourceFetcher::defaultResourceOptions()
1350 { 1359 {
1351 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffCon tent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientF orCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy, UseDefaul tOriginRestrictionsForType, DocumentContext)); 1360 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffCon tent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientF orCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy, UseDefaul tOriginRestrictionsForType, DocumentContext));
1352 return options; 1361 return options;
1353 } 1362 }
1354 1363
1355 } 1364 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698