| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 NET_BASE_LOAD_LOG_H_ | 5 #ifndef NET_BASE_LOAD_LOG_H_ |
| 6 #define NET_BASE_LOAD_LOG_H_ | 6 #define NET_BASE_LOAD_LOG_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
| 11 #include "base/time.h" | 11 #include "base/time.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 | 14 |
| 15 // LoadLog stores profiling information on where time was spent while servicing | 15 // LoadLog stores profiling information on where time was spent while servicing |
| 16 // a request (waiting in queues, resolving hosts, resolving proxy, etc...). | 16 // a request (waiting in queues, resolving hosts, resolving proxy, etc...). |
| 17 class LoadLog : public base::RefCounted<LoadLog> { | 17 // |
| 18 // Note that LoadLog is NOT THREADSAFE, however it is RefCountedThreadSafe so |
| 19 // that it can be AddRef() / Release() across threads. |
| 20 class LoadLog : public base::RefCountedThreadSafe<LoadLog> { |
| 18 public: | 21 public: |
| 19 | 22 |
| 20 enum EventType { | 23 enum EventType { |
| 21 #define EVENT_TYPE(label) TYPE_ ## label, | 24 #define EVENT_TYPE(label) TYPE_ ## label, |
| 22 #include "net/base/load_log_event_type_list.h" | 25 #include "net/base/load_log_event_type_list.h" |
| 23 #undef EVENT_TYPE | 26 #undef EVENT_TYPE |
| 24 }; | 27 }; |
| 25 | 28 |
| 26 // Whether this is the start/end of an event. Or in the case of EventTypes | 29 // Whether this is the start/end of an event. Or in the case of EventTypes |
| 27 // that are "instantaneous", kNone. | 30 // that are "instantaneous", kNone. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // Copies all events from |log|, appending it to the end of |this|. | 105 // Copies all events from |log|, appending it to the end of |this|. |
| 103 void Append(const LoadLog* log); | 106 void Append(const LoadLog* log); |
| 104 | 107 |
| 105 private: | 108 private: |
| 106 EventList events_; | 109 EventList events_; |
| 107 }; | 110 }; |
| 108 | 111 |
| 109 } // namespace net | 112 } // namespace net |
| 110 | 113 |
| 111 #endif // NET_BASE_LOAD_LOG_H_ | 114 #endif // NET_BASE_LOAD_LOG_H_ |
| OLD | NEW |