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

Unified 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, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/copresence/public/whispernet_client.h ('k') | components/copresence/rpc/rpc_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/copresence/rpc/rpc_handler.h
diff --git a/components/copresence/rpc/rpc_handler.h b/components/copresence/rpc/rpc_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..dee7220ac78045659d7e0c62868a344df22026d7
--- /dev/null
+++ b/components/copresence/rpc/rpc_handler.h
@@ -0,0 +1,57 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_COPRESENCE_RPC_RPC_HANDLER_H_
+#define COMPONENTS_COPRESENCE_RPC_RPC_HANDLER_H_
+
+#include <string>
+#include <vector>
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "components/copresence/public/copresence_client_delegate.h"
+
+namespace copresence {
+
+class ReportRequest;
+class WhispernetClient;
+
+// This class currently handles all communication with the copresence server.
+// NOTE: This class is a stub.
+class RpcHandler {
+ public:
+ // A callback to indicate whether handler initialization succeeded.
+ typedef base::Callback<void(bool)> SuccessCallback;
+
+ // Constructor. May call the server to register a device,
+ // so completion status is indicated by the SuccessCallback.
+ RpcHandler(CopresenceClientDelegate* delegate,
+ SuccessCallback init_done_callback);
+
+ virtual ~RpcHandler();
+
+ // Send a report request
+ void SendReportRequest(scoped_ptr<copresence::ReportRequest> request);
+ void SendReportRequest(scoped_ptr<copresence::ReportRequest> request,
+ const std::string& app_id,
+ const StatusCallback& callback);
+
+ // Report a set of tokens to the server for a given medium.
+ void ReportTokens(copresence::TokenMedium medium,
+ const std::vector<std::string>& tokens);
+
+ // Create the directive handler and connect it to the whispernet client.
+ void ConnectToWhispernet(WhispernetClient* whispernet_client);
+
+ // Disconnect the directive handler from the whispernet client.
+ void DisconnectFromWhispernet();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RpcHandler);
+};
+
+} // namespace copresence
+
+#endif // COMPONENTS_COPRESENCE_RPC_RPC_HANDLER_H_
« 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