Chromium Code Reviews

Side by Side Diff: services/test_service/test_service_impl.cc

Issue 1916233002: Mark ApplicationImpl::ConnectTo{Application,Service}() as deprecated. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/test_service/test_service_impl.h" 5 #include "services/test_service/test_service_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/i18n/time_formatting.h" 8 #include "base/i18n/time_formatting.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "mojo/public/cpp/application/application_impl.h" 10 #include "mojo/public/cpp/application/application_impl.h"
(...skipping 25 matching lines...)
36 36
37 void SendTimeResponse( 37 void SendTimeResponse(
38 const mojo::Callback<void(int64_t)>& requestor_callback, 38 const mojo::Callback<void(int64_t)>& requestor_callback,
39 int64_t time_usec) { 39 int64_t time_usec) {
40 requestor_callback.Run(time_usec); 40 requestor_callback.Run(time_usec);
41 } 41 }
42 42
43 void TestServiceImpl::ConnectToAppAndGetTime( 43 void TestServiceImpl::ConnectToAppAndGetTime(
44 const mojo::String& app_url, 44 const mojo::String& app_url,
45 const mojo::Callback<void(int64_t)>& callback) { 45 const mojo::Callback<void(int64_t)>& callback) {
46 app_impl_->ConnectToService(app_url, &time_service_); 46 app_impl_->ConnectToServiceDeprecated(app_url, &time_service_);
47 if (tracking_) { 47 if (tracking_) {
48 tracking_->RecordNewRequest(); 48 tracking_->RecordNewRequest();
49 time_service_->StartTrackingRequests(mojo::Callback<void()>()); 49 time_service_->StartTrackingRequests(mojo::Callback<void()>());
50 } 50 }
51 time_service_->GetPartyTime(base::Bind(&SendTimeResponse, callback)); 51 time_service_->GetPartyTime(base::Bind(&SendTimeResponse, callback));
52 } 52 }
53 53
54 void TestServiceImpl::StartTrackingRequests( 54 void TestServiceImpl::StartTrackingRequests(
55 const mojo::Callback<void()>& callback) { 55 const mojo::Callback<void()>& callback) {
56 TestRequestTrackerPtr tracker; 56 TestRequestTrackerPtr tracker;
57 app_impl_->ConnectToService("mojo:test_request_tracker_app", &tracker); 57 app_impl_->ConnectToServiceDeprecated("mojo:test_request_tracker_app",
58 &tracker);
58 tracking_.reset(new TrackedService(tracker.Pass(), Name_, callback)); 59 tracking_.reset(new TrackedService(tracker.Pass(), Name_, callback));
59 } 60 }
60 61
61 } // namespace test 62 } // namespace test
62 } // namespace mojo 63 } // namespace mojo
OLDNEW
« no previous file with comments | « services/python/mojo_url_redirector/mojo_url_redirector_apptest.cc ('k') | services/test_service/test_time_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine