Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: content/browser/frame_host/interstitial_page_impl.cc

Issue 2945163002: Avoid use-after-free when InterstitialPageImpl is being torn down. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/interstitial_page_navigator_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/frame_host/interstitial_page_impl.h" 5 #include "content/browser/frame_host/interstitial_page_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 SiteInstance* instance) { 804 SiteInstance* instance) {
805 return session_storage_namespace_.get(); 805 return session_storage_namespace_.get();
806 } 806 }
807 807
808 FrameTree* InterstitialPageImpl::GetFrameTree() { 808 FrameTree* InterstitialPageImpl::GetFrameTree() {
809 return frame_tree_.get(); 809 return frame_tree_.get();
810 } 810 }
811 811
812 void InterstitialPageImpl::Disable() { 812 void InterstitialPageImpl::Disable() {
813 enabled_ = false; 813 enabled_ = false;
814
815 // Also let the InterstitialPageNavigatorImpl know.
816 static_cast<InterstitialPageNavigatorImpl*>(frame_tree_->root()->navigator())
817 ->Disable();
814 } 818 }
815 819
816 void InterstitialPageImpl::Shutdown() { 820 void InterstitialPageImpl::Shutdown() {
817 delete this; 821 delete this;
818 } 822 }
819 823
820 void InterstitialPageImpl::OnNavigatingAwayOrTabClosing() { 824 void InterstitialPageImpl::OnNavigatingAwayOrTabClosing() {
821 if (action_taken_ == NO_ACTION) { 825 if (action_taken_ == NO_ACTION) {
822 // We are navigating away from the interstitial or closing a tab with an 826 // We are navigating away from the interstitial or closing a tab with an
823 // interstitial. Default to DontProceed(). We don't just call Hide as 827 // interstitial. Default to DontProceed(). We don't just call Hide as
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 RenderWidgetHostInputEventRouter* InterstitialPageImpl::GetInputEventRouter() { 996 RenderWidgetHostInputEventRouter* InterstitialPageImpl::GetInputEventRouter() {
993 WebContentsImpl* web_contents_impl = 997 WebContentsImpl* web_contents_impl =
994 static_cast<WebContentsImpl*>(web_contents_); 998 static_cast<WebContentsImpl*>(web_contents_);
995 if (!web_contents_impl) 999 if (!web_contents_impl)
996 return nullptr; 1000 return nullptr;
997 1001
998 return web_contents_impl->GetInputEventRouter(); 1002 return web_contents_impl->GetInputEventRouter();
999 } 1003 }
1000 1004
1001 } // namespace content 1005 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/interstitial_page_navigator_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698