1 // Copyright (c) 2012 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.
5 #include "jingle/notifier/listener/push_client.h"
10 #include "base/single_thread_task_runner.h"
11 #include "jingle/notifier/listener/non_blocking_push_client.h"
12 #include "jingle/notifier/listener/xmpp_push_client.h"
16 PushClient::~PushClient() {}
20 scoped_ptr
<PushClient
> CreateXmppPushClient(
21 const NotifierOptions
& notifier_options
) {
22 return scoped_ptr
<PushClient
>(new XmppPushClient(notifier_options
));
27 scoped_ptr
<PushClient
> PushClient::CreateDefault(
28 const NotifierOptions
& notifier_options
) {
29 return scoped_ptr
<PushClient
>(new NonBlockingPushClient(
30 notifier_options
.request_context_getter
->GetNetworkTaskRunner(),
31 base::Bind(&CreateXmppPushClient
, notifier_options
)));
34 scoped_ptr
<PushClient
> PushClient::CreateDefaultOnIOThread(
35 const NotifierOptions
& notifier_options
) {
36 CHECK(notifier_options
.request_context_getter
->GetNetworkTaskRunner()->
37 BelongsToCurrentThread());
38 return CreateXmppPushClient(notifier_options
);
41 } // namespace notifier