Commit 90948ab7 authored by mmenke's avatar mmenke Committed by Commit bot

Remove unused methods from URLRequest.

Remove methods to get/set headers by "ID", which were never
implemented and have existed since initial commit.

Also remove GetAllResponseHeaders, which returns all response
headers in a single string with NULL characters between headers.
Shockingly, nothing is using this method.

BUG=455744

Review URL: https://codereview.chromium.org/905503003

Cr-Commit-Position: refs/heads/master@{#314852}
parent 8b5b00d6
// Copyright (c) 2006-2008 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.
HTTP_ATOM(ACCEPT)
HTTP_ATOM(ACCEPT_CHARSET)
HTTP_ATOM(ACCEPT_ENCODING)
HTTP_ATOM(ACCEPT_LANGUAGE)
HTTP_ATOM(ACCEPT_RANGES)
HTTP_ATOM(AGE)
HTTP_ATOM(ALLOW)
HTTP_ATOM(AUTHORIZATION)
HTTP_ATOM(CACHE_CONTROL)
HTTP_ATOM(CONNECTION)
HTTP_ATOM(CONTENT_BASE)
HTTP_ATOM(CONTENT_DISPOSITION)
HTTP_ATOM(CONTENT_ENCODING)
HTTP_ATOM(CONTENT_LANGUAGE)
HTTP_ATOM(CONTENT_LENGTH)
HTTP_ATOM(CONTENT_LOCATION)
HTTP_ATOM(CONTENT_MD5)
HTTP_ATOM(CONTENT_RANGE)
HTTP_ATOM(CONTENT_TRANSFER_ENCODING)
HTTP_ATOM(CONTENT_TYPE)
HTTP_ATOM(COOKIE)
HTTP_ATOM(DATE)
HTTP_ATOM(DERIVED_FROM)
HTTP_ATOM(ETAG)
HTTP_ATOM(EXPECT)
HTTP_ATOM(EXPIRES)
HTTP_ATOM(FORWARDED)
HTTP_ATOM(FROM)
HTTP_ATOM(HOST)
HTTP_ATOM(IF_MATCH)
HTTP_ATOM(IF_MODIFIED_SINCE)
HTTP_ATOM(IF_NONE_MATCH)
HTTP_ATOM(IF_RANGE)
HTTP_ATOM(IF_UNMODIFIED_SINCE)
HTTP_ATOM(LAST_MODIFIED)
HTTP_ATOM(LINK)
HTTP_ATOM(LOCATION)
HTTP_ATOM(MAX_FORWARDS)
HTTP_ATOM(MESSAGE_ID)
HTTP_ATOM(PRAGMA)
HTTP_ATOM(PROXY_AUTHENTICATE)
HTTP_ATOM(PROXY_AUTHORIZATION)
HTTP_ATOM(PROXY_CONNECTION)
HTTP_ATOM(RANGE)
HTTP_ATOM(REFERER)
HTTP_ATOM(REFRESH)
HTTP_ATOM(RETRY_AFTER)
HTTP_ATOM(SERVER)
HTTP_ATOM(SET_COOKIE)
HTTP_ATOM(TITLE)
HTTP_ATOM(TRANSFER_ENCODING)
HTTP_ATOM(UPGRADE)
HTTP_ATOM(USER_AGENT)
HTTP_ATOM(VARY)
HTTP_ATOM(VIA)
HTTP_ATOM(WARNING)
HTTP_ATOM(WWW_AUTHENTICATE)
......@@ -607,7 +607,6 @@
'http/disk_cache_based_quic_server_info.h',
'http/failing_http_transaction_factory.cc',
'http/failing_http_transaction_factory.h',
'http/http_atom_list.h',
'http/http_auth.cc',
'http/http_auth.h',
'http/http_auth_cache.cc',
......
......@@ -227,12 +227,6 @@ bool URLRequest::has_upload() const {
return upload_data_stream_.get() != NULL;
}
void URLRequest::SetExtraRequestHeaderById(int id, const string& value,
bool overwrite) {
DCHECK(!is_pending_ || is_redirecting_);
NOTREACHED() << "implement me!";
}
void URLRequest::SetExtraRequestHeaderByName(const string& name,
const string& value,
bool overwrite) {
......@@ -378,11 +372,6 @@ UploadProgress URLRequest::GetUploadProgress() const {
return job_->GetUploadProgress();
}
void URLRequest::GetResponseHeaderById(int id, string* value) {
DCHECK(job_.get());
NOTREACHED() << "implement me!";
}
void URLRequest::GetResponseHeaderByName(const string& name, string* value) {
DCHECK(value);
if (response_info_.headers.get()) {
......@@ -392,15 +381,6 @@ void URLRequest::GetResponseHeaderByName(const string& name, string* value) {
}
}
void URLRequest::GetAllResponseHeaders(string* headers) {
DCHECK(headers);
if (response_info_.headers.get()) {
response_info_.headers->GetNormalizedHeaders(headers);
} else {
headers->clear();
}
}
HostPortPair URLRequest::GetSocketAddress() const {
DCHECK(job_.get());
return job_->GetSocketAddress();
......
......@@ -82,14 +82,6 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
NetworkDelegate* network_delegate,
const std::string& scheme);
// HTTP request/response header IDs (via some preprocessor fun) for use with
// SetRequestHeaderById and GetResponseHeaderById.
enum {
#define HTTP_ATOM(x) HTTP_ ## x,
#include "net/http/http_atom_list.h"
#undef HTTP_ATOM
};
// Referrer policies (see set_referrer_policy): During server redirects, the
// referrer header might be cleared, if the protocol changes from HTTPS to
// HTTP. This is the default behavior of URLRequest, corresponding to
......@@ -334,11 +326,9 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
// Returns true if the request has a non-empty message body to upload.
bool has_upload() const;
// Set an extra request header by ID or name, or remove one by name. These
// methods may only be called before Start() is called, or before a new
// redirect in the request chain.
void SetExtraRequestHeaderById(int header_id, const std::string& value,
bool overwrite);
// Set or remove a extra request header. These methods may only be called
// before Start() is called, or between receiving a redirect and trying to
// follow it.
void SetExtraRequestHeaderByName(const std::string& name,
const std::string& value, bool overwrite);
void RemoveRequestHeaderByName(const std::string& name);
......@@ -401,19 +391,13 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
// chunked, size is set to zero, but position will not be.
UploadProgress GetUploadProgress() const;
// Get response header(s) by ID or name. These methods may only be called
// Get response header(s) by name. This method may only be called
// once the delegate's OnResponseStarted method has been called. Headers
// that appear more than once in the response are coalesced, with values
// separated by commas (per RFC 2616). This will not work with cookies since
// comma can be used in cookie values.
// TODO(darin): add API to enumerate response headers.
void GetResponseHeaderById(int header_id, std::string* value);
void GetResponseHeaderByName(const std::string& name, std::string* value);
// Get all response headers, \n-delimited and \n\0-terminated. This includes
// the response status line. Restrictions on GetResponseHeaders apply.
void GetAllResponseHeaders(std::string* headers);
// The time when |this| was constructed.
base::TimeTicks creation_time() const { return creation_time_; }
......
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