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

Unified Diff: components/gcm_driver/gcm_connection_observer.h

Issue 515763002: [GCM] Extracting GCMConnectionObserver from GCMAppHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finishing the CL on a box that compiles much faster... 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/gcm_driver/gcm_connection_observer.h
diff --git a/components/gcm_driver/gcm_connection_observer.h b/components/gcm_driver/gcm_connection_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..1a18f6b9499e69123adad7befdb5fff5ecebb303
--- /dev/null
+++ b/components/gcm_driver/gcm_connection_observer.h
@@ -0,0 +1,36 @@
+// Copyright (c) 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_GCM_DRIVER_GCM_CONNECTION_OBSERVER_H_
+#define COMPONENTS_GCM_DRIVER_GCM_CONNECTION_OBSERVER_H_
+
+#include "base/basictypes.h"
+
+namespace net {
+class IPEndPoint;
+}
+
+namespace gcm {
+
+// Defines the interface to provide handling and event routing logic for a given
jianli 2014/08/27 23:34:17 Update comment.
fgorski 2014/08/27 23:51:45 Done.
+// app.
+class GCMConnectionObserver {
+ public:
+ GCMConnectionObserver();
+ virtual ~GCMConnectionObserver();
+
+ // Called when a new connection is established and a successful handshake
+ // has been performed. Note that |ip_endpoint| is only set if available for
+ // the current platform.
+ // Default implementation does nothing.
+ virtual void OnConnected(const net::IPEndPoint& ip_endpoint);
+
+ // Called when the connection is interrupted.
+ // Default implementation does nothing.
+ virtual void OnDisconnected();
+};
+
+} // namespace gcm
+
+#endif // COMPONENTS_GCM_DRIVER_GCM_APP_HANDLER_H_
jianli 2014/08/27 23:34:17 Update comment.
fgorski 2014/08/27 23:51:45 Done.

Powered by Google App Engine
This is Rietveld 408576698