| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // to contact the server, but it can be overridden for testing. | 101 // to contact the server, but it can be overridden for testing. |
| 102 void SendHttpPost(net::URLRequestContextGetter* url_context_getter, | 102 void SendHttpPost(net::URLRequestContextGetter* url_context_getter, |
| 103 const std::string& rpc_name, | 103 const std::string& rpc_name, |
| 104 scoped_ptr<google::protobuf::MessageLite> request_proto, | 104 scoped_ptr<google::protobuf::MessageLite> request_proto, |
| 105 const PostCleanupCallback& callback); | 105 const PostCleanupCallback& callback); |
| 106 | 106 |
| 107 // This method receives the request to encode a token and forwards it to | 107 // This method receives the request to encode a token and forwards it to |
| 108 // whispernet, setting the samples return callback to samples_callback. | 108 // whispernet, setting the samples return callback to samples_callback. |
| 109 void AudioDirectiveListToWhispernetConnector( | 109 void AudioDirectiveListToWhispernetConnector( |
| 110 const std::string& token, | 110 const std::string& token, |
| 111 bool audible, |
| 111 const WhispernetClient::SamplesCallback& samples_callback); | 112 const WhispernetClient::SamplesCallback& samples_callback); |
| 112 | 113 |
| 113 CopresenceClientDelegate* delegate_; // Belongs to the caller. | 114 CopresenceClientDelegate* delegate_; // Belongs to the caller. |
| 114 TimedMap<std::string, bool> invalid_audio_token_cache_; | 115 TimedMap<std::string, bool> invalid_audio_token_cache_; |
| 115 PostCallback server_post_callback_; | 116 PostCallback server_post_callback_; |
| 116 | 117 |
| 117 std::string device_id_; | 118 std::string device_id_; |
| 118 scoped_ptr<DirectiveHandler> directive_handler_; | 119 scoped_ptr<DirectiveHandler> directive_handler_; |
| 119 std::set<HttpPost*> pending_posts_; | 120 std::set<HttpPost*> pending_posts_; |
| 120 | 121 |
| 121 DISALLOW_COPY_AND_ASSIGN(RpcHandler); | 122 DISALLOW_COPY_AND_ASSIGN(RpcHandler); |
| 122 }; | 123 }; |
| 123 | 124 |
| 124 } // namespace copresence | 125 } // namespace copresence |
| 125 | 126 |
| 126 #endif // COMPONENTS_COPRESENCE_RPC_RPC_HANDLER_H_ | 127 #endif // COMPONENTS_COPRESENCE_RPC_RPC_HANDLER_H_ |
| OLD | NEW |