| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 PlatformInstrumentation_h | 5 #ifndef PlatformInstrumentation_h |
| 6 #define PlatformInstrumentation_h | 6 #define PlatformInstrumentation_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/instrumentation/tracing/TraceEvent.h" | 9 #include "platform/instrumentation/tracing/TraceEvent.h" |
| 10 #include "platform/loader/fetch/FetchContext.h" | 10 #include "platform/loader/fetch/FetchContext.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class FetchContext; | 14 class FetchContext; |
| 15 class PlatformInstrumentationAgents; | 15 class PlatformInstrumentationSink; |
| 16 | 16 |
| 17 namespace probe { | 17 namespace probe { |
| 18 | 18 |
| 19 class PLATFORM_EXPORT ProbeBase { | 19 class PLATFORM_EXPORT ProbeBase { |
| 20 STACK_ALLOCATED() | 20 STACK_ALLOCATED() |
| 21 | 21 |
| 22 public: | 22 public: |
| 23 double captureStartTime() const; | 23 double captureStartTime() const; |
| 24 double captureEndTime() const; | 24 double captureEndTime() const; |
| 25 double duration() const; | 25 double duration() const; |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 mutable double m_startTime = 0; | 28 mutable double m_startTime = 0; |
| 29 mutable double m_endTime = 0; | 29 mutable double m_endTime = 0; |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 inline PlatformInstrumentationAgents* instrumentingAgentsFor( | 32 inline PlatformInstrumentationSink* toPlatformInstrumentationSink(FetchContext*
context) { |
| 33 FetchContext* context) { | |
| 34 return context->instrumentingAgents(); | 33 return context->instrumentingAgents(); |
| 35 } | 34 } |
| 36 | 35 |
| 37 } // namespace probe | 36 } // namespace probe |
| 38 | 37 |
| 39 class PLATFORM_EXPORT PlatformInstrumentation { | 38 class PLATFORM_EXPORT PlatformInstrumentation { |
| 40 public: | 39 public: |
| 41 class LazyPixelRefTracker : TraceEvent::TraceScopedTrackableObject<void*> { | 40 class LazyPixelRefTracker : TraceEvent::TraceScopedTrackableObject<void*> { |
| 42 public: | 41 public: |
| 43 LazyPixelRefTracker(void* instance) | 42 LazyPixelRefTracker(void* instance) |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 88 |
| 90 inline void PlatformInstrumentation::didDecodeLazyPixelRef() { | 89 inline void PlatformInstrumentation::didDecodeLazyPixelRef() { |
| 91 TRACE_EVENT_END0(CategoryName, DecodeLazyPixelRefEvent); | 90 TRACE_EVENT_END0(CategoryName, DecodeLazyPixelRefEvent); |
| 92 } | 91 } |
| 93 | 92 |
| 94 } // namespace blink | 93 } // namespace blink |
| 95 | 94 |
| 96 #include "platform/PlatformInstrumentationInl.h" | 95 #include "platform/PlatformInstrumentationInl.h" |
| 97 | 96 |
| 98 #endif // PlatformInstrumentation_h | 97 #endif // PlatformInstrumentation_h |
| OLD | NEW |