OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Google 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 15 matching lines...) Expand all Loading... | |
26 | 26 |
27 #include "config.h" | 27 #include "config.h" |
28 #include "core/workers/WorkerEventQueue.h" | 28 #include "core/workers/WorkerEventQueue.h" |
29 | 29 |
30 #include "core/dom/ExecutionContext.h" | 30 #include "core/dom/ExecutionContext.h" |
31 #include "core/dom/ExecutionContextTask.h" | 31 #include "core/dom/ExecutionContextTask.h" |
32 #include "core/events/Event.h" | 32 #include "core/events/Event.h" |
33 | 33 |
34 namespace WebCore { | 34 namespace WebCore { |
35 | 35 |
36 PassOwnPtr<WorkerEventQueue> WorkerEventQueue::create(ExecutionContext* context) | 36 PassOwnPtrWillBeRawPtr<WorkerEventQueue> WorkerEventQueue::create(ExecutionConte xt* context) |
37 { | 37 { |
38 return adoptPtr(new WorkerEventQueue(context)); | 38 return adoptPtrWillBeNoop(new WorkerEventQueue(context)); |
39 } | 39 } |
40 | 40 |
41 WorkerEventQueue::WorkerEventQueue(ExecutionContext* context) | 41 WorkerEventQueue::WorkerEventQueue(ExecutionContext* context) |
42 : m_executionContext(context) | 42 : m_executionContext(context) |
43 , m_isClosed(false) | 43 , m_isClosed(false) |
44 { | 44 { |
45 } | 45 } |
46 | 46 |
47 WorkerEventQueue::~WorkerEventQueue() | 47 WorkerEventQueue::~WorkerEventQueue() |
48 { | 48 { |
49 #if !ENABLE(OILPAN) | |
49 close(); | 50 close(); |
haraken
2014/05/30 12:10:41
I'm not sure if you can remove close() from the de
tkent
2014/05/30 13:47:58
In this patch, I moved this |close()| callsite to
haraken
2014/05/30 14:00:56
oh, I missed that. That makes sense.
| |
51 #endif | |
52 } | |
53 | |
54 void WorkerEventQueue::trace(Visitor* visitor) | |
55 { | |
56 visitor->trace(m_eventTaskMap); | |
50 } | 57 } |
51 | 58 |
52 class WorkerEventQueue::EventDispatcherTask : public ExecutionContextTask { | 59 class WorkerEventQueue::EventDispatcherTask : public ExecutionContextTask { |
53 public: | 60 public: |
54 static PassOwnPtr<EventDispatcherTask> create(PassRefPtrWillBeRawPtr<Event> event, WorkerEventQueue* eventQueue) | 61 static PassOwnPtr<EventDispatcherTask> create(PassRefPtrWillBeRawPtr<Event> event, WorkerEventQueue* eventQueue) |
55 { | 62 { |
56 return adoptPtr(new EventDispatcherTask(event, eventQueue)); | 63 return adoptPtr(new EventDispatcherTask(event, eventQueue)); |
57 } | 64 } |
58 | 65 |
59 virtual ~EventDispatcherTask() | 66 virtual ~EventDispatcherTask() |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 { | 132 { |
126 m_isClosed = true; | 133 m_isClosed = true; |
127 for (EventTaskMap::iterator it = m_eventTaskMap.begin(); it != m_eventTaskMa p.end(); ++it) { | 134 for (EventTaskMap::iterator it = m_eventTaskMap.begin(); it != m_eventTaskMa p.end(); ++it) { |
128 EventDispatcherTask* task = it->value; | 135 EventDispatcherTask* task = it->value; |
129 task->cancel(); | 136 task->cancel(); |
130 } | 137 } |
131 m_eventTaskMap.clear(); | 138 m_eventTaskMap.clear(); |
132 } | 139 } |
133 | 140 |
134 } | 141 } |
OLD | NEW |