| 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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 | 519 |
| 520 void LocalDOMWindow::sendOrientationChangeEvent() { | 520 void LocalDOMWindow::sendOrientationChangeEvent() { |
| 521 ASSERT(RuntimeEnabledFeatures::orientationEventEnabled()); | 521 ASSERT(RuntimeEnabledFeatures::orientationEventEnabled()); |
| 522 ASSERT(frame()->isMainFrame()); | 522 ASSERT(frame()->isMainFrame()); |
| 523 | 523 |
| 524 // Before dispatching the event, build a list of all frames in the page | 524 // Before dispatching the event, build a list of all frames in the page |
| 525 // to send the event to, to mitigate side effects from event handlers | 525 // to send the event to, to mitigate side effects from event handlers |
| 526 // potentially interfering with others. | 526 // potentially interfering with others. |
| 527 HeapVector<Member<Frame>> frames; | 527 HeapVector<Member<Frame>> frames; |
| 528 for (Frame* f = frame(); f; f = f->tree().traverseNext()) | 528 for (Frame* f = frame(); f; f = f->tree().traverseNext()) |
| 529 frames.append(f); | 529 frames.push_back(f); |
| 530 | 530 |
| 531 for (size_t i = 0; i < frames.size(); ++i) { | 531 for (size_t i = 0; i < frames.size(); ++i) { |
| 532 if (!frames[i]->isLocalFrame()) | 532 if (!frames[i]->isLocalFrame()) |
| 533 continue; | 533 continue; |
| 534 toLocalFrame(frames[i].get()) | 534 toLocalFrame(frames[i].get()) |
| 535 ->domWindow() | 535 ->domWindow() |
| 536 ->dispatchEvent(Event::create(EventTypeNames::orientationchange)); | 536 ->dispatchEvent(Event::create(EventTypeNames::orientationchange)); |
| 537 } | 537 } |
| 538 } | 538 } |
| 539 | 539 |
| (...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1567 | 1567 |
| 1568 LocalFrame* LocalDOMWindow::frame() const { | 1568 LocalFrame* LocalDOMWindow::frame() const { |
| 1569 // If the LocalDOMWindow still has a frame reference, that frame must point | 1569 // If the LocalDOMWindow still has a frame reference, that frame must point |
| 1570 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation | 1570 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation |
| 1571 // where script execution leaks between different LocalDOMWindows. | 1571 // where script execution leaks between different LocalDOMWindows. |
| 1572 SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this); | 1572 SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this); |
| 1573 return m_frame; | 1573 return m_frame; |
| 1574 } | 1574 } |
| 1575 | 1575 |
| 1576 } // namespace blink | 1576 } // namespace blink |
| OLD | NEW |