summaryrefslogtreecommitdiffstats
path: root/net/url_request/url_request_http_job.cc
diff options
context:
space:
mode:
authorrvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-27 22:39:10 +0000
committerrvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-27 22:39:10 +0000
commit027bd85ae8b1ccfeabfd03aaee811ff4d3bed45b (patch)
tree38251735ee21a5f673bd10679bfdd956e542c97f /net/url_request/url_request_http_job.cc
parentc4790dcb92eaeada95f459576b83e895f7878317 (diff)
downloadchromium_src-027bd85ae8b1ccfeabfd03aaee811ff4d3bed45b.zip
chromium_src-027bd85ae8b1ccfeabfd03aaee811ff4d3bed45b.tar.gz
chromium_src-027bd85ae8b1ccfeabfd03aaee811ff4d3bed45b.tar.bz2
Remove HttpTransactionDelegate and all users (LoadTimeStats).
These metrics are not used anymore. TEST=builds BUG= TBR=mkosiba@chromium.org (webview) Review URL: https://codereview.chromium.org/121453002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242643 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request/url_request_http_job.cc')
-rw-r--r--net/url_request/url_request_http_job.cc89
1 files changed, 1 insertions, 88 deletions
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index cac7e38..c0e2dd1 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -32,7 +32,6 @@
#include "net/http/http_response_info.h"
#include "net/http/http_status_code.h"
#include "net/http/http_transaction.h"
-#include "net/http/http_transaction_delegate.h"
#include "net/http/http_transaction_factory.h"
#include "net/http/http_util.h"
#include "net/ssl/ssl_cert_request_info.h"
@@ -78,84 +77,6 @@ class URLRequestHttpJob::HttpFilterContext : public FilterContext {
DISALLOW_COPY_AND_ASSIGN(HttpFilterContext);
};
-class URLRequestHttpJob::HttpTransactionDelegateImpl
- : public HttpTransactionDelegate {
- public:
- HttpTransactionDelegateImpl(URLRequest* request,
- NetworkDelegate* network_delegate)
- : request_(request),
- network_delegate_(network_delegate),
- state_(NONE_ACTIVE) {}
- virtual ~HttpTransactionDelegateImpl() { OnDetachRequest(); }
- void OnDetachRequest() {
- if (!IsRequestAndDelegateActive())
- return;
- NotifyStateChange(NetworkDelegate::REQUEST_WAIT_STATE_RESET);
- state_ = NONE_ACTIVE;
- request_ = NULL;
- }
- virtual void OnCacheActionStart() OVERRIDE {
- HandleStateChange(NONE_ACTIVE,
- CACHE_ACTIVE,
- NetworkDelegate::REQUEST_WAIT_STATE_CACHE_START);
- }
- virtual void OnCacheActionFinish() OVERRIDE {
- HandleStateChange(CACHE_ACTIVE,
- NONE_ACTIVE,
- NetworkDelegate::REQUEST_WAIT_STATE_CACHE_FINISH);
- }
- virtual void OnNetworkActionStart() OVERRIDE {
- HandleStateChange(NONE_ACTIVE,
- NETWORK_ACTIVE,
- NetworkDelegate::REQUEST_WAIT_STATE_NETWORK_START);
- }
- virtual void OnNetworkActionFinish() OVERRIDE {
- HandleStateChange(NETWORK_ACTIVE,
- NONE_ACTIVE,
- NetworkDelegate::REQUEST_WAIT_STATE_NETWORK_FINISH);
- }
-
- private:
- enum State {
- NONE_ACTIVE,
- CACHE_ACTIVE,
- NETWORK_ACTIVE
- };
-
- // Returns true if this object still has an active request and network
- // delegate.
- bool IsRequestAndDelegateActive() const {
- return request_ && network_delegate_;
- }
-
- // Notifies the |network_delegate_| object of a change in the state of the
- // |request_| to the state given by the |request_wait_state| argument.
- void NotifyStateChange(NetworkDelegate::RequestWaitState request_wait_state) {
- network_delegate_->NotifyRequestWaitStateChange(*request_,
- request_wait_state);
- }
-
- // Checks the request and delegate are still active, changes |state_| from
- // |expected_state| to |next_state|, and then notifies the network delegate of
- // the change to |request_wait_state|.
- void HandleStateChange(State expected_state,
- State next_state,
- NetworkDelegate::RequestWaitState request_wait_state) {
- if (!IsRequestAndDelegateActive())
- return;
- DCHECK_EQ(expected_state, state_);
- state_ = next_state;
- NotifyStateChange(request_wait_state);
- }
-
- URLRequest* request_;
- NetworkDelegate* network_delegate_;
- // Internal state tracking, for sanity checking.
- State state_;
-
- DISALLOW_COPY_AND_ASSIGN(HttpTransactionDelegateImpl);
-};
-
URLRequestHttpJob::HttpFilterContext::HttpFilterContext(URLRequestHttpJob* job)
: job_(job) {
DCHECK(job_);
@@ -269,8 +190,6 @@ URLRequestHttpJob::URLRequestHttpJob(
base::Bind(&URLRequestHttpJob::OnHeadersReceivedCallback,
base::Unretained(this))),
awaiting_callback_(false),
- http_transaction_delegate_(
- new HttpTransactionDelegateImpl(request, network_delegate)),
http_user_agent_settings_(http_user_agent_settings) {
URLRequestThrottlerManager* manager = request->context()->throttler_manager();
if (manager)
@@ -360,8 +279,6 @@ void URLRequestHttpJob::Start() {
}
void URLRequestHttpJob::Kill() {
- http_transaction_delegate_->OnDetachRequest();
-
if (!transaction_.get())
return;
@@ -495,7 +412,7 @@ void URLRequestHttpJob::StartTransactionInternal() {
DCHECK(request_->context()->http_transaction_factory());
rv = request_->context()->http_transaction_factory()->CreateTransaction(
- priority_, &transaction_, http_transaction_delegate_.get());
+ priority_, &transaction_);
if (rv == OK && request_info_.url.SchemeIsWSOrWSS()) {
// TODO(ricea): Implement WebSocket throttling semantics as defined in
@@ -1535,8 +1452,4 @@ void URLRequestHttpJob::NotifyURLRequestDestroyed() {
awaiting_callback_ = false;
}
-void URLRequestHttpJob::OnDetachRequest() {
- http_transaction_delegate_->OnDetachRequest();
-}
-
} // namespace net