Commit c802c606 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Remove leftover references to URLFetcher et al in components/update_client/

Now that components/update_client/* have moved away from URLFetcher
and friends (see [1] and [2]), we can remove these helper classes.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/1118646
[2] https://chromium-review.googlesource.com/c/chromium/src/+/1160725

BUG=844973

Change-Id: I362f135a913aba9bdddaa47a6c51a282c261a900
Reviewed-on: https://chromium-review.googlesource.com/1179941Reviewed-by: default avatarJoshua Pawlicki <waffles@chromium.org>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#584096}
parent 70e92272
...@@ -945,7 +945,7 @@ TEST_F(UpdateCheckerTest, UpdatePauseResume) { ...@@ -945,7 +945,7 @@ TEST_F(UpdateCheckerTest, UpdatePauseResume) {
testing::HasSubstr(R"(<packages><package fp="fp1"/></packages></app>)")); testing::HasSubstr(R"(<packages><package fp="fp1"/></packages></app>)"));
} }
// Tests that an update checker object and its underlying URLFetcher can // Tests that an update checker object and its underlying SimpleURLLoader can
// be safely destroyed while it is paused. // be safely destroyed while it is paused.
TEST_F(UpdateCheckerTest, UpdateResetUpdateChecker) { TEST_F(UpdateCheckerTest, UpdateResetUpdateChecker) {
base::RunLoop runloop; base::RunLoop runloop;
......
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
#include "crypto/sha2.h" #include "crypto/sha2.h"
#include "net/base/load_flags.h" #include "net/base/load_flags.h"
#include "net/traffic_annotation/network_traffic_annotation.h" #include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_status.h"
#include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/simple_url_loader.h" #include "services/network/public/cpp/simple_url_loader.h"
#include "url/gurl.h" #include "url/gurl.h"
...@@ -95,38 +93,6 @@ std::unique_ptr<network::SimpleURLLoader> SendProtocolRequest( ...@@ -95,38 +93,6 @@ std::unique_ptr<network::SimpleURLLoader> SendProtocolRequest(
return simple_loader; return simple_loader;
} }
bool FetchSuccess(const net::URLFetcher& fetcher) {
return GetFetchError(fetcher) == 0;
}
int GetFetchError(const net::URLFetcher& fetcher) {
const net::URLRequestStatus::Status status(fetcher.GetStatus().status());
switch (status) {
case net::URLRequestStatus::IO_PENDING:
case net::URLRequestStatus::CANCELED:
// Network status is a small positive number.
return status;
case net::URLRequestStatus::SUCCESS: {
// Response codes are positive numbers, greater than 100.
const int response_code(fetcher.GetResponseCode());
if (response_code == 200)
return 0;
else
return response_code ? response_code : -1;
}
case net::URLRequestStatus::FAILED: {
// Network errors are small negative numbers.
const int error = fetcher.GetStatus().error();
return error ? error : -1;
}
default:
return -1;
}
}
bool HasDiffUpdate(const Component& component) { bool HasDiffUpdate(const Component& component) {
return !component.crx_diffurls().empty(); return !component.crx_diffurls().empty();
} }
......
...@@ -22,10 +22,6 @@ class DictionaryValue; ...@@ -22,10 +22,6 @@ class DictionaryValue;
class FilePath; class FilePath;
} }
namespace net {
class URLFetcher;
}
namespace network { namespace network {
class SharedURLLoaderFactory; class SharedURLLoaderFactory;
class SimpleURLLoader; class SimpleURLLoader;
...@@ -54,15 +50,6 @@ std::unique_ptr<network::SimpleURLLoader> SendProtocolRequest( ...@@ -54,15 +50,6 @@ std::unique_ptr<network::SimpleURLLoader> SendProtocolRequest(
LoadCompleteCallback callback, LoadCompleteCallback callback,
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory); scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory);
// Returns true if the url request of |fetcher| was succesful.
bool FetchSuccess(const net::URLFetcher& fetcher);
// Returns the error code which occured during the fetch. The function returns 0
// if the fetch was successful. If errors happen, the function could return a
// network error, an http response code, or the status of the fetch, if the
// fetch is pending or canceled.
int GetFetchError(const net::URLFetcher& fetcher);
// Returns true if the |component| contains a valid differential update url. // Returns true if the |component| contains a valid differential update url.
bool HasDiffUpdate(const Component& component); bool HasDiffUpdate(const Component& component);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment