Roll src/third_party/WebKit dd84e80:787a07c (svn 201033:201034)
[chromium-blink-merge.git] / chrome / browser / services / gcm / gcm_desktop_utils.cc
blobcd7fb73d5466a54a5e7f55f846ffb6fbe649e979
1 // Copyright 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.
5 #include "chrome/browser/services/gcm/gcm_desktop_utils.h"
7 #include "base/sequenced_task_runner.h"
8 #include "base/threading/sequenced_worker_pool.h"
9 #include "chrome/common/gcm_desktop_util.h"
10 #include "components/gcm_driver/gcm_client_factory.h"
11 #include "components/gcm_driver/gcm_driver.h"
12 #include "content/public/browser/browser_thread.h"
14 namespace gcm {
16 scoped_ptr<GCMDriver> CreateGCMDriverDesktop(
17 scoped_ptr<GCMClientFactory> gcm_client_factory,
18 PrefService* prefs,
19 const base::FilePath& store_path,
20 const scoped_refptr<net::URLRequestContextGetter>& request_context) {
22 scoped_refptr<base::SequencedWorkerPool> worker_pool(
23 content::BrowserThread::GetBlockingPool());
24 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner(
25 worker_pool->GetSequencedTaskRunnerWithShutdownBehavior(
26 worker_pool->GetSequenceToken(),
27 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN));
29 return CreateGCMDriverDesktopWithTaskRunners(
30 gcm_client_factory.Pass(),
31 prefs,
32 store_path,
33 request_context,
34 content::BrowserThread::GetMessageLoopProxyForThread(
35 content::BrowserThread::UI),
36 content::BrowserThread::GetMessageLoopProxyForThread(
37 content::BrowserThread::IO),
38 blocking_task_runner);
41 } // namespace gcm