Skip to content

Commit

Permalink
Global conversion of Pass()→std::move() on OS==linux
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/1550693002

Cr-Commit-Position: refs/heads/master@{#366956}
  • Loading branch information
zetafunction authored and Commit bot committed Dec 28, 2015
1 parent 03b487d commit e486004
Show file tree
Hide file tree
Showing 49 changed files with 230 additions and 195 deletions.
4 changes: 2 additions & 2 deletions apps/custom_launcher_page_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "apps/custom_launcher_page_contents.h"

#include <string>
#include <utility>

#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
Expand All @@ -22,8 +23,7 @@ namespace apps {
CustomLauncherPageContents::CustomLauncherPageContents(
scoped_ptr<extensions::AppDelegate> app_delegate,
const std::string& extension_id)
: app_delegate_(app_delegate.Pass()), extension_id_(extension_id) {
}
: app_delegate_(std::move(app_delegate)), extension_id_(extension_id) {}

CustomLauncherPageContents::~CustomLauncherPageContents() {
}
Expand Down
4 changes: 2 additions & 2 deletions apps/saved_files_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#include "apps/saved_files_service.h"

#include <stdint.h>

#include <algorithm>
#include <map>
#include <utility>

#include "apps/saved_files_service_factory.h"
#include "base/containers/scoped_ptr_hash_map.h"
Expand Down Expand Up @@ -423,7 +423,7 @@ void SavedFilesService::SavedFiles::LoadSavedFileEntriesFromPreferences() {
const std::string& id = file_entry->id;
saved_file_lru_.insert(
std::make_pair(file_entry->sequence_number, file_entry.get()));
registered_file_entries_.add(id, file_entry.Pass());
registered_file_entries_.add(id, std::move(file_entry));
}
}

Expand Down
5 changes: 3 additions & 2 deletions cloud_print/service/service_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "cloud_print/service/service_state.h"

#include <stdint.h>
#include <utility>

#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
Expand Down Expand Up @@ -149,7 +150,7 @@ std::string ServiceState::ToString() {
xmpp_auth_token_);

base::DictionaryValue services;
services.Set(kCloudPrintJsonName, cloud_print.Pass());
services.Set(kCloudPrintJsonName, std::move(cloud_print));

std::string json;
base::JSONWriter::WriteWithOptions(
Expand Down Expand Up @@ -185,7 +186,7 @@ std::string ServiceState::LoginToGoogle(const std::string& service,
scoped_ptr<net::UploadElementReader> reader(
net::UploadOwnedBytesElementReader::CreateWithString(post_body));
request->set_upload(
net::ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0));
net::ElementsUploadDataStream::CreateWithReader(std::move(reader), 0));
request->SetExtraRequestHeaderByName(
"Content-Type", "application/x-www-form-urlencoded", true);
request->set_method("POST");
Expand Down
2 changes: 1 addition & 1 deletion crypto/nss_key_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ ScopedSECKEYPrivateKey FindNSSKeyFromPublicKeyInfo(
ScopedSECKEYPrivateKey key(
PK11_FindKeyByKeyID(item->module->slots[i], cka_id.get(), nullptr));
if (key)
return key.Pass();
return key;
}
}

Expand Down
3 changes: 2 additions & 1 deletion dbus/exported_object.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "dbus/exported_object.h"

#include <stdint.h>
#include <utility>

#include "base/bind.h"
#include "base/logging.h"
Expand Down Expand Up @@ -264,7 +265,7 @@ void ExportedObject::SendResponse(base::TimeTicks start_time,
base::Passed(&response),
start_time));
} else {
OnMethodCompleted(method_call.Pass(), response.Pass(), start_time);
OnMethodCompleted(std::move(method_call), std::move(response), start_time);
}
}

Expand Down
10 changes: 5 additions & 5 deletions dbus/message.cc
Original file line number Diff line number Diff line change
Expand Up @@ -404,19 +404,19 @@ scoped_ptr<Response> Response::FromRawMessage(DBusMessage* raw_message) {

scoped_ptr<Response> response(new Response);
response->Init(raw_message);
return response.Pass();
return response;
}

scoped_ptr<Response> Response::FromMethodCall(MethodCall* method_call) {
scoped_ptr<Response> response(new Response);
response->Init(dbus_message_new_method_return(method_call->raw_message()));
return response.Pass();
return response;
}

scoped_ptr<Response> Response::CreateEmpty() {
scoped_ptr<Response> response(new Response);
response->Init(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_RETURN));
return response.Pass();
return response;
}

//
Expand All @@ -432,7 +432,7 @@ scoped_ptr<ErrorResponse> ErrorResponse::FromRawMessage(

scoped_ptr<ErrorResponse> response(new ErrorResponse);
response->Init(raw_message);
return response.Pass();
return response;
}

