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

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, 2 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 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1171 void ResourceFetcher::didReceiveData(const Resource* resource, const char* data, int dataLength, int encodedDataLength, const ResourceLoaderOptions& options) 1171 void ResourceFetcher::didReceiveData(const Resource* resource, const char* data, int dataLength, int encodedDataLength, const ResourceLoaderOptions& options)
1172 { 1172 {
1173 // FIXME: use frame of master document for imported documents. 1173 // FIXME: use frame of master document for imported documents.
1174 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiv eResourceData(frame(), resource->identifier(), encodedDataLength); 1174 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiv eResourceData(frame(), resource->identifier(), encodedDataLength);
1175 if (options.sendLoadCallbacks != SendCallbacks) 1175 if (options.sendLoadCallbacks != SendCallbacks)
1176 return; 1176 return;
1177 context().dispatchDidReceiveData(m_documentLoader, resource->identifier(), d ata, dataLength, encodedDataLength); 1177 context().dispatchDidReceiveData(m_documentLoader, resource->identifier(), d ata, dataLength, encodedDataLength);
1178 InspectorInstrumentation::didReceiveResourceData(cookie); 1178 InspectorInstrumentation::didReceiveResourceData(cookie);
1179 } 1179 }
1180 1180
1181 void ResourceFetcher::didDownloadData(const Resource* resource, int dataLength, int encodedDataLength, const ResourceLoaderOptions& options)
1182 {
1183 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiv eResourceData(frame(), resource->identifier(), encodedDataLength);
1184 if (options.sendLoadCallbacks != SendCallbacks)
1185 return;
1186 context().dispatchDidDownloadData(m_documentLoader, resource->identifier(), dataLength, encodedDataLength);
1187 InspectorInstrumentation::didReceiveResourceData(cookie);
1188 }
1189
1181 void ResourceFetcher::subresourceLoaderFinishedLoadingOnePart(ResourceLoader* lo ader) 1190 void ResourceFetcher::subresourceLoaderFinishedLoadingOnePart(ResourceLoader* lo ader)
1182 { 1191 {
1183 if (m_multipartLoaders) 1192 if (m_multipartLoaders)
1184 m_multipartLoaders->add(loader); 1193 m_multipartLoaders->add(loader);
1185 if (m_loaders) 1194 if (m_loaders)
1186 m_loaders->remove(loader); 1195 m_loaders->remove(loader);
1187 if (Frame* frame = this->frame()) 1196 if (Frame* frame = this->frame())
1188 return frame->loader()->checkLoadComplete(m_documentLoader); 1197 return frame->loader()->checkLoadComplete(m_documentLoader);
1189 } 1198 }
1190 1199
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 } 1321 }
1313 #endif 1322 #endif
1314 1323
1315 const ResourceLoaderOptions& ResourceFetcher::defaultResourceOptions() 1324 const ResourceLoaderOptions& ResourceFetcher::defaultResourceOptions()
1316 { 1325 {
1317 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffCon tent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientF orCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy, UseDefaul tOriginRestrictionsForType, DocumentContext)); 1326 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffCon tent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientF orCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy, UseDefaul tOriginRestrictionsForType, DocumentContext));
1318 return options; 1327 return options;
1319 } 1328 }
1320 1329
1321 } 1330 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698