Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef NetworkInstrumentation_h | |
| 6 #define NetworkInstrumentation_h | |
| 7 | |
| 8 #include "platform/PlatformExport.h" | |
| 9 #include "platform/network/ResourceRequest.h" | |
| 10 | |
| 11 namespace network_instrumentation { | |
| 12 | |
| 13 enum RequestOutcome { Success, Fail }; | |
| 14 | |
| 15 class PLATFORM_EXPORT ScopedResourceLoadTracker { | |
| 16 public: | |
| 17 ScopedResourceLoadTracker(unsigned long resourceID, | |
| 18 const blink::ResourceRequest&); | |
| 19 ~ScopedResourceLoadTracker(); | |
| 20 void doNotCloseSliceAtEndOfScope(); | |
| 21 | |
| 22 private: | |
| 23 bool closeSliceAtEndOfScope; | |
| 24 const unsigned long resourceID; | |
| 25 const blink::ResourceRequest request; | |
|
chiniforooshan
2016/11/03 15:50:36
I don't see why we need to store the request?
dproy
2016/11/03 16:27:19
You're right - there's no reason to store it. Fixe
| |
| 26 | |
| 27 DISALLOW_COPY_AND_ASSIGN(ScopedResourceLoadTracker); | |
| 28 }; | |
| 29 | |
| 30 void PLATFORM_EXPORT beginResourceLoad(unsigned long resourceID, | |
| 31 const blink::ResourceRequest&); | |
| 32 | |
| 33 void PLATFORM_EXPORT endResourceLoad(unsigned long resourceID, RequestOutcome); | |
| 34 | |
| 35 const char* RequestOutcomeToString(RequestOutcome); | |
| 36 | |
| 37 } // namespace network_instrumentation | |
| 38 | |
| 39 #endif // NetworkInstrumentation_h | |
| OLD | NEW |