Commit 60038851 authored by Matt Menke's avatar Matt Menke Committed by Commit Bot

Remove use of URLRequestStatus in extensions code.

It wasn't being used meaningfully, and we want to remove the class.

Bug: 651119
Change-Id: Id479b735d1ef677d7eb55faf5e44ab2de859cd2c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1971755Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728426}
parent fbe6b053
......@@ -10,7 +10,6 @@
#include "chrome/browser/chromeos/extensions/wallpaper_function_base.h"
#include "chrome/common/extensions/api/wallpaper.h"
#include "components/account_id/account_id.h"
#include "net/url_request/url_request_status.h"
// Implementation of chrome.wallpaper.setWallpaper API.
// After this API being called, a jpeg encoded wallpaper will be saved to
......
......@@ -14,7 +14,6 @@
#include "content/public/browser/browser_thread.h"
#include "net/base/escape.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/url_request_status.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "url/gurl.h"
......
......@@ -20,7 +20,6 @@
#include "mojo/public/cpp/system/data_pipe_utils.h"
#include "net/base/net_errors.h"
#include "net/url_request/redirect_info.h"
#include "net/url_request/url_request_status.h"
#include "services/network/public/cpp/url_loader_completion_status.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
......@@ -197,7 +196,7 @@ TEST_F(ExtensionLocalizationPeerTest, CreateWithValidInput) {
MATCHER_P(IsURLRequestEqual, status, "") { return arg.status() == status; }
TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestBadURLRequestStatus) {
TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestBadURLLoaderStatus) {
SetUpExtensionLocalizationPeer("text/css", GURL(kExtensionUrl_1));
// This test simulates completion before receiving the response header.
......
......@@ -1086,8 +1086,7 @@ void ExtensionDownloader::StartExtensionLoader() {
void ExtensionDownloader::OnExtensionLoadComplete(base::FilePath crx_path) {
GURL url = extension_loader_->GetFinalURL();
net::URLRequestStatus status =
net::URLRequestStatus::FromError(extension_loader_->NetError());
int net_error = extension_loader_->NetError();
int response_code = -1;
if (extension_loader_->ResponseInfo() &&
extension_loader_->ResponseInfo()->headers) {
......@@ -1118,8 +1117,8 @@ void ExtensionDownloader::OnExtensionLoadComplete(base::FilePath crx_path) {
NotifyDelegateDownloadFinished(std::move(fetch_data), false, crx_path,
true);
}
} else if (IterateFetchCredentialsAfterFailure(
&active_request, status, response_code)) {
} else if (IterateFetchCredentialsAfterFailure(&active_request,
response_code)) {
delegate_->OnExtensionDownloadStageChanged(
id, ExtensionDownloaderDelegate::Stage::DOWNLOADING_CRX_RETRY);
extensions_queue_.RetryRequest(backoff_delay);
......@@ -1139,8 +1138,8 @@ void ExtensionDownloader::OnExtensionLoadComplete(base::FilePath crx_path) {
RETRY_HISTOGRAM("CrxFetchFailure",
extensions_queue_.active_request_failure_count(),
url);
// status.error() is 0 (net::OK) or negative. (See net/base/net_errors.h)
base::UmaHistogramSparse("Extensions.CrxFetchError", -status.error());
// net_error is 0 (net::OK) or negative. (See net/base/net_errors.h)
base::UmaHistogramSparse("Extensions.CrxFetchError", -net_error);
delegate_->OnExtensionDownloadStageChanged(
id, ExtensionDownloaderDelegate::Stage::FINISHED);
delegate_->OnExtensionDownloadFailed(
......@@ -1188,7 +1187,6 @@ void ExtensionDownloader::NotifyUpdateFound(const std::string& id,
bool ExtensionDownloader::IterateFetchCredentialsAfterFailure(
ExtensionFetch* fetch,
const net::URLRequestStatus& status,
int response_code) {
bool auth_failure = response_code == net::HTTP_UNAUTHORIZED ||
response_code == net::HTTP_FORBIDDEN;
......
......@@ -37,10 +37,6 @@ class IdentityManager;
struct AccessTokenInfo;
} // namespace signin
namespace net {
class URLRequestStatus;
}
namespace network {
class SharedURLLoaderFactory;
class SimpleURLLoader;
......@@ -338,7 +334,6 @@ class ExtensionDownloader {
// |true| if the fetch should be retried. Returns |false| if the failure was
// not related to authentication, leaving the ExtensionFetch data unmodified.
bool IterateFetchCredentialsAfterFailure(ExtensionFetch* fetch,
const net::URLRequestStatus& status,
int response_code);
void OnAccessTokenFetchComplete(GoogleServiceAuthError error,
......
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