OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
3 * 1999-2001 Lars Knoll <knoll@kde.org> | 3 * 1999-2001 Lars Knoll <knoll@kde.org> |
4 * 1999-2001 Antti Koivisto <koivisto@kde.org> | 4 * 1999-2001 Antti Koivisto <koivisto@kde.org> |
5 * 2000-2001 Simon Hausmann <hausmann@kde.org> | 5 * 2000-2001 Simon Hausmann <hausmann@kde.org> |
6 * 2000-2001 Dirk Mueller <mueller@kde.org> | 6 * 2000-2001 Dirk Mueller <mueller@kde.org> |
7 * 2000 Stefan Schimanski <1Stein@gmx.de> | 7 * 2000 Stefan Schimanski <1Stein@gmx.de> |
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. |
9 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
10 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 10 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 WTF_MAKE_NONCOPYABLE(FrameNavigationDisabler); | 307 WTF_MAKE_NONCOPYABLE(FrameNavigationDisabler); |
308 STACK_ALLOCATED(); | 308 STACK_ALLOCATED(); |
309 public: | 309 public: |
310 explicit FrameNavigationDisabler(LocalFrame&); | 310 explicit FrameNavigationDisabler(LocalFrame&); |
311 ~FrameNavigationDisabler(); | 311 ~FrameNavigationDisabler(); |
312 | 312 |
313 private: | 313 private: |
314 Member<LocalFrame> m_frame; | 314 Member<LocalFrame> m_frame; |
315 }; | 315 }; |
316 | 316 |
| 317 // A helper class for attributing cost inside a scope to a LocalFrame, with |
| 318 // output written to the trace log. The class is irrelevant to the core logic |
| 319 // of LocalFrame. Sample usage: |
| 320 // |
| 321 // void foo(LocalFrame* frame) |
| 322 // { |
| 323 // ScopedFrameBlamer frameBlamer(frame); |
| 324 // TRACE_EVENT0("blink", "foo"); |
| 325 // // Do some real work... |
| 326 // } |
| 327 // |
| 328 // In Trace Viewer, we can find the cost of slice |foo| attributed to |frame|. |
| 329 // Design doc: https://docs.google.com/document/d/15BB-suCb9j-nFt55yCFJBJCGzLg2q
Um3WaSOPb8APtI/edit?usp=sharing |
| 330 class ScopedFrameBlamer { |
| 331 WTF_MAKE_NONCOPYABLE(ScopedFrameBlamer); |
| 332 STACK_ALLOCATED(); |
| 333 public: |
| 334 explicit ScopedFrameBlamer(LocalFrame*); |
| 335 ~ScopedFrameBlamer(); |
| 336 |
| 337 private: |
| 338 Member<LocalFrame> m_frame; |
| 339 }; |
| 340 |
317 } // namespace blink | 341 } // namespace blink |
318 | 342 |
319 #endif // LocalFrame_h | 343 #endif // LocalFrame_h |
OLD | NEW |