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

Unified Diff: services/test_service/test_service_impl.cc

Issue 2004493002: Add a mojo::RunApplication() for running implementations of ApplicationImplBase. (Closed) Base URL: https://github.com/domokit/mojo.git@work790_environment_no_instantiate
Patch Set: rebased Created 4 years, 7 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 | « services/test_service/test_service_impl.h ('k') | services/test_service/test_time_service_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/test_service/test_service_impl.cc
diff --git a/services/test_service/test_service_impl.cc b/services/test_service/test_service_impl.cc
index 27487c8234d927e4626d1e41a0aaadbb1f2c0f40..bbd6a27e171921bceaafea62bfc617cec9265f7d 100644
--- a/services/test_service/test_service_impl.cc
+++ b/services/test_service/test_service_impl.cc
@@ -7,7 +7,6 @@
#include "base/bind.h"
#include "base/i18n/time_formatting.h"
#include "base/strings/utf_string_conversions.h"
-#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/application/connect.h"
#include "services/test_service/test_service_application.h"
#include "services/test_service/test_time_service_impl.h"
@@ -16,18 +15,14 @@
namespace mojo {
namespace test {
-TestServiceImpl::TestServiceImpl(ApplicationImpl* app_impl,
- TestServiceApplication* application,
+TestServiceImpl::TestServiceImpl(TestServiceApplication* application,
InterfaceRequest<TestService> request)
- : application_(application),
- app_impl_(app_impl),
- binding_(this, request.Pass()) {
+ : application_(application), binding_(this, request.Pass()) {
binding_.set_connection_error_handler(
[this]() { application_->ReleaseRef(); });
}
-TestServiceImpl::~TestServiceImpl() {
-}
+TestServiceImpl::~TestServiceImpl() {}
void TestServiceImpl::Ping(const mojo::Callback<void()>& callback) {
if (tracking_)
@@ -44,7 +39,7 @@ void SendTimeResponse(
void TestServiceImpl::ConnectToAppAndGetTime(
const mojo::String& app_url,
const mojo::Callback<void(int64_t)>& callback) {
- ConnectToService(app_impl_->shell(), app_url, GetProxy(&time_service_));
+ ConnectToService(application_->shell(), app_url, GetProxy(&time_service_));
if (tracking_) {
tracking_->RecordNewRequest();
time_service_->StartTrackingRequests(mojo::Callback<void()>());
@@ -55,7 +50,7 @@ void TestServiceImpl::ConnectToAppAndGetTime(
void TestServiceImpl::StartTrackingRequests(
const mojo::Callback<void()>& callback) {
TestRequestTrackerPtr tracker;
- ConnectToService(app_impl_->shell(), "mojo:test_request_tracker_app",
+ ConnectToService(application_->shell(), "mojo:test_request_tracker_app",
GetProxy(&tracker));
tracking_.reset(new TrackedService(tracker.Pass(), Name_, callback));
}
« no previous file with comments | « services/test_service/test_service_impl.h ('k') | services/test_service/test_time_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698