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

Side by Side Diff: chrome/browser/component_updater/cld_component_installer.cc

Issue 285293004: Allow browser tests to run with dynamic CLD data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cld_uma
Patch Set: Created 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/cld_component_installer.h" 5 #include "chrome/browser/component_updater/cld_component_installer.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 11 matching lines...) Expand all
22 22
23 using component_updater::ComponentUpdateService; 23 using component_updater::ComponentUpdateService;
24 using content::BrowserThread; 24 using content::BrowserThread;
25 25
26 namespace { 26 namespace {
27 27
28 // Once we have acquired a valid file from the component installer, we need to 28 // Once we have acquired a valid file from the component installer, we need to
29 // make the path available to other parts of the system such as the 29 // make the path available to other parts of the system such as the
30 // translation libraries. We create a global to hold onto the path, and a 30 // translation libraries. We create a global to hold onto the path, and a
31 // lock to guard it. See GetLatestCldDataFile(...) for more info. 31 // lock to guard it. See GetLatestCldDataFile(...) for more info.
32 base::LazyInstance<base::Lock> cld_file_lock = LAZY_INSTANCE_INITIALIZER; 32 static base::LazyInstance<base::Lock> cld_file_lock = LAZY_INSTANCE_INITIALIZER;
Sorin Jianu 2014/05/15 17:16:13 Is there a reason we have the static keyword here?
Andrew Hayden (chromium.org) 2014/05/16 17:53:20 Done.
33 base::LazyInstance<base::FilePath> cld_file = LAZY_INSTANCE_INITIALIZER; 33 static base::LazyInstance<base::FilePath> cld_file = LAZY_INSTANCE_INITIALIZER;
34 34
35 } 35 }
36 36
37 namespace component_updater { 37 namespace component_updater {
38 38
39 // The SHA256 of the SubjectPublicKeyInfo used to sign the extension. 39 // The SHA256 of the SubjectPublicKeyInfo used to sign the extension.
40 // The extension id is: dpedmmgabcgnikllifiidmijgoiihfgf 40 // The extension id is: dpedmmgabcgnikllifiidmijgoiihfgf
41 const uint8 kPublicKeySHA256[32] = { 41 const uint8 kPublicKeySHA256[32] = {
42 0x3f, 0x43, 0xcc, 0x60, 0x12, 0x6d, 0x8a, 0xbb, 42 0x3f, 0x43, 0xcc, 0x60, 0x12, 0x6d, 0x8a, 0xbb,
43 0x85, 0x88, 0x3c, 0x89, 0x6e, 0x88, 0x75, 0x65, 43 0x85, 0x88, 0x3c, 0x89, 0x6e, 0x88, 0x75, 0x65,
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 } 123 }
124 124
125 base::FilePath GetLatestCldDataFile() { 125 base::FilePath GetLatestCldDataFile() {
126 base::AutoLock lock(cld_file_lock.Get()); 126 base::AutoLock lock(cld_file_lock.Get());
127 // cld_file is an empty path by default, meaning "file not available yet", 127 // cld_file is an empty path by default, meaning "file not available yet",
128 // so we can simply return by value (making a copy). 128 // so we can simply return by value (making a copy).
129 return cld_file.Get(); 129 return cld_file.Get();
130 } 130 }
131 131
132 } // namespace component_updater 132 } // namespace component_updater
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698