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

Side by Side Diff: components/copresence/rpc/rpc_handler.h

Issue 426093003: Add the copresence component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
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 #ifndef COMPONENTS_COPRESENCE_RPC_RPC_HANDLER_H_
6 #define COMPONENTS_COPRESENCE_RPC_RPC_HANDLER_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/callback.h"
12 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "components/copresence/public/copresence_client_delegate.h"
15
16 namespace copresence {
17
18 class ReportRequest;
19 class WhispernetClient;
20
21 // This class currently handles all communication with the copresence server.
22 // NOTE: This class is a stub.
23 class RpcHandler {
24 public:
25 // A callback to indicate whether handler initialization succeeded.
26 typedef base::Callback<void(bool)> SuccessCallback;
27
28 // Constructor. May call the server to register a device,
29 // so completion status is indicated by the SuccessCallback.
30 RpcHandler(CopresenceClientDelegate* delegate,
31 SuccessCallback init_done_callback);
32
33 virtual ~RpcHandler();
34
35 // Send a report request
36 void SendReportRequest(scoped_ptr<copresence::ReportRequest> request);
37 void SendReportRequest(scoped_ptr<copresence::ReportRequest> request,
38 const std::string& app_id,
39 const StatusCallback& callback);
40
41 // Report a set of tokens to the server for a given medium.
42 void ReportTokens(copresence::TokenMedium medium,
43 const std::vector<std::string>& tokens);
44
45 // Create the directive handler and connect it to the whispernet client.
46 void ConnectToWhispernet(WhispernetClient* whispernet_client);
47
48 // Disconnect the directive handler from the whispernet client.
49 void DisconnectFromWhispernet();
50
51 private:
52 DISALLOW_COPY_AND_ASSIGN(RpcHandler);
53 };
54
55 } // namespace copresence
56
57 #endif // COMPONENTS_COPRESENCE_RPC_RPC_HANDLER_H_
OLDNEW
« no previous file with comments | « components/copresence/public/whispernet_client.h ('k') | components/copresence/rpc/rpc_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698