summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorben <ben@chromium.org>2016-02-07 12:31:19 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-07 20:32:20 +0000
commitc08c4c008d30f1e4965fbdf39ce941a0661cce43 (patch)
tree623c075c0473d2cf87f1aee2c61a32e171eb5443
parentde90347d8ad768372264265e1351d85159d54a55 (diff)
downloadchromium_src-c08c4c008d30f1e4965fbdf39ce941a0661cce43.zip
chromium_src-c08c4c008d30f1e4965fbdf39ce941a0661cce43.tar.gz
chromium_src-c08c4c008d30f1e4965fbdf39ce941a0661cce43.tar.bz2
Rename ConnectToApplication to Connect().
TBR=rockot@chromium.org BUG= Review URL: https://codereview.chromium.org/1673983002 Cr-Commit-Position: refs/heads/master@{#374066}
-rw-r--r--components/html_viewer/ax_provider_apptest.cc2
-rw-r--r--components/html_viewer/blink_platform_impl.cc2
-rw-r--r--components/html_viewer/stats_collection_controller.cc3
-rw-r--r--components/mus/ws/window_manager_client_apptest.cc7
-rw-r--r--components/web_view/frame_connection.cc2
-rw-r--r--mandoline/ui/desktop_ui/browser_window.cc2
-rw-r--r--mash/browser_driver/browser_driver_application_delegate.cc2
-rw-r--r--mash/quick_launch/quick_launch.cc2
-rw-r--r--mash/shell/shell_application_delegate.cc3
-rw-r--r--mash/wm/window_manager_apptest.cc2
-rw-r--r--media/mojo/services/media_apptest.cc2
-rw-r--r--mojo/services/network/http_server_apptest.cc2
-rw-r--r--mojo/services/tracing/public/cpp/tracing_impl.cc2
-rw-r--r--mojo/shell/application_manager_apptest.cc2
-rw-r--r--mojo/shell/application_manager_unittest.cc2
-rw-r--r--mojo/shell/capability_filter_test.cc4
-rw-r--r--mojo/shell/public/cpp/application_impl.h4
-rw-r--r--mojo/shell/public/cpp/connection.h10
-rw-r--r--mojo/shell/public/cpp/lib/application_impl.cc8
-rw-r--r--mojo/shell/public/cpp/shell.h8
-rw-r--r--ui/views/mus/platform_test_helper_mus.cc2
21 files changed, 33 insertions, 40 deletions
diff --git a/components/html_viewer/ax_provider_apptest.cc b/components/html_viewer/ax_provider_apptest.cc
index 0506418..2ee5587 100644
--- a/components/html_viewer/ax_provider_apptest.cc
+++ b/components/html_viewer/ax_provider_apptest.cc
@@ -83,7 +83,7 @@ TEST_F(AXProviderTest, HelloWorld) {
// Connect to the URL through the mojo:html_viewer content handler.
scoped_ptr<Connection> connection =
- shell()->ConnectToApplication(server.GetURL("/test.html").spec());
+ shell()->Connect(server.GetURL("/test.html").spec());
// Embed the html_viewer in a Window.
mus::mojom::WindowTreeClientPtr tree_client;
diff --git a/components/html_viewer/blink_platform_impl.cc b/components/html_viewer/blink_platform_impl.cc
index 3380fb5..1a8d159 100644
--- a/components/html_viewer/blink_platform_impl.cc
+++ b/components/html_viewer/blink_platform_impl.cc
@@ -79,7 +79,7 @@ BlinkPlatformImpl::BlinkPlatformImpl(
main_thread_(renderer_scheduler->CreateMainThread()) {
if (shell) {
scoped_ptr<mojo::Connection> connection =
- shell->ConnectToApplication("mojo:network_service");
+ shell->Connect("mojo:network_service");
connection->ConnectToService(&web_socket_factory_);
connection->ConnectToService(&url_loader_factory_);
diff --git a/components/html_viewer/stats_collection_controller.cc b/components/html_viewer/stats_collection_controller.cc
index 508f616..15710ec 100644
--- a/components/html_viewer/stats_collection_controller.cc
+++ b/components/html_viewer/stats_collection_controller.cc
@@ -82,8 +82,7 @@ tracing::StartupPerformanceDataCollectorPtr StatsCollectionController::Install(
v8::Context::Scope context_scope(context);
- scoped_ptr<mojo::Connection> connection =
- shell->ConnectToApplication("mojo:tracing");
+ scoped_ptr<mojo::Connection> connection = shell->Connect("mojo:tracing");
if (!connection)
return nullptr;
tracing::StartupPerformanceDataCollectorPtr collector_for_controller;
diff --git a/components/mus/ws/window_manager_client_apptest.cc b/components/mus/ws/window_manager_client_apptest.cc
index 34d42fb..8d174d7 100644
--- a/components/mus/ws/window_manager_client_apptest.cc
+++ b/components/mus/ws/window_manager_client_apptest.cc
@@ -258,7 +258,7 @@ class WindowServerTest : public WindowServerTestBase {
EmbedResult Embed(Window* window, uint32_t access_policy_bitmask) {
DCHECK(!embed_details_);
embed_details_.reset(new EmbedDetails);
- window->Embed(ConnectToApplicationAndGetWindowServerClient(),
+ window->Embed(ConnectAndGetWindowServerClient(),
access_policy_bitmask,
base::Bind(&WindowServerTest::EmbedCallbackImpl,
base::Unretained(this)));
@@ -273,8 +273,7 @@ class WindowServerTest : public WindowServerTestBase {
// Establishes a connection to this application and asks for a
// WindowTreeClient.
- mus::mojom::WindowTreeClientPtr
- ConnectToApplicationAndGetWindowServerClient() {
+ mus::mojom::WindowTreeClientPtr ConnectAndGetWindowServerClient() {
mus::mojom::WindowTreeClientPtr client;
shell()->ConnectToService(shell_url(), &client);
return client;
@@ -974,7 +973,7 @@ TEST_F(WindowServerTest, EmbedRemovesChildren) {
window1->AddChild(window2);
WindowRemovedFromParentObserver observer(window2);
- window1->Embed(ConnectToApplicationAndGetWindowServerClient());
+ window1->Embed(ConnectAndGetWindowServerClient());
EXPECT_TRUE(observer.was_removed());
EXPECT_EQ(nullptr, window2->parent());
EXPECT_TRUE(window1->children().empty());
diff --git a/components/web_view/frame_connection.cc b/components/web_view/frame_connection.cc
index a6049b7..af40457 100644
--- a/components/web_view/frame_connection.cc
+++ b/components/web_view/frame_connection.cc
@@ -119,7 +119,7 @@ void FrameConnection::Init(mojo::Shell* shell,
mojo::Shell::ConnectParams params(std::move(request));
params.set_filter(std::move(filter));
- connection_ = shell->ConnectToApplication(&params);
+ connection_ = shell->Connect(&params);
connection_->ConnectToService(&frame_client_);
connection_->AddRemoteIDCallback(on_got_id_callback);
}
diff --git a/mandoline/ui/desktop_ui/browser_window.cc b/mandoline/ui/desktop_ui/browser_window.cc
index a180220..6b4f15e 100644
--- a/mandoline/ui/desktop_ui/browser_window.cc
+++ b/mandoline/ui/desktop_ui/browser_window.cc
@@ -151,7 +151,7 @@ void BrowserWindow::Close() {
void BrowserWindow::ShowOmnibox() {
TRACE_EVENT0("desktop_ui", "BrowserWindow::ShowOmnibox");
if (!omnibox_.get()) {
- omnibox_connection_ = shell_->ConnectToApplication("mojo:omnibox");
+ omnibox_connection_ = shell_->Connect("mojo:omnibox");
omnibox_connection_->AddService<ViewEmbedder>(this);
omnibox_connection_->ConnectToService(&omnibox_);
omnibox_connection_->SetRemoteServiceProviderConnectionErrorHandler(
diff --git a/mash/browser_driver/browser_driver_application_delegate.cc b/mash/browser_driver/browser_driver_application_delegate.cc
index 4765719..98ac6482 100644
--- a/mash/browser_driver/browser_driver_application_delegate.cc
+++ b/mash/browser_driver/browser_driver_application_delegate.cc
@@ -68,7 +68,7 @@ void BrowserDriverApplicationDelegate::OnAccelerator(
case Accelerator::NewWindow:
case Accelerator::NewTab:
case Accelerator::NewIncognitoWindow:
- shell_->ConnectToApplication("exe:chrome");
+ shell_->Connect("exe:chrome");
// TODO(beng): have Chrome export a service that allows it to be driven by
// this driver, e.g. to open new tabs, incognito windows, etc.
break;
diff --git a/mash/quick_launch/quick_launch.cc b/mash/quick_launch/quick_launch.cc
index 41a18d0..8a37d52 100644
--- a/mash/quick_launch/quick_launch.cc
+++ b/mash/quick_launch/quick_launch.cc
@@ -62,7 +62,7 @@ class QuickLaunchUI : public views::WidgetDelegateView,
const ui::KeyEvent& key_event) override {
if (key_event.key_code() == ui::VKEY_RETURN) {
std::string url = Canonicalize(prompt_->text());
- connections_.push_back(shell_->ConnectToApplication(url));
+ connections_.push_back(shell_->Connect(url));
prompt_->SetText(base::string16());
}
return false;
diff --git a/mash/shell/shell_application_delegate.cc b/mash/shell/shell_application_delegate.cc
index 6f919d5..68c01fd 100644
--- a/mash/shell/shell_application_delegate.cc
+++ b/mash/shell/shell_application_delegate.cc
@@ -116,8 +116,7 @@ void ShellApplicationDelegate::StartRestartableService(
const base::Closure& restart_callback) {
// TODO(beng): This would be the place to insert logic that counted restarts
// to avoid infinite crash-restart loops.
- scoped_ptr<mojo::Connection> connection =
- shell_->ConnectToApplication(url);
+ scoped_ptr<mojo::Connection> connection = shell_->Connect(url);
connection->SetRemoteServiceProviderConnectionErrorHandler(restart_callback);
connections_[url] = std::move(connection);
}
diff --git a/mash/wm/window_manager_apptest.cc b/mash/wm/window_manager_apptest.cc
index 51a68f4..6e6e9fb 100644
--- a/mash/wm/window_manager_apptest.cc
+++ b/mash/wm/window_manager_apptest.cc
@@ -39,7 +39,7 @@ TEST_F(WindowManagerAppTest, OpenWindow) {
WindowTreeDelegateImpl window_tree_delegate;
// Bring up the the desktop_wm.
- shell()->ConnectToApplication("mojo:desktop_wm");
+ shell()->Connect("mojo:desktop_wm");
// Connect to mus and create a new top level window. The request goes to
// the |desktop_wm|, but is async.
diff --git a/media/mojo/services/media_apptest.cc b/media/mojo/services/media_apptest.cc
index 0d88334..eb6dbd6 100644
--- a/media/mojo/services/media_apptest.cc
+++ b/media/mojo/services/media_apptest.cc
@@ -59,7 +59,7 @@ class MediaAppTest : public mojo::test::ApplicationTestBase {
void SetUp() override {
ApplicationTestBase::SetUp();
- connection_ = shell()->ConnectToApplication("mojo:media");
+ connection_ = shell()->Connect("mojo:media");
connection_->SetRemoteServiceProviderConnectionErrorHandler(
base::Bind(&MediaAppTest::ConnectionClosed, base::Unretained(this)));
diff --git a/mojo/services/network/http_server_apptest.cc b/mojo/services/network/http_server_apptest.cc
index ae1421a..aefc973 100644
--- a/mojo/services/network/http_server_apptest.cc
+++ b/mojo/services/network/http_server_apptest.cc
@@ -557,7 +557,7 @@ class HttpServerAppTest : public test::ApplicationTestBase {
ApplicationTestBase::SetUp();
scoped_ptr<Connection> connection =
- shell()->ConnectToApplication("mojo:network_service");
+ shell()->Connect("mojo:network_service");
connection->ConnectToService(&network_service_);
connection->ConnectToService(&web_socket_factory_);
}
diff --git a/mojo/services/tracing/public/cpp/tracing_impl.cc b/mojo/services/tracing/public/cpp/tracing_impl.cc
index a340f75..3c61790 100644
--- a/mojo/services/tracing/public/cpp/tracing_impl.cc
+++ b/mojo/services/tracing/public/cpp/tracing_impl.cc
@@ -53,7 +53,7 @@ void TracingImpl::Initialize(Shell* shell, const std::string& url) {
// up to something like CoreServices to name its own child threads.
base::PlatformThread::SetName(url);
- connection_ = shell->ConnectToApplication("mojo:tracing");
+ connection_ = shell->Connect("mojo:tracing");
connection_->AddService(this);
#ifdef NDEBUG
diff --git a/mojo/shell/application_manager_apptest.cc b/mojo/shell/application_manager_apptest.cc
index 5091d45..92c7272 100644
--- a/mojo/shell/application_manager_apptest.cc
+++ b/mojo/shell/application_manager_apptest.cc
@@ -174,7 +174,7 @@ TEST_F(ApplicationManagerAppTest, CreateInstanceForHandle) {
// launches a process. #becauselinkerrors).
mojo::shell::test::mojom::DriverPtr driver;
scoped_ptr<Connection> connection =
- shell()->ConnectToApplication("exe:application_manager_apptest_driver");
+ shell()->Connect("exe:application_manager_apptest_driver");
connection->ConnectToService(&driver);
// 2. Wait for the target to connect to us. (via
diff --git a/mojo/shell/application_manager_unittest.cc b/mojo/shell/application_manager_unittest.cc
index a673347..b83f320 100644
--- a/mojo/shell/application_manager_unittest.cc
+++ b/mojo/shell/application_manager_unittest.cc
@@ -250,7 +250,7 @@ class TestAImpl : public TestA {
InterfaceRequest<TestA> request,
InterfaceFactory<TestC>* factory)
: test_context_(test_context), binding_(this, std::move(request)) {
- connection_ = app_impl->ConnectToApplication(kTestBURLString);
+ connection_ = app_impl->Connect(kTestBURLString);
connection_->AddService<TestC>(factory);
connection_->ConnectToService(&b_);
}
diff --git a/mojo/shell/capability_filter_test.cc b/mojo/shell/capability_filter_test.cc
index 4717bb6..7a97f68 100644
--- a/mojo/shell/capability_filter_test.cc
+++ b/mojo/shell/capability_filter_test.cc
@@ -172,12 +172,12 @@ bool TestApplication::AcceptConnection(Connection* connection) {
// TestApplications receive their Validator via the inbound connection.
connection->ConnectToService(&validator_);
- connection1_ = shell_->ConnectToApplication("test:service");
+ connection1_ = shell_->Connect("test:service");
connection1_->SetRemoteServiceProviderConnectionErrorHandler(
base::Bind(&TestApplication::ConnectionClosed,
base::Unretained(this), "test:service"));
- connection2_ = shell_->ConnectToApplication("test:service2");
+ connection2_ = shell_->Connect("test:service2");
connection2_->SetRemoteServiceProviderConnectionErrorHandler(
base::Bind(&TestApplication::ConnectionClosed,
base::Unretained(this), "test:service2"));
diff --git a/mojo/shell/public/cpp/application_impl.h b/mojo/shell/public/cpp/application_impl.h
index 5ade99f..9f35a0d 100644
--- a/mojo/shell/public/cpp/application_impl.h
+++ b/mojo/shell/public/cpp/application_impl.h
@@ -96,8 +96,8 @@ class ApplicationImpl : public Shell, public shell::mojom::Application {
void WaitForInitialize();
// Shell.
- scoped_ptr<Connection> ConnectToApplication(const std::string& url) override;
- scoped_ptr<Connection> ConnectToApplication(ConnectParams* params) override;
+ scoped_ptr<Connection> Connect(const std::string& url) override;
+ scoped_ptr<Connection> Connect(ConnectParams* params) override;
void Quit() override;
scoped_ptr<AppRefCount> CreateAppRefCount() override;
diff --git a/mojo/shell/public/cpp/connection.h b/mojo/shell/public/cpp/connection.h
index 4be8669..a21657f 100644
--- a/mojo/shell/public/cpp/connection.h
+++ b/mojo/shell/public/cpp/connection.h
@@ -116,11 +116,11 @@ class Connection {
const Closure& handler) = 0;
// Returns the id of the remote application. For Connections created via
- // ApplicationImpl::ConnectToApplication(), this will not be determined until
- // ConnectToApplication()'s callback is run, and this function will return
- // false. Use AddRemoteIDCallback() to schedule a callback to be run when the
- // remote application id is available. A value of Shell::kInvalidApplicationID
- // indicates no remote application connection has been established.
+ // Shell::Connect(), this will not be determined until Connect()'s callback is
+ // run, and this function will return false. Use AddRemoteIDCallback() to
+ // schedule a callback to be run when the remote application id is available.
+ // A value of Shell::kInvalidApplicationID indicates the connection has not
+ // been established.
virtual bool GetRemoteApplicationID(uint32_t* remote_id) const = 0;
// Returns the id of the deepest content handler used in connecting to
diff --git a/mojo/shell/public/cpp/lib/application_impl.cc b/mojo/shell/public/cpp/lib/application_impl.cc
index d51e5aa..132737f 100644
--- a/mojo/shell/public/cpp/lib/application_impl.cc
+++ b/mojo/shell/public/cpp/lib/application_impl.cc
@@ -62,15 +62,13 @@ void ApplicationImpl::WaitForInitialize() {
binding_.WaitForIncomingMethodCall();
}
-scoped_ptr<Connection> ApplicationImpl::ConnectToApplication(
- const std::string& url) {
+scoped_ptr<Connection> ApplicationImpl::Connect(const std::string& url) {
ConnectParams params(url);
params.set_filter(CreatePermissiveCapabilityFilter());
- return ConnectToApplication(&params);
+ return Connect(&params);
}
-scoped_ptr<Connection> ApplicationImpl::ConnectToApplication(
- ConnectParams* params) {
+scoped_ptr<Connection> ApplicationImpl::Connect(ConnectParams* params) {
if (!shell_)
return nullptr;
DCHECK(params);
diff --git a/mojo/shell/public/cpp/shell.h b/mojo/shell/public/cpp/shell.h
index 1610693..104cc45 100644
--- a/mojo/shell/public/cpp/shell.h
+++ b/mojo/shell/public/cpp/shell.h
@@ -42,16 +42,14 @@ class Shell {
// Requests a new connection to an application. Returns a pointer to the
// connection if the connection is permitted by this application's delegate,
// or nullptr otherwise. Caller takes ownership.
- virtual scoped_ptr<Connection> ConnectToApplication(
- const std::string& url) = 0;
- virtual scoped_ptr<Connection> ConnectToApplication(
- ConnectParams* params) = 0;
+ virtual scoped_ptr<Connection> Connect(const std::string& url) = 0;
+ virtual scoped_ptr<Connection> Connect(ConnectParams* params) = 0;
// Connect to application identified by |request->url| and connect to the
// service implementation of the interface identified by |Interface|.
template <typename Interface>
void ConnectToService(ConnectParams* params, InterfacePtr<Interface>* ptr) {
- scoped_ptr<Connection> connection = ConnectToApplication(params);
+ scoped_ptr<Connection> connection = Connect(params);
if (!connection.get())
return;
connection->ConnectToService(ptr);
diff --git a/ui/views/mus/platform_test_helper_mus.cc b/ui/views/mus/platform_test_helper_mus.cc
index c4faba1..f5d1df0 100644
--- a/ui/views/mus/platform_test_helper_mus.cc
+++ b/ui/views/mus/platform_test_helper_mus.cc
@@ -31,7 +31,7 @@ class PlatformTestHelperMus : public PlatformTestHelper {
mojo_test_helper_.reset(new mojo::test::TestHelper(nullptr));
// ui/views/mus requires a WindowManager running, for now use the desktop
// one.
- mojo_test_helper_->shell()->ConnectToApplication("mojo:desktop_wm");
+ mojo_test_helper_->shell()->Connect("mojo:desktop_wm");
WindowManagerConnection::Create(mojo_test_helper_->shell());
}