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

Unified Diff: components/component_updater/request_sender.cc

Issue 808773005: Move most of the component updater artifacts to update_client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « components/component_updater/request_sender.h ('k') | components/component_updater/test/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/component_updater/request_sender.cc
diff --git a/components/component_updater/request_sender.cc b/components/component_updater/request_sender.cc
deleted file mode 100644
index da6f7940db70f9898e6b7eebade3f14833834508..0000000000000000000000000000000000000000
--- a/components/component_updater/request_sender.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2014 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 "components/component_updater/request_sender.h"
-
-#include "base/bind.h"
-#include "base/bind_helpers.h"
-#include "base/location.h"
-#include "base/logging.h"
-#include "base/single_thread_task_runner.h"
-#include "base/thread_task_runner_handle.h"
-#include "components/component_updater/component_updater_configurator.h"
-#include "components/component_updater/component_updater_utils.h"
-#include "net/url_request/url_fetcher.h"
-
-namespace component_updater {
-
-RequestSender::RequestSender(const Configurator& config) : config_(config) {
-}
-
-RequestSender::~RequestSender() {
- DCHECK(thread_checker_.CalledOnValidThread());
-}
-
-void RequestSender::Send(const std::string& request_string,
- const std::vector<GURL>& urls,
- const RequestSenderCallback& request_sender_callback) {
- DCHECK(thread_checker_.CalledOnValidThread());
- if (urls.empty()) {
- request_sender_callback.Run(NULL);
- return;
- }
-
- request_string_ = request_string;
- urls_ = urls;
- request_sender_callback_ = request_sender_callback;
-
- cur_url_ = urls_.begin();
-
- SendInternal();
-}
-
-void RequestSender::SendInternal() {
- DCHECK(cur_url_ != urls_.end());
- DCHECK(cur_url_->is_valid());
- DCHECK(thread_checker_.CalledOnValidThread());
-
- url_fetcher_.reset(SendProtocolRequest(
- *cur_url_, request_string_, this, config_.RequestContext()));
-}
-
-void RequestSender::OnURLFetchComplete(const net::URLFetcher* source) {
- DCHECK(thread_checker_.CalledOnValidThread());
- if (GetFetchError(*source) == 0) {
- request_sender_callback_.Run(source);
- return;
- }
-
- if (++cur_url_ != urls_.end() &&
- base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE,
- base::Bind(&RequestSender::SendInternal, base::Unretained(this)))) {
- return;
- }
-
- request_sender_callback_.Run(source);
-}
-
-} // namespace component_updater
« no previous file with comments | « components/component_updater/request_sender.h ('k') | components/component_updater/test/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698