• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // Records IO statistics associated with a URLRequestJob.
6 // See description in navigation_profiler.h for an overview of perf profiling.
7 
8 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_METRICS_H_
9 #define NET_URL_REQUEST_URL_REQUEST_JOB_METRICS_H_
10 
11 #include <string>
12 
13 #include "base/basictypes.h"
14 #include "base/scoped_ptr.h"
15 #include "base/time.h"
16 #include "googleurl/src/gurl.h"
17 
18 class URLRequestJobMetrics {
19  public:
URLRequestJobMetrics()20   URLRequestJobMetrics() : total_bytes_read_(0), number_of_read_IO_(0) { }
~URLRequestJobMetrics()21   ~URLRequestJobMetrics() { }
22 
23   // The original url the job has been created for.
24   scoped_ptr<GURL> original_url_;
25 
26   // The actual url the job connects to. If the actual url is same as the
27   // original url, url_ is empty.
28   scoped_ptr<GURL> url_;
29 
30   // Time when the job starts.
31   base::TimeTicks start_time_;
32 
33   // Time when the job is done.
34   base::TimeTicks end_time_;
35 
36   // Total number of bytes the job reads from underline IO.
37   int64 total_bytes_read_;
38 
39   // Number of IO read operations the job issues.
40   int number_of_read_IO_;
41 
42   // Final status of the job.
43   bool success_;
44 
45   // Append the text report of the frame loading to the input string.
46   void AppendText(std::wstring* text);
47 };
48 
49 #endif  // NET_URL_REQUEST_URL_REQUEST_JOB_METRICS_H_
50