| 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 "public/web/WebFrame.h" | 5 #include "public/web/WebFrame.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/WindowProxyManager.h" | 7 #include "bindings/core/v8/WindowProxyManager.h" |
| 8 #include "core/frame/FrameHost.h" | 8 #include "core/frame/FrameHost.h" |
| 9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "web/RemoteFrameOwner.h" | 21 #include "web/RemoteFrameOwner.h" |
| 22 #include "web/WebLocalFrameImpl.h" | 22 #include "web/WebLocalFrameImpl.h" |
| 23 #include "web/WebRemoteFrameImpl.h" | 23 #include "web/WebRemoteFrameImpl.h" |
| 24 #include <algorithm> | 24 #include <algorithm> |
| 25 | 25 |
| 26 namespace blink { | 26 namespace blink { |
| 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 RefPtrWillBeRawPtr<Frame> oldFrame = toImplBase()->frame(); | 31 RawPtr<Frame> oldFrame = toImplBase()->frame(); |
| 32 #if !ENABLE(OILPAN) | 32 #if !ENABLE(OILPAN) |
| 33 RefPtr<WebFrameImplBase> protectThis = toImplBase(); | 33 RefPtr<WebFrameImplBase> protectThis = toImplBase(); |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 // Unload the current Document in this frame: this calls unload handlers, | 36 // Unload the current Document in this frame: this calls unload handlers, |
| 37 // detaches child frames, etc. Since this runs script, make sure this frame | 37 // detaches child frames, etc. Since this runs script, make sure this frame |
| 38 // wasn't detached before continuing with the swap. | 38 // wasn't detached before continuing with the swap. |
| 39 // FIXME: There is no unit test for this condition, so one needs to be | 39 // FIXME: There is no unit test for this condition, so one needs to be |
| 40 // written. | 40 // written. |
| 41 if (!oldFrame->prepareForCommit()) | 41 if (!oldFrame->prepareForCommit()) |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 Frame* frame = toImplBase()->frame(); | 269 Frame* frame = toImplBase()->frame(); |
| 270 if (!frame) | 270 if (!frame) |
| 271 return 0; | 271 return 0; |
| 272 // FIXME: It's not clear this should ever be called to find a remote frame. | 272 // FIXME: It's not clear this should ever be called to find a remote frame. |
| 273 // Perhaps just disallow that completely? | 273 // Perhaps just disallow that completely? |
| 274 return fromFrame(frame->tree().child(name)); | 274 return fromFrame(frame->tree().child(name)); |
| 275 } | 275 } |
| 276 | 276 |
| 277 WebFrame* WebFrame::fromFrameOwnerElement(const WebElement& webElement) | 277 WebFrame* WebFrame::fromFrameOwnerElement(const WebElement& webElement) |
| 278 { | 278 { |
| 279 Element* element = PassRefPtrWillBeRawPtr<Element>(webElement).get(); | 279 Element* element = RawPtr<Element>(webElement).get(); |
| 280 | 280 |
| 281 if (!element->isFrameOwnerElement()) | 281 if (!element->isFrameOwnerElement()) |
| 282 return nullptr; | 282 return nullptr; |
| 283 return fromFrame(toHTMLFrameOwnerElement(element)->contentFrame()); | 283 return fromFrame(toHTMLFrameOwnerElement(element)->contentFrame()); |
| 284 } | 284 } |
| 285 | 285 |
| 286 bool WebFrame::isLoading() const | 286 bool WebFrame::isLoading() const |
| 287 { | 287 { |
| 288 if (Frame* frame = toImplBase()->frame()) | 288 if (Frame* frame = toImplBase()->frame()) |
| 289 return frame->isLoading(); | 289 return frame->isLoading(); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 void WebFrame::traceFrames(VisitorDispatcher visitor, WebFrame* frame) { tra
ceFramesImpl(visitor, frame); } \ | 364 void WebFrame::traceFrames(VisitorDispatcher visitor, WebFrame* frame) { tra
ceFramesImpl(visitor, frame); } \ |
| 365 void WebFrame::clearWeakFrames(VisitorDispatcher visitor) { clearWeakFramesI
mpl(visitor); } | 365 void WebFrame::clearWeakFrames(VisitorDispatcher visitor) { clearWeakFramesI
mpl(visitor); } |
| 366 | 366 |
| 367 DEFINE_VISITOR_METHOD(Visitor*) | 367 DEFINE_VISITOR_METHOD(Visitor*) |
| 368 DEFINE_VISITOR_METHOD(InlinedGlobalMarkingVisitor) | 368 DEFINE_VISITOR_METHOD(InlinedGlobalMarkingVisitor) |
| 369 | 369 |
| 370 #undef DEFINE_VISITOR_METHOD | 370 #undef DEFINE_VISITOR_METHOD |
| 371 #endif | 371 #endif |
| 372 | 372 |
| 373 } // namespace blink | 373 } // namespace blink |
| OLD | NEW |