scoped_ptr<ErrorResponse> ErrorResponse::FromMethodCall(
Expand All @@ -443,7 +443,7 @@ scoped_ptr<ErrorResponse> ErrorResponse::FromMethodCall(
response->Init(dbus_message_new_error(method_call->raw_message(),
error_name.c_str(),
error_message.c_str()));
return response.Pass();
return response;
}

//
Expand Down
7 changes: 4 additions & 3 deletions dbus/object_proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "dbus/bus.h"
#include "dbus/object_proxy.h"

#include <stddef.h>
#include <utility>

#include "base/bind.h"
#include "base/logging.h"
Expand All @@ -15,10 +16,10 @@
#include "base/task_runner_util.h"
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
#include "dbus/bus.h"
#include "dbus/dbus_statistics.h"
#include "dbus/message.h"
#include "dbus/object_path.h"
#include "dbus/object_proxy.h"
#include "dbus/scoped_dbus_error.h"
#include "dbus/util.h"

Expand Down Expand Up @@ -476,7 +477,7 @@ DBusHandlerResult ObjectProxy::HandleMessage(
if (path.value() == kDBusSystemObjectPath &&
signal->GetMember() == kNameOwnerChangedMember) {
// Handle NameOwnerChanged separately
return HandleNameOwnerChanged(signal.Pass());
return HandleNameOwnerChanged(std::move(signal));
}
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
Expand Down
22 changes: 11 additions & 11 deletions dbus/test_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include "dbus/test_service.h"

#include <stdint.h>

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

#include "base/bind.h"
Expand Down Expand Up @@ -311,7 +311,7 @@ void TestService::Echo(MethodCall* method_call,
scoped_ptr<Response> response = Response::FromMethodCall(method_call);
MessageWriter writer(response.get());
writer.AppendString(text_message);
response_sender.Run(response.Pass());
response_sender.Run(std::move(response));
}

void TestService::SlowEcho(MethodCall* method_call,
Expand Down Expand Up @@ -352,7 +352,7 @@ void TestService::GetAllProperties(

AddPropertiesToWriter(&writer);

response_sender.Run(response.Pass());
response_sender.Run(std::move(response));
}

void TestService::GetProperty(MethodCall* method_call,
Expand All @@ -378,7 +378,7 @@ void TestService::GetProperty(MethodCall* method_call,

writer.AppendVariantOfString("TestService");

response_sender.Run(response.Pass());
response_sender.Run(std::move(response));
} else if (name == "Version") {
// Return a new value for the "Version" property:
// Variant<20>
Expand All @@ -387,7 +387,7 @@ void TestService::GetProperty(MethodCall* method_call,

writer.AppendVariantOfInt16(20);

response_sender.Run(response.Pass());
response_sender.Run(std::move(response));
} else if (name == "Methods") {
// Return the previous value for the "Methods" property:
// Variant<["Echo", "SlowEcho", "AsyncEcho", "BrokenMethod"]>
Expand All @@ -405,7 +405,7 @@ void TestService::GetProperty(MethodCall* method_call,
variant_writer.CloseContainer(&variant_array_writer);
writer.CloseContainer(&variant_writer);

response_sender.Run(response.Pass());
response_sender.Run(std::move(response));
} else if (name == "Objects") {
// Return the previous value for the "Objects" property:
// Variant<[objectpath:"/TestObjectPath"]>
Expand All @@ -420,7 +420,7 @@ void TestService::GetProperty(MethodCall* method_call,
variant_writer.CloseContainer(&variant_array_writer);
writer.CloseContainer(&variant_writer);

response_sender.Run(response.Pass());
response_sender.Run(std::move(response));
} else if (name == "Bytes") {
// Return the previous value for the "Bytes" property:
// Variant<[0x54, 0x65, 0x73, 0x74]>
Expand All @@ -434,7 +434,7 @@ void TestService::GetProperty(MethodCall* method_call,
variant_writer.AppendArrayOfBytes(bytes, sizeof(bytes));
writer.CloseContainer(&variant_writer);

response_sender.Run(response.Pass());
response_sender.Run(std::move(response));
} else {
// Return error.
response_sender.Run(scoped_ptr<Response>());
Expand Down Expand Up @@ -505,14 +505,14 @@ void TestService::PerformAction(
}

scoped_ptr<Response> response = Response::FromMethodCall(method_call);
response_sender.Run(response.Pass());
response_sender.Run(std::move(response));
}

void TestService::PerformActionResponse(
MethodCall* method_call,
ExportedObject::ResponseSender response_sender) {
scoped_ptr<Response> response = Response::FromMethodCall(method_call);
response_sender.Run(response.Pass());
response_sender.Run(std::move(response));
}

void TestService::OwnershipReleased(
Expand Down Expand Up @@ -572,7 +572,7 @@ void TestService::GetManagedObjects(
array_writer.CloseContainer(&dict_entry_writer);
writer.CloseContainer(&array_writer);

response_sender.Run(response.Pass());
response_sender.Run(std::move(response));

if (send_immediate_properties_changed_)
SendPropertyChangedSignal("ChangedTestServiceName");
Expand Down
3 changes: 2 additions & 1 deletion gin/isolate_holder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <utility>

#include "base/logging.h"
#include "base/message_loop/message_loop.h"
Expand Down Expand Up @@ -97,7 +98,7 @@ void IsolateHolder::RemoveRunMicrotasksObserver() {
void IsolateHolder::EnableIdleTasks(
scoped_ptr<V8IdleTaskRunner> idle_task_runner) {
DCHECK(isolate_data_.get());
isolate_data_->EnableIdleTasks(idle_task_runner.Pass());
isolate_data_->EnableIdleTasks(std::move(idle_task_runner));
}

} // namespace gin
10 changes: 5 additions & 5 deletions gin/modules/module_registry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

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

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

#include "base/logging.h"
Expand Down Expand Up @@ -83,7 +83,7 @@ void Define(const v8::FunctionCallbackInfo<Value>& info) {

ModuleRegistry* registry =
ModuleRegistry::From(args.isolate()->GetCurrentContext());
registry->AddPendingModule(args.isolate(), pending.Pass());
registry->AddPendingModule(args.isolate(), std::move(pending));
}

WrapperInfo g_wrapper_info = { kEmbedderNativeGin };
Expand Down Expand Up @@ -161,7 +161,7 @@ void ModuleRegistry::AddPendingModule(Isolate* isolate,
scoped_ptr<PendingModule> pending) {
const std::string pending_id = pending->id;
const std::vector<std::string> pending_dependencies = pending->dependencies;
AttemptToLoad(isolate, pending.Pass());
AttemptToLoad(isolate, std::move(pending));
FOR_EACH_OBSERVER(ModuleRegistryObserver, observer_list_,
OnDidAddPendingModule(pending_id, pending_dependencies));
}
Expand Down Expand Up @@ -258,7 +258,7 @@ bool ModuleRegistry::AttemptToLoad(Isolate* isolate,
pending_modules_.push_back(pending.release());
return false;
}
return Load(isolate, pending.Pass());
return Load(isolate, std::move(pending));
}

v8::Local<v8::Value> ModuleRegistry::GetModule(v8::Isolate* isolate,
Expand All @@ -278,7 +278,7 @@ void ModuleRegistry::AttemptToLoadMoreModules(Isolate* isolate) {
for (size_t i = 0; i < pending_modules.size(); ++i) {
scoped_ptr<PendingModule> pending(pending_modules[i]);
pending_modules[i] = NULL;
if (AttemptToLoad(isolate, pending.Pass()))
if (AttemptToLoad(isolate, std::move(pending)))
keep_trying = true;
}
}
Expand Down
4 changes: 3 additions & 1 deletion gin/per_isolate_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "gin/per_isolate_data.h"

#include <utility>

#include "base/logging.h"
#include "base/single_thread_task_runner.h"
#include "base/thread_task_runner_handle.h"
Expand Down Expand Up @@ -113,7 +115,7 @@ NamedPropertyInterceptor* PerIsolateData::GetNamedPropertyInterceptor(

void PerIsolateData::EnableIdleTasks(
scoped_ptr<V8IdleTaskRunner> idle_task_runner) {
idle_task_runner_ = idle_task_runner.Pass();
idle_task_runner_ = std::move(idle_task_runner);
}

} // namespace gin
12 changes: 5 additions & 7 deletions gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h"

#include <GLES2/gl2.h>
#include <utility>
#ifndef GL_GLEXT_PROTOTYPES
#define GL_GLEXT_PROTOTYPES 1
#endif
Expand Down Expand Up @@ -68,24 +69,21 @@ WebGraphicsContext3DInProcessCommandBufferImpl::WrapContext(
bool lose_context_when_out_of_memory = false; // Not used.
bool is_offscreen = true; // Not used.
return make_scoped_ptr(new WebGraphicsContext3DInProcessCommandBufferImpl(
context.Pass(),
attributes,
lose_context_when_out_of_memory,
is_offscreen,
gfx::kNullAcceleratedWidget /* window. Not used. */));
std::move(context), attributes, lose_context_when_out_of_memory,
is_offscreen, gfx::kNullAcceleratedWidget /* window. Not used. */));
}

WebGraphicsContext3DInProcessCommandBufferImpl::
WebGraphicsContext3DInProcessCommandBufferImpl(
scoped_ptr< ::gpu::GLInProcessContext> context,
scoped_ptr<::gpu::GLInProcessContext> context,
const blink::WebGraphicsContext3D::Attributes& attributes,
bool lose_context_when_out_of_memory,
bool is_offscreen,
gfx::AcceleratedWidget window)
: share_resources_(attributes.shareResources),
is_offscreen_(is_offscreen),
window_(window),
context_(context.Pass()) {
context_(std::move(context)) {
ConvertAttributes(attributes, &attribs_);
attribs_.lose_context_when_out_of_memory = lose_context_when_out_of_memory;
}
Expand Down
Loading

0 comments on commit e486004

Please sign in to comment.