diff options
author | dcheng <dcheng@chromium.org> | 2015-12-18 09:48:00 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-18 17:48:52 +0000 |
commit | e59eca16010c109a5e3e4922189c8b264d34caa9 (patch) | |
tree | 838815399c6364a99a465938df9978aeaf75c766 /extensions/renderer | |
parent | 5100baf1eac806abbdaaf8002887aacf652f34e5 (diff) | |
download | chromium_src-e59eca16010c109a5e3e4922189c8b264d34caa9.zip chromium_src-e59eca16010c109a5e3e4922189c8b264d34caa9.tar.gz chromium_src-e59eca16010c109a5e3e4922189c8b264d34caa9.tar.bz2 |
Convert Pass()→std::move() in //extensions
BUG=557422
Review URL: https://codereview.chromium.org/1537893002
Cr-Commit-Position: refs/heads/master@{#366120}
Diffstat (limited to 'extensions/renderer')
21 files changed, 86 insertions, 63 deletions
diff --git a/extensions/renderer/api/serial/data_receiver_unittest.cc b/extensions/renderer/api/serial/data_receiver_unittest.cc index 623fcbf..c650866 100644 --- a/extensions/renderer/api/serial/data_receiver_unittest.cc +++ b/extensions/renderer/api/serial/data_receiver_unittest.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include <queue> +#include <utility> #include "device/serial/data_source_sender.h" #include "device/serial/data_stream.mojom.h" @@ -35,7 +36,7 @@ class DataReceiverFactory : public gin::Wrappable<DataReceiverFactory> { mojo::InterfacePtr<device::serial::DataSourceClient> client; mojo::InterfaceRequest<device::serial::DataSourceClient> client_request = mojo::GetProxy(&client); - callback_.Run(mojo::GetProxy(&sink), client.Pass()); + callback_.Run(mojo::GetProxy(&sink), std::move(client)); gin::Dictionary result = gin::Dictionary::CreateEmpty(isolate_); result.Set("source", sink.PassInterface().PassHandle().release()); @@ -89,7 +90,7 @@ class DataReceiverTest : public ApiTestBase { mojo::InterfaceRequest<device::serial::DataSource> request, mojo::InterfacePtr<device::serial::DataSourceClient> client) { sender_ = new device::DataSourceSender( - request.Pass(), client.Pass(), + std::move(request), std::move(client), base::Bind(&DataReceiverTest::ReadyToSend, base::Unretained(this)), base::Bind(base::DoNothing)); } diff --git a/extensions/renderer/api/serial/data_sender_unittest.cc b/extensions/renderer/api/serial/data_sender_unittest.cc index 461f012..dfda6cd 100644 --- a/extensions/renderer/api/serial/data_sender_unittest.cc +++ b/extensions/renderer/api/serial/data_sender_unittest.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include <queue> +#include <utility> #include "device/serial/data_sink_receiver.h" #include "device/serial/data_stream.mojom.h" @@ -39,7 +40,7 @@ class DataSenderTest : public ApiTestBase { void CreateDataSink( mojo::InterfaceRequest<device::serial::DataSink> request) { receiver_ = new device::DataSinkReceiver( - request.Pass(), + std::move(request), base::Bind(&DataSenderTest::ReadyToReceive, base::Unretained(this)), base::Bind(&DataSenderTest::OnCancel, base::Unretained(this)), base::Bind(base::DoNothing)); @@ -48,7 +49,7 @@ class DataSenderTest : public ApiTestBase { void ReadyToReceive(scoped_ptr<device::ReadOnlyBuffer> buffer) { std::string data(buffer->GetData(), buffer->GetSize()); if (expected_data_.empty()) { - buffer_ = buffer.Pass(); + buffer_ = std::move(buffer); return; } diff --git a/extensions/renderer/api/serial/serial_api_unittest.cc b/extensions/renderer/api/serial/serial_api_unittest.cc index f90fe76..216ac5c 100644 --- a/extensions/renderer/api/serial/serial_api_unittest.cc +++ b/extensions/renderer/api/serial/serial_api_unittest.cc @@ -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/thread_task_runner_handle.h" #include "device/serial/serial_device_enumerator.h" #include "device/serial/serial_service_impl.h" @@ -38,7 +40,7 @@ class FakeSerialDeviceEnumerator : public device::SerialDeviceEnumerator { result[2] = device::serial::DeviceInfo::New(); result[2]->path = ""; result[2]->display_name = ""; - return result.Pass(); + return result; } }; @@ -166,7 +168,7 @@ class GetControlSignalsTestIoHandler : public TestIoHandlerBase { signals->ri = num_calls() & 4; signals->dsr = num_calls() & 8; record_call(); - return signals.Pass(); + return signals; } private: @@ -442,7 +444,7 @@ class SerialApiTest : public ApiTestBase { base::ThreadTaskRunnerHandle::Get()), scoped_ptr<device::SerialDeviceEnumerator>( new FakeSerialDeviceEnumerator), - request.Pass()); + std::move(request)); } DISALLOW_COPY_AND_ASSIGN(SerialApiTest); diff --git a/extensions/renderer/api_test_base.cc b/extensions/renderer/api_test_base.cc index 75c6d5d..3ce3d5d 100644 --- a/extensions/renderer/api_test_base.cc +++ b/extensions/renderer/api_test_base.cc @@ -4,6 +4,7 @@ #include "extensions/renderer/api_test_base.h" +#include <utility> #include <vector> #include "base/run_loop.h" @@ -89,7 +90,7 @@ mojo::Handle TestServiceProvider::ConnectToService( base::Callback<void(mojo::ScopedMessagePipeHandle)> >::iterator it = service_factories_.find(service_name); if (it != service_factories_.end()) - it->second.Run(pipe.handle0.Pass()); + it->second.Run(std::move(pipe.handle0)); return pipe.handle1.release(); } diff --git a/extensions/renderer/api_test_base.h b/extensions/renderer/api_test_base.h index ed53280..2bfc4cc 100644 --- a/extensions/renderer/api_test_base.h +++ b/extensions/renderer/api_test_base.h @@ -62,7 +62,7 @@ class TestServiceProvider : public gin::Wrappable<TestServiceProvider> { const base::Callback<void(mojo::InterfaceRequest<Interface>)> service_factory, mojo::ScopedMessagePipeHandle handle) { - service_factory.Run(mojo::MakeRequest<Interface>(handle.Pass())); + service_factory.Run(mojo::MakeRequest<Interface>(std::move(handle))); } static void IgnoreHandle(mojo::ScopedMessagePipeHandle handle); diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc index b6e3a1e..a674504 100644 --- a/extensions/renderer/dispatcher.cc +++ b/extensions/renderer/dispatcher.cc @@ -4,6 +4,8 @@ #include "extensions/renderer/dispatcher.h" +#include <utility> + #include "base/bind.h" #include "base/bind_helpers.h" #include "base/callback.h" @@ -262,7 +264,7 @@ void Dispatcher::DidCreateScriptContext( { scoped_ptr<ModuleSystem> module_system( new ModuleSystem(context, &source_map_)); - context->set_module_system(module_system.Pass()); + context->set_module_system(std::move(module_system)); } ModuleSystem* module_system = context->module_system(); @@ -1170,7 +1172,8 @@ void Dispatcher::OnUpdatePermissions( active->effective_hosts()); } - extension->permissions_data()->SetPermissions(active.Pass(), withheld.Pass()); + extension->permissions_data()->SetPermissions(std::move(active), + std::move(withheld)); UpdateBindings(extension->id()); } diff --git a/extensions/renderer/dom_activity_logger.cc b/extensions/renderer/dom_activity_logger.cc index 53c5917..086f63e 100644 --- a/extensions/renderer/dom_activity_logger.cc +++ b/extensions/renderer/dom_activity_logger.cc @@ -4,6 +4,8 @@ #include "extensions/renderer/dom_activity_logger.h" +#include <utility> + #include "content/public/child/v8_value_converter.h" #include "content/public/renderer/render_thread.h" #include "extensions/common/dom_action_types.h" @@ -85,8 +87,8 @@ void DOMActivityLogger::logSetter(const WebString& api_name, AppendV8Value(api_name_utf8, new_value, args.get()); if (!old_value.IsEmpty()) AppendV8Value(api_name_utf8, old_value, args.get()); - SendDomActionMessage( - api_name_utf8, url, title, DomActionType::SETTER, args.Pass()); + SendDomActionMessage(api_name_utf8, url, title, DomActionType::SETTER, + std::move(args)); } void DOMActivityLogger::logMethod(const WebString& api_name, @@ -98,8 +100,8 @@ void DOMActivityLogger::logMethod(const WebString& api_name, std::string api_name_utf8 = api_name.utf8(); for (int i = 0; i < argc; ++i) AppendV8Value(api_name_utf8, argv[i], args.get()); - SendDomActionMessage( - api_name_utf8, url, title, DomActionType::METHOD, args.Pass()); + SendDomActionMessage(api_name_utf8, url, title, DomActionType::METHOD, + std::move(args)); } void DOMActivityLogger::logEvent(const WebString& event_name, @@ -111,8 +113,8 @@ void DOMActivityLogger::logEvent(const WebString& event_name, std::string event_name_utf8 = event_name.utf8(); for (int i = 0; i < argc; ++i) args->Append(new base::StringValue(argv[i])); - SendDomActionMessage( - event_name_utf8, url, title, DomActionType::METHOD, args.Pass()); + SendDomActionMessage(event_name_utf8, url, title, DomActionType::METHOD, + std::move(args)); } void DOMActivityLogger::SendDomActionMessage(const std::string& api_call, diff --git a/extensions/renderer/event_bindings.cc b/extensions/renderer/event_bindings.cc index 7544f74b..b92ed6c 100644 --- a/extensions/renderer/event_bindings.cc +++ b/extensions/renderer/event_bindings.cc @@ -266,14 +266,14 @@ void EventBindings::AttachFilteredEvent( args.GetReturnValue().Set(static_cast<int32_t>(-1)); return; } - filter = base::DictionaryValue::From(filter_value.Pass()); + filter = base::DictionaryValue::From(std::move(filter_value)); } // Hold onto a weak reference to |filter| so that it can be used after passing // ownership to |event_filter|. base::DictionaryValue* filter_weak = filter.get(); int id = g_event_filter.Get().AddEventMatcher( - event_name, ParseEventMatcher(filter.Pass())); + event_name, ParseEventMatcher(std::move(filter))); attached_matcher_ids_.insert(id); // Only send IPCs the first time a filter gets added. @@ -341,7 +341,7 @@ void EventBindings::MatchAgainstEventFilter( scoped_ptr<EventMatcher> EventBindings::ParseEventMatcher( scoped_ptr<base::DictionaryValue> filter) { return make_scoped_ptr(new EventMatcher( - filter.Pass(), context()->GetRenderFrame()->GetRoutingID())); + std::move(filter), context()->GetRenderFrame()->GetRoutingID())); } void EventBindings::OnInvalidated() { diff --git a/extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc b/extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc index ee243bf..f54c878 100644 --- a/extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc +++ b/extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc @@ -152,7 +152,7 @@ void GuestViewInternalCustomBindings::AttachGuest( scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create()); scoped_ptr<base::Value> params_as_value( converter->FromV8Value(args[2], context()->v8_context())); - params = base::DictionaryValue::From(params_as_value.Pass()); + params = base::DictionaryValue::From(std::move(params_as_value)); CHECK(params); } @@ -162,7 +162,7 @@ void GuestViewInternalCustomBindings::AttachGuest( linked_ptr<guest_view::GuestViewRequest> request( new guest_view::GuestViewAttachRequest( - guest_view_container, guest_instance_id, params.Pass(), + guest_view_container, guest_instance_id, std::move(params), args.Length() == 4 ? args[3].As<v8::Function>() : v8::Local<v8::Function>(), args.GetIsolate())); @@ -226,7 +226,7 @@ void GuestViewInternalCustomBindings::AttachIframeGuest( scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create()); scoped_ptr<base::Value> params_as_value( converter->FromV8Value(args[2], context()->v8_context())); - params = base::DictionaryValue::From(params_as_value.Pass()); + params = base::DictionaryValue::From(std::move(params_as_value)); CHECK(params); } @@ -261,9 +261,9 @@ void GuestViewInternalCustomBindings::AttachIframeGuest( linked_ptr<guest_view::GuestViewRequest> request( new guest_view::GuestViewAttachIframeRequest( guest_view_container, render_frame->GetRoutingID(), guest_instance_id, - params.Pass(), args.Length() == (num_required_params + 1) - ? args[num_required_params].As<v8::Function>() - : v8::Local<v8::Function>(), + std::move(params), args.Length() == (num_required_params + 1) + ? args[num_required_params].As<v8::Function>() + : v8::Local<v8::Function>(), args.GetIsolate())); guest_view_container->IssueRequest(request); diff --git a/extensions/renderer/module_system.h b/extensions/renderer/module_system.h index e8c2601..45e9c44 100644 --- a/extensions/renderer/module_system.h +++ b/extensions/renderer/module_system.h @@ -8,6 +8,7 @@ #include <map> #include <set> #include <string> +#include <utility> #include <vector> #include "base/compiler_specific.h" @@ -141,7 +142,7 @@ class ModuleSystem : public ObjectBackedNativeHandler, // Passes exceptions to |handler| rather than console::Fatal. void SetExceptionHandlerForTest(scoped_ptr<ExceptionHandler> handler) { - exception_handler_ = handler.Pass(); + exception_handler_ = std::move(handler); } protected: diff --git a/extensions/renderer/module_system_test.cc b/extensions/renderer/module_system_test.cc index 7f697a2..0db5495 100644 --- a/extensions/renderer/module_system_test.cc +++ b/extensions/renderer/module_system_test.cc @@ -6,6 +6,7 @@ #include <map> #include <string> +#include <utility> #include "base/callback.h" #include "base/files/file_path.h" @@ -140,7 +141,7 @@ ModuleSystemTestEnvironment::ModuleSystemTestEnvironment(v8::Isolate* isolate) { scoped_ptr<ModuleSystem> module_system( new ModuleSystem(context_.get(), source_map_.get())); - context_->set_module_system(module_system.Pass()); + context_->set_module_system(std::move(module_system)); } ModuleSystem* module_system = context_->module_system(); module_system->RegisterNativeHandler( diff --git a/extensions/renderer/module_system_unittest.cc b/extensions/renderer/module_system_unittest.cc index d2cb5f8..d84e31e 100644 --- a/extensions/renderer/module_system_unittest.cc +++ b/extensions/renderer/module_system_unittest.cc @@ -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 "base/memory/scoped_ptr.h" #include "extensions/renderer/module_system.h" + +#include <utility> + +#include "base/memory/scoped_ptr.h" #include "extensions/renderer/module_system_test.h" #include "gin/modules/module_registry.h" @@ -53,7 +56,7 @@ TEST_F(ModuleSystemTest, TestExceptionHandling) { TestExceptionHandler* handler = new TestExceptionHandler; scoped_ptr<ModuleSystem::ExceptionHandler> scoped_handler(handler); ASSERT_FALSE(handler->handled_exception()); - env()->module_system()->SetExceptionHandlerForTest(scoped_handler.Pass()); + env()->module_system()->SetExceptionHandlerForTest(std::move(scoped_handler)); env()->RegisterModule("test", "throw 'hi';"); env()->module_system()->Require("test"); diff --git a/extensions/renderer/mojo/keep_alive_client_unittest.cc b/extensions/renderer/mojo/keep_alive_client_unittest.cc index 391d03b..2d9c63c 100644 --- a/extensions/renderer/mojo/keep_alive_client_unittest.cc +++ b/extensions/renderer/mojo/keep_alive_client_unittest.cc @@ -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 "extensions/common/mojo/keep_alive.mojom.h" #include "extensions/renderer/api_test_base.h" #include "grit/extensions_renderer_resources.h" @@ -19,14 +21,15 @@ class TestKeepAlive : public KeepAlive { public: TestKeepAlive(const base::Closure& on_destruction, mojo::InterfaceRequest<KeepAlive> keep_alive) - : on_destruction_(on_destruction), binding_(this, keep_alive.Pass()) {} + : on_destruction_(on_destruction), + binding_(this, std::move(keep_alive)) {} ~TestKeepAlive() override { on_destruction_.Run(); } static void Create(const base::Closure& on_creation, const base::Closure& on_destruction, mojo::InterfaceRequest<KeepAlive> keep_alive) { - new TestKeepAlive(on_destruction, keep_alive.Pass()); + new TestKeepAlive(on_destruction, std::move(keep_alive)); on_creation.Run(); } diff --git a/extensions/renderer/programmatic_script_injector.cc b/extensions/renderer/programmatic_script_injector.cc index 8fea5aa..f576305 100644 --- a/extensions/renderer/programmatic_script_injector.cc +++ b/extensions/renderer/programmatic_script_injector.cc @@ -4,6 +4,7 @@ #include "extensions/renderer/programmatic_script_injector.h" +#include <utility> #include <vector> #include "base/values.h" @@ -118,7 +119,7 @@ void ProgrammaticScriptInjector::OnInjectionComplete( content::RenderFrame* render_frame) { DCHECK(results_.empty()); if (execution_result) - results_.Append(execution_result.Pass()); + results_.Append(std::move(execution_result)); Finish(std::string(), render_frame); } diff --git a/extensions/renderer/script_context.h b/extensions/renderer/script_context.h index a345d07..c803b7b 100644 --- a/extensions/renderer/script_context.h +++ b/extensions/renderer/script_context.h @@ -6,6 +6,7 @@ #define EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ #include <string> +#include <utility> #include <vector> #include "base/basictypes.h" @@ -89,7 +90,7 @@ class ScriptContext : public RequestSender::Source { } void set_module_system(scoped_ptr<ModuleSystem> module_system) { - module_system_ = module_system.Pass(); + module_system_ = std::move(module_system); } ModuleSystem* module_system() { return module_system_.get(); } diff --git a/extensions/renderer/script_injection.cc b/extensions/renderer/script_injection.cc index f924a01..876c07a 100644 --- a/extensions/renderer/script_injection.cc +++ b/extensions/renderer/script_injection.cc @@ -5,6 +5,7 @@ #include "extensions/renderer/script_injection.h" #include <map> +#include <utility> #include "base/lazy_instance.h" #include "base/metrics/histogram.h" @@ -113,14 +114,13 @@ void ScriptInjection::RemoveIsolatedWorld(const std::string& host_id) { g_isolated_worlds.Get().erase(host_id); } -ScriptInjection::ScriptInjection( - scoped_ptr<ScriptInjector> injector, - content::RenderFrame* render_frame, - scoped_ptr<const InjectionHost> injection_host, - UserScript::RunLocation run_location) - : injector_(injector.Pass()), +ScriptInjection::ScriptInjection(scoped_ptr<ScriptInjector> injector, + content::RenderFrame* render_frame, + scoped_ptr<const InjectionHost> injection_host, + UserScript::RunLocation run_location) + : injector_(std::move(injector)), render_frame_(render_frame), - injection_host_(injection_host.Pass()), + injection_host_(std::move(injection_host)), run_location_(run_location), request_id_(kInvalidRequestId), complete_(false), @@ -226,7 +226,7 @@ ScriptInjection::InjectionResult ScriptInjection::Inject( injector_->GetRunInfo(scripts_run_info, run_location_); if (complete_) { - injector_->OnInjectionComplete(execution_result_.Pass(), run_location_, + injector_->OnInjectionComplete(std::move(execution_result_), run_location_, render_frame_); } else { ++scripts_run_info->num_blocking_js; @@ -302,7 +302,7 @@ void ScriptInjection::OnJsInjectionCompleted( // If |async_completion_callback_| is set, it means the script finished // asynchronously, and we should run it. if (!async_completion_callback_.is_null()) { - injector_->OnInjectionComplete(execution_result_.Pass(), run_location_, + injector_->OnInjectionComplete(std::move(execution_result_), run_location_, render_frame_); // Warning: this object can be destroyed after this line! async_completion_callback_.Run(this); diff --git a/extensions/renderer/script_injection_manager.cc b/extensions/renderer/script_injection_manager.cc index 90622c7..e2974af 100644 --- a/extensions/renderer/script_injection_manager.cc +++ b/extensions/renderer/script_injection_manager.cc @@ -414,8 +414,7 @@ void ScriptInjectionManager::HandleExecuteCode( scoped_ptr<ScriptInjection> injection(new ScriptInjection( scoped_ptr<ScriptInjector>( new ProgrammaticScriptInjector(params, render_frame)), - render_frame, - injection_host.Pass(), + render_frame, std::move(injection_host), static_cast<UserScript::RunLocation>(params.run_at))); FrameStatusMap::const_iterator iter = frame_statuses_.find(render_frame); @@ -423,7 +422,7 @@ void ScriptInjectionManager::HandleExecuteCode( iter == frame_statuses_.end() ? UserScript::UNDEFINED : iter->second; ScriptsRunInfo scripts_run_info(render_frame, run_location); - TryToInject(injection.Pass(), run_location, &scripts_run_info); + TryToInject(std::move(injection), run_location, &scripts_run_info); } void ScriptInjectionManager::HandleExecuteDeclarativeScript( @@ -442,8 +441,7 @@ void ScriptInjectionManager::HandleExecuteDeclarativeScript( if (injection.get()) { ScriptsRunInfo scripts_run_info(render_frame, UserScript::BROWSER_DRIVEN); // TODO(markdittmer): Use return value of TryToInject for error handling. - TryToInject(injection.Pass(), - UserScript::BROWSER_DRIVEN, + TryToInject(std::move(injection), UserScript::BROWSER_DRIVEN, &scripts_run_info); scripts_run_info.LogRun(); diff --git a/extensions/renderer/user_script_set.cc b/extensions/renderer/user_script_set.cc index 5667f2d..e4d5295 100644 --- a/extensions/renderer/user_script_set.cc +++ b/extensions/renderer/user_script_set.cc @@ -4,6 +4,8 @@ #include "extensions/renderer/user_script_set.h" +#include <utility> + #include "base/memory/ref_counted.h" #include "content/public/common/url_constants.h" #include "content/public/renderer/render_frame.h" @@ -146,7 +148,7 @@ bool UserScriptSet::UpdateUserScripts(base::SharedMemoryHandle shared_memory, continue; } - scripts_.push_back(script.Pass()); + scripts_.push_back(std::move(script)); } FOR_EACH_OBSERVER(Observer, @@ -189,20 +191,20 @@ scoped_ptr<ScriptInjection> UserScriptSet::GetInjectionForScript( if (host_id.type() == HostID::EXTENSIONS) { injection_host = ExtensionInjectionHost::Create(host_id.id()); if (!injection_host) - return injection.Pass(); + return injection; } else { DCHECK_EQ(host_id.type(), HostID::WEBUI); injection_host.reset(new WebUIInjectionHost(host_id)); } if (web_frame->parent() && !script->match_all_frames()) - return injection.Pass(); // Only match subframes if the script declared it. + return injection; // Only match subframes if the script declared it. GURL effective_document_url = ScriptContext::GetEffectiveDocumentURL( web_frame, document_url, script->match_about_blank()); if (!script->MatchesURL(effective_document_url)) - return injection.Pass(); + return injection; scoped_ptr<ScriptInjector> injector(new UserScriptInjector(script, this, @@ -213,7 +215,7 @@ scoped_ptr<ScriptInjection> UserScriptSet::GetInjectionForScript( web_frame, tab_id) == PermissionsData::ACCESS_DENIED) { - return injection.Pass(); + return injection; } bool inject_css = !script->css_scripts().empty() && @@ -221,13 +223,11 @@ scoped_ptr<ScriptInjection> UserScriptSet::GetInjectionForScript( bool inject_js = !script->js_scripts().empty() && script->run_location() == run_location; if (inject_css || inject_js) { - injection.reset(new ScriptInjection( - injector.Pass(), - render_frame, - injection_host.Pass(), - run_location)); + injection.reset(new ScriptInjection(std::move(injector), render_frame, + std::move(injection_host), + run_location)); } - return injection.Pass(); + return injection; } } // namespace extensions diff --git a/extensions/renderer/v8_schema_registry.cc b/extensions/renderer/v8_schema_registry.cc index 65b1bed..e3dd34c 100644 --- a/extensions/renderer/v8_schema_registry.cc +++ b/extensions/renderer/v8_schema_registry.cc @@ -4,6 +4,8 @@ #include "extensions/renderer/v8_schema_registry.h" +#include <utility> + #include "base/logging.h" #include "base/values.h" #include "content/public/child/v8_value_converter.h" @@ -22,7 +24,7 @@ class SchemaRegistryNativeHandler : public ObjectBackedNativeHandler { SchemaRegistryNativeHandler(V8SchemaRegistry* registry, scoped_ptr<ScriptContext> context) : ObjectBackedNativeHandler(context.get()), - context_(context.Pass()), + context_(std::move(context)), registry_(registry) { RouteFunction("GetSchema", base::Bind(&SchemaRegistryNativeHandler::GetSchema, @@ -58,7 +60,7 @@ scoped_ptr<NativeHandler> V8SchemaRegistry::AsNativeHandler() { NULL, // no effective extension Feature::UNSPECIFIED_CONTEXT)); return scoped_ptr<NativeHandler>( - new SchemaRegistryNativeHandler(this, context.Pass())); + new SchemaRegistryNativeHandler(this, std::move(context))); } v8::Local<v8::Array> V8SchemaRegistry::GetSchemas( diff --git a/extensions/renderer/wake_event_page.cc b/extensions/renderer/wake_event_page.cc index ae98acc..6097075 100644 --- a/extensions/renderer/wake_event_page.cc +++ b/extensions/renderer/wake_event_page.cc @@ -4,6 +4,8 @@ #include "extensions/renderer/wake_event_page.h" +#include <utility> + #include "base/atomic_sequence_num.h" #include "base/bind.h" #include "base/bind_helpers.h" @@ -160,7 +162,7 @@ void WakeEventPage::MakeRequest(const std::string& extension_id, scoped_ptr<RequestData> request_data( new RequestData(content::WorkerThread::GetCurrentId(), on_response)); base::AutoLock lock(requests_lock_); - requests_.set(request_id, request_data.Pass()); + requests_.set(request_id, std::move(request_data)); } message_filter_->Send( new ExtensionHostMsg_WakeEventPage(request_id, extension_id)); diff --git a/extensions/renderer/worker_script_context_set.cc b/extensions/renderer/worker_script_context_set.cc index 242e5a0..a05fdbc 100644 --- a/extensions/renderer/worker_script_context_set.cc +++ b/extensions/renderer/worker_script_context_set.cc @@ -5,6 +5,7 @@ #include "extensions/renderer/worker_script_context_set.h" #include <algorithm> +#include <utility> #include "extensions/renderer/script_context.h" @@ -45,7 +46,7 @@ void WorkerScriptContextSet::Insert(scoped_ptr<ScriptContext> context) { } CHECK(FindContext(contexts, context->v8_context()) == contexts->end()) << "Worker for " << context->url() << " is already in this set"; - contexts->push_back(context.Pass()); + contexts->push_back(std::move(context)); } void WorkerScriptContextSet::Remove(v8::Local<v8::Context> v8_context, |