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

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

Issue 1719193003: Add a user id parameter to connections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 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 "mojo/services/test_service/test_request_tracker_application.h" 5 #include "mojo/services/test_service/test_request_tracker_application.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "mojo/public/c/system/main.h" 10 #include "mojo/public/c/system/main.h"
11 #include "mojo/services/test_service/test_time_service_impl.h" 11 #include "mojo/services/test_service/test_time_service_impl.h"
12 #include "mojo/shell/public/cpp/application_runner.h" 12 #include "mojo/shell/public/cpp/application_runner.h"
13 #include "mojo/shell/public/cpp/connection.h" 13 #include "mojo/shell/public/cpp/connection.h"
14 14
15 namespace mojo { 15 namespace mojo {
16 namespace test { 16 namespace test {
17 17
18 TestRequestTrackerApplication::TestRequestTrackerApplication() 18 TestRequestTrackerApplication::TestRequestTrackerApplication()
19 : shell_(nullptr) {} 19 : shell_(nullptr) {}
20 TestRequestTrackerApplication::~TestRequestTrackerApplication() {} 20 TestRequestTrackerApplication::~TestRequestTrackerApplication() {}
21 21
22 void TestRequestTrackerApplication::Initialize(Shell* shell, 22 void TestRequestTrackerApplication::Initialize(Shell* shell,
23 const std::string& url, 23 const std::string& url,
24 uint32_t id) { 24 uint32_t id,
25 uint32_t user_id) {
25 shell_ = shell; 26 shell_ = shell;
26 } 27 }
27 28
28 bool TestRequestTrackerApplication::AcceptConnection(Connection* connection) { 29 bool TestRequestTrackerApplication::AcceptConnection(Connection* connection) {
29 // Every instance of the service and recorder shares the context. 30 // Every instance of the service and recorder shares the context.
30 // Note, this app is single-threaded, so this is thread safe. 31 // Note, this app is single-threaded, so this is thread safe.
31 connection->AddInterface<TestTimeService>(this); 32 connection->AddInterface<TestTimeService>(this);
32 connection->AddInterface<TestRequestTracker>(this); 33 connection->AddInterface<TestRequestTracker>(this);
33 connection->AddInterface<TestTrackedRequestService>(this); 34 connection->AddInterface<TestTrackedRequestService>(this);
34 return true; 35 return true;
(...skipping 18 matching lines...) Expand all
53 } 54 }
54 55
55 } // namespace test 56 } // namespace test
56 } // namespace mojo 57 } // namespace mojo
57 58
58 MojoResult MojoMain(MojoHandle shell_handle) { 59 MojoResult MojoMain(MojoHandle shell_handle) {
59 mojo::ApplicationRunner runner( 60 mojo::ApplicationRunner runner(
60 new mojo::test::TestRequestTrackerApplication); 61 new mojo::test::TestRequestTrackerApplication);
61 return runner.Run(shell_handle); 62 return runner.Run(shell_handle);
62 } 63 }
OLDNEW
« no previous file with comments | « mojo/services/test_service/test_request_tracker_application.h ('k') | mojo/services/test_service/test_service_application.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698