Global conversion of Pass()→std::move() on OS==linux
❆(੭ु ◜◡‾)੭ु⁾☃❆ BUG=557422 R=avi@chromium.org TBR=jam@chromium.org Review URL: https://codereview.chromium.org/1550693002 Cr-Commit-Position: refs/heads/master@{#366956}
This commit is contained in:
apps
cloud_print/service
crypto
dbus
gin
gpu/blink
ipc
jingle
glue
chrome_async_socket.ccchrome_async_socket_unittest.ccfake_ssl_client_socket.ccfake_ssl_client_socket_unittest.ccthread_wrapper.ccxmpp_client_socket_factory.cc
notifier
mash
example
window_type_launcher
wm
printing
remoting/host
sql
third_party
leveldatabase
libaddressinput
zlib
google
@ -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"
|
||||
@ -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() {
|
||||
}
|
||||
|
@ -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"
|
||||
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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"
|
||||
@ -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(
|
||||
@ -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");
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "dbus/exported_object.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <utility>
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/logging.h"
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
//
|
||||
@ -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(
|
||||
@ -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;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -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"
|
||||
@ -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"
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
@ -5,8 +5,8 @@
|
||||
#include "dbus/test_service.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/bind.h"
|
||||
@ -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,
|
||||
@ -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,
|
||||
@ -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>
|
||||
@ -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"]>
|
||||
@ -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"]>
|
||||
@ -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]>
|
||||
@ -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>());
|
||||
@ -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(
|
||||
@ -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");
|
||||
|
@ -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"
|
||||
@ -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
|
||||
|
@ -6,8 +6,8 @@
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/logging.h"
|
||||
@ -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 };
|
||||
@ -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));
|
||||
}
|
||||
@ -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,
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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"
|
||||
@ -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
|
||||
|
@ -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
|
||||
@ -68,16 +69,13 @@ 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,
|
||||
@ -85,7 +83,7 @@ WebGraphicsContext3DInProcessCommandBufferImpl::
|
||||
: 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;
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <utility>
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/compiler_specific.h"
|
||||
@ -359,7 +360,7 @@ scoped_ptr<ChannelProxy> ChannelProxy::Create(
|
||||
const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) {
|
||||
scoped_ptr<ChannelProxy> channel(new ChannelProxy(listener, ipc_task_runner));
|
||||
channel->Init(channel_handle, mode, true);
|
||||
return channel.Pass();
|
||||
return channel;
|
||||
}
|
||||
|
||||
// static
|
||||
@ -368,8 +369,8 @@ scoped_ptr<ChannelProxy> ChannelProxy::Create(
|
||||
Listener* listener,
|
||||
const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) {
|
||||
scoped_ptr<ChannelProxy> channel(new ChannelProxy(listener, ipc_task_runner));
|
||||
channel->Init(factory.Pass(), true);
|
||||
return channel.Pass();
|
||||
channel->Init(std::move(factory), true);
|
||||
return channel;
|
||||
}
|
||||
|
||||
ChannelProxy::ChannelProxy(Context* context)
|
||||
@ -420,7 +421,7 @@ void ChannelProxy::Init(scoped_ptr<ChannelFactory> factory,
|
||||
// low-level pipe so that the client can connect. Without creating
|
||||
// the pipe immediately, it is possible for a listener to attempt
|
||||
// to connect and get an error since the pipe doesn't exist yet.
|
||||
context_->CreateChannel(factory.Pass());
|
||||
context_->CreateChannel(std::move(factory));
|
||||
} else {
|
||||
context_->ipc_task_runner()->PostTask(
|
||||
FROM_HERE, base::Bind(&Context::CreateChannel, context_.get(),
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <utility>
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/lazy_instance.h"
|
||||
@ -416,7 +417,7 @@ scoped_ptr<SyncChannel> SyncChannel::Create(
|
||||
scoped_ptr<SyncChannel> channel =
|
||||
Create(listener, ipc_task_runner, shutdown_event);
|
||||
channel->Init(channel_handle, mode, create_pipe_now);
|
||||
return channel.Pass();
|
||||
return channel;
|
||||
}
|
||||
|
||||
// static
|
||||
@ -428,8 +429,8 @@ scoped_ptr<SyncChannel> SyncChannel::Create(
|
||||
base::WaitableEvent* shutdown_event) {
|
||||
scoped_ptr<SyncChannel> channel =
|
||||
Create(listener, ipc_task_runner, shutdown_event);
|
||||
channel->Init(factory.Pass(), create_pipe_now);
|
||||
return channel.Pass();
|
||||
channel->Init(std::move(factory), create_pipe_now);
|
||||
return channel;
|
||||
}
|
||||
|
||||
// static
|
||||
|
@ -2,15 +2,16 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "build/build_config.h"
|
||||
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "ipc/ipc_test_base.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/process/kill.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "base/time/time.h"
|
||||
#include "build/build_config.h"
|
||||
#include "ipc/ipc_descriptors.h"
|
||||
|
||||
#if defined(OS_POSIX)
|
||||
@ -48,7 +49,7 @@ void IPCTestBase::InitWithCustomMessageLoop(
|
||||
DCHECK(!message_loop_);
|
||||
|
||||
test_client_name_ = test_client_name;
|
||||
message_loop_ = message_loop.Pass();
|
||||
message_loop_ = std::move(message_loop);
|
||||
}
|
||||
|
||||
void IPCTestBase::CreateChannel(IPC::Listener* listener) {
|
||||
@ -61,11 +62,11 @@ bool IPCTestBase::ConnectChannel() {
|
||||
}
|
||||
|
||||
scoped_ptr<IPC::Channel> IPCTestBase::ReleaseChannel() {
|
||||
return channel_.Pass();
|
||||
return std::move(channel_);
|
||||
}
|
||||
|
||||
void IPCTestBase::SetChannel(scoped_ptr<IPC::Channel> channel) {
|
||||
channel_ = channel.Pass();
|
||||
channel_ = std::move(channel);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/bind_helpers.h"
|
||||
@ -76,13 +76,17 @@ class ClientChannelMojo : public ChannelMojo, public ClientChannel {
|
||||
void OnPipeAvailable(mojo::embedder::ScopedPlatformHandle handle,
|
||||
int32_t peer_pid) override {
|
||||
if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk")) {
|
||||
InitMessageReader(mojo::embedder::CreateChannel(
|
||||
handle.Pass(), base::Callback<void(mojo::embedder::ChannelInfo*)>(),
|
||||
scoped_refptr<base::TaskRunner>()), peer_pid);
|
||||
InitMessageReader(
|
||||
mojo::embedder::CreateChannel(
|
||||
std::move(handle),
|
||||
base::Callback<void(mojo::embedder::ChannelInfo*)>(),
|
||||
scoped_refptr<base::TaskRunner>()),
|
||||
peer_pid);
|
||||
return;
|
||||
}
|
||||
CreateMessagingPipe(handle.Pass(), base::Bind(&ClientChannelMojo::BindPipe,
|
||||
weak_factory_.GetWeakPtr()));
|
||||
CreateMessagingPipe(
|
||||
std::move(handle),
|
||||
base::Bind(&ClientChannelMojo::BindPipe, weak_factory_.GetWeakPtr()));
|
||||
}
|
||||
|
||||
// ClientChannel implementation
|
||||
@ -90,13 +94,13 @@ class ClientChannelMojo : public ChannelMojo, public ClientChannel {
|
||||
mojo::ScopedMessagePipeHandle pipe,
|
||||
int32_t peer_pid,
|
||||
const mojo::Callback<void(int32_t)>& callback) override {
|
||||
InitMessageReader(pipe.Pass(), static_cast<base::ProcessId>(peer_pid));
|
||||
InitMessageReader(std::move(pipe), static_cast<base::ProcessId>(peer_pid));
|
||||
callback.Run(GetSelfPID());
|
||||
}
|
||||
|
||||
private:
|
||||
void BindPipe(mojo::ScopedMessagePipeHandle handle) {
|
||||
binding_.Bind(handle.Pass());
|
||||
binding_.Bind(std::move(handle));
|
||||
}
|
||||
void OnConnectionError() {
|
||||
listener()->OnChannelError();
|
||||
@ -127,14 +131,15 @@ class ServerChannelMojo : public ChannelMojo {
|
||||
int32_t peer_pid) override {
|
||||
if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk")) {
|
||||
message_pipe_ = mojo::embedder::CreateChannel(
|
||||
handle.Pass(), base::Callback<void(mojo::embedder::ChannelInfo*)>(),
|
||||
std::move(handle),
|
||||
base::Callback<void(mojo::embedder::ChannelInfo*)>(),
|
||||
scoped_refptr<base::TaskRunner>());
|
||||
if (!message_pipe_.is_valid()) {
|
||||
LOG(WARNING) << "mojo::CreateMessagePipe failed: ";
|
||||
listener()->OnChannelError();
|
||||
return;
|
||||
}
|
||||
InitMessageReader(message_pipe_.Pass(), peer_pid);
|
||||
InitMessageReader(std::move(message_pipe_), peer_pid);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -147,7 +152,7 @@ class ServerChannelMojo : public ChannelMojo {
|
||||
return;
|
||||
}
|
||||
CreateMessagingPipe(
|
||||
handle.Pass(),
|
||||
std::move(handle),
|
||||
base::Bind(&ServerChannelMojo::InitClientChannel,
|
||||
weak_factory_.GetWeakPtr(), base::Passed(&peer)));
|
||||
}
|
||||
@ -162,11 +167,11 @@ class ServerChannelMojo : public ChannelMojo {
|
||||
void InitClientChannel(mojo::ScopedMessagePipeHandle peer_handle,
|
||||
mojo::ScopedMessagePipeHandle handle) {
|
||||
client_channel_.Bind(
|
||||
mojo::InterfacePtrInfo<ClientChannel>(handle.Pass(), 0u));
|
||||
mojo::InterfacePtrInfo<ClientChannel>(std::move(handle), 0u));
|
||||
client_channel_.set_connection_error_handler(base::Bind(
|
||||
&ServerChannelMojo::OnConnectionError, base::Unretained(this)));
|
||||
client_channel_->Init(
|
||||
peer_handle.Pass(), static_cast<int32_t>(GetSelfPID()),
|
||||
std::move(peer_handle), static_cast<int32_t>(GetSelfPID()),
|
||||
base::Bind(&ServerChannelMojo::ClientChannelWasInitialized,
|
||||
base::Unretained(this)));
|
||||
}
|
||||
@ -177,7 +182,7 @@ class ServerChannelMojo : public ChannelMojo {
|
||||
|
||||
// ClientChannelClient implementation
|
||||
void ClientChannelWasInitialized(int32_t peer_pid) {
|
||||
InitMessageReader(message_pipe_.Pass(), peer_pid);
|
||||
InitMessageReader(std::move(message_pipe_), peer_pid);
|
||||
}
|
||||
|
||||
mojo::InterfacePtr<ClientChannel> client_channel_;
|
||||
@ -300,8 +305,9 @@ void ChannelMojo::CreateMessagingPipe(
|
||||
weak_factory_.GetWeakPtr(), callback);
|
||||
if (!g_use_channel_on_io_thread_only ||
|
||||
base::ThreadTaskRunnerHandle::Get() == io_runner_) {
|
||||
CreateMessagingPipeOnIOThread(
|
||||
handle.Pass(), base::ThreadTaskRunnerHandle::Get(), return_callback);
|
||||
CreateMessagingPipeOnIOThread(std::move(handle),
|
||||
base::ThreadTaskRunnerHandle::Get(),
|
||||
return_callback);
|
||||
} else {
|
||||
io_runner_->PostTask(
|
||||
FROM_HERE,
|
||||
@ -318,9 +324,9 @@ void ChannelMojo::CreateMessagingPipeOnIOThread(
|
||||
const CreateMessagingPipeOnIOThreadCallback& callback) {
|
||||
mojo::embedder::ChannelInfo* channel_info;
|
||||
mojo::ScopedMessagePipeHandle pipe =
|
||||
mojo::embedder::CreateChannelOnIOThread(handle.Pass(), &channel_info);
|
||||
mojo::embedder::CreateChannelOnIOThread(std::move(handle), &channel_info);
|
||||
if (base::ThreadTaskRunnerHandle::Get() == callback_runner) {
|
||||
callback.Run(pipe.Pass(), channel_info);
|
||||
callback.Run(std::move(pipe), channel_info);
|
||||
} else {
|
||||
callback_runner->PostTask(
|
||||
FROM_HERE, base::Bind(callback, base::Passed(&pipe), channel_info));
|
||||
@ -334,7 +340,7 @@ void ChannelMojo::OnMessagingPipeCreated(
|
||||
DCHECK(!channel_info_.get());
|
||||
channel_info_ = scoped_ptr<mojo::embedder::ChannelInfo, ChannelInfoDeleter>(
|
||||
channel_info, ChannelInfoDeleter(io_runner_));
|
||||
callback.Run(handle.Pass());
|
||||
callback.Run(std::move(handle));
|
||||
}
|
||||
|
||||
bool ChannelMojo::Connect() {
|
||||
@ -349,7 +355,7 @@ void ChannelMojo::Close() {
|
||||
// |message_reader_| has to be cleared inside the lock,
|
||||
// but the instance has to be deleted outside.
|
||||
base::AutoLock l(lock_);
|
||||
to_be_deleted = message_reader_.Pass();
|
||||
to_be_deleted = std::move(message_reader_);
|
||||
// We might Close() before we Connect().
|
||||
waiting_connect_ = false;
|
||||
}
|
||||
@ -381,7 +387,7 @@ struct ClosingDeleter {
|
||||
void ChannelMojo::InitMessageReader(mojo::ScopedMessagePipeHandle pipe,
|
||||
int32_t peer_pid) {
|
||||
scoped_ptr<internal::MessagePipeReader, ClosingDeleter> reader(
|
||||
new internal::MessagePipeReader(pipe.Pass(), this));
|
||||
new internal::MessagePipeReader(std::move(pipe), this));
|
||||
|
||||
{
|
||||
base::AutoLock l(lock_);
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <utility>
|
||||
|
||||
#include "base/base_paths.h"
|
||||
#include "base/files/file.h"
|
||||
@ -316,8 +317,8 @@ class HandleSendingHelper {
|
||||
mojo::WriteMessageRaw(pipe->self.get(), &content[0],
|
||||
static_cast<uint32_t>(content.size()),
|
||||
nullptr, 0, 0));
|
||||
EXPECT_TRUE(
|
||||
IPC::MojoMessageHelper::WriteMessagePipeTo(message, pipe->peer.Pass()));
|
||||
EXPECT_TRUE(IPC::MojoMessageHelper::WriteMessagePipeTo(
|
||||
message, std::move(pipe->peer)));
|
||||
}
|
||||
|
||||
static void WritePipeThenSend(IPC::Sender* sender, TestingMessagePipe* pipe) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "ipc/mojo/ipc_message_pipe_reader.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <utility>
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/bind_helpers.h"
|
||||
@ -20,14 +21,12 @@ namespace internal {
|
||||
|
||||
MessagePipeReader::MessagePipeReader(mojo::ScopedMessagePipeHandle handle,
|
||||
MessagePipeReader::Delegate* delegate)
|
||||
: pipe_(handle.Pass()),
|
||||
: pipe_(std::move(handle)),
|
||||
handle_copy_(pipe_.get().value()),
|
||||
delegate_(delegate),
|
||||
async_waiter_(
|
||||
new AsyncHandleWaiter(base::Bind(&MessagePipeReader::PipeIsReady,
|
||||
base::Unretained(this)))),
|
||||
pending_send_error_(MOJO_RESULT_OK) {
|
||||
}
|
||||
async_waiter_(new AsyncHandleWaiter(
|
||||
base::Bind(&MessagePipeReader::PipeIsReady, base::Unretained(this)))),
|
||||
pending_send_error_(MOJO_RESULT_OK) {}
|
||||
|
||||
MessagePipeReader::~MessagePipeReader() {
|
||||
DCHECK(thread_checker_.CalledOnValidThread());
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "ipc/mojo/ipc_mojo_bootstrap.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <utility>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/macros.h"
|
||||
@ -164,8 +165,8 @@ scoped_ptr<MojoBootstrap> MojoBootstrap::Create(ChannelHandle handle,
|
||||
|
||||
scoped_ptr<Channel> bootstrap_channel =
|
||||
Channel::Create(handle, mode, self.get());
|
||||
self->Init(bootstrap_channel.Pass(), delegate);
|
||||
return self.Pass();
|
||||
self->Init(std::move(bootstrap_channel), delegate);
|
||||
return self;
|
||||
}
|
||||
|
||||
MojoBootstrap::MojoBootstrap() : delegate_(NULL), state_(STATE_INITIALIZED) {
|
||||
@ -175,7 +176,7 @@ MojoBootstrap::~MojoBootstrap() {
|
||||
}
|
||||
|
||||
void MojoBootstrap::Init(scoped_ptr<Channel> channel, Delegate* delegate) {
|
||||
channel_ = channel.Pass();
|
||||
channel_ = std::move(channel);
|
||||
delegate_ = delegate;
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
#include "ipc/mojo/ipc_mojo_handle_attachment.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "build/build_config.h"
|
||||
#include "ipc/ipc_message_attachment_set.h"
|
||||
#include "third_party/mojo/src/mojo/edk/embedder/embedder.h"
|
||||
@ -12,8 +14,7 @@ namespace IPC {
|
||||
namespace internal {
|
||||
|
||||
MojoHandleAttachment::MojoHandleAttachment(mojo::ScopedHandle handle)
|
||||
: handle_(handle.Pass()) {
|
||||
}
|
||||
: handle_(std::move(handle)) {}
|
||||
|
||||
MojoHandleAttachment::~MojoHandleAttachment() {
|
||||
}
|
||||
@ -38,7 +39,7 @@ base::PlatformFile MojoHandleAttachment::TakePlatformFile() {
|
||||
#endif // OS_POSIX
|
||||
|
||||
mojo::ScopedHandle MojoHandleAttachment::TakeHandle() {
|
||||
return handle_.Pass();
|
||||
return std::move(handle_);
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
#include "ipc/mojo/ipc_mojo_message_helper.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "ipc/mojo/ipc_mojo_handle_attachment.h"
|
||||
|
||||
namespace IPC {
|
||||
@ -13,7 +15,7 @@ bool MojoMessageHelper::WriteMessagePipeTo(
|
||||
Message* message,
|
||||
mojo::ScopedMessagePipeHandle handle) {
|
||||
message->WriteAttachment(new internal::MojoHandleAttachment(
|
||||
mojo::ScopedHandle::From(handle.Pass())));
|
||||
mojo::ScopedHandle::From(std::move(handle))));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,10 @@
|
||||
#include "jingle/glue/chrome_async_socket.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <utility>
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/compiler_specific.h"
|
||||
@ -405,10 +405,9 @@ bool ChromeAsyncSocket::StartTls(const std::string& domain_name) {
|
||||
DCHECK(transport_socket_.get());
|
||||
scoped_ptr<net::ClientSocketHandle> socket_handle(
|
||||
new net::ClientSocketHandle());
|
||||
socket_handle->SetSocket(transport_socket_.Pass());
|
||||
transport_socket_ =
|
||||
resolving_client_socket_factory_->CreateSSLClientSocket(
|
||||
socket_handle.Pass(), net::HostPortPair(domain_name, 443));
|
||||
socket_handle->SetSocket(std::move(transport_socket_));
|
||||
transport_socket_ = resolving_client_socket_factory_->CreateSSLClientSocket(
|
||||
std::move(socket_handle), net::HostPortPair(domain_name, 443));
|
||||
int status = transport_socket_->Connect(
|
||||
base::Bind(&ChromeAsyncSocket::ProcessSSLConnectDone,
|
||||
weak_ptr_factory_.GetWeakPtr()));
|
||||
|
@ -5,9 +5,9 @@
|
||||
#include "jingle/glue/chrome_async_socket.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <deque>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/macros.h"
|
||||
@ -137,7 +137,7 @@ class MockXmppClientSocketFactory : public ResolvingClientSocketFactory {
|
||||
context.cert_verifier = cert_verifier_.get();
|
||||
context.transport_security_state = transport_security_state_.get();
|
||||
return mock_client_socket_factory_->CreateSSLClientSocket(
|
||||
transport_socket.Pass(), host_and_port, ssl_config_, context);
|
||||
std::move(transport_socket), host_and_port, ssl_config_, context);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -161,7 +161,7 @@ class ChromeAsyncSocketTest
|
||||
// when called.
|
||||
// Explicitly create a MessagePumpDefault which can run in this enivronment.
|
||||
scoped_ptr<base::MessagePump> pump(new base::MessagePumpDefault());
|
||||
message_loop_.reset(new base::MessageLoop(pump.Pass()));
|
||||
message_loop_.reset(new base::MessageLoop(std::move(pump)));
|
||||
}
|
||||
|
||||
~ChromeAsyncSocketTest() override {}
|
||||
|
@ -6,8 +6,8 @@
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <cstdlib>
|
||||
#include <utility>
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/logging.h"
|
||||
@ -81,7 +81,7 @@ base::StringPiece FakeSSLClientSocket::GetSslServerHello() {
|
||||
|
||||
FakeSSLClientSocket::FakeSSLClientSocket(
|
||||
scoped_ptr<net::StreamSocket> transport_socket)
|
||||
: transport_socket_(transport_socket.Pass()),
|
||||
: transport_socket_(std::move(transport_socket)),
|
||||
next_handshake_state_(STATE_NONE),
|
||||
handshake_completed_(false),
|
||||
write_buf_(NewDrainableIOBufferWithSize(arraysize(kSslClientHello))),
|
||||
|
@ -6,8 +6,8 @@
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
@ -291,7 +291,7 @@ TEST_F(FakeSSLClientSocketTest, PassThroughMethods) {
|
||||
EXPECT_CALL(*mock_client_socket, SetOmniboxSpeculation());
|
||||
|
||||
// Takes ownership of |mock_client_socket|.
|
||||
FakeSSLClientSocket fake_ssl_client_socket(mock_client_socket.Pass());
|
||||
FakeSSLClientSocket fake_ssl_client_socket(std::move(mock_client_socket));
|
||||
fake_ssl_client_socket.SetReceiveBufferSize(kReceiveBufferSize);
|
||||
fake_ssl_client_socket.SetSendBufferSize(kSendBufferSize);
|
||||
EXPECT_EQ(kPeerAddress,
|
||||
|
@ -51,7 +51,7 @@ scoped_ptr<JingleThreadWrapper> JingleThreadWrapper::WrapTaskRunner(
|
||||
|
||||
scoped_ptr<JingleThreadWrapper> result(new JingleThreadWrapper(task_runner));
|
||||
g_jingle_thread_wrapper.Get().Set(result.get());
|
||||
return result.Pass();
|
||||
return result;
|
||||
}
|
||||
|
||||
// static
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
#include "jingle/glue/xmpp_client_socket_factory.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "jingle/glue/fake_ssl_client_socket.h"
|
||||
#include "jingle/glue/proxy_resolving_client_socket.h"
|
||||
@ -39,10 +41,10 @@ XmppClientSocketFactory::CreateTransportClientSocket(
|
||||
request_context_getter_,
|
||||
ssl_config_,
|
||||
host_and_port));
|
||||
return (use_fake_ssl_client_socket_ ?
|
||||
scoped_ptr<net::StreamSocket>(
|
||||
new FakeSSLClientSocket(transport_socket.Pass())) :
|
||||
transport_socket.Pass());
|
||||
return (use_fake_ssl_client_socket_
|
||||
? scoped_ptr<net::StreamSocket>(
|
||||
new FakeSSLClientSocket(std::move(transport_socket)))
|
||||
: std::move(transport_socket));
|
||||
}
|
||||
|
||||
scoped_ptr<net::SSLClientSocket>
|
||||
@ -58,7 +60,7 @@ XmppClientSocketFactory::CreateSSLClientSocket(
|
||||
// TODO(rkn): context.channel_id_service is NULL because the
|
||||
// ChannelIDService class is not thread safe.
|
||||
return client_socket_factory_->CreateSSLClientSocket(
|
||||
transport_socket.Pass(), host_and_port, ssl_config_, context);
|
||||
std::move(transport_socket), host_and_port, ssl_config_, context);
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "jingle/notifier/base/xmpp_connection.h"
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/memory/ref_counted.h"
|
||||
@ -76,7 +77,7 @@ class XmppConnectionTest : public testing::Test {
|
||||
XmppConnectionTest()
|
||||
: mock_pre_xmpp_auth_(new MockPreXmppAuth()) {
|
||||
scoped_ptr<base::MessagePump> pump(new base::MessagePumpDefault());
|
||||
message_loop_.reset(new base::MessageLoop(pump.Pass()));
|
||||
message_loop_.reset(new base::MessageLoop(std::move(pump)));
|
||||
|
||||
url_request_context_getter_ = new net::TestURLRequestContextGetter(
|
||||
message_loop_->task_runner());
|
||||
|
@ -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/at_exit.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/debug/stack_trace.h"
|
||||
@ -69,7 +71,7 @@ int main(int argc, char** argv) {
|
||||
&application_request, mojo::ScopedMessagePipeHandle()));
|
||||
base::MessageLoop loop(mojo::common::MessagePumpMojo::Create());
|
||||
WindowTypeLauncher delegate;
|
||||
mojo::ApplicationImpl impl(&delegate, application_request.Pass());
|
||||
mojo::ApplicationImpl impl(&delegate, std::move(application_request));
|
||||
loop.Run();
|
||||
|
||||
mojo::embedder::ShutdownIPCSupport();
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "mash/wm/accelerator_registrar_impl.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <utility>
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "components/mus/public/interfaces/window_tree_host.mojom.h"
|
||||
@ -22,7 +23,7 @@ AcceleratorRegistrarImpl::AcceleratorRegistrarImpl(
|
||||
mojo::InterfaceRequest<AcceleratorRegistrar> request,
|
||||
const DestroyCallback& destroy_callback)
|
||||
: host_(host),
|
||||
binding_(this, request.Pass()),
|
||||
binding_(this, std::move(request)),
|
||||
accelerator_namespace_(accelerator_namespace & 0xffff),
|
||||
destroy_callback_(destroy_callback) {
|
||||
binding_.set_connection_error_handler(base::Bind(
|
||||
@ -43,7 +44,7 @@ void AcceleratorRegistrarImpl::ProcessAccelerator(uint32_t accelerator_id,
|
||||
mus::mojom::EventPtr event) {
|
||||
DCHECK(OwnsAccelerator(accelerator_id));
|
||||
accelerator_handler_->OnAccelerator(accelerator_id & kAcceleratorIdMask,
|
||||
event.Pass());
|
||||
std::move(event));
|
||||
}
|
||||
|
||||
uint32_t AcceleratorRegistrarImpl::ComputeAcceleratorId(
|
||||
@ -75,7 +76,7 @@ void AcceleratorRegistrarImpl::OnHandlerGone() {
|
||||
|
||||
void AcceleratorRegistrarImpl::SetHandler(
|
||||
mus::mojom::AcceleratorHandlerPtr handler) {
|
||||
accelerator_handler_ = handler.Pass();
|
||||
accelerator_handler_ = std::move(handler);
|
||||
accelerator_handler_.set_connection_error_handler(base::Bind(
|
||||
&AcceleratorRegistrarImpl::OnHandlerGone, base::Unretained(this)));
|
||||
}
|
||||
@ -92,7 +93,8 @@ void AcceleratorRegistrarImpl::AddAccelerator(
|
||||
}
|
||||
uint32_t namespaced_accelerator_id = ComputeAcceleratorId(accelerator_id);
|
||||
accelerator_ids_.insert(namespaced_accelerator_id);
|
||||
host_->AddAccelerator(namespaced_accelerator_id, matcher.Pass(), callback);
|
||||
host_->AddAccelerator(namespaced_accelerator_id, std::move(matcher),
|
||||
callback);
|
||||
}
|
||||
|
||||
void AcceleratorRegistrarImpl::RemoveAccelerator(uint32_t accelerator_id) {
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "mash/wm/window_manager_application.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <utility>
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "components/mus/common/util.h"
|
||||
@ -82,8 +83,8 @@ void WindowManagerApplication::Initialize(mojo::ApplicationImpl* app) {
|
||||
mojo::GetProxy(&window_manager)));
|
||||
mus::mojom::WindowTreeHostClientPtr host_client;
|
||||
host_client_binding_.Bind(GetProxy(&host_client));
|
||||
mus::CreateSingleWindowTreeHost(app, host_client.Pass(), this,
|
||||
&window_tree_host_, window_manager.Pass(),
|
||||
mus::CreateSingleWindowTreeHost(app, std::move(host_client), this,
|
||||
&window_tree_host_, std::move(window_manager),
|
||||
window_manager_.get());
|
||||
}
|
||||
|
||||
@ -103,7 +104,7 @@ void WindowManagerApplication::OnAccelerator(uint32_t id,
|
||||
default:
|
||||
for (auto* registrar : accelerator_registrars_) {
|
||||
if (registrar->OwnsAccelerator(id)) {
|
||||
registrar->ProcessAccelerator(id, event.Pass());
|
||||
registrar->ProcessAccelerator(id, std::move(event));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -132,7 +133,8 @@ void WindowManagerApplication::OnEmbed(mus::Window* root) {
|
||||
window_manager_->Initialize(this);
|
||||
|
||||
for (auto request : requests_)
|
||||
window_manager_binding_.AddBinding(window_manager_.get(), request->Pass());
|
||||
window_manager_binding_.AddBinding(window_manager_.get(),
|
||||
std::move(*request));
|
||||
requests_.clear();
|
||||
|
||||
shadow_controller_.reset(new ShadowController(root->connection()));
|
||||
@ -158,7 +160,8 @@ void WindowManagerApplication::Create(
|
||||
accelerator_registrar_count = 0;
|
||||
}
|
||||
accelerator_registrars_.insert(new AcceleratorRegistrarImpl(
|
||||
window_tree_host_.get(), ++accelerator_registrar_count, request.Pass(),
|
||||
window_tree_host_.get(), ++accelerator_registrar_count,
|
||||
std::move(request),
|
||||
base::Bind(&WindowManagerApplication::OnAcceleratorRegistrarDestroyed,
|
||||
base::Unretained(this))));
|
||||
}
|
||||
@ -167,10 +170,11 @@ void WindowManagerApplication::Create(
|
||||
mojo::ApplicationConnection* connection,
|
||||
mojo::InterfaceRequest<mus::mojom::WindowManager> request) {
|
||||
if (root_) {
|
||||
window_manager_binding_.AddBinding(window_manager_.get(), request.Pass());
|
||||
window_manager_binding_.AddBinding(window_manager_.get(),
|
||||
std::move(request));
|
||||
} else {
|
||||
requests_.push_back(
|
||||
new mojo::InterfaceRequest<mus::mojom::WindowManager>(request.Pass()));
|
||||
requests_.push_back(new mojo::InterfaceRequest<mus::mojom::WindowManager>(
|
||||
std::move(request)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <stdint.h>
|
||||
#include <utility>
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/macros.h"
|
||||
@ -34,9 +35,10 @@ class WindowManagerAppTest : public mojo::test::ApplicationTestBase,
|
||||
window_tree_client_request = GetProxy(&window_tree_client);
|
||||
mojo::Map<mojo::String, mojo::Array<uint8_t>> properties;
|
||||
properties.mark_non_null();
|
||||
window_manager->OpenWindow(window_tree_client.Pass(), properties.Pass());
|
||||
window_manager->OpenWindow(std::move(window_tree_client),
|
||||
std::move(properties));
|
||||
mus::WindowTreeConnection* connection = mus::WindowTreeConnection::Create(
|
||||
this, window_tree_client_request.Pass(),
|
||||
this, std::move(window_tree_client_request),
|
||||
mus::WindowTreeConnection::CreateType::WAIT_FOR_EMBED);
|
||||
return connection->GetRoot();
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "mash/wm/window_manager_impl.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <utility>
|
||||
|
||||
#include "components/mus/common/types.h"
|
||||
#include "components/mus/public/cpp/property_type_converters.h"
|
||||
@ -115,7 +116,7 @@ void WindowManagerImpl::OpenWindow(
|
||||
|
||||
mojom::Container container = GetRequestedContainer(child_window);
|
||||
state_->GetWindowForContainer(container)->AddChild(child_window);
|
||||
child_window->Embed(client.Pass());
|
||||
child_window->Embed(std::move(client));
|
||||
|
||||
if (provide_non_client_frame) {
|
||||
// NonClientFrameController deletes itself when |child_window| is destroyed.
|
||||
@ -153,7 +154,7 @@ void WindowManagerImpl::GetConfig(const GetConfigCallback& callback) {
|
||||
config->max_title_bar_button_width =
|
||||
NonClientFrameController::GetMaxTitleBarButtonWidth();
|
||||
|
||||
callback.Run(config.Pass());
|
||||
callback.Run(std::move(config));
|
||||
}
|
||||
|
||||
bool WindowManagerImpl::OnWmSetBounds(mus::Window* window, gfx::Rect* bounds) {
|
||||
|
@ -300,10 +300,10 @@ scoped_ptr<PdfMetafileSkia> PdfMetafileSkia::GetMetafileForCurrentPage() {
|
||||
scoped_ptr<PdfMetafileSkia> metafile(new PdfMetafileSkia);
|
||||
|
||||
if (data_->pages_.size() == 0)
|
||||
return metafile.Pass();
|
||||
return metafile;
|
||||
|
||||
if (data_->recorder_.getRecordingCanvas()) // page outstanding
|
||||
return metafile.Pass();
|
||||
return metafile;
|
||||
|
||||
const Page& page = data_->pages_.back();
|
||||
|
||||
@ -312,7 +312,7 @@ scoped_ptr<PdfMetafileSkia> PdfMetafileSkia::GetMetafileForCurrentPage() {
|
||||
if (!metafile->FinishDocument()) // Generate PDF.
|
||||
metafile.reset();
|
||||
|
||||
return metafile.Pass();
|
||||
return metafile;
|
||||
}
|
||||
|
||||
} // namespace printing
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <algorithm>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/bind.h"
|
||||
@ -118,8 +119,8 @@ void PrintedDocument::SetPage(int page_number,
|
||||
const gfx::Rect& page_rect) {
|
||||
// Notice the page_number + 1, the reason is that this is the value that will
|
||||
// be shown. Users dislike 0-based counting.
|
||||
scoped_refptr<PrintedPage> page(
|
||||
new PrintedPage(page_number + 1, metafile.Pass(), paper_size, page_rect));
|
||||
scoped_refptr<PrintedPage> page(new PrintedPage(
|
||||
page_number + 1, std::move(metafile), paper_size, page_rect));
|
||||
#if defined(OS_WIN)
|
||||
page->set_shrink_factor(shrink);
|
||||
#endif // OS_WIN
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
#include "printing/printed_page.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace printing {
|
||||
|
||||
PrintedPage::PrintedPage(int page_number,
|
||||
@ -11,7 +13,7 @@ PrintedPage::PrintedPage(int page_number,
|
||||
const gfx::Size& page_size,
|
||||
const gfx::Rect& page_content_rect)
|
||||
: page_number_(page_number),
|
||||
metafile_(metafile.Pass()),
|
||||
metafile_(std::move(metafile)),
|
||||
#if defined(OS_WIN)
|
||||
shrink_factor_(0.0f),
|
||||
#endif // OS_WIN
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
#include "remoting/host/video_frame_recorder_host_extension.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "base/base64.h"
|
||||
#include "base/json/json_reader.h"
|
||||
#include "base/json/json_writer.h"
|
||||
@ -64,7 +66,7 @@ VideoFrameRecorderHostExtensionSession::
|
||||
void VideoFrameRecorderHostExtensionSession::OnCreateVideoEncoder(
|
||||
scoped_ptr<VideoEncoder>* encoder) {
|
||||
video_frame_recorder_.DetachVideoEncoderWrapper();
|
||||
*encoder = video_frame_recorder_.WrapVideoEncoder(encoder->Pass());
|
||||
*encoder = video_frame_recorder_.WrapVideoEncoder(std::move(*encoder));
|
||||
}
|
||||
|
||||
bool VideoFrameRecorderHostExtensionSession::ModifiesVideoPipeline() const {
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <utility>
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/debug/dump_without_crashing.h"
|
||||
@ -695,9 +696,9 @@ bool Connection::RegisterIntentToUpload() const {
|
||||
|
||||
scoped_ptr<base::ListValue> dumps(new base::ListValue);
|
||||
dumps->AppendString(histogram_tag_);
|
||||
root_dict->Set(kDiagnosticDumpsKey, dumps.Pass());
|
||||
root_dict->Set(kDiagnosticDumpsKey, std::move(dumps));
|
||||
|
||||
root = root_dict.Pass();
|
||||
root = std::move(root_dict);
|
||||
} else {
|
||||
// Failure to read a valid dictionary implies that something is going wrong
|
||||
// on the system.
|
||||
@ -707,7 +708,7 @@ bool Connection::RegisterIntentToUpload() const {
|
||||
if (!read_root.get())
|
||||
return false;
|
||||
scoped_ptr<base::DictionaryValue> root_dict =
|
||||
base::DictionaryValue::From(read_root.Pass());
|
||||
base::DictionaryValue::From(std::move(read_root));
|
||||
if (!root_dict)
|
||||
return false;
|
||||
|
||||
@ -731,7 +732,7 @@ bool Connection::RegisterIntentToUpload() const {
|
||||
|
||||
// Record intention to proceed with upload.
|
||||
dumps->AppendString(histogram_tag_);
|
||||
root = root_dict.Pass();
|
||||
root = std::move(root_dict);
|
||||
}
|
||||
|
||||
const base::FilePath breadcrumb_new =
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <utility>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/rand_util.h"
|
||||
@ -116,7 +117,7 @@ int MojoVFSWrite(sqlite3_file* sql_file,
|
||||
|
||||
filesystem::FileError error = filesystem::FILE_ERROR_FAILED;
|
||||
uint32_t num_bytes_written = 0;
|
||||
GetFSFile(sql_file)->Write(mojo_data.Pass(), offset,
|
||||
GetFSFile(sql_file)->Write(std::move(mojo_data), offset,
|
||||
filesystem::WHENCE_FROM_BEGIN,
|
||||
Capture(&error, &num_bytes_written));
|
||||
GetFSFile(sql_file).WaitForIncomingResponse();
|
||||
@ -299,7 +300,7 @@ int MojoVFSOpen(sqlite3_vfs* mojo_vfs,
|
||||
// |file| is actually a malloced buffer of size szOsFile. This means that we
|
||||
// need to manually use placement new to construct the C++ object which owns
|
||||
// the pipe to our file.
|
||||
new (&GetFSFile(file)) filesystem::FilePtr(file_ptr.Pass());
|
||||
new (&GetFSFile(file)) filesystem::FilePtr(std::move(file_ptr));
|
||||
|
||||
return SQLITE_OK;
|
||||
}
|
||||
@ -431,7 +432,7 @@ static sqlite3_vfs mojo_vfs = {
|
||||
ScopedMojoFilesystemVFS::ScopedMojoFilesystemVFS(
|
||||
filesystem::DirectoryPtr root_directory)
|
||||
: parent_(sqlite3_vfs_find(NULL)),
|
||||
root_directory_(root_directory.Pass()) {
|
||||
root_directory_(std::move(root_directory)) {
|
||||
CHECK(!mojo_vfs.pAppData);
|
||||
mojo_vfs.pAppData = this;
|
||||
mojo_vfs.mxPathname = parent_->mxPathname;
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <utility>
|
||||
|
||||
#include "mojo/application/public/cpp/application_impl.h"
|
||||
#include "mojo/util/capture_util.h"
|
||||
@ -79,7 +80,7 @@ bool SQLTestBase::CorruptSizeInHeaderOfDB() {
|
||||
test::CorruptSizeInHeaderMemory(&header.front(), db_size);
|
||||
|
||||
uint32_t num_bytes_written = 0;
|
||||
file_ptr->Write(header.Pass(), 0, filesystem::WHENCE_FROM_BEGIN,
|
||||
file_ptr->Write(std::move(header), 0, filesystem::WHENCE_FROM_BEGIN,
|
||||
Capture(&error, &num_bytes_written));
|
||||
file_ptr.WaitForIncomingResponse();
|
||||
if (error != filesystem::FILE_ERROR_OK)
|
||||
@ -112,7 +113,7 @@ void SQLTestBase::WriteJunkToDatabase(WriteJunkType type) {
|
||||
memcpy(&data.front(), kJunk, strlen(kJunk));
|
||||
|
||||
uint32_t num_bytes_written = 0;
|
||||
file_ptr->Write(data.Pass(), 0, filesystem::WHENCE_FROM_BEGIN,
|
||||
file_ptr->Write(std::move(data), 0, filesystem::WHENCE_FROM_BEGIN,
|
||||
Capture(&error, &num_bytes_written));
|
||||
file_ptr.WaitForIncomingResponse();
|
||||
}
|
||||
@ -143,12 +144,12 @@ void SQLTestBase::SetUp() {
|
||||
|
||||
filesystem::FileError error = filesystem::FILE_ERROR_FAILED;
|
||||
filesystem::DirectoryPtr directory;
|
||||
files()->OpenFileSystem("temp", GetProxy(&directory), client.Pass(),
|
||||
files()->OpenFileSystem("temp", GetProxy(&directory), std::move(client),
|
||||
Capture(&error));
|
||||
ASSERT_TRUE(files().WaitForIncomingResponse());
|
||||
ASSERT_EQ(filesystem::FILE_ERROR_OK, error);
|
||||
|
||||
vfs_.reset(new ScopedMojoFilesystemVFS(directory.Pass()));
|
||||
vfs_.reset(new ScopedMojoFilesystemVFS(std::move(directory)));
|
||||
ASSERT_TRUE(db_.Open(db_path()));
|
||||
}
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "components/filesystem/public/interfaces/file_system.mojom.h"
|
||||
@ -60,12 +60,12 @@ class VFSTest : public mojo::test::ApplicationTestBase,
|
||||
|
||||
filesystem::FileError error = filesystem::FILE_ERROR_FAILED;
|
||||
filesystem::DirectoryPtr directory;
|
||||
files_->OpenFileSystem("temp", GetProxy(&directory), client.Pass(),
|
||||
files_->OpenFileSystem("temp", GetProxy(&directory), std::move(client),
|
||||
mojo::Capture(&error));
|
||||
ASSERT_TRUE(files_.WaitForIncomingResponse());
|
||||
ASSERT_EQ(filesystem::FILE_ERROR_OK, error);
|
||||
|
||||
vfs_.reset(new ScopedMojoFilesystemVFS(directory.Pass()));
|
||||
vfs_.reset(new ScopedMojoFilesystemVFS(std::move(directory)));
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
|
@ -115,7 +115,7 @@ scoped_ptr<Recovery> Recovery::Begin(
|
||||
return scoped_ptr<Recovery>();
|
||||
}
|
||||
|
||||
return r.Pass();
|
||||
return r;
|
||||
}
|
||||
|
||||
// static
|
||||
|
@ -2,9 +2,11 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <stddef.h>
|
||||
#include "sql/recovery.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/files/file_path.h"
|
||||
@ -14,7 +16,6 @@
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "sql/connection.h"
|
||||
#include "sql/meta_table.h"
|
||||
#include "sql/recovery.h"
|
||||
#include "sql/statement.h"
|
||||
#include "sql/test/paths.h"
|
||||
#include "sql/test/scoped_error_ignorer.h"
|
||||
@ -93,7 +94,7 @@ TEST_F(SQLRecoveryTest, RecoverBasic) {
|
||||
{
|
||||
scoped_ptr<sql::Recovery> recovery = sql::Recovery::Begin(&db(), db_path());
|
||||
ASSERT_TRUE(recovery.get());
|
||||
sql::Recovery::Unrecoverable(recovery.Pass());
|
||||
sql::Recovery::Unrecoverable(std::move(recovery));
|
||||
|
||||
// TODO(shess): Test that calls to recover.db() start failing.
|
||||
}
|
||||
@ -120,7 +121,7 @@ TEST_F(SQLRecoveryTest, RecoverBasic) {
|
||||
ASSERT_TRUE(recovery->db()->Execute(kAltInsertSql));
|
||||
|
||||
// Successfully recovered.
|
||||
ASSERT_TRUE(sql::Recovery::Recovered(recovery.Pass()));
|
||||
ASSERT_TRUE(sql::Recovery::Recovered(std::move(recovery)));
|
||||
}
|
||||
EXPECT_FALSE(db().is_open());
|
||||
ASSERT_TRUE(Reopen());
|
||||
@ -163,7 +164,7 @@ TEST_F(SQLRecoveryTest, VirtualTable) {
|
||||
ASSERT_TRUE(recovery->db()->Execute(kRecoveryCopySql));
|
||||
|
||||
// Successfully recovered.
|
||||
ASSERT_TRUE(sql::Recovery::Recovered(recovery.Pass()));
|
||||
ASSERT_TRUE(sql::Recovery::Recovered(std::move(recovery)));
|
||||
}
|
||||
|
||||
// Since the database was not corrupt, the entire schema and all
|
||||
@ -204,7 +205,7 @@ void RecoveryCallback(sql::Connection* db, const base::FilePath& db_path,
|
||||
ASSERT_TRUE(recovery->db()->Execute(kCreateIndex));
|
||||
ASSERT_TRUE(recovery->db()->Execute(kRecoveryCopySql));
|
||||
|
||||
ASSERT_TRUE(sql::Recovery::Recovered(recovery.Pass()));
|
||||
ASSERT_TRUE(sql::Recovery::Recovered(std::move(recovery)));
|
||||
}
|
||||
|
||||
// Build a database, corrupt it by making an index reference to
|
||||
@ -361,7 +362,7 @@ TEST_F(SQLRecoveryTest, Meta) {
|
||||
EXPECT_TRUE(recovery->GetMetaVersionNumber(&version));
|
||||
EXPECT_EQ(kVersion, version);
|
||||
|
||||
sql::Recovery::Rollback(recovery.Pass());
|
||||
sql::Recovery::Rollback(std::move(recovery));
|
||||
}
|
||||
ASSERT_TRUE(Reopen()); // Handle was poisoned.
|
||||
|
||||
@ -374,7 +375,7 @@ TEST_F(SQLRecoveryTest, Meta) {
|
||||
EXPECT_FALSE(recovery->GetMetaVersionNumber(&version));
|
||||
EXPECT_EQ(0, version);
|
||||
|
||||
sql::Recovery::Rollback(recovery.Pass());
|
||||
sql::Recovery::Rollback(std::move(recovery));
|
||||
}
|
||||
ASSERT_TRUE(Reopen()); // Handle was poisoned.
|
||||
|
||||
@ -424,7 +425,7 @@ TEST_F(SQLRecoveryTest, AutoRecoverTable) {
|
||||
EXPECT_EQ(temp_schema,
|
||||
ExecuteWithResults(recovery->db(), kTempSchemaSql, "|", "\n"));
|
||||
|
||||
ASSERT_TRUE(sql::Recovery::Recovered(recovery.Pass()));
|
||||
ASSERT_TRUE(sql::Recovery::Recovered(std::move(recovery)));
|
||||
}
|
||||
|
||||
// Since the database was not corrupt, the entire schema and all
|
||||
@ -442,7 +443,7 @@ TEST_F(SQLRecoveryTest, AutoRecoverTable) {
|
||||
size_t rows = 0;
|
||||
EXPECT_FALSE(recovery->AutoRecoverTable("y", 0, &rows));
|
||||
|
||||
sql::Recovery::Unrecoverable(recovery.Pass());
|
||||
sql::Recovery::Unrecoverable(std::move(recovery));
|
||||
}
|
||||
}
|
||||
|
||||
@ -500,7 +501,7 @@ TEST_F(SQLRecoveryTest, AutoRecoverTableWithDefault) {
|
||||
EXPECT_TRUE(recovery->AutoRecoverTable("x", 0, &rows));
|
||||
EXPECT_EQ(4u, rows);
|
||||
|
||||
ASSERT_TRUE(sql::Recovery::Recovered(recovery.Pass()));
|
||||
ASSERT_TRUE(sql::Recovery::Recovered(std::move(recovery)));
|
||||
}
|
||||
|
||||
// Since the database was not corrupt, the entire schema and all
|
||||
@ -536,7 +537,7 @@ TEST_F(SQLRecoveryTest, AutoRecoverTableNullFilter) {
|
||||
EXPECT_TRUE(recovery->AutoRecoverTable("x", 0, &rows));
|
||||
EXPECT_EQ(1u, rows);
|
||||
|
||||
ASSERT_TRUE(sql::Recovery::Recovered(recovery.Pass()));
|
||||
ASSERT_TRUE(sql::Recovery::Recovered(std::move(recovery)));
|
||||
}
|
||||
|
||||
// The schema should be the same, but only one row of data should
|
||||
@ -575,7 +576,7 @@ TEST_F(SQLRecoveryTest, AutoRecoverTableWithRowid) {
|
||||
EXPECT_TRUE(recovery->AutoRecoverTable("x", 0, &rows));
|
||||
EXPECT_EQ(2u, rows);
|
||||
|
||||
ASSERT_TRUE(sql::Recovery::Recovered(recovery.Pass()));
|
||||
ASSERT_TRUE(sql::Recovery::Recovered(std::move(recovery)));
|
||||
}
|
||||
|
||||
// Since the database was not corrupt, the entire schema and all
|
||||
@ -620,7 +621,7 @@ TEST_F(SQLRecoveryTest, AutoRecoverTableWithCompoundKey) {
|
||||
EXPECT_TRUE(recovery->AutoRecoverTable("x", 0, &rows));
|
||||
EXPECT_EQ(3u, rows);
|
||||
|
||||
ASSERT_TRUE(sql::Recovery::Recovered(recovery.Pass()));
|
||||
ASSERT_TRUE(sql::Recovery::Recovered(std::move(recovery)));
|
||||
}
|
||||
|
||||
// Since the database was not corrupt, the entire schema and all
|
||||
@ -654,7 +655,7 @@ TEST_F(SQLRecoveryTest, AutoRecoverTableExtendColumns) {
|
||||
size_t rows = 0;
|
||||
EXPECT_TRUE(recovery->AutoRecoverTable("x", 1, &rows));
|
||||
EXPECT_EQ(2u, rows);
|
||||
ASSERT_TRUE(sql::Recovery::Recovered(recovery.Pass()));
|
||||
ASSERT_TRUE(sql::Recovery::Recovered(std::move(recovery)));
|
||||
}
|
||||
|
||||
// Since the database was not corrupt, the entire schema and all
|
||||
@ -689,7 +690,7 @@ TEST_F(SQLRecoveryTest, Bug387868) {
|
||||
EXPECT_EQ(43u, rows);
|
||||
|
||||
// Successfully recovered.
|
||||
EXPECT_TRUE(sql::Recovery::Recovered(recovery.Pass()));
|
||||
EXPECT_TRUE(sql::Recovery::Recovered(std::move(recovery)));
|
||||
}
|
||||
}
|
||||
#endif // !defined(USE_SYSTEM_SQLITE)
|
||||
|
8
third_party/leveldatabase/env_chromium.cc
vendored
8
third_party/leveldatabase/env_chromium.cc
vendored
@ -4,6 +4,8 @@
|
||||
|
||||
#include "third_party/leveldatabase/env_chromium.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#if defined(OS_POSIX)
|
||||
#include <dirent.h>
|
||||
#include <sys/types.h>
|
||||
@ -188,7 +190,7 @@ class ChromiumRandomAccessFile : public leveldb::RandomAccessFile {
|
||||
ChromiumRandomAccessFile(const std::string& fname,
|
||||
base::File file,
|
||||
const UMALogger* uma_logger)
|
||||
: filename_(fname), file_(file.Pass()), uma_logger_(uma_logger) {}
|
||||
: filename_(fname), file_(std::move(file)), uma_logger_(uma_logger) {}
|
||||
virtual ~ChromiumRandomAccessFile() {}
|
||||
|
||||
Status Read(uint64_t offset,
|
||||
@ -766,7 +768,7 @@ Status ChromiumEnv::LockFile(const std::string& fname, FileLock** lock) {
|
||||
}
|
||||
|
||||
ChromiumFileLock* my_lock = new ChromiumFileLock;
|
||||
my_lock->file_ = file.Pass();
|
||||
my_lock->file_ = std::move(file);
|
||||
my_lock->name_ = fname;
|
||||
*lock = my_lock;
|
||||
return result;
|
||||
@ -851,7 +853,7 @@ Status ChromiumEnv::NewRandomAccessFile(const std::string& fname,
|
||||
int flags = base::File::FLAG_READ | base::File::FLAG_OPEN;
|
||||
base::File file(FilePath::FromUTF8Unsafe(fname), flags);
|
||||
if (file.IsValid()) {
|
||||
*result = new ChromiumRandomAccessFile(fname, file.Pass(), this);
|
||||
*result = new ChromiumRandomAccessFile(fname, std::move(file), this);
|
||||
RecordOpenFilesLimit("Success");
|
||||
return Status::OK();
|
||||
}
|
||||
|
@ -5,8 +5,8 @@
|
||||
#include "third_party/libaddressinput/chromium/chrome_address_validator.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
@ -740,12 +740,11 @@ class FailingAddressValidatorTest : public testing::Test, LoadRulesListener {
|
||||
class TestAddressValidator : public AddressValidator {
|
||||
public:
|
||||
// Takes ownership of |source| and |storage|.
|
||||
TestAddressValidator(
|
||||
scoped_ptr< ::i18n::addressinput::Source> source,
|
||||
scoped_ptr< ::i18n::addressinput::Storage> storage,
|
||||
LoadRulesListener* load_rules_listener)
|
||||
: AddressValidator(source.Pass(),
|
||||
storage.Pass(),
|
||||
TestAddressValidator(scoped_ptr<::i18n::addressinput::Source> source,
|
||||
scoped_ptr<::i18n::addressinput::Storage> storage,
|
||||
LoadRulesListener* load_rules_listener)
|
||||
: AddressValidator(std::move(source),
|
||||
std::move(storage),
|
||||
load_rules_listener) {}
|
||||
|
||||
virtual ~TestAddressValidator() {}
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
#include "third_party/libaddressinput/chromium/chrome_metadata_source.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
@ -83,9 +85,7 @@ void ChromeMetadataSource::OnURLFetchComplete(const net::URLFetcher* source) {
|
||||
ChromeMetadataSource::Request::Request(const std::string& key,
|
||||
scoped_ptr<net::URLFetcher> fetcher,
|
||||
const Callback& callback)
|
||||
: key(key),
|
||||
fetcher(fetcher.Pass()),
|
||||
callback(callback) {}
|
||||
: key(key), fetcher(std::move(fetcher)), callback(callback) {}
|
||||
|
||||
void ChromeMetadataSource::Download(const std::string& key,
|
||||
const Callback& downloaded) {
|
||||
@ -101,7 +101,7 @@ void ChromeMetadataSource::Download(const std::string& key,
|
||||
net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES);
|
||||
fetcher->SetRequestContext(getter_);
|
||||
|
||||
Request* request = new Request(key, fetcher.Pass(), downloaded);
|
||||
Request* request = new Request(key, std::move(fetcher), downloaded);
|
||||
request->fetcher->SaveResponseWithWriter(
|
||||
scoped_ptr<net::URLFetcherResponseWriter>(
|
||||
new UnownedStringWriter(&request->data)));
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
#include "third_party/libaddressinput/chromium/chrome_storage_impl.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/prefs/writeable_pref_store.h"
|
||||
#include "base/values.h"
|
||||
@ -25,7 +27,7 @@ void ChromeStorageImpl::Put(const std::string& key, std::string* data) {
|
||||
scoped_ptr<base::StringValue> string_value(
|
||||
new base::StringValue(std::string()));
|
||||
string_value->GetString()->swap(*owned_data);
|
||||
backing_store_->SetValue(key, string_value.Pass(),
|
||||
backing_store_->SetValue(key, std::move(string_value),
|
||||
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
|
||||
}
|
||||
|
||||
|
2
third_party/libaddressinput/chromium/json.cc
vendored
2
third_party/libaddressinput/chromium/json.cc
vendored
@ -36,7 +36,7 @@ namespace {
|
||||
else
|
||||
result.reset(static_cast<const base::DictionaryValue*>(parsed.release()));
|
||||
|
||||
return result.Pass();
|
||||
return std::move(result);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
23
third_party/zlib/google/zip_reader.cc
vendored
23
third_party/zlib/google/zip_reader.cc
vendored
@ -4,6 +4,8 @@
|
||||
|
||||
#include "third_party/zlib/google/zip_reader.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/files/file.h"
|
||||
#include "base/logging.h"
|
||||
@ -394,13 +396,9 @@ void ZipReader::ExtractCurrentEntryToFilePathAsync(
|
||||
|
||||
base::MessageLoop::current()->PostTask(
|
||||
FROM_HERE,
|
||||
base::Bind(&ZipReader::ExtractChunk,
|
||||
weak_ptr_factory_.GetWeakPtr(),
|
||||
Passed(output_file.Pass()),
|
||||
success_callback,
|
||||
failure_callback,
|
||||
progress_callback,
|
||||
0 /* initial offset */));
|
||||
base::Bind(&ZipReader::ExtractChunk, weak_ptr_factory_.GetWeakPtr(),
|
||||
Passed(std::move(output_file)), success_callback,
|
||||
failure_callback, progress_callback, 0 /* initial offset */));
|
||||
}
|
||||
|
||||
bool ZipReader::ExtractCurrentEntryIntoDirectory(
|
||||
@ -505,14 +503,9 @@ void ZipReader::ExtractChunk(base::File output_file,
|
||||
|
||||
base::MessageLoop::current()->PostTask(
|
||||
FROM_HERE,
|
||||
base::Bind(&ZipReader::ExtractChunk,
|
||||
weak_ptr_factory_.GetWeakPtr(),
|
||||
Passed(output_file.Pass()),
|
||||
success_callback,
|
||||
failure_callback,
|
||||
progress_callback,
|
||||
current_progress));
|
||||
|
||||
base::Bind(&ZipReader::ExtractChunk, weak_ptr_factory_.GetWeakPtr(),
|
||||
Passed(std::move(output_file)), success_callback,
|
||||
failure_callback, progress_callback, current_progress));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user