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

Side by Side Diff: Source/core/loader/WorkerThreadableLoader.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/loader/WorkerThreadableLoader.h ('k') | Source/core/xml/XMLHttpRequest.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) 2009, 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 workerClientWrapper->didReceiveData(vectorData->data(), vectorData->size()); 193 workerClientWrapper->didReceiveData(vectorData->data(), vectorData->size());
194 } 194 }
195 195
196 void WorkerThreadableLoader::MainThreadBridge::didReceiveData(const char* data, int dataLength) 196 void WorkerThreadableLoader::MainThreadBridge::didReceiveData(const char* data, int dataLength)
197 { 197 {
198 OwnPtr<Vector<char> > vector = adoptPtr(new Vector<char>(dataLength)); // ne eds to be an OwnPtr for usage with createCallbackTask. 198 OwnPtr<Vector<char> > vector = adoptPtr(new Vector<char>(dataLength)); // ne eds to be an OwnPtr for usage with createCallbackTask.
199 memcpy(vector->data(), data, dataLength); 199 memcpy(vector->data(), data, dataLength);
200 m_loaderProxy.postTaskForModeToWorkerGlobalScope(createCallbackTask(&workerG lobalScopeDidReceiveData, m_workerClientWrapper, vector.release()), m_taskMode); 200 m_loaderProxy.postTaskForModeToWorkerGlobalScope(createCallbackTask(&workerG lobalScopeDidReceiveData, m_workerClientWrapper, vector.release()), m_taskMode);
201 } 201 }
202 202
203 static void workerGlobalScopeDidDownloadData(ExecutionContext* context, PassRefP tr<ThreadableLoaderClientWrapper> workerClientWrapper, int dataLength)
204 {
205 ASSERT_UNUSED(context, context->isWorkerGlobalScope());
206 workerClientWrapper->didDownloadData(dataLength);
207 }
208
209 void WorkerThreadableLoader::MainThreadBridge::didDownloadData(int dataLength)
210 {
211 m_loaderProxy.postTaskForModeToWorkerGlobalScope(createCallbackTask(&workerG lobalScopeDidDownloadData, m_workerClientWrapper, dataLength), m_taskMode);
212 }
213
203 static void workerGlobalScopeDidReceiveCachedMetadata(ExecutionContext* context, PassRefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, PassOwnPtr<Vecto r<char> > vectorData) 214 static void workerGlobalScopeDidReceiveCachedMetadata(ExecutionContext* context, PassRefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, PassOwnPtr<Vecto r<char> > vectorData)
204 { 215 {
205 ASSERT_UNUSED(context, context->isWorkerGlobalScope()); 216 ASSERT_UNUSED(context, context->isWorkerGlobalScope());
206 workerClientWrapper->didReceiveCachedMetadata(vectorData->data(), vectorData ->size()); 217 workerClientWrapper->didReceiveCachedMetadata(vectorData->data(), vectorData ->size());
207 } 218 }
208 219
209 void WorkerThreadableLoader::MainThreadBridge::didReceiveCachedMetadata(const ch ar* data, int dataLength) 220 void WorkerThreadableLoader::MainThreadBridge::didReceiveCachedMetadata(const ch ar* data, int dataLength)
210 { 221 {
211 OwnPtr<Vector<char> > vector = adoptPtr(new Vector<char>(dataLength)); // ne eds to be an OwnPtr for usage with createCallbackTask. 222 OwnPtr<Vector<char> > vector = adoptPtr(new Vector<char>(dataLength)); // ne eds to be an OwnPtr for usage with createCallbackTask.
212 memcpy(vector->data(), data, dataLength); 223 memcpy(vector->data(), data, dataLength);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 ASSERT_UNUSED(context, context->isWorkerGlobalScope()); 262 ASSERT_UNUSED(context, context->isWorkerGlobalScope());
252 workerClientWrapper->didFailRedirectCheck(); 263 workerClientWrapper->didFailRedirectCheck();
253 } 264 }
254 265
255 void WorkerThreadableLoader::MainThreadBridge::didFailRedirectCheck() 266 void WorkerThreadableLoader::MainThreadBridge::didFailRedirectCheck()
256 { 267 {
257 m_loaderProxy.postTaskForModeToWorkerGlobalScope(createCallbackTask(&workerG lobalScopeDidFailRedirectCheck, m_workerClientWrapper), m_taskMode); 268 m_loaderProxy.postTaskForModeToWorkerGlobalScope(createCallbackTask(&workerG lobalScopeDidFailRedirectCheck, m_workerClientWrapper), m_taskMode);
258 } 269 }
259 270
260 } // namespace WebCore 271 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/loader/WorkerThreadableLoader.h ('k') | Source/core/xml/XMLHttpRequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698