Commit 27f7483f authored by dcheng's avatar dcheng Committed by Commit bot

Global conversion of Pass()→std::move() on OS=linux (GYP edition)

A few more things that are present in GYP builds but not GN builds...

(╯^□^)╯︵ 

BUG=557422
R=vmpstr@chromium.org
TBR=jam@chromium.org

Review URL: https://codereview.chromium.org/1558513002

Cr-Commit-Position: refs/heads/master@{#367108}
parent 85fee024
...@@ -103,7 +103,7 @@ class GcdPrivateAPITest : public ExtensionApiTest { ...@@ -103,7 +103,7 @@ class GcdPrivateAPITest : public ExtensionApiTest {
new net::HttpResponseHeaders(""); new net::HttpResponseHeaders("");
headers->AddHeader("Content-Type: application/json"); headers->AddHeader("Content-Type: application/json");
fetcher->set_response_headers(headers); fetcher->set_response_headers(headers);
return fetcher.Pass(); return fetcher;
} }
protected: protected:
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "chrome/browser/extensions/api/input_ime/input_ime_api.h" #include "chrome/browser/extensions/api/input_ime/input_ime_api.h"
#include <utility>
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "chrome/common/extensions/api/input_ime.h" #include "chrome/common/extensions/api/input_ime.h"
#include "chrome/common/extensions/api/input_ime/input_components_handler.h" #include "chrome/common/extensions/api/input_ime/input_components_handler.h"
...@@ -34,7 +36,7 @@ void ImeObserver::OnFocus( ...@@ -34,7 +36,7 @@ void ImeObserver::OnFocus(
scoped_ptr<base::ListValue> args(input_ime::OnFocus::Create(context_value)); scoped_ptr<base::ListValue> args(input_ime::OnFocus::Create(context_value));
DispatchEventToExtension(extensions::events::INPUT_IME_ON_FOCUS, DispatchEventToExtension(extensions::events::INPUT_IME_ON_FOCUS,
input_ime::OnFocus::kEventName, args.Pass()); input_ime::OnFocus::kEventName, std::move(args));
} }
void ImeObserver::OnBlur(int context_id) { void ImeObserver::OnBlur(int context_id) {
...@@ -44,7 +46,7 @@ void ImeObserver::OnBlur(int context_id) { ...@@ -44,7 +46,7 @@ void ImeObserver::OnBlur(int context_id) {
scoped_ptr<base::ListValue> args(input_ime::OnBlur::Create(context_id)); scoped_ptr<base::ListValue> args(input_ime::OnBlur::Create(context_id));
DispatchEventToExtension(extensions::events::INPUT_IME_ON_BLUR, DispatchEventToExtension(extensions::events::INPUT_IME_ON_BLUR,
input_ime::OnBlur::kEventName, args.Pass()); input_ime::OnBlur::kEventName, std::move(args));
} }
void ImeObserver::OnKeyEvent( void ImeObserver::OnKeyEvent(
...@@ -82,7 +84,7 @@ void ImeObserver::OnKeyEvent( ...@@ -82,7 +84,7 @@ void ImeObserver::OnKeyEvent(
input_ime::OnKeyEvent::Create(component_id, key_data_value)); input_ime::OnKeyEvent::Create(component_id, key_data_value));
DispatchEventToExtension(extensions::events::INPUT_IME_ON_KEY_EVENT, DispatchEventToExtension(extensions::events::INPUT_IME_ON_KEY_EVENT,
input_ime::OnKeyEvent::kEventName, args.Pass()); input_ime::OnKeyEvent::kEventName, std::move(args));
} }
void ImeObserver::OnReset(const std::string& component_id) { void ImeObserver::OnReset(const std::string& component_id) {
...@@ -92,7 +94,7 @@ void ImeObserver::OnReset(const std::string& component_id) { ...@@ -92,7 +94,7 @@ void ImeObserver::OnReset(const std::string& component_id) {
scoped_ptr<base::ListValue> args(input_ime::OnReset::Create(component_id)); scoped_ptr<base::ListValue> args(input_ime::OnReset::Create(component_id));
DispatchEventToExtension(extensions::events::INPUT_IME_ON_RESET, DispatchEventToExtension(extensions::events::INPUT_IME_ON_RESET,
input_ime::OnReset::kEventName, args.Pass()); input_ime::OnReset::kEventName, std::move(args));
} }
void ImeObserver::OnDeactivated(const std::string& component_id) { void ImeObserver::OnDeactivated(const std::string& component_id) {
...@@ -104,7 +106,8 @@ void ImeObserver::OnDeactivated(const std::string& component_id) { ...@@ -104,7 +106,8 @@ void ImeObserver::OnDeactivated(const std::string& component_id) {
input_ime::OnDeactivated::Create(component_id)); input_ime::OnDeactivated::Create(component_id));
DispatchEventToExtension(extensions::events::INPUT_IME_ON_DEACTIVATED, DispatchEventToExtension(extensions::events::INPUT_IME_ON_DEACTIVATED,
input_ime::OnDeactivated::kEventName, args.Pass()); input_ime::OnDeactivated::kEventName,
std::move(args));
} }
// TODO(azurewei): This function implementation should be shared on all // TODO(azurewei): This function implementation should be shared on all
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include "chrome/browser/extensions/api/input_ime/input_ime_api.h" #include "chrome/browser/extensions/api/input_ime/input_ime_api.h"
#include <utility>
#include "base/command_line.h" #include "base/command_line.h"
#include "base/macros.h" #include "base/macros.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
...@@ -39,10 +41,10 @@ class ImeObserverNonChromeOS : public ui::ImeObserver { ...@@ -39,10 +41,10 @@ class ImeObserverNonChromeOS : public ui::ImeObserver {
} }
scoped_ptr<extensions::Event> event( scoped_ptr<extensions::Event> event(
new extensions::Event(histogram_value, event_name, args.Pass())); new extensions::Event(histogram_value, event_name, std::move(args)));
event->restrict_to_browser_context = profile_; event->restrict_to_browser_context = profile_;
extensions::EventRouter::Get(profile_) extensions::EventRouter::Get(profile_)
->DispatchEventToExtension(extension_id_, event.Pass()); ->DispatchEventToExtension(extension_id_, std::move(event));
} }
DISALLOW_COPY_AND_ASSIGN(ImeObserverNonChromeOS); DISALLOW_COPY_AND_ASSIGN(ImeObserverNonChromeOS);
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "chrome/test/nacl/pnacl_header_test.h" #include "chrome/test/nacl/pnacl_header_test.h"
#include <utility>
#include "base/bind.h" #include "base/bind.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/test/scoped_path_override.h" #include "base/test/scoped_path_override.h"
...@@ -98,7 +100,7 @@ scoped_ptr<HttpResponse> PnaclHeaderTest::WatchForPexeFetch( ...@@ -98,7 +100,7 @@ scoped_ptr<HttpResponse> PnaclHeaderTest::WatchForPexeFetch(
http_response->set_code(net::HTTP_OK); http_response->set_code(net::HTTP_OK);
http_response->set_content(""); http_response->set_content("");
http_response->set_content_type("application/octet-stream"); http_response->set_content_type("application/octet-stream");
return http_response.Pass(); return std::move(http_response);
} }
// Skip other non-pexe files and let ServeFilesFromDirectory handle it. // Skip other non-pexe files and let ServeFilesFromDirectory handle it.
...@@ -130,7 +132,7 @@ scoped_ptr<HttpResponse> PnaclHeaderTest::WatchForPexeFetch( ...@@ -130,7 +132,7 @@ scoped_ptr<HttpResponse> PnaclHeaderTest::WatchForPexeFetch(
http_response->set_code(net::HTTP_NOT_FOUND); http_response->set_code(net::HTTP_NOT_FOUND);
http_response->set_content("PEXE ... not found"); http_response->set_content("PEXE ... not found");
http_response->set_content_type("application/octet-stream"); http_response->set_content_type("application/octet-stream");
return http_response.Pass(); return std::move(http_response);
} }
IN_PROC_BROWSER_TEST_F(PnaclHeaderTest, TestHasPnaclHeader) { IN_PROC_BROWSER_TEST_F(PnaclHeaderTest, TestHasPnaclHeader) {
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
#include <GLES2/gl2ext.h> #include <GLES2/gl2ext.h>
#include <GLES2/gl2extchromium.h> #include <GLES2/gl2extchromium.h>
#include <stdint.h> #include <stdint.h>
#include <algorithm> #include <algorithm>
#include <utility>
#include "base/logging.h" #include "base/logging.h"
#include "base/macros.h" #include "base/macros.h"
...@@ -154,7 +154,7 @@ void Buffer::Texture::ReleaseTexImage(const gpu::SyncToken& sync_token) { ...@@ -154,7 +154,7 @@ void Buffer::Texture::ReleaseTexImage(const gpu::SyncToken& sync_token) {
Buffer::Buffer(scoped_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer, Buffer::Buffer(scoped_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer,
unsigned texture_target) unsigned texture_target)
: gpu_memory_buffer_(gpu_memory_buffer.Pass()), : gpu_memory_buffer_(std::move(gpu_memory_buffer)),
texture_target_(texture_target), texture_target_(texture_target),
use_count_(0) {} use_count_(0) {}
...@@ -170,7 +170,7 @@ scoped_ptr<cc::SingleReleaseCallback> Buffer::ProduceTextureMailbox( ...@@ -170,7 +170,7 @@ scoped_ptr<cc::SingleReleaseCallback> Buffer::ProduceTextureMailbox(
// Creating a new texture is relatively expensive so we reuse the last // Creating a new texture is relatively expensive so we reuse the last
// texture whenever possible. // texture whenever possible.
scoped_ptr<Texture> texture = last_texture_.Pass(); scoped_ptr<Texture> texture = std::move(last_texture_);
// If texture is lost, destroy it to ensure that we create a new one below. // If texture is lost, destroy it to ensure that we create a new one below.
if (texture && texture->IsLost()) if (texture && texture->IsLost())
...@@ -251,7 +251,7 @@ void Buffer::ReleaseTexture(base::WeakPtr<Buffer> buffer, ...@@ -251,7 +251,7 @@ void Buffer::ReleaseTexture(base::WeakPtr<Buffer> buffer,
// Allow buffer to reused texture if it's not lost. // Allow buffer to reused texture if it's not lost.
if (!is_lost) if (!is_lost)
buffer->last_texture_ = texture.Pass(); buffer->last_texture_ = std::move(texture);
buffer->Release(); buffer->Release();
} }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "components/exo/shared_memory.h" #include "components/exo/shared_memory.h"
#include <stddef.h> #include <stddef.h>
#include <utility>
#include "base/logging.h" #include "base/logging.h"
#include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event.h"
...@@ -75,7 +76,8 @@ scoped_ptr<Buffer> SharedMemory::CreateBuffer(const gfx::Size& size, ...@@ -75,7 +76,8 @@ scoped_ptr<Buffer> SharedMemory::CreateBuffer(const gfx::Size& size,
return nullptr; return nullptr;
} }
return make_scoped_ptr(new Buffer(gpu_memory_buffer.Pass(), GL_TEXTURE_2D)); return make_scoped_ptr(
new Buffer(std::move(gpu_memory_buffer), GL_TEXTURE_2D));
} }
} // namespace exo } // namespace exo
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "components/exo/surface.h" #include "components/exo/surface.h"
#include <utility>
#include "base/callback_helpers.h" #include "base/callback_helpers.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/macros.h" #include "base/macros.h"
...@@ -269,7 +271,7 @@ void Surface::CommitSurfaceHierarchy() { ...@@ -269,7 +271,7 @@ void Surface::CommitSurfaceHierarchy() {
if (texture_mailbox_release_callback) { if (texture_mailbox_release_callback) {
// Update layer with the new contents. // Update layer with the new contents.
layer()->SetTextureMailbox(texture_mailbox, layer()->SetTextureMailbox(texture_mailbox,
texture_mailbox_release_callback.Pass(), std::move(texture_mailbox_release_callback),
texture_mailbox.size_in_pixels()); texture_mailbox.size_in_pixels());
layer()->SetTextureFlipped(false); layer()->SetTextureFlipped(false);
layer()->SetBounds(gfx::Rect(layer()->bounds().origin(), layer()->SetBounds(gfx::Rect(layer()->bounds().origin(),
...@@ -402,7 +404,7 @@ void Surface::OnCompositingEnded(ui::Compositor* compositor) { ...@@ -402,7 +404,7 @@ void Surface::OnCompositingEnded(ui::Compositor* compositor) {
current_buffer_->ProduceTextureMailbox(&texture_mailbox); current_buffer_->ProduceTextureMailbox(&texture_mailbox);
if (texture_mailbox_release_callback) { if (texture_mailbox_release_callback) {
layer()->SetTextureMailbox(texture_mailbox, layer()->SetTextureMailbox(texture_mailbox,
texture_mailbox_release_callback.Pass(), std::move(texture_mailbox_release_callback),
texture_mailbox.size_in_pixels()); texture_mailbox.size_in_pixels());
layer()->SetTextureFlipped(false); layer()->SetTextureFlipped(false);
layer()->SchedulePaint(gfx::Rect(texture_mailbox.size_in_pixels())); layer()->SchedulePaint(gfx::Rect(texture_mailbox.size_in_pixels()));
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
#include <wayland-server-core.h> #include <wayland-server-core.h>
#include <wayland-server-protocol-core.h> #include <wayland-server-protocol-core.h>
#include <xdg-shell-unstable-v5-server-protocol.h> #include <xdg-shell-unstable-v5-server-protocol.h>
#include <algorithm> #include <algorithm>
#include <utility>
#include "base/bind.h" #include "base/bind.h"
#include "base/cancelable_callback.h" #include "base/cancelable_callback.h"
...@@ -57,7 +57,7 @@ template <class T> ...@@ -57,7 +57,7 @@ template <class T>
scoped_ptr<T> TakeUserDataAs(wl_resource* resource) { scoped_ptr<T> TakeUserDataAs(wl_resource* resource) {
scoped_ptr<T> user_data = make_scoped_ptr(GetUserDataAs<T>(resource)); scoped_ptr<T> user_data = make_scoped_ptr(GetUserDataAs<T>(resource));
wl_resource_set_user_data(resource, nullptr); wl_resource_set_user_data(resource, nullptr);
return user_data.Pass(); return user_data;
} }
template <class T> template <class T>
...@@ -148,7 +148,7 @@ void surface_frame(wl_client* client, ...@@ -148,7 +148,7 @@ void surface_frame(wl_client* client,
GetUserDataAs<Surface>(resource) GetUserDataAs<Surface>(resource)
->RequestFrameCallback(cancelable_callback->callback()); ->RequestFrameCallback(cancelable_callback->callback());
SetImplementation(callback_resource, nullptr, cancelable_callback.Pass()); SetImplementation(callback_resource, nullptr, std::move(cancelable_callback));
} }
void surface_set_opaque_region(wl_client* client, void surface_set_opaque_region(wl_client* client,
...@@ -242,7 +242,8 @@ void compositor_create_surface(wl_client* client, ...@@ -242,7 +242,8 @@ void compositor_create_surface(wl_client* client,
// Set the surface resource property for type-checking downcast support. // Set the surface resource property for type-checking downcast support.
surface->SetProperty(kSurfaceResourceKey, surface_resource); surface->SetProperty(kSurfaceResourceKey, surface_resource);
SetImplementation(surface_resource, &surface_implementation, surface.Pass()); SetImplementation(surface_resource, &surface_implementation,
std::move(surface));
} }
void compositor_create_region(wl_client* client, void compositor_create_region(wl_client* client,
...@@ -257,7 +258,7 @@ void compositor_create_region(wl_client* client, ...@@ -257,7 +258,7 @@ void compositor_create_region(wl_client* client,
return; return;
} }
SetImplementation(region_resource, &region_implementation, region.Pass()); SetImplementation(region_resource, &region_implementation, std::move(region));
} }
const struct wl_compositor_interface compositor_implementation = { const struct wl_compositor_interface compositor_implementation = {
...@@ -339,7 +340,7 @@ void shm_pool_create_buffer(wl_client* client, ...@@ -339,7 +340,7 @@ void shm_pool_create_buffer(wl_client* client,
buffer->set_release_callback( buffer->set_release_callback(
base::Bind(&wl_buffer_send_release, base::Unretained(buffer_resource))); base::Bind(&wl_buffer_send_release, base::Unretained(buffer_resource)));
SetImplementation(buffer_resource, &buffer_implementation, buffer.Pass()); SetImplementation(buffer_resource, &buffer_implementation, std::move(buffer));
} }
void shm_pool_destroy(wl_client* client, wl_resource* resource) { void shm_pool_destroy(wl_client* client, wl_resource* resource) {
...@@ -377,7 +378,7 @@ void shm_create_pool(wl_client* client, ...@@ -377,7 +378,7 @@ void shm_create_pool(wl_client* client,
} }
SetImplementation(shm_pool_resource, &shm_pool_implementation, SetImplementation(shm_pool_resource, &shm_pool_implementation,
shared_memory.Pass()); std::move(shared_memory));
} }
const struct wl_shm_interface shm_implementation = {shm_create_pool}; const struct wl_shm_interface shm_implementation = {shm_create_pool};
...@@ -581,7 +582,7 @@ void subcompositor_get_subsurface(wl_client* client, ...@@ -581,7 +582,7 @@ void subcompositor_get_subsurface(wl_client* client,
} }
SetImplementation(subsurface_resource, &subsurface_implementation, SetImplementation(subsurface_resource, &subsurface_implementation,
subsurface.Pass()); std::move(subsurface));
} }
const struct wl_subcompositor_interface subcompositor_implementation = { const struct wl_subcompositor_interface subcompositor_implementation = {
...@@ -706,7 +707,7 @@ void shell_get_shell_surface(wl_client* client, ...@@ -706,7 +707,7 @@ void shell_get_shell_surface(wl_client* client,
} }
SetImplementation(shell_surface_resource, &shell_surface_implementation, SetImplementation(shell_surface_resource, &shell_surface_implementation,
shell_surface.Pass()); std::move(shell_surface));
} }
const struct wl_shell_interface shell_implementation = { const struct wl_shell_interface shell_implementation = {
...@@ -871,7 +872,7 @@ void xdg_shell_get_xdg_surface(wl_client* client, ...@@ -871,7 +872,7 @@ void xdg_shell_get_xdg_surface(wl_client* client,
shell_surface->SetToplevel(); shell_surface->SetToplevel();
SetImplementation(xdg_surface_resource, &xdg_surface_implementation, SetImplementation(xdg_surface_resource, &xdg_surface_implementation,
shell_surface.Pass()); std::move(shell_surface));
} }
void xdg_shell_get_xdg_popup(wl_client* client, void xdg_shell_get_xdg_popup(wl_client* client,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment