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

Side by Side Diff: chrome/browser/component_updater/ssl_error_assistant_component_installer.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 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/component_updater/ssl_error_assistant_component_install er.h" 5 #include "chrome/browser/component_updater/ssl_error_assistant_component_install er.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 77 }
78 78
79 void SSLErrorAssistantComponentInstallerTraits::ComponentReady( 79 void SSLErrorAssistantComponentInstallerTraits::ComponentReady(
80 const base::Version& version, 80 const base::Version& version,
81 const base::FilePath& install_dir, 81 const base::FilePath& install_dir,
82 std::unique_ptr<base::DictionaryValue> manifest) { 82 std::unique_ptr<base::DictionaryValue> manifest) {
83 DVLOG(1) << "Component ready, version " << version.GetString() << " in " 83 DVLOG(1) << "Component ready, version " << version.GetString() << " in "
84 << install_dir.value(); 84 << install_dir.value();
85 85
86 base::PostTaskWithTraits( 86 base::PostTaskWithTraits(
87 FROM_HERE, 87 FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
88 base::TaskTraits()
89 .WithPriority(base::TaskPriority::BACKGROUND)
90 .MayBlock(),
91 base::Bind(&LoadProtoFromDisk, GetInstalledPath(install_dir))); 88 base::Bind(&LoadProtoFromDisk, GetInstalledPath(install_dir)));
92 } 89 }
93 90
94 // Called during startup and installation before ComponentReady(). 91 // Called during startup and installation before ComponentReady().
95 bool SSLErrorAssistantComponentInstallerTraits::VerifyInstallation( 92 bool SSLErrorAssistantComponentInstallerTraits::VerifyInstallation(
96 const base::DictionaryValue& manifest, 93 const base::DictionaryValue& manifest,
97 const base::FilePath& install_dir) const { 94 const base::FilePath& install_dir) const {
98 // No need to actually validate the proto here, since we'll do the checking 95 // No need to actually validate the proto here, since we'll do the checking
99 // in PopulateFromDynamicUpdate(). 96 // in PopulateFromDynamicUpdate().
100 return base::PathExists(GetInstalledPath(install_dir)); 97 return base::PathExists(GetInstalledPath(install_dir));
(...skipping 30 matching lines...) Expand all
131 128
132 std::unique_ptr<ComponentInstallerTraits> traits( 129 std::unique_ptr<ComponentInstallerTraits> traits(
133 new SSLErrorAssistantComponentInstallerTraits()); 130 new SSLErrorAssistantComponentInstallerTraits());
134 // |cus| takes ownership of |installer|. 131 // |cus| takes ownership of |installer|.
135 DefaultComponentInstaller* installer = 132 DefaultComponentInstaller* installer =
136 new DefaultComponentInstaller(std::move(traits)); 133 new DefaultComponentInstaller(std::move(traits));
137 installer->Register(cus, base::Closure()); 134 installer->Register(cus, base::Closure());
138 } 135 }
139 136
140 } // namespace component_updater 137 } // namespace component_updater
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698