| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "public/web/WebFrame.h" | 6 #include "public/web/WebFrame.h" |
| 7 | 7 |
| 8 #include "core/frame/RemoteFrame.h" | 8 #include "core/frame/RemoteFrame.h" |
| 9 #include "core/html/HTMLFrameOwnerElement.h" | 9 #include "core/html/HTMLFrameOwnerElement.h" |
| 10 #include "platform/UserGestureIndicator.h" | 10 #include "platform/UserGestureIndicator.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 return 0; | 21 return 0; |
| 22 | 22 |
| 23 return frame->isWebLocalFrame() | 23 return frame->isWebLocalFrame() |
| 24 ? static_cast<Frame*>(toWebLocalFrameImpl(frame)->frame()) | 24 ? static_cast<Frame*>(toWebLocalFrameImpl(frame)->frame()) |
| 25 : toWebRemoteFrameImpl(frame)->frame(); | 25 : toWebRemoteFrameImpl(frame)->frame(); |
| 26 } | 26 } |
| 27 | 27 |
| 28 bool WebFrame::swap(WebFrame* frame) | 28 bool WebFrame::swap(WebFrame* frame) |
| 29 { | 29 { |
| 30 using std::swap; | 30 using std::swap; |
| 31 RefPtr<Frame> oldFrame = toCoreFrame(this); | 31 RefPtrWillBeRawPtr<Frame> oldFrame = toCoreFrame(this); |
| 32 | 32 |
| 33 // All child frames must be detached first. | 33 // All child frames must be detached first. |
| 34 oldFrame->detachChildren(); | 34 oldFrame->detachChildren(); |
| 35 | 35 |
| 36 // If the frame has been detached during detaching its children, return | 36 // If the frame has been detached during detaching its children, return |
| 37 // immediately. | 37 // immediately. |
| 38 // FIXME: There is no unit test for this condition, so one needs to be | 38 // FIXME: There is no unit test for this condition, so one needs to be |
| 39 // written. | 39 // written. |
| 40 if (!oldFrame->host()) | 40 if (!oldFrame->host()) |
| 41 return false; | 41 return false; |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 , m_opener(0) | 223 , m_opener(0) |
| 224 , m_openedFrameTracker(new OpenedFrameTracker) | 224 , m_openedFrameTracker(new OpenedFrameTracker) |
| 225 { | 225 { |
| 226 } | 226 } |
| 227 | 227 |
| 228 WebFrame::~WebFrame() | 228 WebFrame::~WebFrame() |
| 229 { | 229 { |
| 230 m_openedFrameTracker.reset(0); | 230 m_openedFrameTracker.reset(0); |
| 231 } | 231 } |
| 232 | 232 |
| 233 void WebFrame::traceChildren(Visitor* visitor, WebFrame* frame) |
| 234 { |
| 235 #if ENABLE(OILPAN) |
| 236 // Trace the children frames. |
| 237 WebFrame* child = frame ? frame->firstChild() : 0; |
| 238 while (child) { |
| 239 if (child->isWebLocalFrame()) |
| 240 visitor->trace(toWebLocalFrameImpl(child)); |
| 241 else |
| 242 visitor->trace(toWebRemoteFrameImpl(child)); |
| 243 |
| 244 child = child->nextSibling(); |
| 245 } |
| 246 #endif |
| 247 } |
| 248 |
| 233 } // namespace blink | 249 } // namespace blink |
| OLD | NEW |