| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 * | 7 * |
| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 return adoptRef(new MockPagePopup(client, originBoundsInRootView, mainFrame)
); | 79 return adoptRef(new MockPagePopup(client, originBoundsInRootView, mainFrame)
); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void MockPagePopup::closeLater() | 82 void MockPagePopup::closeLater() |
| 83 { | 83 { |
| 84 ref(); | 84 ref(); |
| 85 m_popupClient->didClosePopup(); | 85 m_popupClient->didClosePopup(); |
| 86 m_popupClient = 0; | 86 m_popupClient = 0; |
| 87 // This can be called in detach(), and we should not change DOM structure | 87 // This can be called in detach(), and we should not change DOM structure |
| 88 // during detach(). | 88 // during detach(). |
| 89 m_closeTimer.startOneShot(0); | 89 m_closeTimer.startOneShot(0, FROM_HERE); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void MockPagePopup::close(Timer<MockPagePopup>*) | 92 void MockPagePopup::close(Timer<MockPagePopup>*) |
| 93 { | 93 { |
| 94 deref(); | 94 deref(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 MockPagePopup::~MockPagePopup() | 97 MockPagePopup::~MockPagePopup() |
| 98 { | 98 { |
| 99 if (m_iframe && m_iframe->parentNode()) | 99 if (m_iframe && m_iframe->parentNode()) |
| (...skipping 30 matching lines...) Expand all Loading... |
| 130 { | 130 { |
| 131 if (!popup || popup != m_mockPagePopup.get()) | 131 if (!popup || popup != m_mockPagePopup.get()) |
| 132 return; | 132 return; |
| 133 m_mockPagePopup->closeLater(); | 133 m_mockPagePopup->closeLater(); |
| 134 m_mockPagePopup.clear(); | 134 m_mockPagePopup.clear(); |
| 135 m_pagePopupController->clearPagePopupClient(); | 135 m_pagePopupController->clearPagePopupClient(); |
| 136 m_pagePopupController.clear(); | 136 m_pagePopupController.clear(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 } | 139 } |
| OLD | NEW |