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

Side by Side Diff: chromeos/binder/test_service.h

Issue 1575313002: Add CommandBroker::OnTransaction to handle incoming transactions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment Created 4 years, 11 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
« no previous file with comments | « chromeos/binder/ipc_thread.cc ('k') | chromeos/binder/test_service.cc » ('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 2015 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 #ifndef CHROMEOS_BINDER_TEST_SERVICE_H_
6 #define CHROMEOS_BINDER_TEST_SERVICE_H_
7
8 #include "base/macros.h"
9 #include "base/strings/string16.h"
10 #include "chromeos/binder/constants.h"
11 #include "chromeos/binder/ipc_thread.h"
12
13 namespace binder {
14
15 // Service for testing.
16 // Opens binder driver on its own thread and provides a service.
17 // Note: Although this service runs in the same process as the test code, the
18 // binder driver thinks this service is in a separate process because it owns a
19 // separate binder driver FD itself.
20 class TestService {
21 public:
22 enum {
23 INCREMENT_INT_TRANSACTION = kFirstTransactionCode,
24 };
25
26 TestService();
27 ~TestService();
28
29 // The name of this service.
30 const base::string16& service_name() const { return service_name_; }
31
32 // Starts the service and waits for it to complete initialization.
33 // Returns true on success.
34 bool StartAndWait();
35
36 // Stops this service.
37 void Stop();
38
39 private:
40 class TestObject;
41
42 // Initializes the service on the service thread.
43 // |result| will be set to true on success.
44 void Initialize(bool* result);
45
46 base::string16 service_name_;
47 IpcThread thread_;
48
49 DISALLOW_COPY_AND_ASSIGN(TestService);
50 };
51
52 } // namespace binder
53
54 #endif // CHROMEOS_BINDER_TEST_SERVICE_H_
OLDNEW
« no previous file with comments | « chromeos/binder/ipc_thread.cc ('k') | chromeos/binder/test_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698