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

Side by Side Diff: chrome/browser/media_galleries/fileapi/picasa_file_util.cc

Issue 1579863003: Convert Pass()→std::move() for Mac build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/media_galleries/fileapi/picasa_file_util.h" 5 #include "chrome/browser/media_galleries/fileapi/picasa_file_util.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility>
8 #include <vector> 9 #include <vector>
9 10
10 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
11 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
12 #include "base/strings/stringprintf.h" 13 #include "base/strings/stringprintf.h"
13 #include "base/strings/sys_string_conversions.h" 14 #include "base/strings/sys_string_conversions.h"
14 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
15 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" 16 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h"
16 #include "chrome/browser/media_galleries/fileapi/picasa_data_provider.h" 17 #include "chrome/browser/media_galleries/fileapi/picasa_data_provider.h"
17 #include "chrome/browser/media_galleries/imported_media_gallery_registry.h" 18 #include "chrome/browser/media_galleries/imported_media_gallery_registry.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 PicasaFileUtil::~PicasaFileUtil() {} 86 PicasaFileUtil::~PicasaFileUtil() {}
86 87
87 void PicasaFileUtil::GetFileInfoOnTaskRunnerThread( 88 void PicasaFileUtil::GetFileInfoOnTaskRunnerThread(
88 scoped_ptr<storage::FileSystemOperationContext> context, 89 scoped_ptr<storage::FileSystemOperationContext> context,
89 const storage::FileSystemURL& url, 90 const storage::FileSystemURL& url,
90 const GetFileInfoCallback& callback) { 91 const GetFileInfoCallback& callback) {
91 PicasaDataProvider* data_provider = GetDataProvider(); 92 PicasaDataProvider* data_provider = GetDataProvider();
92 // |data_provider| may be NULL if the file system was revoked before this 93 // |data_provider| may be NULL if the file system was revoked before this
93 // operation had a chance to run. 94 // operation had a chance to run.
94 if (!data_provider) { 95 if (!data_provider) {
95 GetFileInfoWithFreshDataProvider(context.Pass(), url, callback, false); 96 GetFileInfoWithFreshDataProvider(std::move(context), url, callback, false);
96 } else { 97 } else {
97 data_provider->RefreshData( 98 data_provider->RefreshData(
98 GetDataTypeForURL(url), 99 GetDataTypeForURL(url),
99 base::Bind(&PicasaFileUtil::GetFileInfoWithFreshDataProvider, 100 base::Bind(&PicasaFileUtil::GetFileInfoWithFreshDataProvider,
100 weak_factory_.GetWeakPtr(), 101 weak_factory_.GetWeakPtr(),
101 base::Passed(&context), 102 base::Passed(&context),
102 url, 103 url,
103 callback)); 104 callback));
104 } 105 }
105 } 106 }
106 107
107 void PicasaFileUtil::ReadDirectoryOnTaskRunnerThread( 108 void PicasaFileUtil::ReadDirectoryOnTaskRunnerThread(
108 scoped_ptr<storage::FileSystemOperationContext> context, 109 scoped_ptr<storage::FileSystemOperationContext> context,
109 const storage::FileSystemURL& url, 110 const storage::FileSystemURL& url,
110 const ReadDirectoryCallback& callback) { 111 const ReadDirectoryCallback& callback) {
111 PicasaDataProvider* data_provider = GetDataProvider(); 112 PicasaDataProvider* data_provider = GetDataProvider();
112 // |data_provider| may be NULL if the file system was revoked before this 113 // |data_provider| may be NULL if the file system was revoked before this
113 // operation had a chance to run. 114 // operation had a chance to run.
114 if (!data_provider) { 115 if (!data_provider) {
115 ReadDirectoryWithFreshDataProvider(context.Pass(), url, callback, false); 116 ReadDirectoryWithFreshDataProvider(std::move(context), url, callback,
117 false);
116 } else { 118 } else {
117 data_provider->RefreshData( 119 data_provider->RefreshData(
118 GetDataTypeForURL(url), 120 GetDataTypeForURL(url),
119 base::Bind(&PicasaFileUtil::ReadDirectoryWithFreshDataProvider, 121 base::Bind(&PicasaFileUtil::ReadDirectoryWithFreshDataProvider,
120 weak_factory_.GetWeakPtr(), 122 weak_factory_.GetWeakPtr(),
121 base::Passed(&context), 123 base::Passed(&context),
122 url, 124 url,
123 callback)); 125 callback));
124 } 126 }
125 } 127 }
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 const storage::FileSystemURL& url, 369 const storage::FileSystemURL& url,
368 const GetFileInfoCallback& callback, 370 const GetFileInfoCallback& callback,
369 bool success) { 371 bool success) {
370 if (!success) { 372 if (!success) {
371 content::BrowserThread::PostTask( 373 content::BrowserThread::PostTask(
372 content::BrowserThread::IO, 374 content::BrowserThread::IO,
373 FROM_HERE, 375 FROM_HERE,
374 base::Bind(callback, base::File::FILE_ERROR_IO, base::File::Info())); 376 base::Bind(callback, base::File::FILE_ERROR_IO, base::File::Info()));
375 return; 377 return;
376 } 378 }
377 NativeMediaFileUtil::GetFileInfoOnTaskRunnerThread( 379 NativeMediaFileUtil::GetFileInfoOnTaskRunnerThread(std::move(context), url,
378 context.Pass(), url, callback); 380 callback);
379 } 381 }
380 382
381 void PicasaFileUtil::ReadDirectoryWithFreshDataProvider( 383 void PicasaFileUtil::ReadDirectoryWithFreshDataProvider(
382 scoped_ptr<storage::FileSystemOperationContext> context, 384 scoped_ptr<storage::FileSystemOperationContext> context,
383 const storage::FileSystemURL& url, 385 const storage::FileSystemURL& url,
384 const ReadDirectoryCallback& callback, 386 const ReadDirectoryCallback& callback,
385 bool success) { 387 bool success) {
386 if (!success) { 388 if (!success) {
387 content::BrowserThread::PostTask( 389 content::BrowserThread::PostTask(
388 content::BrowserThread::IO, 390 content::BrowserThread::IO,
389 FROM_HERE, 391 FROM_HERE,
390 base::Bind(callback, base::File::FILE_ERROR_IO, EntryList(), false)); 392 base::Bind(callback, base::File::FILE_ERROR_IO, EntryList(), false));
391 return; 393 return;
392 } 394 }
393 NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread( 395 NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread(std::move(context), url,
394 context.Pass(), url, callback); 396 callback);
395 } 397 }
396 398
397 PicasaDataProvider* PicasaFileUtil::GetDataProvider() { 399 PicasaDataProvider* PicasaFileUtil::GetDataProvider() {
398 return ImportedMediaGalleryRegistry::PicasaDataProvider(); 400 return ImportedMediaGalleryRegistry::PicasaDataProvider();
399 } 401 }
400 402
401 } // namespace picasa 403 } // namespace picasa
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698