summaryrefslogtreecommitdiff
path: root/chromium/google_apis/gcm/gcm_client.cc
blob: e437a305e478d9ec8462a7172b60c2f86e0b8d1c (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
36
37
38
39
40
41
42
43
44
45
// Copyright 2013 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.

#include "google_apis/gcm/gcm_client.h"

#include "base/lazy_instance.h"
#include "google_apis/gcm/gcm_client_impl.h"

namespace gcm {

namespace {

static base::LazyInstance<GCMClientImpl>::Leaky g_gcm_client =
    LAZY_INSTANCE_INITIALIZER;
static GCMClient* g_gcm_client_override = NULL;

}  // namespace

GCMClient::OutgoingMessage::OutgoingMessage()
    : time_to_live(0) {
}

GCMClient::OutgoingMessage::~OutgoingMessage() {
}

GCMClient::IncomingMessage::IncomingMessage() {
}

GCMClient::IncomingMessage::~IncomingMessage() {
}

// static
GCMClient* GCMClient::Get() {
  if (g_gcm_client_override)
    return g_gcm_client_override;
  return g_gcm_client.Pointer();
}

// static
void GCMClient::SetForTesting(GCMClient* client) {
  g_gcm_client_override = client;
}

}  // namespace gcm