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

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

Issue 1861383004: Add module for counting date-last-roll-call and persisting those counts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/chrome_component_updater_configurator .h" 5 #include "chrome/browser/component_updater/chrome_component_updater_configurator .h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/files/file_path.h"
11 #include "base/path_service.h"
10 #include "base/strings/sys_string_conversions.h" 12 #include "base/strings/sys_string_conversions.h"
11 #include "base/threading/sequenced_worker_pool.h" 13 #include "base/threading/sequenced_worker_pool.h"
12 #include "base/version.h" 14 #include "base/version.h"
13 #if defined(OS_WIN) 15 #if defined(OS_WIN)
14 #include "base/win/win_util.h" 16 #include "base/win/win_util.h"
15 #endif 17 #endif
16 #include "chrome/browser/component_updater/component_patcher_operation_out_of_pr ocess.h" 18 #include "chrome/browser/component_updater/component_patcher_operation_out_of_pr ocess.h"
17 #include "chrome/browser/google/google_brand.h" 19 #include "chrome/browser/google/google_brand.h"
18 #include "chrome/browser/update_client/chrome_update_query_params_delegate.h" 20 #include "chrome/browser/update_client/chrome_update_query_params_delegate.h"
19 #include "chrome/common/channel_info.h" 21 #include "chrome/common/channel_info.h"
22 #include "chrome/common/chrome_paths.h"
20 #if defined(OS_WIN) 23 #if defined(OS_WIN)
21 #include "chrome/installer/util/google_update_settings.h" 24 #include "chrome/installer/util/google_update_settings.h"
22 #endif 25 #endif
23 #include "components/component_updater/configurator_impl.h" 26 #include "components/component_updater/configurator_impl.h"
24 #include "content/public/browser/browser_thread.h" 27 #include "content/public/browser/browser_thread.h"
25 28
26 namespace component_updater { 29 namespace component_updater {
27 30
28 namespace { 31 namespace {
29 32
(...skipping 18 matching lines...) Expand all
48 std::string ExtraRequestParams() const override; 51 std::string ExtraRequestParams() const override;
49 std::string GetDownloadPreference() const override; 52 std::string GetDownloadPreference() const override;
50 net::URLRequestContextGetter* RequestContext() const override; 53 net::URLRequestContextGetter* RequestContext() const override;
51 scoped_refptr<update_client::OutOfProcessPatcher> CreateOutOfProcessPatcher() 54 scoped_refptr<update_client::OutOfProcessPatcher> CreateOutOfProcessPatcher()
52 const override; 55 const override;
53 bool DeltasEnabled() const override; 56 bool DeltasEnabled() const override;
54 bool UseBackgroundDownloader() const override; 57 bool UseBackgroundDownloader() const override;
55 bool UseCupSigning() const override; 58 bool UseCupSigning() const override;
56 scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner() 59 scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner()
57 const override; 60 const override;
61 base::FilePath GetMetadataPath() const override;
58 62
59 private: 63 private:
60 friend class base::RefCountedThreadSafe<ChromeConfigurator>; 64 friend class base::RefCountedThreadSafe<ChromeConfigurator>;
61 65
62 ConfiguratorImpl configurator_impl_; 66 ConfiguratorImpl configurator_impl_;
63 67
64 ~ChromeConfigurator() override {} 68 ~ChromeConfigurator() override {}
65 }; 69 };
66 70
67 // Allows the component updater to use non-encrypted communication with the 71 // Allows the component updater to use non-encrypted communication with the
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // imposes certain requirements for the code using the task runner, such as 169 // imposes certain requirements for the code using the task runner, such as
166 // not accessing any global browser state while the code is running. 170 // not accessing any global browser state while the code is running.
167 scoped_refptr<base::SequencedTaskRunner> 171 scoped_refptr<base::SequencedTaskRunner>
168 ChromeConfigurator::GetSequencedTaskRunner() const { 172 ChromeConfigurator::GetSequencedTaskRunner() const {
169 return content::BrowserThread::GetBlockingPool() 173 return content::BrowserThread::GetBlockingPool()
170 ->GetSequencedTaskRunnerWithShutdownBehavior( 174 ->GetSequencedTaskRunnerWithShutdownBehavior(
171 base::SequencedWorkerPool::GetSequenceToken(), 175 base::SequencedWorkerPool::GetSequenceToken(),
172 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN); 176 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN);
173 } 177 }
174 178
179 base::FilePath ChromeConfigurator::GetMetadataPath() const {
180 base::FilePath result;
181 CHECK(PathService::Get(chrome::DIR_USER_DATA, &result));
Sorin Jianu 2016/04/07 04:03:19 Do we need to CHECK? Can we be fault tolerant? I d
waffles 2016/04/07 17:04:43 Done. In practice it won't matter because several
182 return result.AppendASCII("component_metadata.json");
183 }
184
175 } // namespace 185 } // namespace
176 186
177 scoped_refptr<update_client::Configurator> 187 scoped_refptr<update_client::Configurator>
178 MakeChromeComponentUpdaterConfigurator( 188 MakeChromeComponentUpdaterConfigurator(
179 const base::CommandLine* cmdline, 189 const base::CommandLine* cmdline,
180 net::URLRequestContextGetter* context_getter) { 190 net::URLRequestContextGetter* context_getter) {
181 return new ChromeConfigurator(cmdline, context_getter); 191 return new ChromeConfigurator(cmdline, context_getter);
182 } 192 }
183 193
184 } // namespace component_updater 194 } // namespace component_updater
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/updater/chrome_update_client_config.h » ('j') | components/update_client.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698