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

Unified Diff: extensions/browser/updater/update_client_config.cc

Issue 1362043005: Add extensions code to use common updater in components/update_client/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ready for review Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/updater/update_client_config.cc
diff --git a/extensions/browser/updater/update_client_config.cc b/extensions/browser/updater/update_client_config.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a3f5bb5dbaac75f131ea24a25f7155aec7e57473
--- /dev/null
+++ b/extensions/browser/updater/update_client_config.cc
@@ -0,0 +1,76 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "extensions/browser/updater/update_client_config.h"
+
+#include "components/update_client/component_patcher_operation.h"
+#include "components/version_info/version_info.h"
+#include "content/public/browser/browser_context.h"
+#include "content/public/browser/browser_thread.h"
+
+namespace extensions {
+
+UpdateClientConfig::UpdateClientConfig(content::BrowserContext* context)
+ : context_(context) {}
+
+int UpdateClientConfig::InitialDelay() const {
+ return 0;
+}
Ken Rockot(use gerrit already) 2015/09/25 16:19:19 nit: missing vertical whitespace between all these
asargent_no_longer_on_chrome 2015/09/29 22:59:21 Done.
+int UpdateClientConfig::NextCheckDelay() const {
+ return 0;
+}
+int UpdateClientConfig::StepDelay() const {
+ return 1;
+}
+int UpdateClientConfig::OnDemandDelay() const {
+ return 1;
+}
+int UpdateClientConfig::UpdateDelay() const {
+ return 1;
+}
+
+std::string UpdateClientConfig::GetOSLongName() const {
+ return version_info::GetOSType();
+}
+
+std::string UpdateClientConfig::ExtraRequestParams() const {
+ return std::string();
+}
+
+net::URLRequestContextGetter* UpdateClientConfig::RequestContext() const {
+ if (!context_)
+ return nullptr;
+ return context_->GetRequestContext();
+}
+
+scoped_refptr<update_client::OutOfProcessPatcher>
+UpdateClientConfig::CreateOutOfProcessPatcher() const {
+ return nullptr;
+}
+
+bool UpdateClientConfig::DeltasEnabled() const {
+ return true;
+}
+
+bool UpdateClientConfig::UseBackgroundDownloader() const {
+ return false;
+}
+
+scoped_refptr<base::SequencedTaskRunner>
+UpdateClientConfig::GetSequencedTaskRunner() const {
+ return content::BrowserThread::GetBlockingPool()
+ ->GetSequencedTaskRunnerWithShutdownBehavior(
+ content::BrowserThread::GetBlockingPool()->GetSequenceToken(),
+ base::SequencedWorkerPool::SKIP_ON_SHUTDOWN);
+}
+
+scoped_refptr<base::SingleThreadTaskRunner>
+UpdateClientConfig::GetSingleThreadTaskRunner() const {
+ return content::BrowserThread::GetMessageLoopProxyForThread(
+ content::BrowserThread::FILE);
+}
+
+UpdateClientConfig::~UpdateClientConfig() {}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698