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

Side by Side Diff: chrome/browser/ssl_blocking_page.cc

Issue 1898: Fix crasher when closing tab with bad SSL constrained popup (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/ssl_uitest.cc » ('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 (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/ssl_blocking_page.h" 5 #include "chrome/browser/ssl_blocking_page.h"
6 6
7 #include "base/string_piece.h" 7 #include "base/string_piece.h"
8 #include "chrome/browser/browser.h" 8 #include "chrome/browser/browser.h"
9 #include "chrome/browser/browser_resources.h" 9 #include "chrome/browser/browser_resources.h"
10 #include "chrome/browser/cert_store.h" 10 #include "chrome/browser/cert_store.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 const NotificationSource& source, 164 const NotificationSource& source,
165 const NotificationDetails& details) { 165 const NotificationDetails& details) {
166 switch (type) { 166 switch (type) {
167 case NOTIFY_TAB_CLOSING: 167 case NOTIFY_TAB_CLOSING:
168 case NOTIFY_INTERSTITIAL_PAGE_CLOSED: { 168 case NOTIFY_INTERSTITIAL_PAGE_CLOSED: {
169 // We created a navigation entry for the interstitial, remove it. 169 // We created a navigation entry for the interstitial, remove it.
170 // Note that we don't remove the entry if we are closing all tabs so that 170 // Note that we don't remove the entry if we are closing all tabs so that
171 // the last entry is kept for the restoring on next start-up. 171 // the last entry is kept for the restoring on next start-up.
172 Browser* browser = Browser::GetBrowserForController(tab_->controller(), 172 Browser* browser = Browser::GetBrowserForController(tab_->controller(),
173 NULL); 173 NULL);
174 if (remove_last_entry_ && 174 // We may not have a browser (this is the case for constrained popups), in
175 // which case it does not matter if we do not remove the temporary entry
176 // as their navigation history is not saved.
177 if (remove_last_entry_ && browser &&
175 !browser->tabstrip_model()->closing_all()) { 178 !browser->tabstrip_model()->closing_all()) {
176 tab_->controller()->RemoveLastEntry(); 179 tab_->controller()->RemoveLastEntry();
177 } 180 }
178 delete this; 181 delete this;
179 break; 182 break;
180 } 183 }
181 case NOTIFY_DOM_OPERATION_RESPONSE: { 184 case NOTIFY_DOM_OPERATION_RESPONSE: {
182 std::string json = 185 std::string json =
183 Details<DomOperationNotificationDetails>(details)->json(); 186 Details<DomOperationNotificationDetails>(details)->json();
184 if (json == "1") { 187 if (json == "1") {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 }; 286 };
284 int i; 287 int i;
285 for (i = 0; i < static_cast<int>(extra_info.size()); i++) { 288 for (i = 0; i < static_cast<int>(extra_info.size()); i++) {
286 strings->SetString(keys[i], extra_info[i]); 289 strings->SetString(keys[i], extra_info[i]);
287 } 290 }
288 for (;i < 5; i++) { 291 for (;i < 5; i++) {
289 strings->SetString(keys[i], L""); 292 strings->SetString(keys[i], L"");
290 } 293 }
291 } 294 }
292 295
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ssl_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698