Chromium Code Reviews| 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 "core/frame/RemoteFrame.h" | 5 #include "core/frame/RemoteFrame.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/WindowProxy.h" | 7 #include "bindings/core/v8/WindowProxy.h" |
| 8 #include "bindings/core/v8/WindowProxyManager.h" | 8 #include "bindings/core/v8/WindowProxyManager.h" |
| 9 #include "core/dom/RemoteSecurityContext.h" | 9 #include "core/dom/RemoteSecurityContext.h" |
| 10 #include "core/frame/FrameHost.h" | 10 #include "core/frame/FrameHost.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 101 // persistent strong references to RemoteDOMWindow will prevent the GCing | 101 // persistent strong references to RemoteDOMWindow will prevent the GCing |
| 102 // of all these objects. Break the cycle by notifying of detachment. | 102 // of all these objects. Break the cycle by notifying of detachment. |
| 103 toRemoteDOMWindow(m_domWindow)->frameDetached(); | 103 toRemoteDOMWindow(m_domWindow)->frameDetached(); |
| 104 if (m_webLayer) | 104 if (m_webLayer) |
| 105 setWebLayer(nullptr); | 105 setWebLayer(nullptr); |
| 106 Frame::detach(type); | 106 Frame::detach(type); |
| 107 } | 107 } |
| 108 | 108 |
| 109 bool RemoteFrame::prepareForCommit() { | 109 bool RemoteFrame::prepareForCommit() { |
| 110 detachChildren(); | 110 detachChildren(); |
| 111 return !!host(); | 111 return !!page(); |
|
sashab
2017/03/24 00:33:05
Replacing this with page() != nullptr gives the er
haraken
2017/03/24 00:36:49
Yes, it's a common pattern.
| |
| 112 } | 112 } |
| 113 | 113 |
| 114 RemoteSecurityContext* RemoteFrame::securityContext() const { | 114 RemoteSecurityContext* RemoteFrame::securityContext() const { |
| 115 return m_securityContext.get(); | 115 return m_securityContext.get(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 bool RemoteFrame::shouldClose() { | 118 bool RemoteFrame::shouldClose() { |
| 119 // TODO(nasko): Implement running the beforeunload handler in the actual | 119 // TODO(nasko): Implement running the beforeunload handler in the actual |
| 120 // LocalFrame running in a different process and getting back a real result. | 120 // LocalFrame running in a different process and getting back a real result. |
| 121 return true; | 121 return true; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 169 FrameVector childrenToDetach; | 169 FrameVector childrenToDetach; |
| 170 childrenToDetach.reserveCapacity(tree().childCount()); | 170 childrenToDetach.reserveCapacity(tree().childCount()); |
| 171 for (Frame* child = tree().firstChild(); child; | 171 for (Frame* child = tree().firstChild(); child; |
| 172 child = child->tree().nextSibling()) | 172 child = child->tree().nextSibling()) |
| 173 childrenToDetach.push_back(child); | 173 childrenToDetach.push_back(child); |
| 174 for (const auto& child : childrenToDetach) | 174 for (const auto& child : childrenToDetach) |
| 175 child->detach(FrameDetachType::Remove); | 175 child->detach(FrameDetachType::Remove); |
| 176 } | 176 } |
| 177 | 177 |
| 178 } // namespace blink | 178 } // namespace blink |
| OLD | NEW |