| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 3 * Copyright (C) 2006 Apple Computer, Inc. | 3 * Copyright (C) 2006 Apple Computer, Inc. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
| 14 * | 14 * |
| 15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
| 16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
| 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
| 19 */ | 19 */ |
| 20 | 20 |
| 21 #include "core/page/FrameTree.h" | 21 #include "core/page/FrameTree.h" |
| 22 | 22 |
| 23 #include "core/dom/Document.h" | 23 #include "core/dom/Document.h" |
| 24 #include "core/frame/FrameClient.h" | 24 #include "core/frame/FrameClient.h" |
| 25 #include "core/frame/FrameView.h" | 25 #include "core/frame/FrameView.h" |
| 26 #include "core/frame/LocalFrame.h" | 26 #include "core/frame/LocalFrame.h" |
| 27 #include "core/frame/RemoteFrame.h" | 27 #include "core/frame/RemoteFrame.h" |
| 28 #include "core/frame/RemoteFrameView.h" | 28 #include "core/frame/RemoteFrameView.h" |
| 29 #include "core/frame/UseCounter.h" |
| 29 #include "core/page/Page.h" | 30 #include "core/page/Page.h" |
| 30 #include "wtf/Assertions.h" | 31 #include "wtf/Assertions.h" |
| 31 #include "wtf/Vector.h" | 32 #include "wtf/Vector.h" |
| 32 #include "wtf/text/CString.h" | 33 #include "wtf/text/CString.h" |
| 33 #include "wtf/text/StringBuilder.h" | 34 #include "wtf/text/StringBuilder.h" |
| 34 | 35 |
| 35 using std::swap; | 36 using std::swap; |
| 36 | 37 |
| 37 namespace blink { | 38 namespace blink { |
| 38 | 39 |
| 39 namespace { | 40 namespace { |
| 40 | 41 |
| 41 const unsigned invalidChildCount = ~0U; | 42 const unsigned invalidChildCount = ~0U; |
| 42 | 43 |
| 43 } // namespace | 44 } // namespace |
| 44 | 45 |
| 45 FrameTree::FrameTree(Frame* thisFrame) | 46 FrameTree::FrameTree(Frame* thisFrame) |
| 46 : m_thisFrame(thisFrame), m_scopedChildCount(invalidChildCount) {} | 47 : m_thisFrame(thisFrame), m_scopedChildCount(invalidChildCount) {} |
| 47 | 48 |
| 48 FrameTree::~FrameTree() {} | 49 FrameTree::~FrameTree() {} |
| 49 | 50 |
| 51 const AtomicString& FrameTree::name() const { |
| 52 // TODO(andypaicu): remove this once we have gathered the data |
| 53 if (m_experimentalSetNulledName) { |
| 54 UseCounter::count(m_thisFrame.get(), |
| 55 UseCounter::CrossOriginMainFrameNulledNameAccessed); |
| 56 } |
| 57 return m_name; |
| 58 } |
| 59 |
| 60 // TODO(andypaicu): remove this once we have gathered the data |
| 61 void FrameTree::experimentalSetNulledName() { |
| 62 m_experimentalSetNulledName = true; |
| 63 } |
| 64 |
| 50 void FrameTree::setName(const AtomicString& name) { | 65 void FrameTree::setName(const AtomicString& name) { |
| 66 // TODO(andypaicu): remove this once we have gathered the data |
| 67 m_experimentalSetNulledName = false; |
| 51 m_name = name; | 68 m_name = name; |
| 52 } | 69 } |
| 53 | 70 |
| 54 DISABLE_CFI_PERF | 71 DISABLE_CFI_PERF |
| 55 Frame* FrameTree::parent() const { | 72 Frame* FrameTree::parent() const { |
| 56 if (!m_thisFrame->client()) | 73 if (!m_thisFrame->client()) |
| 57 return nullptr; | 74 return nullptr; |
| 58 return m_thisFrame->client()->parent(); | 75 return m_thisFrame->client()->parent(); |
| 59 } | 76 } |
| 60 | 77 |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 void showFrameTree(const blink::Frame* frame) { | 295 void showFrameTree(const blink::Frame* frame) { |
| 279 if (!frame) { | 296 if (!frame) { |
| 280 printf("Null input frame\n"); | 297 printf("Null input frame\n"); |
| 281 return; | 298 return; |
| 282 } | 299 } |
| 283 | 300 |
| 284 printFrames(frame->tree().top(), frame, 0); | 301 printFrames(frame->tree().top(), frame, 0); |
| 285 } | 302 } |
| 286 | 303 |
| 287 #endif | 304 #endif |
| OLD | NEW |