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

Unified Diff: components/copresence/copresence_manager_impl.h

Issue 671573003: Adding support for authenticated copresence calls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing memory error Created 6 years, 2 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/copresence_manager.cc ('k') | components/copresence/copresence_manager_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/copresence/copresence_manager_impl.h
diff --git a/components/copresence/copresence_manager_impl.h b/components/copresence/copresence_manager_impl.h
index 035f4621f895e289c3e7dc903782249d7ae5ea07..2d874ae5674f37b520fc86f449a3ca9738c1dc5a 100644
--- a/components/copresence/copresence_manager_impl.h
+++ b/components/copresence/copresence_manager_impl.h
@@ -12,6 +12,7 @@
#include "base/cancelable_callback.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/scoped_vector.h"
#include "components/copresence/proto/rpcs.pb.h"
#include "components/copresence/public/copresence_manager.h"
@@ -25,20 +26,24 @@ class RpcHandler;
struct PendingRequest {
PendingRequest(const ReportRequest& report,
- const std::string app_id,
+ const std::string& app_id,
+ const std::string& auth_token,
const StatusCallback& callback);
~PendingRequest();
- ReportRequest report;
+ scoped_ptr<ReportRequest> report;
std::string app_id;
+ std::string auth_token;
StatusCallback callback;
};
-// The implementation for CopresenceManager.
+// The implementation for CopresenceManager. Responsible primarily for
+// client-side initialization. The RpcHandler handles all the details
+// of interacting with the server.
class CopresenceManagerImpl : public CopresenceManager {
public:
~CopresenceManagerImpl() override;
- void ExecuteReportRequest(ReportRequest request,
+ void ExecuteReportRequest(const ReportRequest& request,
const std::string& app_id,
const StatusCallback& callback) override;
@@ -51,15 +56,15 @@ class CopresenceManagerImpl : public CopresenceManager {
void InitStepComplete(const std::string& step, bool success);
bool init_failed_;
- std::vector<PendingRequest> pending_requests_queue_;
+ ScopedVector<PendingRequest> pending_requests_queue_;
- base::CancelableCallback<void(bool)> init_callback_;
+ base::CancelableCallback<void(bool)> whispernet_init_callback_;
// TODO(rkc): This code is almost identical to what we use in feedback to
// perform multiple blocking tasks and then run a post process method. Look
// into refactoring it all out to a common construct, like maybe a
// PostMultipleTasksAndReply?
- size_t pending_init_operations_;
+ int pending_init_operations_;
CopresenceDelegate* const delegate_;
scoped_ptr<RpcHandler> rpc_handler_;
« no previous file with comments | « components/copresence/copresence_manager.cc ('k') | components/copresence/copresence_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698