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

Side by Side Diff: mojo/services/test_service/test_time_service_impl.cc

Issue 687433002: Remove mojo/shell and (most) service implementations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove mojo/gles2, disable mojo apps in component build Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « mojo/services/test_service/test_time_service_impl.h ('k') | mojo/shell/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "base/time/time.h"
6 #include "mojo/public/cpp/application/application_connection.h"
7 #include "mojo/services/test_service/test_request_tracker.mojom.h"
8 #include "mojo/services/test_service/test_request_tracker_client_impl.h"
9 #include "mojo/services/test_service/test_time_service_impl.h"
10
11 namespace mojo {
12 namespace test {
13
14 TestTimeServiceImpl::TestTimeServiceImpl(ApplicationConnection* application)
15 : application_(application) {
16 }
17
18 TestTimeServiceImpl::~TestTimeServiceImpl() {
19 }
20
21 void TestTimeServiceImpl::StartTrackingRequests(
22 const mojo::Callback<void()>& callback) {
23 TestRequestTrackerPtr tracker;
24 application_->ConnectToService("mojo:test_request_tracker_app", &tracker);
25 tracking_.reset(new TestRequestTrackerClientImpl(
26 tracker.Pass(), Name_, callback));
27 }
28
29 void TestTimeServiceImpl::GetPartyTime(
30 const mojo::Callback<void(int64_t)>& callback) {
31 if (tracking_)
32 tracking_->RecordNewRequest();
33 base::Time frozen_time(base::Time::UnixEpoch()
34 + base::TimeDelta::FromDays(10957)
35 + base::TimeDelta::FromHours(7)
36 + base::TimeDelta::FromMinutes(59));
37 int64 time(frozen_time.ToInternalValue());
38 callback.Run(time);
39 }
40
41 } // namespace test
42 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/test_service/test_time_service_impl.h ('k') | mojo/shell/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698