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

Side by Side Diff: chrome/browser/chromeos/app_mode/kiosk_app_icon_loader.cc

Issue 2871303004: Rename TaskRunner::RunsTasksOnCurrentThread() in //chrome (Closed)
Patch Set: fixed build error 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/app_mode/kiosk_app_icon_loader.h" 5 #include "chrome/browser/chromeos/app_mode/kiosk_app_icon_loader.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 30 matching lines...) Expand all
41 41
42 private: 42 private:
43 ~IconImageRequest() override = default; 43 ~IconImageRequest() override = default;
44 KioskAppIconLoader::ResultCallback result_callback_; 44 KioskAppIconLoader::ResultCallback result_callback_;
45 }; 45 };
46 46
47 void LoadOnBlockingPool( 47 void LoadOnBlockingPool(
48 const base::FilePath& icon_path, 48 const base::FilePath& icon_path,
49 scoped_refptr<base::SequencedTaskRunner> callback_task_runner, 49 scoped_refptr<base::SequencedTaskRunner> callback_task_runner,
50 KioskAppIconLoader::ResultCallback result_callback) { 50 KioskAppIconLoader::ResultCallback result_callback) {
51 DCHECK(callback_task_runner->RunsTasksOnCurrentThread()); 51 DCHECK(callback_task_runner->RunsTasksInCurrentSequence());
52 52
53 std::string data; 53 std::string data;
54 if (!base::ReadFileToString(base::FilePath(icon_path), &data)) { 54 if (!base::ReadFileToString(base::FilePath(icon_path), &data)) {
55 LOG(ERROR) << "Failed to read icon file."; 55 LOG(ERROR) << "Failed to read icon file.";
56 BrowserThread::PostTask( 56 BrowserThread::PostTask(
57 BrowserThread::UI, FROM_HERE, 57 BrowserThread::UI, FROM_HERE,
58 base::Bind(result_callback, base::Optional<gfx::ImageSkia>())); 58 base::Bind(result_callback, base::Optional<gfx::ImageSkia>()));
59 return; 59 return;
60 } 60 }
61 61
(...skipping 26 matching lines...) Expand all
88 DCHECK_CURRENTLY_ON(BrowserThread::UI); 88 DCHECK_CURRENTLY_ON(BrowserThread::UI);
89 89
90 if (result.has_value()) { 90 if (result.has_value()) {
91 delegate_->OnIconLoadSuccess(result.value()); 91 delegate_->OnIconLoadSuccess(result.value());
92 } else { 92 } else {
93 delegate_->OnIconLoadFailure(); 93 delegate_->OnIconLoadFailure();
94 } 94 }
95 } 95 }
96 96
97 } // namespace chromeos 97 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/app_mode/kiosk_app_data_base.cc ('k') | chrome/browser/chromeos/policy/cloud_external_data_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698