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

Unified Diff: mandoline/services/core_services/core_services_application_delegate.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
Index: mandoline/services/core_services/core_services_application_delegate.cc
diff --git a/mandoline/services/core_services/core_services_application_delegate.cc b/mandoline/services/core_services/core_services_application_delegate.cc
index b0333fc1967722850c36596e1d9481247d0c4338..efd21d0375d0ad7f9f390d41e58b8add70097525 100644
--- a/mandoline/services/core_services/core_services_application_delegate.cc
+++ b/mandoline/services/core_services/core_services_application_delegate.cc
@@ -20,7 +20,6 @@
#include "mojo/services/tracing/public/cpp/tracing_impl.h"
#include "mojo/services/tracing/tracing_app.h"
#include "mojo/shell/public/cpp/application_connection.h"
-#include "mojo/shell/public/cpp/application_impl.h"
#include "mojo/shell/public/cpp/application_runner.h"
#include "url/gurl.h"
@@ -29,12 +28,13 @@ namespace core_services {
// A helper class for hosting a mojo::ApplicationImpl on its own thread.
class ApplicationThread : public base::SimpleThread {
public:
- ApplicationThread(const base::WeakPtr<CoreServicesApplicationDelegate>
- core_services_application,
- const std::string& url,
- scoped_ptr<mojo::ApplicationDelegate> delegate,
- mojo::ApplicationRequest request,
- const mojo::Callback<void()>& destruct_callback)
+ ApplicationThread(
+ const base::WeakPtr<CoreServicesApplicationDelegate>
+ core_services_application,
+ const std::string& url,
+ scoped_ptr<mojo::ApplicationDelegate> delegate,
+ mojo::InterfaceRequest<mojo::shell::mojom::Application> request,
+ const mojo::Callback<void()>& destruct_callback)
: base::SimpleThread(url),
core_services_application_(core_services_application),
core_services_application_task_runner_(base::MessageLoop::current()
@@ -73,7 +73,7 @@ class ApplicationThread : public base::SimpleThread {
core_services_application_task_runner_;
std::string url_;
scoped_ptr<mojo::ApplicationDelegate> delegate_;
- mojo::ApplicationRequest request_;
+ mojo::InterfaceRequest<mojo::shell::mojom::Application> request_;
mojo::Callback<void()> destruct_callback_;
DISALLOW_COPY_AND_ASSIGN(ApplicationThread);
@@ -97,9 +97,11 @@ void CoreServicesApplicationDelegate::ApplicationThreadDestroyed(
application_threads_.erase(iter);
}
-void CoreServicesApplicationDelegate::Initialize(mojo::ApplicationImpl* app) {
+void CoreServicesApplicationDelegate::Initialize(mojo::Shell* shell,
+ const std::string& url,
+ uint32_t id) {
mojo::InitLogging();
- tracing_.Initialize(app);
+ tracing_.Initialize(shell, url);
}
bool CoreServicesApplicationDelegate::AcceptConnection(
@@ -122,7 +124,7 @@ void CoreServicesApplicationDelegate::Create(
}
void CoreServicesApplicationDelegate::StartApplication(
- mojo::ApplicationRequest request,
+ mojo::InterfaceRequest<mojo::shell::mojom::Application> request,
mojo::URLResponsePtr response,
const mojo::Callback<void()>& destruct_callback) {
const std::string url = response->url;
« no previous file with comments | « mandoline/services/core_services/core_services_application_delegate.h ('k') | mandoline/services/updater/updater_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698