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

Side by Side Diff: chrome/browser/chromeos/customization/customization_document.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/customization/customization_document.h" 5 #include "chrome/browser/chromeos/customization/customization_document.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 std::unique_ptr<bool> exists(new bool(false)); 859 std::unique_ptr<bool> exists(new bool(false));
860 860
861 base::Closure check_file_exists = 861 base::Closure check_file_exists =
862 base::Bind(&CheckWallpaperCacheExists, 862 base::Bind(&CheckWallpaperCacheExists,
863 GetCustomizedWallpaperDownloadedFileName(), 863 GetCustomizedWallpaperDownloadedFileName(),
864 base::Unretained(exists.get())); 864 base::Unretained(exists.get()));
865 base::Closure on_checked_closure = base::Bind( 865 base::Closure on_checked_closure = base::Bind(
866 &ServicesCustomizationDocument::OnCheckedWallpaperCacheExists, 866 &ServicesCustomizationDocument::OnCheckedWallpaperCacheExists,
867 weak_ptr_factory_.GetWeakPtr(), base::Passed(std::move(exists)), 867 weak_ptr_factory_.GetWeakPtr(), base::Passed(std::move(exists)),
868 base::Passed(std::move(applying))); 868 base::Passed(std::move(applying)));
869 base::PostTaskWithTraitsAndReply(FROM_HERE, 869 base::PostTaskWithTraitsAndReply(
870 base::TaskTraits().MayBlock().WithPriority( 870 FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
871 base::TaskPriority::BACKGROUND), 871 check_file_exists, on_checked_closure);
872 check_file_exists, on_checked_closure);
873 } 872 }
874 873
875 void ServicesCustomizationDocument::OnCheckedWallpaperCacheExists( 874 void ServicesCustomizationDocument::OnCheckedWallpaperCacheExists(
876 std::unique_ptr<bool> exists, 875 std::unique_ptr<bool> exists,
877 std::unique_ptr<ServicesCustomizationDocument::ApplyingTask> applying) { 876 std::unique_ptr<ServicesCustomizationDocument::ApplyingTask> applying) {
878 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 877 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
879 DCHECK(exists); 878 DCHECK(exists);
880 DCHECK(applying); 879 DCHECK(applying);
881 880
882 ApplyWallpaper(*exists, std::move(applying)); 881 ApplyWallpaper(*exists, std::move(applying));
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 apply_tasks_success_ += success; 957 apply_tasks_success_ += success;
959 958
960 if (apply_tasks_started_ != apply_tasks_finished_) 959 if (apply_tasks_started_ != apply_tasks_finished_)
961 return; 960 return;
962 961
963 if (apply_tasks_success_ == apply_tasks_finished_) 962 if (apply_tasks_success_ == apply_tasks_finished_)
964 SetApplied(true); 963 SetApplied(true);
965 } 964 }
966 965
967 } // namespace chromeos 966 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698