Skip to content

Commit

Permalink
Convert Pass()→std::move() for Mac build.
Browse files Browse the repository at this point in the history
BUG=557422
R=avi@chromium.org
TBR=jam@chromium.org

Review URL: https://codereview.chromium.org/1579863003

Cr-Commit-Position: refs/heads/master@{#369135}
  • Loading branch information
zetafunction authored and Commit bot committed Jan 13, 2016
1 parent c1f77e7 commit f26eed3
Show file tree
Hide file tree
Showing 93 changed files with 422 additions and 299 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <utility>

#include "base/bind.h"
#include "base/callback.h"
#include "base/command_line.h"
Expand Down Expand Up @@ -89,7 +91,7 @@ class NetworkingPrivateServiceClientApiTest : public ExtensionApiTest {
scoped_ptr<wifi::FakeWiFiService> wifi_service(new wifi::FakeWiFiService());
scoped_ptr<CryptoVerifyStub> crypto_verify(new CryptoVerifyStub);
return scoped_ptr<KeyedService>(new NetworkingPrivateServiceClient(
wifi_service.Pass(), crypto_verify.Pass()));
std::move(wifi_service), std::move(crypto_verify)));
}

void SetUpOnMainThread() override {
Expand Down
16 changes: 9 additions & 7 deletions chrome/browser/media_galleries/fileapi/iphoto_file_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <set>
#include <string>
#include <utility>
#include <vector>

#include "base/bind_helpers.h"
Expand Down Expand Up @@ -84,7 +85,7 @@ void IPhotoFileUtil::GetFileInfoOnTaskRunnerThread(
// |data_provider| may be NULL if the file system was revoked before this
// operation had a chance to run.
if (!data_provider) {
GetFileInfoWithFreshDataProvider(context.Pass(), url, callback, false);
GetFileInfoWithFreshDataProvider(std::move(context), url, callback, false);
} else {
data_provider->RefreshData(
base::Bind(&IPhotoFileUtil::GetFileInfoWithFreshDataProvider,
Expand All @@ -101,7 +102,8 @@ void IPhotoFileUtil::ReadDirectoryOnTaskRunnerThread(
// |data_provider| may be NULL if the file system was revoked before this
// operation had a chance to run.
if (!data_provider) {
ReadDirectoryWithFreshDataProvider(context.Pass(), url, callback, false);
ReadDirectoryWithFreshDataProvider(std::move(context), url, callback,
false);
} else {
data_provider->RefreshData(
base::Bind(&IPhotoFileUtil::ReadDirectoryWithFreshDataProvider,
Expand All @@ -118,7 +120,7 @@ void IPhotoFileUtil::CreateSnapshotFileOnTaskRunnerThread(
// |data_provider| may be NULL if the file system was revoked before this
// operation had a chance to run.
if (!data_provider) {
CreateSnapshotFileWithFreshDataProvider(context.Pass(), url, callback,
CreateSnapshotFileWithFreshDataProvider(std::move(context), url, callback,
false);
} else {
data_provider->RefreshData(
Expand All @@ -142,7 +144,7 @@ void IPhotoFileUtil::GetFileInfoWithFreshDataProvider(
}
return;
}
NativeMediaFileUtil::GetFileInfoOnTaskRunnerThread(context.Pass(), url,
NativeMediaFileUtil::GetFileInfoOnTaskRunnerThread(std::move(context), url,
callback);
}

Expand All @@ -160,7 +162,7 @@ void IPhotoFileUtil::ReadDirectoryWithFreshDataProvider(
}
return;
}
NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread(context.Pass(), url,
NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread(std::move(context), url,
callback);
}

Expand All @@ -182,8 +184,8 @@ void IPhotoFileUtil::CreateSnapshotFileWithFreshDataProvider(
}
return;
}
NativeMediaFileUtil::CreateSnapshotFileOnTaskRunnerThread(context.Pass(), url,
callback);
NativeMediaFileUtil::CreateSnapshotFileOnTaskRunnerThread(std::move(context),
url, callback);
}

// Begin actual implementation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/media_galleries/fileapi/iphoto_file_util.h"

#include <map>
#include <set>
#include <string>
#include <utility>
#include <vector>

#include "base/bind.h"
Expand All @@ -18,7 +21,6 @@
#include "base/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "chrome/browser/media_galleries/fileapi/iphoto_data_provider.h"
#include "chrome/browser/media_galleries/fileapi/iphoto_file_util.h"
#include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h"
#include "chrome/browser/media_galleries/fileapi/media_path_filter.h"
#include "chrome/browser/media_galleries/imported_media_gallery_registry.h"
Expand Down Expand Up @@ -213,11 +215,8 @@ class IPhotoFileUtilTest : public testing::Test {
base::ThreadTaskRunnerHandle::Get().get(),
base::ThreadTaskRunnerHandle::Get().get(),
storage::ExternalMountPoints::CreateRefCounted().get(),
storage_policy.get(),
NULL,
additional_providers.Pass(),
std::vector<storage::URLRequestAutoMountHandler>(),
profile_dir_.path(),
storage_policy.get(), NULL, std::move(additional_providers),
std::vector<storage::URLRequestAutoMountHandler>(), profile_dir_.path(),
content::CreateAllowFileAccessOptions());
}

Expand Down
16 changes: 9 additions & 7 deletions chrome/browser/media_galleries/fileapi/itunes_file_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <set>
#include <string>
#include <utility>
#include <vector>

#include "base/bind_helpers.h"
Expand Down Expand Up @@ -75,7 +76,7 @@ void ITunesFileUtil::GetFileInfoOnTaskRunnerThread(
// |data_provider| may be NULL if the file system was revoked before this
// operation had a chance to run.
if (!data_provider) {
GetFileInfoWithFreshDataProvider(context.Pass(), url, callback, false);
GetFileInfoWithFreshDataProvider(std::move(context), url, callback, false);
} else {
data_provider->RefreshData(
base::Bind(&ITunesFileUtil::GetFileInfoWithFreshDataProvider,
Expand All @@ -92,7 +93,8 @@ void ITunesFileUtil::ReadDirectoryOnTaskRunnerThread(
// |data_provider| may be NULL if the file system was revoked before this
// operation had a chance to run.
if (!data_provider) {
ReadDirectoryWithFreshDataProvider(context.Pass(), url, callback, false);
ReadDirectoryWithFreshDataProvider(std::move(context), url, callback,
false);
} else {
data_provider->RefreshData(
base::Bind(&ITunesFileUtil::ReadDirectoryWithFreshDataProvider,
Expand All @@ -109,7 +111,7 @@ void ITunesFileUtil::CreateSnapshotFileOnTaskRunnerThread(
// |data_provider| may be NULL if the file system was revoked before this
// operation had a chance to run.
if (!data_provider) {
CreateSnapshotFileWithFreshDataProvider(context.Pass(), url, callback,
CreateSnapshotFileWithFreshDataProvider(std::move(context), url, callback,
false);
} else {
data_provider->RefreshData(
Expand Down Expand Up @@ -363,7 +365,7 @@ void ITunesFileUtil::GetFileInfoWithFreshDataProvider(
}
return;
}
NativeMediaFileUtil::GetFileInfoOnTaskRunnerThread(context.Pass(), url,
NativeMediaFileUtil::GetFileInfoOnTaskRunnerThread(std::move(context), url,
callback);
}

Expand All @@ -381,7 +383,7 @@ void ITunesFileUtil::ReadDirectoryWithFreshDataProvider(
}
return;
}
NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread(context.Pass(), url,
NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread(std::move(context), url,
callback);
}

Expand All @@ -403,8 +405,8 @@ void ITunesFileUtil::CreateSnapshotFileWithFreshDataProvider(
}
return;
}
NativeMediaFileUtil::CreateSnapshotFileOnTaskRunnerThread(context.Pass(), url,
callback);
NativeMediaFileUtil::CreateSnapshotFileOnTaskRunnerThread(std::move(context),
url, callback);
}

ITunesDataProvider* ITunesFileUtil::GetDataProvider() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/media_galleries/fileapi/itunes_file_util.h"

#include <set>
#include <string>
#include <utility>
#include <vector>

#include "base/bind.h"
Expand All @@ -17,7 +20,6 @@
#include "base/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "chrome/browser/media_galleries/fileapi/itunes_data_provider.h"
#include "chrome/browser/media_galleries/fileapi/itunes_file_util.h"
#include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h"
#include "chrome/browser/media_galleries/fileapi/media_path_filter.h"
#include "chrome/browser/media_galleries/imported_media_gallery_registry.h"
Expand Down Expand Up @@ -181,11 +183,8 @@ class ItunesFileUtilTest : public testing::Test {
base::ThreadTaskRunnerHandle::Get().get(),
base::ThreadTaskRunnerHandle::Get().get(),
storage::ExternalMountPoints::CreateRefCounted().get(),
storage_policy.get(),
NULL,
additional_providers.Pass(),
std::vector<storage::URLRequestAutoMountHandler>(),
profile_dir_.path(),
storage_policy.get(), NULL, std::move(additional_providers),
std::vector<storage::URLRequestAutoMountHandler>(), profile_dir_.path(),
content::CreateAllowFileAccessOptions());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/media_galleries/fileapi/picasa_data_provider.h"

#include <utility>
#include <vector>

#include "base/files/file_enumerator.h"
Expand All @@ -14,7 +17,6 @@
#include "base/run_loop.h"
#include "build/build_config.h"
#include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h"
#include "chrome/browser/media_galleries/fileapi/picasa_data_provider.h"
#include "chrome/common/media_galleries/picasa_test_util.h"
#include "chrome/common/media_galleries/picasa_types.h"
#include "chrome/test/base/in_process_browser_test.h"
Expand Down Expand Up @@ -156,7 +158,7 @@ class TestPicasaDataProvider : public PicasaDataProvider {
private:
void OnTempDirWatchStarted(
scoped_ptr<base::FilePathWatcher> temp_dir_watcher) override {
PicasaDataProvider::OnTempDirWatchStarted(temp_dir_watcher.Pass());
PicasaDataProvider::OnTempDirWatchStarted(std::move(temp_dir_watcher));

file_watch_request_returned_ = true;
for (std::vector<ReadyCallback>::const_iterator it =
Expand Down
14 changes: 8 additions & 6 deletions chrome/browser/media_galleries/fileapi/picasa_file_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "chrome/browser/media_galleries/fileapi/picasa_file_util.h"

#include <string>
#include <utility>
#include <vector>

#include "base/bind_helpers.h"
Expand Down Expand Up @@ -92,7 +93,7 @@ void PicasaFileUtil::GetFileInfoOnTaskRunnerThread(
// |data_provider| may be NULL if the file system was revoked before this
// operation had a chance to run.
if (!data_provider) {
GetFileInfoWithFreshDataProvider(context.Pass(), url, callback, false);
GetFileInfoWithFreshDataProvider(std::move(context), url, callback, false);
} else {
data_provider->RefreshData(
GetDataTypeForURL(url),
Expand All @@ -112,7 +113,8 @@ void PicasaFileUtil::ReadDirectoryOnTaskRunnerThread(
// |data_provider| may be NULL if the file system was revoked before this
// operation had a chance to run.
if (!data_provider) {
ReadDirectoryWithFreshDataProvider(context.Pass(), url, callback, false);
ReadDirectoryWithFreshDataProvider(std::move(context), url, callback,
false);
} else {
data_provider->RefreshData(
GetDataTypeForURL(url),
Expand Down Expand Up @@ -374,8 +376,8 @@ void PicasaFileUtil::GetFileInfoWithFreshDataProvider(
base::Bind(callback, base::File::FILE_ERROR_IO, base::File::Info()));
return;
}
NativeMediaFileUtil::GetFileInfoOnTaskRunnerThread(
context.Pass(), url, callback);
NativeMediaFileUtil::GetFileInfoOnTaskRunnerThread(std::move(context), url,
callback);
}

void PicasaFileUtil::ReadDirectoryWithFreshDataProvider(
Expand All @@ -390,8 +392,8 @@ void PicasaFileUtil::ReadDirectoryWithFreshDataProvider(
base::Bind(callback, base::File::FILE_ERROR_IO, EntryList(), false));
return;
}
NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread(
context.Pass(), url, callback);
NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread(std::move(context), url,
callback);
}

PicasaDataProvider* PicasaFileUtil::GetDataProvider() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/media_galleries/fileapi/picasa_file_util.h"

#include <stddef.h>
#include <stdint.h>

#include <set>
#include <string>
#include <utility>
#include <vector>

#include "base/bind_helpers.h"
Expand All @@ -25,7 +28,6 @@
#include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h"
#include "chrome/browser/media_galleries/fileapi/media_path_filter.h"
#include "chrome/browser/media_galleries/fileapi/picasa_data_provider.h"
#include "chrome/browser/media_galleries/fileapi/picasa_file_util.h"
#include "chrome/browser/media_galleries/imported_media_gallery_registry.h"
#include "chrome/common/media_galleries/picasa_types.h"
#include "chrome/common/media_galleries/pmp_constants.h"
Expand Down Expand Up @@ -251,11 +253,8 @@ class PicasaFileUtilTest : public testing::Test {
base::ThreadTaskRunnerHandle::Get().get(),
base::ThreadTaskRunnerHandle::Get().get(),
storage::ExternalMountPoints::CreateRefCounted().get(),
storage_policy.get(),
NULL,
additional_providers.Pass(),
std::vector<storage::URLRequestAutoMountHandler>(),
profile_dir_.path(),
storage_policy.get(), NULL, std::move(additional_providers),
std::vector<storage::URLRequestAutoMountHandler>(), profile_dir_.path(),
content::CreateAllowFileAccessOptions());
}

Expand Down
20 changes: 10 additions & 10 deletions chrome/browser/media_galleries/fileapi/safe_iapps_library_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "chrome/browser/media_galleries/fileapi/safe_iapps_library_parser.h"

#include <utility>

#include "build/build_config.h"
#include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h"
#include "chrome/common/chrome_utility_messages.h"
Expand Down Expand Up @@ -89,18 +91,16 @@ void SafeIAppsLibraryParser::OnUtilityProcessStarted() {
}

if (!itunes_callback_.is_null()) {
utility_process_host_->Send(
new ChromeUtilityMsg_ParseITunesLibraryXmlFile(
IPC::TakeFileHandleForProcess(
library_file_.Pass(),
utility_process_host_->GetData().handle)));
utility_process_host_->Send(new ChromeUtilityMsg_ParseITunesLibraryXmlFile(
IPC::TakeFileHandleForProcess(
std::move(library_file_),
utility_process_host_->GetData().handle)));
} else if (!iphoto_callback_.is_null()) {
#if defined(OS_MACOSX)
utility_process_host_->Send(
new ChromeUtilityMsg_ParseIPhotoLibraryXmlFile(
IPC::TakeFileHandleForProcess(
library_file_.Pass(),
utility_process_host_->GetData().handle)));
utility_process_host_->Send(new ChromeUtilityMsg_ParseIPhotoLibraryXmlFile(
IPC::TakeFileHandleForProcess(
std::move(library_file_),
utility_process_host_->GetData().handle)));
#endif
}

Expand Down
Loading

0 comments on commit f26eed3

Please sign in to comment.