Chromium Code Reviews| Index: third_party/WebKit/Source/platform/network/NetworkInstrumentation.h |
| diff --git a/third_party/WebKit/Source/platform/network/NetworkInstrumentation.h b/third_party/WebKit/Source/platform/network/NetworkInstrumentation.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..339f7409b970b0f37181a64eaed7ffd9cac84e46 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/platform/network/NetworkInstrumentation.h |
| @@ -0,0 +1,39 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef NetworkInstrumentation_h |
| +#define NetworkInstrumentation_h |
| + |
| +#include "platform/PlatformExport.h" |
| +#include "platform/network/ResourceRequest.h" |
| + |
| +namespace network_instrumentation { |
| + |
| +enum RequestOutcome { Success, Fail }; |
| + |
| +class PLATFORM_EXPORT ScopedResourceLoadTracker { |
| + public: |
| + ScopedResourceLoadTracker(unsigned long resourceID, |
| + const blink::ResourceRequest&); |
| + ~ScopedResourceLoadTracker(); |
| + void doNotCloseSliceAtEndOfScope(); |
| + |
| + private: |
| + bool closeSliceAtEndOfScope; |
| + const unsigned long resourceID; |
| + 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
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(ScopedResourceLoadTracker); |
| +}; |
| + |
| +void PLATFORM_EXPORT beginResourceLoad(unsigned long resourceID, |
| + const blink::ResourceRequest&); |
| + |
| +void PLATFORM_EXPORT endResourceLoad(unsigned long resourceID, RequestOutcome); |
| + |
| +const char* RequestOutcomeToString(RequestOutcome); |
| + |
| +} // namespace network_instrumentation |
| + |
| +#endif // NetworkInstrumentation_h |