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

Side by Side Diff: chrome/browser/tab_contents/interstitial_page.cc

Issue 56019: Fix crasher with SSL interstitial (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/browser/tab_contents/interstitial_page.h" 5 #include "chrome/browser/tab_contents/interstitial_page.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/thread.h" 9 #include "base/thread.h"
10 #include "chrome/browser/browser.h" 10 #include "chrome/browser/browser.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 126
127 InterstitialPage::~InterstitialPage() { 127 InterstitialPage::~InterstitialPage() {
128 InterstitialPageMap::iterator iter = tab_to_interstitial_page_->find(tab_); 128 InterstitialPageMap::iterator iter = tab_to_interstitial_page_->find(tab_);
129 DCHECK(iter != tab_to_interstitial_page_->end()); 129 DCHECK(iter != tab_to_interstitial_page_->end());
130 tab_to_interstitial_page_->erase(iter); 130 tab_to_interstitial_page_->erase(iter);
131 DCHECK(!render_view_host_); 131 DCHECK(!render_view_host_);
132 } 132 }
133 133
134 void InterstitialPage::Show() { 134 void InterstitialPage::Show() {
135 // If an interstitial is already showing, close it before showing the new one. 135 // If an interstitial is already showing, close it before showing the new one.
136 if (tab_->interstitial_page()) 136 // Be careful not to take an action on the old interstitial more than once.
137 tab_->interstitial_page()->DontProceed(); 137 if (tab_->interstitial_page()) {
138 if (tab_->interstitial_page()->action_taken())
139 tab_->interstitial_page()->Hide();
140 else
141 tab_->interstitial_page()->DontProceed();
142 }
138 143
139 // Block the resource requests for the render view host while it is hidden. 144 // Block the resource requests for the render view host while it is hidden.
140 TakeActionOnResourceDispatcher(BLOCK); 145 TakeActionOnResourceDispatcher(BLOCK);
141 // We need to be notified when the RenderViewHost is destroyed so we can 146 // We need to be notified when the RenderViewHost is destroyed so we can
142 // cancel the blocked requests. We cannot do that on 147 // cancel the blocked requests. We cannot do that on
143 // NOTIFY_TAB_CONTENTS_DESTROYED as at that point the RenderViewHost has 148 // NOTIFY_TAB_CONTENTS_DESTROYED as at that point the RenderViewHost has
144 // already been destroyed. 149 // already been destroyed.
145 notification_registrar_.Add( 150 notification_registrar_.Add(
146 this, NotificationType::RENDER_WIDGET_HOST_DESTROYED, 151 this, NotificationType::RENDER_WIDGET_HOST_DESTROYED,
147 Source<RenderWidgetHost>(tab_->render_view_host())); 152 Source<RenderWidgetHost>(tab_->render_view_host()));
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 void InterstitialPage::InterstitialPageRVHViewDelegate::HandleKeyboardEvent( 487 void InterstitialPage::InterstitialPageRVHViewDelegate::HandleKeyboardEvent(
483 const NativeWebKeyboardEvent& event) { 488 const NativeWebKeyboardEvent& event) {
484 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate()) 489 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate())
485 interstitial_page_->tab()->GetViewDelegate()->HandleKeyboardEvent(event); 490 interstitial_page_->tab()->GetViewDelegate()->HandleKeyboardEvent(event);
486 } 491 }
487 492
488 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( 493 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply(
489 int request_id, int number_of_matches, const gfx::Rect& selection_rect, 494 int request_id, int number_of_matches, const gfx::Rect& selection_rect,
490 int active_match_ordinal, bool final_update) { 495 int active_match_ordinal, bool final_update) {
491 } 496 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/interstitial_page.h ('k') | chrome/browser/tab_contents/web_contents_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698