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

Unified Diff: chrome/browser/extensions/api/downloads/downloads_api.cc

Issue 1549233002: Convert Pass()→std::move() in //chrome/browser/extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/downloads/downloads_api.cc
diff --git a/chrome/browser/extensions/api/downloads/downloads_api.cc b/chrome/browser/extensions/api/downloads/downloads_api.cc
index 8f7e2b9440058af0e2fddba29187579264483c27..5739323d017585618bcb49cd0b5471e6c823032a 100644
--- a/chrome/browser/extensions/api/downloads/downloads_api.cc
+++ b/chrome/browser/extensions/api/downloads/downloads_api.cc
@@ -6,9 +6,9 @@
#include <stddef.h>
#include <stdint.h>
-
#include <set>
#include <string>
+#include <utility>
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -540,7 +540,7 @@ void RunDownloadQuery(
return;
}
- scoped_ptr<base::DictionaryValue> query_in_value(query_in.ToValue().Pass());
+ scoped_ptr<base::DictionaryValue> query_in_value(query_in.ToValue());
for (base::DictionaryValue::Iterator query_json_field(*query_in_value.get());
!query_json_field.IsAtEnd(); query_json_field.Advance()) {
FilterTypeMap::const_iterator filter_type =
@@ -601,9 +601,8 @@ class ExtensionDownloadsEventRouterData : public base::SupportsUserData::Data {
scoped_ptr<base::DictionaryValue> json_item)
: updated_(0),
changed_fired_(0),
- json_(json_item.Pass()),
- creator_conflict_action_(
- downloads::FILENAME_CONFLICT_ACTION_UNIQUIFY),
+ json_(std::move(json_item)),
+ creator_conflict_action_(downloads::FILENAME_CONFLICT_ACTION_UNIQUIFY),
determined_conflict_action_(
downloads::FILENAME_CONFLICT_ACTION_UNIQUIFY) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -619,7 +618,7 @@ class ExtensionDownloadsEventRouterData : public base::SupportsUserData::Data {
const base::DictionaryValue& json() const { return *json_.get(); }
void set_json(scoped_ptr<base::DictionaryValue> json_item) {
- json_ = json_item.Pass();
+ json_ = std::move(json_item);
}
void OnItemUpdated() { ++updated_; }
@@ -1025,7 +1024,7 @@ bool DownloadsDownloadFunction::RunAsync() {
DownloadManager* manager = BrowserContext::GetDownloadManager(
current_profile);
- manager->DownloadUrl(download_params.Pass());
+ manager->DownloadUrl(std::move(download_params));
RecordDownloadSource(DOWNLOAD_INITIATED_BY_EXTENSION);
RecordApiFunctions(DOWNLOADS_FUNCTION_DOWNLOAD);
return true;
@@ -1768,7 +1767,7 @@ void ExtensionDownloadsEventRouter::OnDownloadCreated(
(router->HasEventListener(downloads::OnChanged::kEventName) ||
router->HasEventListener(
downloads::OnDeterminingFilename::kEventName))) {
- new ExtensionDownloadsEventRouterData(download_item, json_item.Pass());
+ new ExtensionDownloadsEventRouterData(download_item, std::move(json_item));
}
}
@@ -1837,7 +1836,7 @@ void ExtensionDownloadsEventRouter::OnDownloadUpdated(
Event::WillDispatchCallback(), delta.release());
data->OnChangedFired();
}
- data->set_json(new_json.Pass());
+ data->set_json(std::move(new_json));
}
void ExtensionDownloadsEventRouter::OnDownloadRemoved(
@@ -1864,7 +1863,8 @@ void ExtensionDownloadsEventRouter::DispatchEvent(
args->Append(arg);
std::string json_args;
base::JSONWriter::Write(*args, &json_args);
- scoped_ptr<Event> event(new Event(histogram_value, event_name, args.Pass()));
+ scoped_ptr<Event> event(
+ new Event(histogram_value, event_name, std::move(args)));
// The downloads system wants to share on-record events with off-record
// extension renderers even in incognito_split_mode because that's how
// chrome://downloads works. The "restrict_to_profile" mechanism does not
@@ -1873,7 +1873,7 @@ void ExtensionDownloadsEventRouter::DispatchEvent(
event->restrict_to_browser_context =
(include_incognito && !profile_->IsOffTheRecord()) ? NULL : profile_;
event->will_dispatch_callback = will_dispatch_callback;
- EventRouter::Get(profile_)->BroadcastEvent(event.Pass());
+ EventRouter::Get(profile_)->BroadcastEvent(std::move(event));
DownloadsNotificationSource notification_source;
notification_source.event_name = event_name;
notification_source.profile = profile_;

Powered by Google App Engine
This is Rietveld 408576698