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

Side by Side Diff: Source/core/dom/ActiveDOMObject.cpp

Issue 1006253002: Oilpan: have LifetimeNotifier<T> track its observers weakly. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 5 years, 9 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 /* 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // ActiveDOMObject may be inherited by a sub-class whose life-cycle 45 // ActiveDOMObject may be inherited by a sub-class whose life-cycle
46 // exceeds that of the associated ExecutionContext. In those cases, 46 // exceeds that of the associated ExecutionContext. In those cases,
47 // m_executionContext would/should have been nullified by 47 // m_executionContext would/should have been nullified by
48 // ContextLifecycleObserver::contextDestroyed() (which we implement / 48 // ContextLifecycleObserver::contextDestroyed() (which we implement /
49 // inherit). Hence, we should ensure that this is not 0 before use it 49 // inherit). Hence, we should ensure that this is not 0 before use it
50 // here. 50 // here.
51 if (!executionContext()) 51 if (!executionContext())
52 return; 52 return;
53 53
54 ASSERT(m_suspendIfNeededCalled); 54 ASSERT(m_suspendIfNeededCalled);
55 #if !ENABLE(OILPAN)
55 ASSERT(executionContext()->isContextThread()); 56 ASSERT(executionContext()->isContextThread());
57 #endif
56 } 58 }
57 59
58 void ActiveDOMObject::suspendIfNeeded() 60 void ActiveDOMObject::suspendIfNeeded()
59 { 61 {
60 #if ENABLE(ASSERT) 62 #if ENABLE(ASSERT)
61 ASSERT(!m_suspendIfNeededCalled); 63 ASSERT(!m_suspendIfNeededCalled);
62 m_suspendIfNeededCalled = true; 64 m_suspendIfNeededCalled = true;
63 #endif 65 #endif
64 if (ExecutionContext* context = executionContext()) 66 if (ExecutionContext* context = executionContext())
65 context->suspendActiveDOMObjectIfNeeded(this); 67 context->suspendActiveDOMObjectIfNeeded(this);
(...skipping 27 matching lines...) Expand all
93 95
94 if (context->activeDOMObjectsAreSuspended()) { 96 if (context->activeDOMObjectsAreSuspended()) {
95 suspend(); 97 suspend();
96 return; 98 return;
97 } 99 }
98 100
99 resume(); 101 resume();
100 } 102 }
101 103
102 } // namespace blink 104 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/ScriptPromiseResolver.cpp ('k') | Source/modules/webmidi/MIDIAccessInitializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698