Chromium Code Reviews| 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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 726 DOMSelection* LocalDOMWindow::getSelection() | 726 DOMSelection* LocalDOMWindow::getSelection() |
| 727 { | 727 { |
| 728 if (!isCurrentlyDisplayedInFrame()) | 728 if (!isCurrentlyDisplayedInFrame()) |
| 729 return nullptr; | 729 return nullptr; |
| 730 | 730 |
| 731 return frame()->document()->getSelection(); | 731 return frame()->document()->getSelection(); |
| 732 } | 732 } |
| 733 | 733 |
| 734 Element* LocalDOMWindow::frameElement() const | 734 Element* LocalDOMWindow::frameElement() const |
| 735 { | 735 { |
| 736 if (!frame()) | 736 if (!frame() || (frame()->owner() && !frame()->owner()->isLocal())) |
|
alexmos
2015/04/30 20:45:26
The comment about the binding security check below
dcheng
2015/04/30 20:58:51
I'd prefer to just hit the assert below. deprecate
alexmos
2015/04/30 21:12:58
Sounds good -- done.
| |
| 737 return nullptr; | 737 return nullptr; |
| 738 | 738 |
| 739 // The bindings security check should ensure we're same origin... | 739 // The bindings security check should ensure we're same origin... |
| 740 ASSERT(!frame()->owner() || frame()->owner()->isLocal()); | 740 ASSERT(!frame()->owner() || frame()->owner()->isLocal()); |
| 741 return frame()->deprecatedLocalOwner(); | 741 return frame()->deprecatedLocalOwner(); |
| 742 } | 742 } |
| 743 | 743 |
| 744 void LocalDOMWindow::focus(ExecutionContext* context) | 744 void LocalDOMWindow::focus(ExecutionContext* context) |
| 745 { | 745 { |
| 746 if (!frame()) | 746 if (!frame()) |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1571 DOMWindow::trace(visitor); | 1571 DOMWindow::trace(visitor); |
| 1572 DOMWindowLifecycleNotifier::trace(visitor); | 1572 DOMWindowLifecycleNotifier::trace(visitor); |
| 1573 } | 1573 } |
| 1574 | 1574 |
| 1575 LocalFrame* LocalDOMWindow::frame() const | 1575 LocalFrame* LocalDOMWindow::frame() const |
| 1576 { | 1576 { |
| 1577 return m_frameObserver->frame(); | 1577 return m_frameObserver->frame(); |
| 1578 } | 1578 } |
| 1579 | 1579 |
| 1580 } // namespace blink | 1580 } // namespace blink |
| OLD | NEW |