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

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

Issue 1304043002: Make classes and structures in core/dom fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « Source/core/dom/QualifiedName.h ('k') | Source/core/dom/ScriptLoader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class ScopedWindowFocusAllowedIndicator final { 14 class ScopedWindowFocusAllowedIndicator final {
15 WTF_MAKE_FAST_ALLOCATED(ScopedWindowFocusAllowedIndicator);
15 WTF_MAKE_NONCOPYABLE(ScopedWindowFocusAllowedIndicator); 16 WTF_MAKE_NONCOPYABLE(ScopedWindowFocusAllowedIndicator);
16 public: 17 public:
17 explicit ScopedWindowFocusAllowedIndicator(ExecutionContext* executionContex t) 18 explicit ScopedWindowFocusAllowedIndicator(ExecutionContext* executionContex t)
18 : m_observer(adoptPtrWillBeNoop(new Observer(executionContext))) 19 : m_observer(adoptPtrWillBeNoop(new Observer(executionContext)))
19 { 20 {
20 } 21 }
21 ~ScopedWindowFocusAllowedIndicator() 22 ~ScopedWindowFocusAllowedIndicator()
22 { 23 {
23 m_observer->dispose(); 24 m_observer->dispose();
24 } 25 }
(...skipping 24 matching lines...) Expand all
49 // In Oilpan, destructors are not allowed to touch other on-heap objects. 50 // In Oilpan, destructors are not allowed to touch other on-heap objects.
50 // The Observer indirection is needed to keep 51 // The Observer indirection is needed to keep
51 // ScopedWindowFocusAllowedIndicator off-heap and thus allows its destructor 52 // ScopedWindowFocusAllowedIndicator off-heap and thus allows its destructor
52 // to call executionContext()->consumeWindowInteraction(). 53 // to call executionContext()->consumeWindowInteraction().
53 OwnPtrWillBePersistent<Observer> m_observer; 54 OwnPtrWillBePersistent<Observer> m_observer;
54 }; 55 };
55 56
56 } // namespace blink 57 } // namespace blink
57 58
58 #endif // ScopedWindowFocusAllowedIndicator_h 59 #endif // ScopedWindowFocusAllowedIndicator_h
OLDNEW
« no previous file with comments | « Source/core/dom/QualifiedName.h ('k') | Source/core/dom/ScriptLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698