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

Side by Side Diff: Source/platform/LifecycleObserver.h

Issue 1146353002: Oilpan: insist on eager sweeping for some objects. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add some limited-lifetime comments Created 5 years, 7 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
« no previous file with comments | « Source/core/frame/DOMWindowProperty.h ('k') | Source/platform/heap/Heap.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 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 26 matching lines...) Expand all
37 public: 37 public:
38 using Context = T; 38 using Context = T;
39 39
40 #if !ENABLE(OILPAN) 40 #if !ENABLE(OILPAN)
41 virtual ~LifecycleObserver() 41 virtual ~LifecycleObserver()
42 { 42 {
43 dispose(); 43 dispose();
44 } 44 }
45 #endif 45 #endif
46 46
47 // TODO(Oilpan): remove eager sweeping once LifecycleObserver is
48 // always on the heap.
49 EAGERLY_SWEEP();
47 DEFINE_INLINE_VIRTUAL_TRACE() 50 DEFINE_INLINE_VIRTUAL_TRACE()
48 { 51 {
49 visitor->trace(m_lifecycleContext); 52 visitor->trace(m_lifecycleContext);
50 } 53 }
54
51 virtual void contextDestroyed() { } 55 virtual void contextDestroyed() { }
52 56
53 void dispose() 57 void dispose()
54 { 58 {
55 setContext(nullptr); 59 setContext(nullptr);
56 } 60 }
57 61
58 Context* lifecycleContext() const { return m_lifecycleContext; } 62 Context* lifecycleContext() const { return m_lifecycleContext; }
59 void clearLifecycleContext() { m_lifecycleContext = nullptr; } 63 void clearLifecycleContext() { m_lifecycleContext = nullptr; }
60 64
(...skipping 18 matching lines...) Expand all
79 83
80 m_lifecycleContext = context; 84 m_lifecycleContext = context;
81 85
82 if (m_lifecycleContext) 86 if (m_lifecycleContext)
83 static_cast<Notifier*>(m_lifecycleContext.get())->addObserver(static_cas t<Observer*>(this)); 87 static_cast<Notifier*>(m_lifecycleContext.get())->addObserver(static_cas t<Observer*>(this));
84 } 88 }
85 89
86 } // namespace blink 90 } // namespace blink
87 91
88 #endif // LifecycleObserver_h 92 #endif // LifecycleObserver_h
OLDNEW
« no previous file with comments | « Source/core/frame/DOMWindowProperty.h ('k') | Source/platform/heap/Heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698