OLD | NEW |
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 #ifndef COMPONENTS_COPRESENCE_RPC_RPC_HANDLER_H_ | 5 #ifndef COMPONENTS_COPRESENCE_RPC_RPC_HANDLER_H_ |
6 #define COMPONENTS_COPRESENCE_RPC_RPC_HANDLER_H_ | 6 #define COMPONENTS_COPRESENCE_RPC_RPC_HANDLER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // to be called before invoking any other methods. | 43 // to be called before invoking any other methods. |
44 void Initialize(const SuccessCallback& init_done_callback); | 44 void Initialize(const SuccessCallback& init_done_callback); |
45 | 45 |
46 // Send a report request | 46 // Send a report request |
47 void SendReportRequest(scoped_ptr<ReportRequest> request); | 47 void SendReportRequest(scoped_ptr<ReportRequest> request); |
48 void SendReportRequest(scoped_ptr<ReportRequest> request, | 48 void SendReportRequest(scoped_ptr<ReportRequest> request, |
49 const std::string& app_id, | 49 const std::string& app_id, |
50 const StatusCallback& callback); | 50 const StatusCallback& callback); |
51 | 51 |
52 // Report a set of tokens to the server for a given medium. | 52 // Report a set of tokens to the server for a given medium. |
53 void ReportTokens(TokenMedium medium, const std::vector<std::string>& tokens); | 53 void ReportTokens(const std::vector<FullToken>& tokens); |
54 | 54 |
55 // Create the directive handler and connect it to | 55 // Create the directive handler and connect it to |
56 // the whispernet client specified by the delegate. | 56 // the whispernet client specified by the delegate. |
57 void ConnectToWhispernet(); | 57 void ConnectToWhispernet(); |
58 | 58 |
59 private: | 59 private: |
60 // An HttpPost::ResponseCallback prepended with an HttpPost object | 60 // An HttpPost::ResponseCallback prepended with an HttpPost object |
61 // that needs to be deleted. | 61 // that needs to be deleted. |
62 typedef base::Callback<void(HttpPost*, int, const std::string&)> | 62 typedef base::Callback<void(HttpPost*, int, const std::string&)> |
63 PostCleanupCallback; | 63 PostCleanupCallback; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 std::string device_id_; | 118 std::string device_id_; |
119 scoped_ptr<DirectiveHandler> directive_handler_; | 119 scoped_ptr<DirectiveHandler> directive_handler_; |
120 std::set<HttpPost*> pending_posts_; | 120 std::set<HttpPost*> pending_posts_; |
121 | 121 |
122 DISALLOW_COPY_AND_ASSIGN(RpcHandler); | 122 DISALLOW_COPY_AND_ASSIGN(RpcHandler); |
123 }; | 123 }; |
124 | 124 |
125 } // namespace copresence | 125 } // namespace copresence |
126 | 126 |
127 #endif // COMPONENTS_COPRESENCE_RPC_RPC_HANDLER_H_ | 127 #endif // COMPONENTS_COPRESENCE_RPC_RPC_HANDLER_H_ |
OLD | NEW |