Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: chrome/browser/chromeos/printing/ppd_provider_factory.cc

Issue 2939373003: Convert PpdCache and PpdProvider to TaskScheduler. (Closed)
Patch Set: remove extra imports Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chromeos/printing/ppd_cache.h » ('j') | chromeos/printing/ppd_cache.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/printing/ppd_provider_factory.h" 5 #include "chrome/browser/chromeos/printing/ppd_provider_factory.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chromeos/printing/ppd_cache.h" 12 #include "chromeos/printing/ppd_cache.h"
13 #include "chromeos/printing/ppd_provider.h" 13 #include "chromeos/printing/ppd_provider.h"
14 #include "content/public/browser/browser_thread.h"
15 #include "google_apis/google_api_keys.h" 14 #include "google_apis/google_api_keys.h"
16 #include "net/url_request/url_request_context_getter.h" 15 #include "net/url_request/url_request_context_getter.h"
17 16
18 namespace chromeos { 17 namespace chromeos {
19 namespace printing { 18 namespace printing {
20 19
21 scoped_refptr<PpdProvider> CreateProvider(Profile* profile) { 20 scoped_refptr<PpdProvider> CreateProvider(Profile* profile) {
22 base::FilePath ppd_cache_path = 21 base::FilePath ppd_cache_path =
23 profile->GetPath().Append(FILE_PATH_LITERAL("PPDCache")); 22 profile->GetPath().Append(FILE_PATH_LITERAL("PPDCache"));
24 23
25 auto cache = PpdCache::Create(ppd_cache_path, 24 auto cache = PpdCache::Create(ppd_cache_path);
26 content::BrowserThread::GetTaskRunnerForThread(
27 content::BrowserThread::CACHE)
28 .get());
29 25
30 return PpdProvider::Create(g_browser_process->GetApplicationLocale(), 26 return PpdProvider::Create(g_browser_process->GetApplicationLocale(),
31 g_browser_process->system_request_context(), cache, 27 g_browser_process->system_request_context(),
32 content::BrowserThread::GetTaskRunnerForThread( 28 cache);
gab 2017/06/19 15:13:21 inline |cache| here? (or at least std::move() it)
skau 2017/06/19 23:31:08 Done.
33 content::BrowserThread::FILE)
34 .get());
35 } 29 }
36 30
37 } // namespace printing 31 } // namespace printing
38 } // namespace chromeos 32 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chromeos/printing/ppd_cache.h » ('j') | chromeos/printing/ppd_cache.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698