diff options
author | dcheng <dcheng@chromium.org> | 2015-12-28 20:19:48 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-29 04:21:11 +0000 |
commit | a3c693e216157a8fddaa5080b503d35f7f9c2745 (patch) | |
tree | 227a43e57281c45e1a4619193414dbc374328eb2 | |
parent | a352d7c482891dd488302b06e87929b14877c7dc (diff) | |
download | chromium_src-a3c693e216157a8fddaa5080b503d35f7f9c2745.zip chromium_src-a3c693e216157a8fddaa5080b503d35f7f9c2745.tar.gz chromium_src-a3c693e216157a8fddaa5080b503d35f7f9c2745.tar.bz2 |
Global conversion of Pass()→std::move() on OS=linux chromecast=1
(╯^□^)╯︵ ❄☃❄
BUG=557422
R=avi@chromium.org
TBR=jam@chromium.org
Review URL: https://codereview.chromium.org/1553493002
Cr-Commit-Position: refs/heads/master@{#367050}
26 files changed, 120 insertions, 85 deletions
diff --git a/base/feature_list_unittest.cc b/base/feature_list_unittest.cc index edd656e..11cf179 100644 --- a/base/feature_list_unittest.cc +++ b/base/feature_list_unittest.cc @@ -332,7 +332,7 @@ TEST_F(FeatureListTest, GetFeatureOverrides) { FeatureList::OVERRIDE_ENABLE_FEATURE, trial); - RegisterFeatureListInstance(feature_list.Pass()); + RegisterFeatureListInstance(std::move(feature_list)); std::string enable_features; std::string disable_features; @@ -348,7 +348,7 @@ TEST_F(FeatureListTest, InitializeFromCommandLine_WithFieldTrials) { FieldTrialList::CreateFieldTrial("Trial", "Group"); scoped_ptr<FeatureList> feature_list(new FeatureList); feature_list->InitializeFromCommandLine("A,OffByDefault<Trial,X", "D"); - RegisterFeatureListInstance(feature_list.Pass()); + RegisterFeatureListInstance(std::move(feature_list)); EXPECT_FALSE(FieldTrialList::IsTrialActive("Trial")); EXPECT_TRUE(FeatureList::IsEnabled(kFeatureOffByDefault)); diff --git a/cloud_print/gcp20/prototype/cloud_print_request.cc b/cloud_print/gcp20/prototype/cloud_print_request.cc index 455dbaf..95c9fe8 100644 --- a/cloud_print/gcp20/prototype/cloud_print_request.cc +++ b/cloud_print/gcp20/prototype/cloud_print_request.cc @@ -5,6 +5,7 @@ #include "cloud_print/gcp20/prototype/cloud_print_request.h" #include <stdint.h> +#include <utility> #include "base/bind.h" #include "base/command_line.h" @@ -56,7 +57,7 @@ scoped_ptr<CloudPrintRequest> CloudPrintRequest::CreatePost( scoped_ptr<CloudPrintRequest> request( new CloudPrintRequest(url, URLFetcher::POST, delegate)); request->fetcher_->SetUploadData(mimetype, content); - return request.Pass(); + return std::move(request); } void CloudPrintRequest::Run( diff --git a/cloud_print/gcp20/prototype/cloud_print_requester.cc b/cloud_print/gcp20/prototype/cloud_print_requester.cc index 9b94a38..b32456c 100644 --- a/cloud_print/gcp20/prototype/cloud_print_requester.cc +++ b/cloud_print/gcp20/prototype/cloud_print_requester.cc @@ -5,8 +5,8 @@ #include "cloud_print/gcp20/prototype/cloud_print_requester.h" #include <stdint.h> - #include <limits> +#include <utility> #include "base/bind.h" #include "base/json/json_writer.h" @@ -90,7 +90,7 @@ std::string LocalSettingsToJson(const LocalSettings& settings) { current->SetBoolean("printer/local_printing_enabled", settings.local_printing_enabled); current->SetInteger("xmpp_timeout_value", settings.xmpp_timeout_value); - dictionary.Set("current", current.Pass()); + dictionary.Set("current", std::move(current)); std::string local_settings; base::JSONWriter::Write(dictionary, &local_settings); diff --git a/cloud_print/gcp20/prototype/cloud_print_url_request_context_getter.cc b/cloud_print/gcp20/prototype/cloud_print_url_request_context_getter.cc index 904ae65..efcdf00 100644 --- a/cloud_print/gcp20/prototype/cloud_print_url_request_context_getter.cc +++ b/cloud_print/gcp20/prototype/cloud_print_url_request_context_getter.cc @@ -4,6 +4,8 @@ #include "cloud_print/gcp20/prototype/cloud_print_url_request_context_getter.h" +#include <utility> + #include "net/proxy/proxy_config_service_fixed.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_builder.h" @@ -25,7 +27,7 @@ CloudPrintURLRequestContextGetter::GetURLRequestContext() { builder.set_proxy_config_service( make_scoped_ptr(new net::ProxyConfigServiceFixed(net::ProxyConfig()))); #endif // defined(OS_LINUX) || defined(OS_ANDROID) - context_ = builder.Build().Pass(); + context_ = std::move(builder.Build()); } return context_.get(); } diff --git a/cloud_print/gcp20/prototype/privet_http_server.cc b/cloud_print/gcp20/prototype/privet_http_server.cc index 52716f2..38046e0 100644 --- a/cloud_print/gcp20/prototype/privet_http_server.cc +++ b/cloud_print/gcp20/prototype/privet_http_server.cc @@ -6,6 +6,7 @@ #include <stddef.h> #include <stdint.h> +#include <utility> #include "base/command_line.h" #include "base/json/json_writer.h" @@ -34,7 +35,7 @@ scoped_ptr<base::DictionaryValue> CreateError(const std::string& error_type) { scoped_ptr<base::DictionaryValue> error(new base::DictionaryValue); error->SetString("error", error_type); - return error.Pass(); + return std::move(error); } // {"error":|error_type|, "description":|description|} @@ -43,7 +44,7 @@ scoped_ptr<base::DictionaryValue> CreateErrorWithDescription( const std::string& description) { scoped_ptr<base::DictionaryValue> error(CreateError(error_type)); error->SetString("description", description); - return error.Pass(); + return std::move(error); } // {"error":|error_type|, "timeout":|timeout|} @@ -52,7 +53,7 @@ scoped_ptr<base::DictionaryValue> CreateErrorWithTimeout( int timeout) { scoped_ptr<base::DictionaryValue> error(CreateError(error_type)); error->SetInteger("timeout", timeout); - return error.Pass(); + return std::move(error); } // Converts state to string. @@ -115,7 +116,7 @@ bool PrivetHttpServer::Start(uint16_t port) { if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableIpv6)) listen_address = "0.0.0.0"; server_socket->ListenWithAddressAndPort(listen_address, port, 1); - server_.reset(new net::HttpServer(server_socket.Pass(), this)); + server_.reset(new net::HttpServer(std::move(server_socket), this)); net::IPEndPoint address; if (server_->GetLocalAddress(&address) != net::OK) { @@ -277,7 +278,7 @@ scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessInfo( response->Set("type", type.DeepCopy()); *status_code = net::HTTP_OK; - return response.Pass(); + return std::move(response); } scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessCapabilities( @@ -316,7 +317,7 @@ scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessCreateJob( response.reset(new base::DictionaryValue); response->SetString("job_id", job_id); response->SetInteger("expires_in", expires_in); - return response.Pass(); + return std::move(response); case LocalPrintJob::CREATE_INVALID_TICKET: return CreateError("invalid_ticket"); @@ -376,7 +377,7 @@ scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessSubmitDoc( base::StringPrintf("%u", static_cast<uint32_t>(job.content.size()))); if (job_name_present) response->SetString("job_name", job.job_name); - return response.Pass(); + return std::move(response); case LocalPrintJob::SAVE_INVALID_PRINT_JOB: return CreateErrorWithTimeout("invalid_print_job", timeout); @@ -414,7 +415,7 @@ scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessJobState( response->SetString("job_id", job_id); response->SetString("state", LocalPrintJobStateToString(info.state)); response->SetInteger("expires_in", info.expires_in); - return response.Pass(); + return std::move(response); } scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessRegister( @@ -465,7 +466,7 @@ scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessRegister( ProcessRegistrationStatus(status, &response); *status_code = net::HTTP_OK; - return response.Pass(); + return std::move(response); } void PrivetHttpServer::ProcessRegistrationStatus( diff --git a/content/browser/compositor/browser_compositor_overlay_candidate_validator_ozone.cc b/content/browser/compositor/browser_compositor_overlay_candidate_validator_ozone.cc index 23e54da..dae75cf 100644 --- a/content/browser/compositor/browser_compositor_overlay_candidate_validator_ozone.cc +++ b/content/browser/compositor/browser_compositor_overlay_candidate_validator_ozone.cc @@ -5,6 +5,7 @@ #include "content/browser/compositor/browser_compositor_overlay_candidate_validator_ozone.h" #include <stddef.h> +#include <utility> #include "cc/output/overlay_strategy_single_on_top.h" #include "cc/output/overlay_strategy_underlay.h" @@ -29,9 +30,8 @@ BrowserCompositorOverlayCandidateValidatorOzone:: gfx::AcceleratedWidget widget, scoped_ptr<ui::OverlayCandidatesOzone> overlay_candidates) : widget_(widget), - overlay_candidates_(overlay_candidates.Pass()), - software_mirror_active_(false) { -} + overlay_candidates_(std::move(overlay_candidates)), + software_mirror_active_(false) {} BrowserCompositorOverlayCandidateValidatorOzone:: ~BrowserCompositorOverlayCandidateValidatorOzone() { diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc index 983be0c..51099ca 100644 --- a/content/browser/compositor/gpu_process_transport_factory.cc +++ b/content/browser/compositor/gpu_process_transport_factory.cc @@ -176,7 +176,7 @@ CreateOverlayCandidateValidator(gfx::AcceleratedWidget widget) { (command_line->HasSwitch(switches::kEnableHardwareOverlays) || command_line->HasSwitch(switches::kOzoneTestSingleOverlaySupport))) { validator.reset(new BrowserCompositorOverlayCandidateValidatorOzone( - widget, overlay_candidates.Pass())); + widget, std::move(overlay_candidates))); } #elif defined(OS_MACOSX) // Overlays are only supported through the remote layer API. diff --git a/content/browser/media/cdm/browser_cdm_manager.cc b/content/browser/media/cdm/browser_cdm_manager.cc index 7c49c6d..2f997d0 100644 --- a/content/browser/media/cdm/browser_cdm_manager.cc +++ b/content/browser/media/cdm/browser_cdm_manager.cc @@ -5,8 +5,8 @@ #include "content/browser/media/cdm/browser_cdm_manager.h" #include <stddef.h> - #include <string> +#include <utility> #include "base/bind.h" #include "base/bind_helpers.h" @@ -426,7 +426,7 @@ void BrowserCdmManager::OnSetServerCertificate( return; } - cdm->SetServerCertificate(certificate, promise.Pass()); + cdm->SetServerCertificate(certificate, std::move(promise)); } void BrowserCdmManager::OnCreateSessionAndGenerateRequest( @@ -540,7 +540,7 @@ void BrowserCdmManager::OnUpdateSession(int render_frame_id, return; } - cdm->UpdateSession(session_id, response, promise.Pass()); + cdm->UpdateSession(session_id, response, std::move(promise)); } void BrowserCdmManager::OnCloseSession(int render_frame_id, @@ -558,7 +558,7 @@ void BrowserCdmManager::OnCloseSession(int render_frame_id, return; } - cdm->CloseSession(session_id, promise.Pass()); + cdm->CloseSession(session_id, std::move(promise)); } void BrowserCdmManager::OnRemoveSession(int render_frame_id, @@ -576,7 +576,7 @@ void BrowserCdmManager::OnRemoveSession(int render_frame_id, return; } - cdm->RemoveSession(session_id, promise.Pass()); + cdm->RemoveSession(session_id, std::move(promise)); } void BrowserCdmManager::OnDestroyCdm(int render_frame_id, int cdm_id) { @@ -700,8 +700,8 @@ void BrowserCdmManager::CreateSessionAndGenerateRequestIfPermitted( return; } - cdm->CreateSessionAndGenerateRequest(session_type, init_data_type, - init_data, promise.Pass()); + cdm->CreateSessionAndGenerateRequest(session_type, init_data_type, init_data, + std::move(promise)); } void BrowserCdmManager::LoadSessionIfPermitted( @@ -725,7 +725,7 @@ void BrowserCdmManager::LoadSessionIfPermitted( return; } - cdm->LoadSession(session_type, session_id, promise.Pass()); + cdm->LoadSession(session_type, session_id, std::move(promise)); } } // namespace content diff --git a/content/common/discardable_shared_memory_heap_perftest.cc b/content/common/discardable_shared_memory_heap_perftest.cc index e81aa84a..8c37a85 100644 --- a/content/common/discardable_shared_memory_heap_perftest.cc +++ b/content/common/discardable_shared_memory_heap_perftest.cc @@ -5,10 +5,10 @@ #include "content/common/discardable_shared_memory_heap.h" #include <stddef.h> - #include <algorithm> #include <cmath> #include <cstdlib> +#include <utility> #include "base/bind.h" #include "base/callback_helpers.h" @@ -40,9 +40,9 @@ TEST(DiscardableSharedMemoryHeapTest, SearchFreeLists) { scoped_ptr<base::DiscardableSharedMemory> memory( new base::DiscardableSharedMemory); ASSERT_TRUE(memory->CreateAndMap(segment_size)); - heap.MergeIntoFreeLists(heap.Grow(memory.Pass(), segment_size, + heap.MergeIntoFreeLists(heap.Grow(std::move(memory), segment_size, next_discardable_shared_memory_id++, - base::Bind(NullTask)).Pass()); + base::Bind(NullTask))); } unsigned kSeed = 1; diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc b/content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc index 98a1b3f..c030355 100644 --- a/content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc +++ b/content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc @@ -4,6 +4,8 @@ #include "content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_pixmap.h" +#include <utility> + #include "content/common/gpu/gpu_memory_buffer_factory_ozone_native_pixmap.h" #include "ui/gfx/buffer_format_util.h" #include "ui/ozone/public/client_native_pixmap_factory.h" @@ -27,7 +29,8 @@ GpuMemoryBufferImplOzoneNativePixmap::GpuMemoryBufferImplOzoneNativePixmap( gfx::BufferFormat format, const DestructionCallback& callback, scoped_ptr<ui::ClientNativePixmap> pixmap) - : GpuMemoryBufferImpl(id, size, format, callback), pixmap_(pixmap.Pass()) {} + : GpuMemoryBufferImpl(id, size, format, callback), + pixmap_(std::move(pixmap)) {} GpuMemoryBufferImplOzoneNativePixmap::~GpuMemoryBufferImplOzoneNativePixmap() {} @@ -44,7 +47,7 @@ GpuMemoryBufferImplOzoneNativePixmap::CreateFromHandle( handle.native_pixmap_handle, size, usage); DCHECK(native_pixmap); return make_scoped_ptr(new GpuMemoryBufferImplOzoneNativePixmap( - handle.id, size, format, callback, native_pixmap.Pass())); + handle.id, size, format, callback, std::move(native_pixmap))); } // static diff --git a/content/renderer/media/cdm/proxy_media_keys.cc b/content/renderer/media/cdm/proxy_media_keys.cc index d628c35..2e5752e 100644 --- a/content/renderer/media/cdm/proxy_media_keys.cc +++ b/content/renderer/media/cdm/proxy_media_keys.cc @@ -4,6 +4,7 @@ #include "content/renderer/media/cdm/proxy_media_keys.h" +#include <utility> #include <vector> #include "base/logging.h" @@ -37,13 +38,13 @@ void ProxyMediaKeys::Create( new media::CdmInitializedPromise(cdm_created_cb, proxy_media_keys)); proxy_media_keys->InitializeCdm(key_system, security_origin, - use_hw_secure_codecs, promise.Pass()); + use_hw_secure_codecs, std::move(promise)); } void ProxyMediaKeys::SetServerCertificate( const std::vector<uint8_t>& certificate, scoped_ptr<media::SimpleCdmPromise> promise) { - uint32_t promise_id = cdm_promise_adapter_.SavePromise(promise.Pass()); + uint32_t promise_id = cdm_promise_adapter_.SavePromise(std::move(promise)); manager_->SetServerCertificate(cdm_id_, promise_id, certificate); } @@ -69,7 +70,7 @@ void ProxyMediaKeys::CreateSessionAndGenerateRequest( return; } - uint32_t promise_id = cdm_promise_adapter_.SavePromise(promise.Pass()); + uint32_t promise_id = cdm_promise_adapter_.SavePromise(std::move(promise)); manager_->CreateSessionAndGenerateRequest(cdm_id_, promise_id, session_type, create_session_init_data_type, init_data); @@ -79,7 +80,7 @@ void ProxyMediaKeys::LoadSession( SessionType session_type, const std::string& session_id, scoped_ptr<media::NewSessionCdmPromise> promise) { - uint32_t promise_id = cdm_promise_adapter_.SavePromise(promise.Pass()); + uint32_t promise_id = cdm_promise_adapter_.SavePromise(std::move(promise)); manager_->LoadSession(cdm_id_, promise_id, session_type, session_id); } @@ -87,20 +88,20 @@ void ProxyMediaKeys::UpdateSession( const std::string& session_id, const std::vector<uint8_t>& response, scoped_ptr<media::SimpleCdmPromise> promise) { - uint32_t promise_id = cdm_promise_adapter_.SavePromise(promise.Pass()); + uint32_t promise_id = cdm_promise_adapter_.SavePromise(std::move(promise)); manager_->UpdateSession(cdm_id_, promise_id, session_id, response); } void ProxyMediaKeys::CloseSession(const std::string& session_id, scoped_ptr<media::SimpleCdmPromise> promise) { - uint32_t promise_id = cdm_promise_adapter_.SavePromise(promise.Pass()); + uint32_t promise_id = cdm_promise_adapter_.SavePromise(std::move(promise)); manager_->CloseSession(cdm_id_, promise_id, session_id); } void ProxyMediaKeys::RemoveSession( const std::string& session_id, scoped_ptr<media::SimpleCdmPromise> promise) { - uint32_t promise_id = cdm_promise_adapter_.SavePromise(promise.Pass()); + uint32_t promise_id = cdm_promise_adapter_.SavePromise(std::move(promise)); manager_->RemoveSession(cdm_id_, promise_id, session_id); } @@ -141,7 +142,7 @@ void ProxyMediaKeys::OnSessionKeysChange(const std::string& session_id, bool has_additional_usable_key, media::CdmKeysInfo keys_info) { session_keys_change_cb_.Run(session_id, has_additional_usable_key, - keys_info.Pass()); + std::move(keys_info)); } void ProxyMediaKeys::OnSessionExpirationUpdate( @@ -195,7 +196,7 @@ void ProxyMediaKeys::InitializeCdm( const GURL& security_origin, bool use_hw_secure_codecs, scoped_ptr<media::SimpleCdmPromise> promise) { - uint32_t promise_id = cdm_promise_adapter_.SavePromise(promise.Pass()); + uint32_t promise_id = cdm_promise_adapter_.SavePromise(std::move(promise)); manager_->InitializeCdm(cdm_id_, promise_id, this, key_system, security_origin, use_hw_secure_codecs); } diff --git a/content/renderer/media/cdm/renderer_cdm_manager.cc b/content/renderer/media/cdm/renderer_cdm_manager.cc index 7c1a866..67402da7 100644 --- a/content/renderer/media/cdm/renderer_cdm_manager.cc +++ b/content/renderer/media/cdm/renderer_cdm_manager.cc @@ -5,6 +5,7 @@ #include "content/renderer/media/cdm/renderer_cdm_manager.h" #include <stddef.h> +#include <utility> #include "base/stl_util.h" #include "content/common/media/cdm_messages.h" @@ -180,7 +181,7 @@ void RendererCdmManager::OnSessionKeysChange( keys_info.push_back(new media::CdmKeyInformation(key_info)); media_keys->OnSessionKeysChange(session_id, has_additional_usable_key, - keys_info.Pass()); + std::move(keys_info)); } void RendererCdmManager::OnSessionExpirationUpdate( diff --git a/google_apis/drive/files_list_request_runner_unittest.cc b/google_apis/drive/files_list_request_runner_unittest.cc index 51b72c6..e3e472d 100644 --- a/google_apis/drive/files_list_request_runner_unittest.cc +++ b/google_apis/drive/files_list_request_runner_unittest.cc @@ -4,6 +4,8 @@ #include "google_apis/drive/files_list_request_runner.h" +#include <utility> + #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" @@ -93,7 +95,7 @@ class FilesListRequestRunnerTest : public testing::Test { // happen. void OnCompleted(DriveApiErrorCode error, scoped_ptr<FileList> entry) { response_error_.reset(new DriveApiErrorCode(error)); - response_entry_ = entry.Pass(); + response_entry_ = std::move(entry); on_completed_callback_.Run(); } @@ -113,7 +115,7 @@ class FilesListRequestRunnerTest : public testing::Test { const GURL& base_url, const net::test_server::HttpRequest& request) { http_request_.reset(new net::test_server::HttpRequest(request)); - return fake_server_response_.Pass(); + return std::move(fake_server_response_); } base::MessageLoopForIO message_loop_; // Test server needs IO thread. diff --git a/media/blink/resource_multibuffer_data_provider_unittest.cc b/media/blink/resource_multibuffer_data_provider_unittest.cc index f3d7556..91975c1 100644 --- a/media/blink/resource_multibuffer_data_provider_unittest.cc +++ b/media/blink/resource_multibuffer_data_provider_unittest.cc @@ -2,10 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <stdint.h> +#include "media/blink/resource_multibuffer_data_provider.h" +#include <stdint.h> #include <algorithm> #include <string> +#include <utility> #include "base/bind.h" #include "base/format_macros.h" @@ -16,7 +18,6 @@ #include "media/base/seekable_buffer.h" #include "media/blink/mock_webframeclient.h" #include "media/blink/mock_weburlloader.h" -#include "media/blink/resource_multibuffer_data_provider.h" #include "media/blink/url_index.h" #include "net/base/net_errors.h" #include "net/http/http_request_headers.h" @@ -94,7 +95,7 @@ class ResourceMultiBufferDataProviderTest : public testing::Test { scoped_ptr<ResourceMultiBufferDataProvider> loader( new ResourceMultiBufferDataProvider(url_data_.get(), first_position_)); loader_ = loader.get(); - url_data_->multibuffer()->AddProvider(loader.Pass()); + url_data_->multibuffer()->AddProvider(std::move(loader)); // |test_loader_| will be used when Start() is called. url_loader_ = new NiceMock<MockWebURLLoader>(); diff --git a/media/formats/common/stream_parser_test_base.cc b/media/formats/common/stream_parser_test_base.cc index 29ca747..de80bac 100644 --- a/media/formats/common/stream_parser_test_base.cc +++ b/media/formats/common/stream_parser_test_base.cc @@ -4,6 +4,8 @@ #include "media/formats/common/stream_parser_test_base.h" +#include <utility> + #include "base/bind.h" #include "media/base/test_data_util.h" #include "testing/gtest/include/gtest/gtest.h" @@ -29,7 +31,7 @@ static std::string BufferQueueToString( StreamParserTestBase::StreamParserTestBase( scoped_ptr<StreamParser> stream_parser) - : parser_(stream_parser.Pass()) { + : parser_(std::move(stream_parser)) { parser_->Init( base::Bind(&StreamParserTestBase::OnInitDone, base::Unretained(this)), base::Bind(&StreamParserTestBase::OnNewConfig, base::Unretained(this)), diff --git a/media/formats/mp2t/mp2t_stream_parser.cc b/media/formats/mp2t/mp2t_stream_parser.cc index 37d4797..8ebe5a5 100644 --- a/media/formats/mp2t/mp2t_stream_parser.cc +++ b/media/formats/mp2t/mp2t_stream_parser.cc @@ -4,6 +4,8 @@ #include "media/formats/mp2t/mp2t_stream_parser.h" +#include <utility> + #include "base/bind.h" #include "base/callback_helpers.h" #include "base/stl_util.h" @@ -72,13 +74,14 @@ class PidState { int continuity_counter_; }; -PidState::PidState(int pid, PidType pid_type, +PidState::PidState(int pid, + PidType pid_type, scoped_ptr<TsSection> section_parser) - : pid_(pid), - pid_type_(pid_type), - section_parser_(section_parser.Pass()), - enable_(false), - continuity_counter_(-1) { + : pid_(pid), + pid_type_(pid_type), + section_parser_(std::move(section_parser)), + enable_(false), + continuity_counter_(-1) { DCHECK(section_parser_); } @@ -281,9 +284,8 @@ bool Mp2tStreamParser::Parse(const uint8_t* buf, int size) { new TsSectionPat( base::Bind(&Mp2tStreamParser::RegisterPmt, base::Unretained(this)))); - scoped_ptr<PidState> pat_pid_state( - new PidState(ts_packet->pid(), PidState::kPidPat, - pat_section_parser.Pass())); + scoped_ptr<PidState> pat_pid_state(new PidState( + ts_packet->pid(), PidState::kPidPat, std::move(pat_section_parser))); pat_pid_state->Enable(); it = pids_.insert( std::pair<int, PidState*>(ts_packet->pid(), @@ -330,7 +332,7 @@ void Mp2tStreamParser::RegisterPmt(int program_number, int pmt_pid) { base::Bind(&Mp2tStreamParser::RegisterPes, base::Unretained(this), pmt_pid))); scoped_ptr<PidState> pmt_pid_state( - new PidState(pmt_pid, PidState::kPidPmt, pmt_section_parser.Pass())); + new PidState(pmt_pid, PidState::kPidPmt, std::move(pmt_section_parser))); pmt_pid_state->Enable(); pids_.insert(std::pair<int, PidState*>(pmt_pid, pmt_pid_state.release())); } @@ -384,11 +386,11 @@ void Mp2tStreamParser::RegisterPes(int pmt_pid, // Create the PES state here. DVLOG(1) << "Create a new PES state"; scoped_ptr<TsSection> pes_section_parser( - new TsSectionPes(es_parser.Pass(), ×tamp_unroller_)); + new TsSectionPes(std::move(es_parser), ×tamp_unroller_)); PidState::PidType pid_type = is_audio ? PidState::kPidAudioPes : PidState::kPidVideoPes; scoped_ptr<PidState> pes_pid_state( - new PidState(pes_pid, pid_type, pes_section_parser.Pass())); + new PidState(pes_pid, pid_type, std::move(pes_section_parser))); pids_.insert(std::pair<int, PidState*>(pes_pid, pes_pid_state.release())); // A new PES pid has been added, the PID filter might change. diff --git a/media/formats/mp4/avc.cc b/media/formats/mp4/avc.cc index 01f7df2..3844bef 100644 --- a/media/formats/mp4/avc.cc +++ b/media/formats/mp4/avc.cc @@ -5,6 +5,7 @@ #include "media/formats/mp4/avc.h" #include <algorithm> +#include <utility> #include "base/logging.h" #include "media/base/decrypt_config.h" @@ -311,7 +312,7 @@ bool AVC::IsValidAnnexB(const uint8_t* buffer, AVCBitstreamConverter::AVCBitstreamConverter( scoped_ptr<AVCDecoderConfigurationRecord> avc_config) - : avc_config_(avc_config.Pass()) { + : avc_config_(std::move(avc_config)) { DCHECK(avc_config_); } diff --git a/media/formats/mp4/box_definitions.cc b/media/formats/mp4/box_definitions.cc index 95e0b2f..e448b1a 100644 --- a/media/formats/mp4/box_definitions.cc +++ b/media/formats/mp4/box_definitions.cc @@ -4,6 +4,8 @@ #include "media/formats/mp4/box_definitions.h" +#include <utility> + #include "base/logging.h" #include "media/base/video_types.h" #include "media/base/video_util.h" @@ -520,8 +522,8 @@ bool VideoSampleEntry::Parse(BoxReader* reader) { scoped_ptr<AVCDecoderConfigurationRecord> avcConfig( new AVCDecoderConfigurationRecord()); RCHECK(reader->ReadChild(avcConfig.get())); - frame_bitstream_converter = make_scoped_refptr( - new AVCBitstreamConverter(avcConfig.Pass())); + frame_bitstream_converter = + make_scoped_refptr(new AVCBitstreamConverter(std::move(avcConfig))); video_codec = kCodecH264; video_codec_profile = H264PROFILE_MAIN; #if defined(ENABLE_HEVC_DEMUXING) @@ -531,8 +533,8 @@ bool VideoSampleEntry::Parse(BoxReader* reader) { scoped_ptr<HEVCDecoderConfigurationRecord> hevcConfig( new HEVCDecoderConfigurationRecord()); RCHECK(reader->ReadChild(hevcConfig.get())); - frame_bitstream_converter = make_scoped_refptr( - new HEVCBitstreamConverter(hevcConfig.Pass())); + frame_bitstream_converter = + make_scoped_refptr(new HEVCBitstreamConverter(std::move(hevcConfig))); video_codec = kCodecHEVC; #endif } else { diff --git a/media/formats/mp4/hevc.cc b/media/formats/mp4/hevc.cc index ff964b0..49f13c0 100644 --- a/media/formats/mp4/hevc.cc +++ b/media/formats/mp4/hevc.cc @@ -5,6 +5,7 @@ #include "media/formats/mp4/hevc.h" #include <algorithm> +#include <utility> #include <vector> #include "base/logging.h" @@ -209,7 +210,7 @@ bool HEVC::IsValidAnnexB(const uint8_t* buffer, HEVCBitstreamConverter::HEVCBitstreamConverter( scoped_ptr<HEVCDecoderConfigurationRecord> hevc_config) - : hevc_config_(hevc_config.Pass()) { + : hevc_config_(std::move(hevc_config)) { DCHECK(hevc_config_); } diff --git a/media/formats/mp4/mp4_stream_parser.cc b/media/formats/mp4/mp4_stream_parser.cc index 6faf303..ee88ea1 100644 --- a/media/formats/mp4/mp4_stream_parser.cc +++ b/media/formats/mp4/mp4_stream_parser.cc @@ -5,8 +5,8 @@ #include "media/formats/mp4/mp4_stream_parser.h" #include <stddef.h> - #include <limits> +#include <utility> #include <vector> #include "base/callback_helpers.h" @@ -530,7 +530,7 @@ bool MP4StreamParser::EnqueueSample(BufferQueue* audio_buffers, buffer_type, 0); if (decrypt_config) - stream_buf->set_decrypt_config(decrypt_config.Pass()); + stream_buf->set_decrypt_config(std::move(decrypt_config)); stream_buf->set_duration(runs_->duration()); stream_buf->set_timestamp(runs_->cts()); diff --git a/ui/events/ozone/evdev/event_converter_evdev_impl_unittest.cc b/ui/events/ozone/evdev/event_converter_evdev_impl_unittest.cc index e2309bd..3658567 100644 --- a/ui/events/ozone/evdev/event_converter_evdev_impl_unittest.cc +++ b/ui/events/ozone/evdev/event_converter_evdev_impl_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/bind.h" #include "base/macros.h" #include "base/memory/scoped_ptr.h" @@ -13,12 +15,17 @@ #include "ui/events/keycodes/keyboard_codes.h" #include "ui/events/ozone/device/device_manager.h" #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" +// Note: This should normally be the first include in the list, but it +// transitively includes <linux/input.h>, which breaks dom_code.h due to macros +// that conflict with enumerator names. #include "ui/events/ozone/evdev/event_converter_evdev_impl.h" #include "ui/events/ozone/evdev/event_converter_test_util.h" #include "ui/events/ozone/evdev/event_factory_evdev.h" #include "ui/events/ozone/evdev/keyboard_evdev.h" #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" +// This is not ordered with the normal #includes, due to the aforementioned +// macro conflict. #include <linux/input.h> namespace ui { @@ -141,7 +148,7 @@ class EventConverterEvdevImplTest : public testing::Test { private: void DispatchEventForTest(ui::Event* event) { scoped_ptr<ui::Event> cloned_event = ui::Event::Clone(*event); - dispatched_events_.push_back(cloned_event.Pass()); + dispatched_events_.push_back(std::move(cloned_event)); } base::MessageLoopForUI ui_loop_; diff --git a/ui/events/ozone/evdev/event_factory_evdev.cc b/ui/events/ozone/evdev/event_factory_evdev.cc index 32dd7c5..1811829 100644 --- a/ui/events/ozone/evdev/event_factory_evdev.cc +++ b/ui/events/ozone/evdev/event_factory_evdev.cc @@ -4,6 +4,8 @@ #include "ui/events/ozone/evdev/event_factory_evdev.h" +#include <utility> + #include "base/bind.h" #include "base/task_runner.h" #include "base/thread_task_runner_handle.h" @@ -155,7 +157,7 @@ scoped_ptr<SystemInputInjector> EventFactoryEvdev::CreateSystemInputInjector() { new ProxyDeviceEventDispatcher(base::ThreadTaskRunnerHandle::Get(), weak_ptr_factory_.GetWeakPtr())); return make_scoped_ptr( - new InputInjectorEvdev(proxy_dispatcher.Pass(), cursor_)); + new InputInjectorEvdev(std::move(proxy_dispatcher), cursor_)); } void EventFactoryEvdev::DispatchKeyEvent(const KeyEventParams& params) { @@ -400,7 +402,7 @@ void EventFactoryEvdev::StartThread() { scoped_ptr<DeviceEventDispatcherEvdev> proxy_dispatcher( new ProxyDeviceEventDispatcher(base::ThreadTaskRunnerHandle::Get(), weak_ptr_factory_.GetWeakPtr())); - thread_.Start(proxy_dispatcher.Pass(), cursor_, + thread_.Start(std::move(proxy_dispatcher), cursor_, base::Bind(&EventFactoryEvdev::OnThreadStarted, weak_ptr_factory_.GetWeakPtr())); } @@ -408,7 +410,7 @@ void EventFactoryEvdev::StartThread() { void EventFactoryEvdev::OnThreadStarted( scoped_ptr<InputDeviceFactoryEvdevProxy> input_device_factory) { TRACE_EVENT0("evdev", "EventFactoryEvdev::OnThreadStarted"); - input_device_factory_proxy_ = input_device_factory.Pass(); + input_device_factory_proxy_ = std::move(input_device_factory); // Hook up device configuration. input_controller_.SetInputDeviceFactory(input_device_factory_proxy_.get()); diff --git a/ui/events/ozone/evdev/event_thread_evdev.cc b/ui/events/ozone/evdev/event_thread_evdev.cc index 66ce4c2..7257718f 100644 --- a/ui/events/ozone/evdev/event_thread_evdev.cc +++ b/ui/events/ozone/evdev/event_thread_evdev.cc @@ -4,6 +4,8 @@ #include "ui/events/ozone/evdev/event_thread_evdev.h" +#include <utility> + #include "base/bind.h" #include "base/callback.h" #include "base/logging.h" @@ -25,7 +27,7 @@ class EvdevThread : public base::Thread { CursorDelegateEvdev* cursor, const EventThreadStartCallback& callback) : base::Thread("evdev"), - dispatcher_(dispatcher.Pass()), + dispatcher_(std::move(dispatcher)), cursor_(cursor), init_callback_(callback), init_runner_(base::ThreadTaskRunnerHandle::Get()) {} @@ -34,7 +36,7 @@ class EvdevThread : public base::Thread { void Init() override { TRACE_EVENT0("evdev", "EvdevThread::Init"); input_device_factory_ = - new InputDeviceFactoryEvdev(dispatcher_.Pass(), cursor_); + new InputDeviceFactoryEvdev(std::move(dispatcher_), cursor_); scoped_ptr<InputDeviceFactoryEvdevProxy> proxy( new InputDeviceFactoryEvdevProxy(base::ThreadTaskRunnerHandle::Get(), @@ -72,7 +74,7 @@ void EventThreadEvdev::Start(scoped_ptr<DeviceEventDispatcherEvdev> dispatcher, CursorDelegateEvdev* cursor, const EventThreadStartCallback& callback) { TRACE_EVENT0("evdev", "EventThreadEvdev::Start"); - thread_.reset(new EvdevThread(dispatcher.Pass(), cursor, callback)); + thread_.reset(new EvdevThread(std::move(dispatcher), cursor, callback)); if (!thread_->StartWithOptions( base::Thread::Options(base::MessageLoop::TYPE_UI, 0))) LOG(FATAL) << "Failed to create input thread"; diff --git a/ui/events/ozone/evdev/input_device_factory_evdev.cc b/ui/events/ozone/evdev/input_device_factory_evdev.cc index 0ab72a7f..728d7e8 100644 --- a/ui/events/ozone/evdev/input_device_factory_evdev.cc +++ b/ui/events/ozone/evdev/input_device_factory_evdev.cc @@ -7,6 +7,7 @@ #include <fcntl.h> #include <linux/input.h> #include <stddef.h> +#include <utility> #include "base/stl_util.h" #include "base/thread_task_runner_handle.h" @@ -103,7 +104,7 @@ scoped_ptr<EventConverterEvdev> CreateConverter( scoped_ptr<TouchEventConverterEvdev> converter(new TouchEventConverterEvdev( fd, params.path, params.id, devinfo, params.dispatcher)); converter->Initialize(devinfo); - return converter.Pass(); + return std::move(converter); } // Graphics tablet @@ -180,7 +181,7 @@ InputDeviceFactoryEvdev::InputDeviceFactoryEvdev( #if defined(USE_EVDEV_GESTURES) gesture_property_provider_(new GesturePropertyProvider), #endif - dispatcher_(dispatcher.Pass()), + dispatcher_(std::move(dispatcher)), weak_ptr_factory_(this) { } @@ -292,7 +293,7 @@ void InputDeviceFactoryEvdev::GetTouchDeviceStatus( #if defined(USE_EVDEV_GESTURES) DumpTouchDeviceStatus(gesture_property_provider_.get(), status.get()); #endif - reply.Run(status.Pass()); + reply.Run(std::move(status)); } void InputDeviceFactoryEvdev::GetTouchEventLog( @@ -304,7 +305,7 @@ void InputDeviceFactoryEvdev::GetTouchEventLog( DumpTouchEventLog(converters_, gesture_property_provider_.get(), out_dir, log_paths.Pass(), reply); #else - reply.Run(log_paths.Pass()); + reply.Run(std::move(log_paths)); #endif } diff --git a/ui/events/ozone/evdev/input_injector_evdev.cc b/ui/events/ozone/evdev/input_injector_evdev.cc index d180e61..e927482 100644 --- a/ui/events/ozone/evdev/input_injector_evdev.cc +++ b/ui/events/ozone/evdev/input_injector_evdev.cc @@ -2,13 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "ui/events/ozone/evdev/input_injector_evdev.h" + +#include <utility> + #include "ui/events/event.h" #include "ui/events/event_utils.h" #include "ui/events/keycodes/dom/dom_code.h" #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" #include "ui/events/ozone/evdev/device_event_dispatcher_evdev.h" #include "ui/events/ozone/evdev/event_modifiers_evdev.h" -#include "ui/events/ozone/evdev/input_injector_evdev.h" #include "ui/events/ozone/evdev/keyboard_evdev.h" #include "ui/events/ozone/evdev/keyboard_util_evdev.h" @@ -23,8 +26,7 @@ const int kDeviceIdForInjection = -1; InputInjectorEvdev::InputInjectorEvdev( scoped_ptr<DeviceEventDispatcherEvdev> dispatcher, CursorDelegateEvdev* cursor) - : cursor_(cursor), dispatcher_(dispatcher.Pass()) { -} + : cursor_(cursor), dispatcher_(std::move(dispatcher)) {} InputInjectorEvdev::~InputInjectorEvdev() { } diff --git a/ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc b/ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc index aaa121d..b7def52 100644 --- a/ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc +++ b/ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc @@ -2,11 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "ui/events/ozone/evdev/tablet_event_converter_evdev.h" + #include <errno.h> #include <fcntl.h> #include <linux/input.h> #include <unistd.h> - +#include <utility> #include <vector> #include "base/bind.h" @@ -23,7 +25,6 @@ #include "ui/events/ozone/evdev/event_converter_test_util.h" #include "ui/events/ozone/evdev/event_device_test_util.h" #include "ui/events/ozone/evdev/event_factory_evdev.h" -#include "ui/events/ozone/evdev/tablet_event_converter_evdev.h" #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" #include "ui/events/platform/platform_event_dispatcher.h" #include "ui/events/platform/platform_event_source.h" @@ -213,7 +214,7 @@ class TabletEventConverterEvdevTest : public testing::Test { void DispatchEventForTest(ui::Event* event) { scoped_ptr<ui::Event> cloned_event = ui::Event::Clone(*event); - dispatched_events_.push_back(cloned_event.Pass()); + dispatched_events_.push_back(std::move(cloned_event)); } private: |