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

Side by Side Diff: chrome/browser/component_updater/widevine_cdm_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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/component_updater/widevine_cdm_component_installer.h" 5 #include "chrome/browser/component_updater/widevine_cdm_component_installer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string.h> 9 #include <string.h>
10 #include <memory> 10 #include <memory>
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 void WidevineCdmComponentInstallerTraits::ComponentReady( 305 void WidevineCdmComponentInstallerTraits::ComponentReady(
306 const base::Version& version, 306 const base::Version& version,
307 const base::FilePath& path, 307 const base::FilePath& path,
308 std::unique_ptr<base::DictionaryValue> manifest) { 308 std::unique_ptr<base::DictionaryValue> manifest) {
309 if (!IsCompatibleWithChrome(*manifest)) { 309 if (!IsCompatibleWithChrome(*manifest)) {
310 VLOG(1) << "Installed Widevine CDM component is incompatible."; 310 VLOG(1) << "Installed Widevine CDM component is incompatible.";
311 return; 311 return;
312 } 312 }
313 313
314 base::PostTaskWithTraits( 314 base::PostTaskWithTraits(
315 FROM_HERE, base::TaskTraits().MayBlock().WithPriority( 315 FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
316 base::TaskPriority::BACKGROUND),
317 base::Bind(&WidevineCdmComponentInstallerTraits::UpdateCdmAdapter, 316 base::Bind(&WidevineCdmComponentInstallerTraits::UpdateCdmAdapter,
318 base::Unretained(this), version, path, 317 base::Unretained(this), version, path,
319 base::Passed(&manifest))); 318 base::Passed(&manifest)));
320 } 319 }
321 320
322 bool WidevineCdmComponentInstallerTraits::VerifyInstallation( 321 bool WidevineCdmComponentInstallerTraits::VerifyInstallation(
323 const base::DictionaryValue& manifest, 322 const base::DictionaryValue& manifest,
324 const base::FilePath& install_dir) const { 323 const base::FilePath& install_dir) const {
325 return IsCompatibleWithChrome(manifest) && 324 return IsCompatibleWithChrome(manifest) &&
326 base::PathExists(GetPlatformDirectory(install_dir) 325 base::PathExists(GetPlatformDirectory(install_dir)
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 std::unique_ptr<ComponentInstallerTraits> traits( 445 std::unique_ptr<ComponentInstallerTraits> traits(
447 new WidevineCdmComponentInstallerTraits); 446 new WidevineCdmComponentInstallerTraits);
448 // |cus| will take ownership of |installer| during installer->Register(cus). 447 // |cus| will take ownership of |installer| during installer->Register(cus).
449 DefaultComponentInstaller* installer = 448 DefaultComponentInstaller* installer =
450 new DefaultComponentInstaller(std::move(traits)); 449 new DefaultComponentInstaller(std::move(traits));
451 installer->Register(cus, base::Closure()); 450 installer->Register(cus, base::Closure());
452 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) 451 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT)
453 } 452 }
454 453
455 } // namespace component_updater 454 } // namespace component_updater
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698