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

Side by Side Diff: content/browser/loader/detachable_resource_handler.h

Issue 148573002: Add some histograms for <a ping> requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reword comments Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/loader/detachable_resource_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_LOADER_DETACHABLE_RESOURCE_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_LOADER_DETACHABLE_RESOURCE_HANDLER_H_
6 #define CONTENT_BROWSER_LOADER_DETACHABLE_RESOURCE_HANDLER_H_ 6 #define CONTENT_BROWSER_LOADER_DETACHABLE_RESOURCE_HANDLER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "base/timer/elapsed_timer.h"
13 #include "base/timer/timer.h" 14 #include "base/timer/timer.h"
14 #include "content/browser/loader/resource_handler.h" 15 #include "content/browser/loader/resource_handler.h"
15 #include "content/public/browser/resource_controller.h" 16 #include "content/public/browser/resource_controller.h"
17 #include "net/url_request/url_request_status.h"
16 18
17 namespace net { 19 namespace net {
18 class IOBuffer; 20 class IOBuffer;
19 class URLRequest; 21 class URLRequest;
20 } // namespace net 22 } // namespace net
21 23
22 namespace content { 24 namespace content {
23 25
24 // A ResourceHandler which delegates all calls to the next handler, unless 26 // A ResourceHandler which delegates all calls to the next handler, unless
25 // detached. Once detached, it drives the request to completion itself. This is 27 // detached. Once detached, it drives the request to completion itself. This is
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 bool* defer) OVERRIDE; 75 bool* defer) OVERRIDE;
74 virtual void OnDataDownloaded(int request_id, int bytes_downloaded) OVERRIDE; 76 virtual void OnDataDownloaded(int request_id, int bytes_downloaded) OVERRIDE;
75 77
76 // ResourceController implementation: 78 // ResourceController implementation:
77 virtual void Resume() OVERRIDE; 79 virtual void Resume() OVERRIDE;
78 virtual void Cancel() OVERRIDE; 80 virtual void Cancel() OVERRIDE;
79 virtual void CancelAndIgnore() OVERRIDE; 81 virtual void CancelAndIgnore() OVERRIDE;
80 virtual void CancelWithError(int error_code) OVERRIDE; 82 virtual void CancelWithError(int error_code) OVERRIDE;
81 83
82 private: 84 private:
85 void TimedOut();
86
83 scoped_ptr<ResourceHandler> next_handler_; 87 scoped_ptr<ResourceHandler> next_handler_;
84 scoped_refptr<net::IOBuffer> read_buffer_; 88 scoped_refptr<net::IOBuffer> read_buffer_;
85 89
86 scoped_ptr<base::OneShotTimer<DetachableResourceHandler> > detached_timer_; 90 scoped_ptr<base::OneShotTimer<DetachableResourceHandler> > detached_timer_;
87 base::TimeDelta cancel_delay_; 91 base::TimeDelta cancel_delay_;
88 92
89 bool is_deferred_; 93 bool is_deferred_;
90 bool is_finished_; 94 bool is_finished_;
95 bool timed_out_;
96
97 bool response_started_;
98 base::ElapsedTimer time_since_start_;
99
100 // The status recorded from OnResponseCompleted. Value is
101 // net::URLRequestStatus::IO_PENDING if OnResponseCompleted is never received.
102 net::URLRequestStatus::Status status_;
91 103
92 DISALLOW_COPY_AND_ASSIGN(DetachableResourceHandler); 104 DISALLOW_COPY_AND_ASSIGN(DetachableResourceHandler);
93 }; 105 };
94 106
95 } // namespace content 107 } // namespace content
96 108
97 #endif // CONTENT_BROWSER_LOADER_DETACHABLE_RESOURCE_HANDLER_H_ 109 #endif // CONTENT_BROWSER_LOADER_DETACHABLE_RESOURCE_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/loader/detachable_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698