Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Unified Diff: components/web_view/frame_apptest.cc

Issue 1548203002: Convert Pass()→std::move() in //components/[n-z]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bad headers Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/web_view/frame.cc ('k') | components/web_view/frame_connection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/web_view/frame_apptest.cc
diff --git a/components/web_view/frame_apptest.cc b/components/web_view/frame_apptest.cc
index 0b8aca98a309417124bbe0fcd1841c264c20aa57..0c7ce4f6d6157f770dac2f2cf0d96da19d5eb9dd 100644
--- a/components/web_view/frame_apptest.cc
+++ b/components/web_view/frame_apptest.cc
@@ -5,6 +5,7 @@
#include "components/web_view/frame.h"
#include <stdint.h>
+#include <utility>
#include "base/bind.h"
#include "base/location.h"
@@ -20,7 +21,6 @@
#include "components/mus/public/cpp/window_tree_delegate.h"
#include "components/mus/public/cpp/window_tree_host_factory.h"
#include "components/mus/public/interfaces/window_tree_host.mojom.h"
-#include "components/web_view/frame.h"
#include "components/web_view/frame_connection.h"
#include "components/web_view/frame_tree.h"
#include "components/web_view/frame_tree_delegate.h"
@@ -81,7 +81,7 @@ scoped_ptr<FrameConnection> CreateFrameConnection(mojo::ApplicationImpl* app) {
mojo::URLRequestPtr request(mojo::URLRequest::New());
request->url = mojo::String::From(app->url());
base::RunLoop run_loop;
- frame_connection->Init(app, request.Pass(),
+ frame_connection->Init(app, std::move(request),
base::Bind(&OnGotIdCallback, &run_loop));
run_loop.Run();
return frame_connection;
@@ -96,10 +96,10 @@ class TestFrameClient : public mojom::FrameClient {
int connect_count() const { return connect_count_; }
mojo::Array<mojom::FrameDataPtr> connect_frames() {
- return connect_frames_.Pass();
+ return std::move(connect_frames_);
}
- mojo::Array<mojom::FrameDataPtr> adds() { return adds_.Pass(); }
+ mojo::Array<mojom::FrameDataPtr> adds() { return std::move(adds_); }
// Sets a callback to run once OnConnect() is received.
void set_on_connect_callback(const base::Closure& closure) {
@@ -143,9 +143,9 @@ class TestFrameClient : public mojom::FrameClient {
int64_t navigation_start_time_ticks,
const OnConnectCallback& callback) override {
connect_count_++;
- connect_frames_ = frames.Pass();
+ connect_frames_ = std::move(frames);
if (frame)
- server_frame_ = frame.Pass();
+ server_frame_ = std::move(frame);
callback.Run();
if (!on_connect_callback_.is_null())
on_connect_callback_.Run();
@@ -154,7 +154,7 @@ class TestFrameClient : public mojom::FrameClient {
base::TimeTicks::FromInternalValue(navigation_start_time_ticks);
}
void OnFrameAdded(uint32_t change_id, mojom::FrameDataPtr frame) override {
- adds_.push_back(frame.Pass());
+ adds_.push_back(std::move(frame));
}
void OnFrameRemoved(uint32_t change_id, uint32_t frame_id) override {}
void OnFrameClientPropertyChanged(uint32_t frame_id,
@@ -253,14 +253,14 @@ class WindowAndFrame : public mus::WindowTreeDelegate {
mojom::FrameClientPtr GetFrameClientPtr() {
mojom::FrameClientPtr client_ptr;
frame_client_binding_.Bind(GetProxy(&client_ptr));
- return client_ptr.Pass();
+ return client_ptr;
}
void Bind(mojo::InterfaceRequest<mojom::FrameClient> request) {
ASSERT_FALSE(frame_client_binding_.is_bound());
test_frame_tree_client_.set_on_connect_callback(
base::Bind(&WindowAndFrame::OnGotConnect, base::Unretained(this)));
- frame_client_binding_.Bind(request.Pass());
+ frame_client_binding_.Bind(std::move(request));
}
void OnGotConnect() { QuitRunLoopIfNecessary(); }
@@ -317,7 +317,7 @@ class FrameTest : public mojo::test::ApplicationTestBase,
request->originating_time_ticks = navigation_start_time.ToInternalValue();
window_and_frame->server_frame()->RequestNavigate(
mojom::NAVIGATION_TARGET_TYPE_EXISTING_FRAME,
- window_and_frame->window()->id(), request.Pass());
+ window_and_frame->window()->id(), std::move(request));
return WaitForViewAndFrame();
}
@@ -339,9 +339,9 @@ class FrameTest : public mojo::test::ApplicationTestBase,
parent->server_frame()->OnCreatedFrame(
window_and_frame->GetServerFrameRequest(),
window_and_frame->GetFrameClientPtr(), child_frame_window->id(),
- client_properties.Pass());
+ std::move(client_properties));
frame_tree_delegate()->WaitForCreateFrame();
- return HasFatalFailure() ? nullptr : window_and_frame.Pass();
+ return HasFatalFailure() ? nullptr : std::move(window_and_frame);
}
// Runs a message loop until the data necessary to represent to a client side
@@ -350,7 +350,7 @@ class FrameTest : public mojo::test::ApplicationTestBase,
DCHECK(!window_and_frame_);
window_and_frame_.reset(new WindowAndFrame);
window_and_frame_->WaitForViewAndFrame();
- return window_and_frame_.Pass();
+ return std::move(window_and_frame_);
}
private:
@@ -394,8 +394,8 @@ class FrameTest : public mojo::test::ApplicationTestBase,
mus::Window* frame_root_view = window_manager()->NewWindow();
window_manager()->GetRoot()->AddChild(frame_root_view);
frame_tree_.reset(new FrameTree(
- 0u, frame_root_view, window_tree_client.Pass(),
- frame_tree_delegate_.get(), frame_client, frame_connection.Pass(),
+ 0u, frame_root_view, std::move(window_tree_client),
+ frame_tree_delegate_.get(), frame_client, std::move(frame_connection),
Frame::ClientPropertyMap(), base::TimeTicks::Now()));
root_window_and_frame_ = WaitForViewAndFrame();
}
@@ -414,11 +414,11 @@ class FrameTest : public mojo::test::ApplicationTestBase,
mojo::InterfaceRequest<mus::mojom::WindowTreeClient> request) override {
if (window_and_frame_) {
mus::WindowTreeConnection::Create(
- window_and_frame_.get(), request.Pass(),
+ window_and_frame_.get(), std::move(request),
mus::WindowTreeConnection::CreateType::DONT_WAIT_FOR_EMBED);
} else {
mus::WindowTreeConnection::Create(
- this, request.Pass(),
+ this, std::move(request),
mus::WindowTreeConnection::CreateType::DONT_WAIT_FOR_EMBED);
}
}
@@ -427,7 +427,7 @@ class FrameTest : public mojo::test::ApplicationTestBase,
void Create(mojo::ApplicationConnection* connection,
mojo::InterfaceRequest<mojom::FrameClient> request) override {
ASSERT_TRUE(window_and_frame_);
- window_and_frame_->Bind(request.Pass());
+ window_and_frame_->Bind(std::move(request));
}
scoped_ptr<TestFrameTreeDelegate> frame_tree_delegate_;
@@ -472,7 +472,7 @@ TEST_F(FrameTest, MAYBE_ChildFrameClientConnectData) {
EXPECT_EQ(0, child_view_and_frame->test_frame_client()->connect_count());
scoped_ptr<WindowAndFrame> navigated_child_view_and_frame =
- NavigateFrame(child_view_and_frame.get()).Pass();
+ NavigateFrame(child_view_and_frame.get());
mojo::Array<mojom::FrameDataPtr> frames_in_child =
navigated_child_view_and_frame->test_frame_client()->connect_frames();
@@ -493,7 +493,7 @@ TEST_F(FrameTest, OnViewEmbeddedInFrameDisconnected) {
ASSERT_TRUE(child_view_and_frame);
scoped_ptr<WindowAndFrame> navigated_child_view_and_frame =
- NavigateFrame(child_view_and_frame.get()).Pass();
+ NavigateFrame(child_view_and_frame.get());
// Delete the WindowTreeConnection for the child, which should trigger
// notification.
@@ -578,8 +578,7 @@ TEST_F(FrameTest, PassAlongNavigationStartTime) {
base::TimeTicks navigation_start_time = base::TimeTicks::FromInternalValue(1);
scoped_ptr<WindowAndFrame> navigated_child_view_and_frame =
NavigateFrameWithStartTime(child_view_and_frame.get(),
- navigation_start_time)
- .Pass();
+ navigation_start_time);
EXPECT_EQ(navigation_start_time,
navigated_child_view_and_frame->test_frame_client()
->last_navigation_start_time());
« no previous file with comments | « components/web_view/frame.cc ('k') | components/web_view/frame_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698