Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(607)

Side by Side Diff: Source/core/dom/ScopedWindowFocusAllowedIndicator.h

Issue 947393002: InlinedVisitor: Migrate dom to use inlined tracing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 ScopedWindowFocusAllowedIndicator_h 5 #ifndef ScopedWindowFocusAllowedIndicator_h
6 #define ScopedWindowFocusAllowedIndicator_h 6 #define ScopedWindowFocusAllowedIndicator_h
7 7
8 #include "core/dom/ContextLifecycleObserver.h" 8 #include "core/dom/ContextLifecycleObserver.h"
9 #include "core/dom/ExecutionContext.h" 9 #include "core/dom/ExecutionContext.h"
10 #include "wtf/Noncopyable.h" 10 #include "wtf/Noncopyable.h"
(...skipping 22 matching lines...) Expand all
33 if (executionContext) 33 if (executionContext)
34 executionContext->allowWindowInteraction(); 34 executionContext->allowWindowInteraction();
35 } 35 }
36 36
37 void dispose() 37 void dispose()
38 { 38 {
39 if (executionContext()) 39 if (executionContext())
40 executionContext()->consumeWindowInteraction(); 40 executionContext()->consumeWindowInteraction();
41 } 41 }
42 42
43 void trace(Visitor* visitor) 43 DEFINE_INLINE_TRACE()
44 { 44 {
45 ContextLifecycleObserver::trace(visitor); 45 ContextLifecycleObserver::trace(visitor);
46 } 46 }
47 }; 47 };
48 48
49 // In Oilpan, destructors are not allowed to touch other on-heap objects. 49 // In Oilpan, destructors are not allowed to touch other on-heap objects.
50 // The Observer indirection is needed to keep 50 // The Observer indirection is needed to keep
51 // ScopedWindowFocusAllowedIndicator off-heap and thus allows its destructor 51 // ScopedWindowFocusAllowedIndicator off-heap and thus allows its destructor
52 // to call executionContext()->consumeWindowInteraction(). 52 // to call executionContext()->consumeWindowInteraction().
53 OwnPtrWillBePersistent<Observer> m_observer; 53 OwnPtrWillBePersistent<Observer> m_observer;
54 }; 54 };
55 55
56 } // namespace blink 56 } // namespace blink
57 57
58 #endif // ScopedWindowFocusAllowedIndicator_h 58 #endif // ScopedWindowFocusAllowedIndicator_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698