summaryrefslogtreecommitdiffstats
path: root/components/gcm_driver/gcm_connection_observer.h
blob: 0778286b1572b0f6c0d9ec460c9ff0ddcb8f9794 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// 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 {

// Interface for objects observing GCM connection events.
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_CONNECTION_OBSERVER_H_