| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 NetworkInstrumentation_h | 5 #ifndef NetworkInstrumentation_h |
| 6 #define NetworkInstrumentation_h | 6 #define NetworkInstrumentation_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/loader/fetch/ResourceLoadPriority.h" | 9 #include "platform/loader/fetch/ResourceLoadPriority.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 |
| 12 class ResourceRequest; | 13 class ResourceRequest; |
| 13 } // namespace blink | |
| 14 | 14 |
| 15 namespace network_instrumentation { | 15 namespace network_instrumentation { |
| 16 | 16 |
| 17 enum RequestOutcome { Success, Fail }; | 17 enum RequestOutcome { kSuccess, kFail }; |
| 18 | 18 |
| 19 class PLATFORM_EXPORT ScopedResourceLoadTracker { | 19 class PLATFORM_EXPORT ScopedResourceLoadTracker { |
| 20 public: | 20 public: |
| 21 ScopedResourceLoadTracker(unsigned long resourceID, | 21 ScopedResourceLoadTracker(unsigned long resource_id, |
| 22 const blink::ResourceRequest&); | 22 const blink::ResourceRequest&); |
| 23 ~ScopedResourceLoadTracker(); | 23 ~ScopedResourceLoadTracker(); |
| 24 void resourceLoadContinuesBeyondScope(); | 24 void ResourceLoadContinuesBeyondScope(); |
| 25 | 25 |
| 26 private: | 26 private: |
| 27 // If this variable is false, close resource load slice at end of scope. | 27 // If this variable is false, close resource load slice at end of scope. |
| 28 bool m_resourceLoadContinuesBeyondScope; | 28 bool resource_load_continues_beyond_scope_; |
| 29 | 29 |
| 30 const unsigned long m_resourceID; | 30 const unsigned long resource_id_; |
| 31 | 31 |
| 32 DISALLOW_COPY_AND_ASSIGN(ScopedResourceLoadTracker); | 32 DISALLOW_COPY_AND_ASSIGN(ScopedResourceLoadTracker); |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 void PLATFORM_EXPORT resourcePrioritySet(unsigned long resourceID, | 35 void PLATFORM_EXPORT ResourcePrioritySet(unsigned long resource_id, |
| 36 blink::ResourceLoadPriority); | 36 blink::ResourceLoadPriority); |
| 37 | 37 |
| 38 void PLATFORM_EXPORT endResourceLoad(unsigned long resourceID, RequestOutcome); | 38 void PLATFORM_EXPORT EndResourceLoad(unsigned long resource_id, RequestOutcome); |
| 39 | 39 |
| 40 } // namespace network_instrumentation | 40 } // namespace network_instrumentation |
| 41 } // namespace blink |
| 41 | 42 |
| 42 #endif // NetworkInstrumentation_h | 43 #endif // NetworkInstrumentation_h |
| OLD | NEW |