OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 // TODO(alexclarke): Override timerTaskRunner() to pass in a document specif
ic default task runner. | 165 // TODO(alexclarke): Override timerTaskRunner() to pass in a document specif
ic default task runner. |
166 | 166 |
167 private: | 167 private: |
168 void fired() override | 168 void fired() override |
169 { | 169 { |
170 InspectorInstrumentation::AsyncTask asyncTask(m_window->document(), this
); | 170 InspectorInstrumentation::AsyncTask asyncTask(m_window->document(), this
); |
171 m_disposalAllowed = false; | 171 m_disposalAllowed = false; |
172 m_window->postMessageTimerFired(this); | 172 m_window->postMessageTimerFired(this); |
173 dispose(); | 173 dispose(); |
| 174 // Oilpan optimization: unregister as an observer right away. |
| 175 clearContext(); |
174 } | 176 } |
175 | 177 |
176 void dispose() | 178 void dispose() |
177 { | 179 { |
178 // Oilpan optimization: unregister as an observer right away. | |
179 clearContext(); | |
180 // Will destroy this object, now or after the next GC depending | |
181 // on whether Oilpan is disabled or not. | |
182 m_window->removePostMessageTimer(this); | 180 m_window->removePostMessageTimer(this); |
183 } | 181 } |
184 | 182 |
185 Member<MessageEvent> m_event; | 183 Member<MessageEvent> m_event; |
186 Member<LocalDOMWindow> m_window; | 184 Member<LocalDOMWindow> m_window; |
187 RefPtr<SecurityOrigin> m_targetOrigin; | 185 RefPtr<SecurityOrigin> m_targetOrigin; |
188 std::unique_ptr<SourceLocation> m_location; | 186 std::unique_ptr<SourceLocation> m_location; |
189 RefPtr<UserGestureToken> m_userGestureToken; | 187 RefPtr<UserGestureToken> m_userGestureToken; |
190 bool m_disposalAllowed; | 188 bool m_disposalAllowed; |
191 }; | 189 }; |
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1552 { | 1550 { |
1553 // If the LocalDOMWindow still has a frame reference, that frame must point | 1551 // If the LocalDOMWindow still has a frame reference, that frame must point |
1554 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation | 1552 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation |
1555 // where script execution leaks between different LocalDOMWindows. | 1553 // where script execution leaks between different LocalDOMWindows. |
1556 if (m_frameObserver->frame()) | 1554 if (m_frameObserver->frame()) |
1557 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); | 1555 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); |
1558 return m_frameObserver->frame(); | 1556 return m_frameObserver->frame(); |
1559 } | 1557 } |
1560 | 1558 |
1561 } // namespace blink | 1559 } // namespace blink |
OLD | NEW |