OLD | NEW |
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 void WorkerGlobalScope::exceptionUnhandled(int exceptionId) { | 123 void WorkerGlobalScope::exceptionUnhandled(int exceptionId) { |
124 ErrorEvent* event = m_pendingErrorEvents.take(exceptionId); | 124 ErrorEvent* event = m_pendingErrorEvents.take(exceptionId); |
125 DCHECK(event); | 125 DCHECK(event); |
126 if (WorkerThreadDebugger* debugger = | 126 if (WorkerThreadDebugger* debugger = |
127 WorkerThreadDebugger::from(thread()->isolate())) | 127 WorkerThreadDebugger::from(thread()->isolate())) |
128 debugger->exceptionThrown(m_thread, event); | 128 debugger->exceptionThrown(m_thread, event); |
129 } | 129 } |
130 | 130 |
131 void WorkerGlobalScope::registerEventListener( | 131 void WorkerGlobalScope::registerEventListener( |
132 V8AbstractEventListener* eventListener) { | 132 V8AbstractEventListener* eventListener) { |
| 133 // TODO(sof): remove once crbug.com/677654 has been diagnosed. |
| 134 CHECK(&ThreadState::fromObject(this)->heap() == &ThreadState::fromObject(event
Listener)->heap()); |
133 bool newEntry = m_eventListeners.add(eventListener).isNewEntry; | 135 bool newEntry = m_eventListeners.add(eventListener).isNewEntry; |
134 RELEASE_ASSERT(newEntry); | 136 CHECK(newEntry); |
135 } | 137 } |
136 | 138 |
137 void WorkerGlobalScope::deregisterEventListener( | 139 void WorkerGlobalScope::deregisterEventListener( |
138 V8AbstractEventListener* eventListener) { | 140 V8AbstractEventListener* eventListener) { |
139 auto it = m_eventListeners.find(eventListener); | 141 auto it = m_eventListeners.find(eventListener); |
140 RELEASE_ASSERT(it != m_eventListeners.end()); | 142 CHECK(it != m_eventListeners.end()); |
141 m_eventListeners.remove(it); | 143 m_eventListeners.remove(it); |
142 } | 144 } |
143 | 145 |
144 WorkerLocation* WorkerGlobalScope::location() const { | 146 WorkerLocation* WorkerGlobalScope::location() const { |
145 if (!m_location) | 147 if (!m_location) |
146 m_location = WorkerLocation::create(m_url); | 148 m_location = WorkerLocation::create(m_url); |
147 return m_location.get(); | 149 return m_location.get(); |
148 } | 150 } |
149 | 151 |
150 WorkerNavigator* WorkerGlobalScope::navigator() const { | 152 WorkerNavigator* WorkerGlobalScope::navigator() const { |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 visitor->trace(m_timers); | 376 visitor->trace(m_timers); |
375 visitor->trace(m_eventListeners); | 377 visitor->trace(m_eventListeners); |
376 visitor->trace(m_pendingErrorEvents); | 378 visitor->trace(m_pendingErrorEvents); |
377 ExecutionContext::trace(visitor); | 379 ExecutionContext::trace(visitor); |
378 EventTargetWithInlineData::trace(visitor); | 380 EventTargetWithInlineData::trace(visitor); |
379 SecurityContext::trace(visitor); | 381 SecurityContext::trace(visitor); |
380 Supplementable<WorkerGlobalScope>::trace(visitor); | 382 Supplementable<WorkerGlobalScope>::trace(visitor); |
381 } | 383 } |
382 | 384 |
383 } // namespace blink | 385 } // namespace blink |
OLD | NEW |