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

Unified Diff: components/copresence/public/copresence_client.h

Issue 441103002: Tests for the Copresence API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@api
Patch Set: "Assertions" cleanup 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 side-by-side diff with in-line comments
Download patch
Index: components/copresence/public/copresence_client.h
diff --git a/components/copresence/public/copresence_client.h b/components/copresence/public/copresence_client.h
index 40b8bf97bfe4720e83416fae7eabd5e89574a568..698425677b385e1320a9e425cd4bdf4436b0976c 100644
--- a/components/copresence/public/copresence_client.h
+++ b/components/copresence/public/copresence_client.h
@@ -41,8 +41,6 @@ struct PendingRequest {
// client.
class CopresenceClient : public base::SupportsWeakPtr<CopresenceClient> {
public:
- // The delegate must outlive us.
- explicit CopresenceClient(CopresenceClientDelegate* delegate);
virtual ~CopresenceClient();
// This method will execute a report request. Each report request can have
@@ -50,14 +48,24 @@ class CopresenceClient : public base::SupportsWeakPtr<CopresenceClient> {
// client is initialized, it sends all request to the server and handles
// the response. If an error is encountered, the status callback is used
// to relay it to the requester.
- void ExecuteReportRequest(copresence::ReportRequest request,
- const std::string& app_id,
- const StatusCallback& callback);
+ virtual void ExecuteReportRequest(copresence::ReportRequest request,
+ const std::string& app_id,
+ const StatusCallback& callback);
// Called before the API (and thus the Client) is destructed.
void Shutdown();
+ // Factory method for CopresenceClients. The delegate is owned
+ // by the caller, and must outlive the client.
+ static scoped_ptr<CopresenceClient> Create(
+ CopresenceClientDelegate* delegate);
+
+ protected:
+ // Create clients with the Create() method.
+ CopresenceClient();
+
private:
+
void CompleteInitialization();
void InitStepComplete(const std::string& step, bool success);
« components/copresence/copresence_client.cc ('K') | « components/copresence/copresence_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698