OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_CONNECTION_OBSERVER_H_ |
| 6 #define COMPONENTS_GCM_DRIVER_GCM_CONNECTION_OBSERVER_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 |
| 10 namespace net { |
| 11 class IPEndPoint; |
| 12 } |
| 13 |
| 14 namespace gcm { |
| 15 |
| 16 // Interface for objects observing GCM connection events. |
| 17 class GCMConnectionObserver { |
| 18 public: |
| 19 GCMConnectionObserver(); |
| 20 virtual ~GCMConnectionObserver(); |
| 21 |
| 22 // Called when a new connection is established and a successful handshake |
| 23 // has been performed. Note that |ip_endpoint| is only set if available for |
| 24 // the current platform. |
| 25 // Default implementation does nothing. |
| 26 virtual void OnConnected(const net::IPEndPoint& ip_endpoint); |
| 27 |
| 28 // Called when the connection is interrupted. |
| 29 // Default implementation does nothing. |
| 30 virtual void OnDisconnected(); |
| 31 }; |
| 32 |
| 33 } // namespace gcm |
| 34 |
| 35 #endif // COMPONENTS_GCM_DRIVER_GCM_CONNECTION_OBSERVER_H_ |
OLD | NEW |