| OLD | NEW |
| 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 Loading... |
| 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) |
| OLD | NEW |