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

Side by Side Diff: chrome/browser/search/local_files_ntp_source.cc

Issue 2858073002: Use constexpr TaskTraits constructor in chrome. (Closed)
Patch Set: Created 3 years, 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/search/local_files_ntp_source.h" 5 #include "chrome/browser/search/local_files_ntp_source.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #if !defined(GOOGLE_CHROME_BUILD) 9 #if !defined(GOOGLE_CHROME_BUILD)
10 10
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 void SendLocalFileResourceWithOrigin( 109 void SendLocalFileResourceWithOrigin(
110 const std::string& path, 110 const std::string& path,
111 const std::string& origin, 111 const std::string& origin,
112 const content::URLDataSource::GotDataCallback& callback) { 112 const content::URLDataSource::GotDataCallback& callback) {
113 base::FilePath fullpath; 113 base::FilePath fullpath;
114 PathService::Get(base::DIR_SOURCE_ROOT, &fullpath); 114 PathService::Get(base::DIR_SOURCE_ROOT, &fullpath);
115 fullpath = fullpath.AppendASCII(kBasePath).AppendASCII(path); 115 fullpath = fullpath.AppendASCII(kBasePath).AppendASCII(path);
116 content::URLDataSource::GotDataCallback wrapper = 116 content::URLDataSource::GotDataCallback wrapper =
117 base::Bind(&CheckLocalIncludes, callback); 117 base::Bind(&CheckLocalIncludes, callback);
118 base::PostTaskWithTraitsAndReplyWithResult( 118 base::PostTaskWithTraitsAndReplyWithResult(
119 FROM_HERE, base::TaskTraits().MayBlock().WithPriority( 119 FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
120 base::TaskPriority::BACKGROUND),
121 base::Bind(&ReadFileAndReturn, fullpath), 120 base::Bind(&ReadFileAndReturn, fullpath),
122 base::Bind(&CallbackWithLoadedResource, origin, wrapper)); 121 base::Bind(&CallbackWithLoadedResource, origin, wrapper));
123 } 122 }
124 123
125 } // namespace local_ntp 124 } // namespace local_ntp
126 125
127 #endif // !defined(GOOGLE_CHROME_BUILD) 126 #endif // !defined(GOOGLE_CHROME_BUILD)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698