| OLD | NEW |
| 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/component_updater/component_updater_configurator.h" | 5 #include "chrome/browser/component_updater/chrome_component_updater_configurator
.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "base/version.h" | 14 #include "base/version.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 #include "chrome/browser/component_updater/component_patcher_operation_out_of_pr
ocess.h" | 16 #include "chrome/browser/component_updater/component_patcher_operation_out_of_pr
ocess.h" |
| 17 #include "chrome/browser/omaha_query_params/chrome_omaha_query_params_delegate.h
" | 17 #include "chrome/browser/omaha_query_params/chrome_omaha_query_params_delegate.h
" |
| 18 #include "chrome/common/chrome_version_info.h" | 18 #include "chrome/common/chrome_version_info.h" |
| 19 #include "components/component_updater/component_updater_configurator.h" |
| 19 #include "components/component_updater/component_updater_switches.h" | 20 #include "components/component_updater/component_updater_switches.h" |
| 20 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
| 21 #include "net/url_request/url_request_context_getter.h" | 22 #include "net/url_request/url_request_context_getter.h" |
| 22 #include "url/gurl.h" | 23 #include "url/gurl.h" |
| 23 | 24 |
| 24 namespace component_updater { | 25 namespace component_updater { |
| 25 | 26 |
| 26 namespace { | 27 namespace { |
| 27 | 28 |
| 28 // Default time constants. | 29 // Default time constants. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 const std::size_t found = it->find("="); | 83 const std::size_t found = it->find("="); |
| 83 if (found != std::string::npos) { | 84 if (found != std::string::npos) { |
| 84 if (it->substr(0, found) == test) { | 85 if (it->substr(0, found) == test) { |
| 85 return it->substr(found + 1); | 86 return it->substr(found + 1); |
| 86 } | 87 } |
| 87 } | 88 } |
| 88 } | 89 } |
| 89 return std::string(); | 90 return std::string(); |
| 90 } | 91 } |
| 91 | 92 |
| 92 } // namespace | |
| 93 | |
| 94 class ChromeConfigurator : public Configurator { | 93 class ChromeConfigurator : public Configurator { |
| 95 public: | 94 public: |
| 96 ChromeConfigurator(const CommandLine* cmdline, | 95 ChromeConfigurator(const CommandLine* cmdline, |
| 97 net::URLRequestContextGetter* url_request_getter); | 96 net::URLRequestContextGetter* url_request_getter); |
| 98 | 97 |
| 99 virtual ~ChromeConfigurator() {} | 98 virtual ~ChromeConfigurator() {} |
| 100 | 99 |
| 101 virtual int InitialDelay() const OVERRIDE; | 100 virtual int InitialDelay() const OVERRIDE; |
| 102 virtual int NextCheckDelay() OVERRIDE; | 101 virtual int NextCheckDelay() OVERRIDE; |
| 103 virtual int StepDelay() const OVERRIDE; | 102 virtual int StepDelay() const OVERRIDE; |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 content::BrowserThread::GetBlockingPool()->GetSequenceToken(), | 244 content::BrowserThread::GetBlockingPool()->GetSequenceToken(), |
| 246 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); | 245 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); |
| 247 } | 246 } |
| 248 | 247 |
| 249 scoped_refptr<base::SingleThreadTaskRunner> | 248 scoped_refptr<base::SingleThreadTaskRunner> |
| 250 ChromeConfigurator::GetSingleThreadTaskRunner() const { | 249 ChromeConfigurator::GetSingleThreadTaskRunner() const { |
| 251 return content::BrowserThread::GetMessageLoopProxyForThread( | 250 return content::BrowserThread::GetMessageLoopProxyForThread( |
| 252 content::BrowserThread::FILE); | 251 content::BrowserThread::FILE); |
| 253 } | 252 } |
| 254 | 253 |
| 254 } // namespace |
| 255 |
| 255 Configurator* MakeChromeComponentUpdaterConfigurator( | 256 Configurator* MakeChromeComponentUpdaterConfigurator( |
| 256 const base::CommandLine* cmdline, | 257 const base::CommandLine* cmdline, |
| 257 net::URLRequestContextGetter* context_getter) { | 258 net::URLRequestContextGetter* context_getter) { |
| 258 return new ChromeConfigurator(cmdline, context_getter); | 259 return new ChromeConfigurator(cmdline, context_getter); |
| 259 } | 260 } |
| 260 | 261 |
| 261 } // namespace component_updater | 262 } // namespace component_updater |
| OLD | NEW |