 Chromium Code Reviews
 Chromium Code Reviews Issue 657263002:
  Disallow script execution after unload event dispatch in frame detach.  (Closed) 
  Base URL: svn://svn.chromium.org/blink/trunk
    
  
    Issue 657263002:
  Disallow script execution after unload event dispatch in frame detach.  (Closed) 
  Base URL: svn://svn.chromium.org/blink/trunk| 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 "core/frame/RemoteFrame.h" | 6 #include "core/frame/RemoteFrame.h" | 
| 7 | 7 | 
| 8 #include "core/frame/RemoteFrameClient.h" | 8 #include "core/frame/RemoteFrameClient.h" | 
| 9 #include "core/frame/RemoteFrameView.h" | 9 #include "core/frame/RemoteFrameView.h" | 
| 10 #include "core/html/HTMLFrameOwnerElement.h" | 10 #include "core/html/HTMLFrameOwnerElement.h" | 
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 // correct referrer, since it won't have access to the originDocument. Set i t now. | 33 // correct referrer, since it won't have access to the originDocument. Set i t now. | 
| 34 ResourceRequest request(url); | 34 ResourceRequest request(url); | 
| 35 Referrer referrer(SecurityPolicy::generateReferrerHeader(originDocument.refe rrerPolicy(), url, originDocument.outgoingReferrer()), originDocument.referrerPo licy()); | 35 Referrer referrer(SecurityPolicy::generateReferrerHeader(originDocument.refe rrerPolicy(), url, originDocument.outgoingReferrer()), originDocument.referrerPo licy()); | 
| 36 request.setHTTPReferrer(referrer); | 36 request.setHTTPReferrer(referrer); | 
| 37 remoteFrameClient()->navigate(request, lockBackForwardList); | 37 remoteFrameClient()->navigate(request, lockBackForwardList); | 
| 38 } | 38 } | 
| 39 | 39 | 
| 40 void RemoteFrame::detach() | 40 void RemoteFrame::detach() | 
| 41 { | 41 { | 
| 42 detachChildren(); | 42 detachChildren(); | 
| 43 if (!client()) | |
| 
dcheng
2014/10/16 01:21:32
I'm not sure if this condition is ever true at the
 | |
| 44 return; | |
| 43 Frame::detach(); | 45 Frame::detach(); | 
| 44 } | 46 } | 
| 45 | 47 | 
| 46 void RemoteFrame::trace(Visitor* visitor) | 48 void RemoteFrame::trace(Visitor* visitor) | 
| 47 { | 49 { | 
| 48 visitor->trace(m_view); | 50 visitor->trace(m_view); | 
| 49 Frame::trace(visitor); | 51 Frame::trace(visitor); | 
| 50 } | 52 } | 
| 51 | 53 | 
| 52 void RemoteFrame::setView(PassRefPtrWillBeRawPtr<RemoteFrameView> view) | 54 void RemoteFrame::setView(PassRefPtrWillBeRawPtr<RemoteFrameView> view) | 
| (...skipping 14 matching lines...) Expand all Loading... | |
| 67 owner->setWidget(view); | 69 owner->setWidget(view); | 
| 68 } | 70 } | 
| 69 } | 71 } | 
| 70 | 72 | 
| 71 RemoteFrameClient* RemoteFrame::remoteFrameClient() const | 73 RemoteFrameClient* RemoteFrame::remoteFrameClient() const | 
| 72 { | 74 { | 
| 73 return static_cast<RemoteFrameClient*>(client()); | 75 return static_cast<RemoteFrameClient*>(client()); | 
| 74 } | 76 } | 
| 75 | 77 | 
| 76 } // namespace blink | 78 } // namespace blink | 
| OLD | NEW |