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

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

Issue 943053003: Simple multi-url support for mojo apps (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: hate Created 5 years, 9 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 unified diff | Download patch
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_request_tracker_application.h" 5 #include "services/test_service/test_request_tracker_application.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 8
9 #include "mojo/public/c/system/main.h" 9 #include "mojo/public/c/system/main.h"
10 #include "mojo/public/cpp/application/application_connection.h" 10 #include "mojo/public/cpp/application/application_connection.h"
11 #include "mojo/public/cpp/application/application_runner.h" 11 #include "mojo/public/cpp/application/application_runner.h"
12 #include "services/test_service/test_time_service_impl.h" 12 #include "services/test_service/test_time_service_impl.h"
13 13
14 namespace mojo { 14 namespace mojo {
15 namespace test { 15 namespace test {
16 16
17 TestRequestTrackerApplication::TestRequestTrackerApplication() 17 TestRequestTrackerApplication::TestRequestTrackerApplication()
18 : app_impl_(nullptr) { 18 : app_impl_(nullptr) {
19 } 19 }
20 20
21 TestRequestTrackerApplication::~TestRequestTrackerApplication() { 21 TestRequestTrackerApplication::~TestRequestTrackerApplication() {
22 } 22 }
23 23
24 void TestRequestTrackerApplication::Initialize(ApplicationImpl* app) { 24 void TestRequestTrackerApplication::Initialize(ApplicationImpl* app) {
25 app_impl_ = app; 25 app_impl_ = app;
26 } 26 }
27 27
28 bool TestRequestTrackerApplication::ConfigureIncomingConnection( 28 bool TestRequestTrackerApplication::ConfigureIncomingConnection(
29 ApplicationConnection* connection) { 29 ApplicationConnection* connection,
30 const std::string& url) {
30 // Every instance of the service and recorder shares the context. 31 // Every instance of the service and recorder shares the context.
31 // Note, this app is single-threaded, so this is thread safe. 32 // Note, this app is single-threaded, so this is thread safe.
32 connection->AddService<TestTimeService>(this); 33 connection->AddService<TestTimeService>(this);
33 connection->AddService<TestRequestTracker>(this); 34 connection->AddService<TestRequestTracker>(this);
34 connection->AddService<TestTrackedRequestService>(this); 35 connection->AddService<TestTrackedRequestService>(this);
35 return true; 36 return true;
36 } 37 }
37 38
38 void TestRequestTrackerApplication::Create( 39 void TestRequestTrackerApplication::Create(
39 ApplicationConnection* connection, 40 ApplicationConnection* connection,
(...skipping 14 matching lines...) Expand all
54 } 55 }
55 56
56 } // namespace test 57 } // namespace test
57 } // namespace mojo 58 } // namespace mojo
58 59
59 MojoResult MojoMain(MojoHandle shell_handle) { 60 MojoResult MojoMain(MojoHandle shell_handle) {
60 mojo::ApplicationRunner runner( 61 mojo::ApplicationRunner runner(
61 new mojo::test::TestRequestTrackerApplication); 62 new mojo::test::TestRequestTrackerApplication);
62 return runner.Run(shell_handle); 63 return runner.Run(shell_handle);
63 } 64 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698