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

Unified Diff: mojo/shell/application_manager_apptest_driver.cc

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 months 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 | « mojo/shell/application_manager_apptest.cc ('k') | mojo/shell/application_manager_apptest_target.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/application_manager_apptest_driver.cc
diff --git a/mojo/shell/application_manager_apptest_driver.cc b/mojo/shell/application_manager_apptest_driver.cc
index 33ca80a67d808f6385ecca4822efa268f07876b3..3b575f5e4c0929680576d3460b28a8698109c105 100644
--- a/mojo/shell/application_manager_apptest_driver.cc
+++ b/mojo/shell/application_manager_apptest_driver.cc
@@ -26,8 +26,8 @@
#include "mojo/shell/application_manager_apptests.mojom.h"
#include "mojo/shell/public/cpp/application_connection.h"
#include "mojo/shell/public/cpp/application_delegate.h"
-#include "mojo/shell/public/cpp/application_impl.h"
#include "mojo/shell/public/cpp/interface_factory.h"
+#include "mojo/shell/public/cpp/shell.h"
#include "mojo/shell/public/interfaces/application_manager.mojom.h"
#include "mojo/shell/runner/child/test_native_main.h"
#include "mojo/shell/runner/common/switches.h"
@@ -42,13 +42,14 @@ class TargetApplicationDelegate : public mojo::ApplicationDelegate,
public mojo::InterfaceFactory<Driver>,
public Driver {
public:
- TargetApplicationDelegate() : app_(nullptr), weak_factory_(this) {}
+ TargetApplicationDelegate() : shell_(nullptr), weak_factory_(this) {}
~TargetApplicationDelegate() override {}
private:
// mojo::ApplicationDelegate:
- void Initialize(mojo::ApplicationImpl* app) override {
- app_ = app;
+ void Initialize(mojo::Shell* shell, const std::string& url,
+ uint32_t id) override {
+ shell_ = shell;
base::FilePath target_path;
CHECK(base::PathService::Get(base::DIR_EXE, &target_path));
@@ -109,8 +110,7 @@ class TargetApplicationDelegate : public mojo::ApplicationDelegate,
platform_channel_pair.PassServerHandle());
}
- bool AcceptConnection(
- mojo::ApplicationConnection* connection) override {
+ bool AcceptConnection(mojo::ApplicationConnection* connection) override {
connection->AddService<Driver>(this);
return true;
}
@@ -124,7 +124,7 @@ class TargetApplicationDelegate : public mojo::ApplicationDelegate,
// Driver:
void QuitDriver() override {
target_.Terminate(0, false);
- app_->Quit();
+ shell_->Quit();
}
static void OnMessagePipeCreated(
@@ -150,14 +150,14 @@ class TargetApplicationDelegate : public mojo::ApplicationDelegate,
std::move(test_interfaces));
mojo::shell::mojom::ApplicationManagerPtr application_manager;
- app_->ConnectToService("mojo:shell", &application_manager);
+ shell_->ConnectToService("mojo:shell", &application_manager);
application_manager->CreateInstanceForHandle(
mojo::ScopedHandle(mojo::Handle(pipe.release().value())),
"exe:application_manager_apptest_target", std::move(filter),
std::move(request));
}
- mojo::ApplicationImpl* app_;
+ mojo::Shell* shell_;
base::Process target_;
mojo::WeakBindingSet<Driver> bindings_;
base::WeakPtrFactory<TargetApplicationDelegate> weak_factory_;
« no previous file with comments | « mojo/shell/application_manager_apptest.cc ('k') | mojo/shell/application_manager_apptest_target.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698