blob: e437a305e478d9ec8462a7172b60c2f86e0b8d1c [file] [log] [blame]
[email protected]e4097c82013-11-08 00:16:121// Copyright 2013 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#include "google_apis/gcm/gcm_client.h"
6
7#include "base/lazy_instance.h"
8#include "google_apis/gcm/gcm_client_impl.h"
9
10namespace gcm {
11
12namespace {
13
14static base::LazyInstance<GCMClientImpl>::Leaky g_gcm_client =
15 LAZY_INSTANCE_INITIALIZER;
16static GCMClient* g_gcm_client_override = NULL;
17
18} // namespace
19
20GCMClient::OutgoingMessage::OutgoingMessage()
21 : time_to_live(0) {
22}
23
24GCMClient::OutgoingMessage::~OutgoingMessage() {
25}
26
27GCMClient::IncomingMessage::IncomingMessage() {
28}
29
30GCMClient::IncomingMessage::~IncomingMessage() {
31}
32
33// static
34GCMClient* GCMClient::Get() {
35 if (g_gcm_client_override)
36 return g_gcm_client_override;
37 return g_gcm_client.Pointer();
38}
39
40// static
41void GCMClient::SetForTesting(GCMClient* client) {
42 g_gcm_client_override = client;
43}
44
45} // namespace gcm