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

Side by Side Diff: third_party/WebKit/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp

Issue 2308343002: Replaced PassRefPtr copites with moves in Source/modules. (Closed)
Patch Set: Created 4 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/fetch/FetchBlobDataConsumerHandle.h" 5 #include "modules/fetch/FetchBlobDataConsumerHandle.h"
6 6
7 #include "core/dom/ExecutionContext.h" 7 #include "core/dom/ExecutionContext.h"
8 #include "core/fetch/FetchInitiatorTypeNames.h" 8 #include "core/fetch/FetchInitiatorTypeNames.h"
9 #include "core/loader/ThreadableLoaderClient.h" 9 #include "core/loader/ThreadableLoaderClient.h"
10 #include "modules/fetch/CompositeDataConsumerHandle.h" 10 #include "modules/fetch/CompositeDataConsumerHandle.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 280
281 std::unique_ptr<WebDataConsumerHandle> m_handle; 281 std::unique_ptr<WebDataConsumerHandle> m_handle;
282 RefPtr<BlobDataHandle> m_blobDataHandleForDrain; 282 RefPtr<BlobDataHandle> m_blobDataHandleForDrain;
283 std::unique_ptr<CrossThreadHolder<LoaderContext>> m_loaderContextHolder; 283 std::unique_ptr<CrossThreadHolder<LoaderContext>> m_loaderContextHolder;
284 284
285 bool m_loaderStarted; 285 bool m_loaderStarted;
286 bool m_drained; 286 bool m_drained;
287 }; 287 };
288 288
289 FetchBlobDataConsumerHandle::FetchBlobDataConsumerHandle(ExecutionContext* execu tionContext, PassRefPtr<BlobDataHandle> blobDataHandle, LoaderFactory* loaderFac tory) 289 FetchBlobDataConsumerHandle::FetchBlobDataConsumerHandle(ExecutionContext* execu tionContext, PassRefPtr<BlobDataHandle> blobDataHandle, LoaderFactory* loaderFac tory)
290 : m_readerContext(adoptRef(new ReaderContext(executionContext, blobDataHandl e, loaderFactory))) 290 : m_readerContext(adoptRef(new ReaderContext(executionContext, std::move(blo bDataHandle), loaderFactory)))
291 { 291 {
292 } 292 }
293 293
294 FetchBlobDataConsumerHandle::~FetchBlobDataConsumerHandle() 294 FetchBlobDataConsumerHandle::~FetchBlobDataConsumerHandle()
295 { 295 {
296 } 296 }
297 297
298 std::unique_ptr<FetchDataConsumerHandle> FetchBlobDataConsumerHandle::create(Exe cutionContext* executionContext, PassRefPtr<BlobDataHandle> blobDataHandle, Load erFactory* loaderFactory) 298 std::unique_ptr<FetchDataConsumerHandle> FetchBlobDataConsumerHandle::create(Exe cutionContext* executionContext, PassRefPtr<BlobDataHandle> blobDataHandle, Load erFactory* loaderFactory)
299 { 299 {
300 if (!blobDataHandle) 300 if (!blobDataHandle)
301 return createFetchDataConsumerHandleFromWebHandle(createDoneDataConsumer Handle()); 301 return createFetchDataConsumerHandleFromWebHandle(createDoneDataConsumer Handle());
302 302
303 return wrapUnique(new FetchBlobDataConsumerHandle(executionContext, blobData Handle, loaderFactory)); 303 return wrapUnique(new FetchBlobDataConsumerHandle(executionContext, std::mov e(blobDataHandle), loaderFactory));
304 } 304 }
305 305
306 std::unique_ptr<FetchDataConsumerHandle> FetchBlobDataConsumerHandle::create(Exe cutionContext* executionContext, PassRefPtr<BlobDataHandle> blobDataHandle) 306 std::unique_ptr<FetchDataConsumerHandle> FetchBlobDataConsumerHandle::create(Exe cutionContext* executionContext, PassRefPtr<BlobDataHandle> blobDataHandle)
307 { 307 {
308 if (!blobDataHandle) 308 if (!blobDataHandle)
309 return createFetchDataConsumerHandleFromWebHandle(createDoneDataConsumer Handle()); 309 return createFetchDataConsumerHandleFromWebHandle(createDoneDataConsumer Handle());
310 310
311 return wrapUnique(new FetchBlobDataConsumerHandle(executionContext, blobData Handle, new DefaultLoaderFactory)); 311 return wrapUnique(new FetchBlobDataConsumerHandle(executionContext, std::mov e(blobDataHandle), new DefaultLoaderFactory));
312 } 312 }
313 313
314 std::unique_ptr<FetchDataConsumerHandle::Reader> FetchBlobDataConsumerHandle::ob tainFetchDataReader(Client* client) 314 std::unique_ptr<FetchDataConsumerHandle::Reader> FetchBlobDataConsumerHandle::ob tainFetchDataReader(Client* client)
315 { 315 {
316 return m_readerContext->obtainReader(client); 316 return m_readerContext->obtainReader(client);
317 } 317 }
318 318
319 } // namespace blink 319 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698