| Index: third_party/WebKit/Source/core/frame/LocalFrame.h
|
| diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.h b/third_party/WebKit/Source/core/frame/LocalFrame.h
|
| index 3ed463b03a781d5c8d972416b8acbb29f6bbf19b..649721bcb85e8e711ebc724f0224262b4d1b0d8a 100644
|
| --- a/third_party/WebKit/Source/core/frame/LocalFrame.h
|
| +++ b/third_party/WebKit/Source/core/frame/LocalFrame.h
|
| @@ -314,6 +314,30 @@ private:
|
| Member<LocalFrame> m_frame;
|
| };
|
|
|
| +// A helper class for attributing cost inside a scope to a LocalFrame, with
|
| +// output written to the trace log. The class is irrelevant to the core logic
|
| +// of LocalFrame. Sample usage:
|
| +//
|
| +// void foo(LocalFrame* frame)
|
| +// {
|
| +// ScopedFrameBlamer frameBlamer(frame);
|
| +// TRACE_EVENT0("blink", "foo");
|
| +// // Do some real work...
|
| +// }
|
| +//
|
| +// In Trace Viewer, we can find the cost of slice |foo| attributed to |frame|.
|
| +// Design doc: https://docs.google.com/document/d/15BB-suCb9j-nFt55yCFJBJCGzLg2qUm3WaSOPb8APtI/edit?usp=sharing
|
| +class ScopedFrameBlamer {
|
| + WTF_MAKE_NONCOPYABLE(ScopedFrameBlamer);
|
| + STACK_ALLOCATED();
|
| +public:
|
| + explicit ScopedFrameBlamer(LocalFrame*);
|
| + ~ScopedFrameBlamer();
|
| +
|
| +private:
|
| + Member<LocalFrame> m_frame;
|
| +};
|
| +
|
| } // namespace blink
|
|
|
| #endif // LocalFrame_h
|
|
|