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

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

Issue 17351003: Rename ContextDestructionObserver to ContextLifecycleObserver (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reapplied Created 7 years, 6 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/dom/ScriptExecutionContext.h ('k') | Source/core/html/track/TextTrackRegion.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 * Copyright (C) 2012 Google Inc. All Rights Reserved. 3 * Copyright (C) 2012 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 28 matching lines...) Expand all
39 #include "core/page/DOMTimer.h" 39 #include "core/page/DOMTimer.h"
40 #include "core/workers/WorkerContext.h" 40 #include "core/workers/WorkerContext.h"
41 #include "core/workers/WorkerThread.h" 41 #include "core/workers/WorkerThread.h"
42 #include "modules/webdatabase/DatabaseContext.h" 42 #include "modules/webdatabase/DatabaseContext.h"
43 #include <wtf/MainThread.h> 43 #include <wtf/MainThread.h>
44 #include <wtf/MemoryInstrumentationHashMap.h> 44 #include <wtf/MemoryInstrumentationHashMap.h>
45 #include <wtf/MemoryInstrumentationVector.h> 45 #include <wtf/MemoryInstrumentationVector.h>
46 46
47 namespace WTF { 47 namespace WTF {
48 48
49 template<> struct SequenceMemoryInstrumentationTraits<WebCore::ContextDestructio nObserver*> { 49 template<> struct SequenceMemoryInstrumentationTraits<WebCore::ContextLifecycleO bserver*> {
50 template <typename I> static void reportMemoryUsage(I, I, MemoryClassInfo&) { } 50 template <typename I> static void reportMemoryUsage(I, I, MemoryClassInfo&) { }
51 }; 51 };
52 52
53 } 53 }
54 namespace WebCore { 54 namespace WebCore {
55 55
56 class ProcessMessagesSoonTask : public ScriptExecutionContext::Task { 56 class ProcessMessagesSoonTask : public ScriptExecutionContext::Task {
57 public: 57 public:
58 static PassOwnPtr<ProcessMessagesSoonTask> create() 58 static PassOwnPtr<ProcessMessagesSoonTask> create()
59 { 59 {
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 } 187 }
188 188
189 void ScriptExecutionContext::suspendActiveDOMObjectIfNeeded(ActiveDOMObject* obj ect) 189 void ScriptExecutionContext::suspendActiveDOMObjectIfNeeded(ActiveDOMObject* obj ect)
190 { 190 {
191 ASSERT(lifecycleNotifier()->contains(object)); 191 ASSERT(lifecycleNotifier()->contains(object));
192 // Ensure all ActiveDOMObjects are suspended also newly created ones. 192 // Ensure all ActiveDOMObjects are suspended also newly created ones.
193 if (m_activeDOMObjectsAreSuspended) 193 if (m_activeDOMObjectsAreSuspended)
194 object->suspend(m_reasonForSuspendingActiveDOMObjects); 194 object->suspend(m_reasonForSuspendingActiveDOMObjects);
195 } 195 }
196 196
197 void ScriptExecutionContext::wasObservedBy(ContextDestructionObserver* observer, ContextDestructionObserver::Type as) 197 void ScriptExecutionContext::wasObservedBy(ContextLifecycleObserver* observer, C ontextLifecycleObserver::Type as)
198 { 198 {
199 lifecycleNotifier()->addObserver(observer, as); 199 lifecycleNotifier()->addObserver(observer, as);
200 } 200 }
201 201
202 void ScriptExecutionContext::wasUnobservedBy(ContextDestructionObserver* observe r, ContextDestructionObserver::Type as) 202 void ScriptExecutionContext::wasUnobservedBy(ContextLifecycleObserver* observer, ContextLifecycleObserver::Type as)
203 { 203 {
204 lifecycleNotifier()->removeObserver(observer, as); 204 lifecycleNotifier()->removeObserver(observer, as);
205 } 205 }
206 206
207 void ScriptExecutionContext::closeMessagePorts() { 207 void ScriptExecutionContext::closeMessagePorts() {
208 HashSet<MessagePort*>::iterator messagePortsEnd = m_messagePorts.end(); 208 HashSet<MessagePort*>::iterator messagePortsEnd = m_messagePorts.end();
209 for (HashSet<MessagePort*>::iterator iter = m_messagePorts.begin(); iter != messagePortsEnd; ++iter) { 209 for (HashSet<MessagePort*>::iterator iter = m_messagePorts.begin(); iter != messagePortsEnd; ++iter) {
210 ASSERT((*iter)->scriptExecutionContext() == this); 210 ASSERT((*iter)->scriptExecutionContext() == this);
211 (*iter)->close(); 211 (*iter)->close();
212 } 212 }
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 ScriptExecutionContext::Task::~Task() 324 ScriptExecutionContext::Task::~Task()
325 { 325 {
326 } 326 }
327 327
328 void ScriptExecutionContext::setDatabaseContext(DatabaseContext* databaseContext ) 328 void ScriptExecutionContext::setDatabaseContext(DatabaseContext* databaseContext )
329 { 329 {
330 m_databaseContext = databaseContext; 330 m_databaseContext = databaseContext;
331 } 331 }
332 332
333 } // namespace WebCore 333 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/ScriptExecutionContext.h ('k') | Source/core/html/track/TextTrackRegion.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698