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

Side by Side Diff: Source/core/workers/WorkerGlobalScope.cpp

Issue 307943002: Oilpan: Prepare moving InspectorController and InspectorAgents to oilpan. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009, 2011 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 } 72 }
73 73
74 virtual bool isCleanupTask() const { return true; } 74 virtual bool isCleanupTask() const { return true; }
75 }; 75 };
76 76
77 WorkerGlobalScope::WorkerGlobalScope(const KURL& url, const String& userAgent, W orkerThread* thread, double timeOrigin, PassOwnPtrWillBeRawPtr<WorkerClients> wo rkerClients) 77 WorkerGlobalScope::WorkerGlobalScope(const KURL& url, const String& userAgent, W orkerThread* thread, double timeOrigin, PassOwnPtrWillBeRawPtr<WorkerClients> wo rkerClients)
78 : m_url(url) 78 : m_url(url)
79 , m_userAgent(userAgent) 79 , m_userAgent(userAgent)
80 , m_script(adoptPtr(new WorkerScriptController(*this))) 80 , m_script(adoptPtr(new WorkerScriptController(*this)))
81 , m_thread(thread) 81 , m_thread(thread)
82 , m_workerInspectorController(adoptPtr(new WorkerInspectorController(this))) 82 , m_workerInspectorController(adoptPtrWillBeNoop(new WorkerInspectorControll er(this)))
83 , m_closing(false) 83 , m_closing(false)
84 , m_eventQueue(WorkerEventQueue::create(this)) 84 , m_eventQueue(WorkerEventQueue::create(this))
85 , m_workerClients(workerClients) 85 , m_workerClients(workerClients)
86 , m_timeOrigin(timeOrigin) 86 , m_timeOrigin(timeOrigin)
87 , m_terminationObserver(0) 87 , m_terminationObserver(0)
88 { 88 {
89 ScriptWrappable::init(this); 89 ScriptWrappable::init(this);
90 setClient(this); 90 setClient(this);
91 setSecurityOrigin(SecurityOrigin::create(url)); 91 setSecurityOrigin(SecurityOrigin::create(url));
92 m_workerClients->reattachThread(); 92 m_workerClients->reattachThread();
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 return m_navigator.get(); 175 return m_navigator.get();
176 } 176 }
177 177
178 void WorkerGlobalScope::postTask(PassOwnPtr<ExecutionContextTask> task) 178 void WorkerGlobalScope::postTask(PassOwnPtr<ExecutionContextTask> task)
179 { 179 {
180 thread()->runLoop().postTask(task); 180 thread()->runLoop().postTask(task);
181 } 181 }
182 182
183 void WorkerGlobalScope::clearInspector() 183 void WorkerGlobalScope::clearInspector()
184 { 184 {
185 if (!m_workerInspectorController)
haraken 2014/06/12 08:40:25 Is it possible that clearInspector() is called twi
keishi 2014/06/13 03:37:34 Seems like its called twice. First from 1 0x9e
haraken 2014/06/13 08:02:53 Thanks, understood. It seems strange that clearIns
keishi 2014/06/17 03:13:22 Yes I think we can remove the call to clearInspect
186 return;
187 m_workerInspectorController->discard();
haraken 2014/06/12 08:40:25 We conventionally call this kind of method dispose
keishi 2014/06/13 03:37:34 Done.
185 m_workerInspectorController.clear(); 188 m_workerInspectorController.clear();
186 } 189 }
187 190
188 void WorkerGlobalScope::registerTerminationObserver(TerminationObserver* observe r) 191 void WorkerGlobalScope::registerTerminationObserver(TerminationObserver* observe r)
189 { 192 {
190 ASSERT(!m_terminationObserver); 193 ASSERT(!m_terminationObserver);
191 ASSERT(observer); 194 ASSERT(observer);
192 m_terminationObserver = observer; 195 m_terminationObserver = observer;
193 } 196 }
194 197
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 WorkerEventQueue* WorkerGlobalScope::eventQueue() const 322 WorkerEventQueue* WorkerGlobalScope::eventQueue() const
320 { 323 {
321 return m_eventQueue.get(); 324 return m_eventQueue.get();
322 } 325 }
323 326
324 void WorkerGlobalScope::trace(Visitor* visitor) 327 void WorkerGlobalScope::trace(Visitor* visitor)
325 { 328 {
326 visitor->trace(m_console); 329 visitor->trace(m_console);
327 visitor->trace(m_location); 330 visitor->trace(m_location);
328 visitor->trace(m_navigator); 331 visitor->trace(m_navigator);
332 visitor->trace(m_workerInspectorController);
329 visitor->trace(m_eventQueue); 333 visitor->trace(m_eventQueue);
330 visitor->trace(m_workerClients); 334 visitor->trace(m_workerClients);
331 WillBeHeapSupplementable<WorkerGlobalScope>::trace(visitor); 335 WillBeHeapSupplementable<WorkerGlobalScope>::trace(visitor);
332 ExecutionContext::trace(visitor); 336 ExecutionContext::trace(visitor);
333 EventTargetWithInlineData::trace(visitor); 337 EventTargetWithInlineData::trace(visitor);
334 } 338 }
335 339
336 } // namespace WebCore 340 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698