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

Side by Side Diff: chrome/browser/ui/panels/panel_host.cc

Issue 11092066: [Panels] Fix favicon crash from using deleted WebContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/panels/panel_host.h" 5 #include "chrome/browser/ui/panels/panel_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "chrome/browser/chrome_page_zoom.h" 10 #include "chrome/browser/chrome_page_zoom.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 extensions::WindowController* window = GetExtensionWindowController(); 196 extensions::WindowController* window = GetExtensionWindowController();
197 render_view_host->Send(new ExtensionMsg_UpdateBrowserWindowId( 197 render_view_host->Send(new ExtensionMsg_UpdateBrowserWindowId(
198 render_view_host->GetRoutingID(), window->GetWindowId())); 198 render_view_host->GetRoutingID(), window->GetWindowId()));
199 } 199 }
200 200
201 void PanelHost::RenderViewGone(base::TerminationStatus status) { 201 void PanelHost::RenderViewGone(base::TerminationStatus status) {
202 CloseContents(web_contents_.get()); 202 CloseContents(web_contents_.get());
203 } 203 }
204 204
205 void PanelHost::WebContentsDestroyed(content::WebContents* web_contents) { 205 void PanelHost::WebContentsDestroyed(content::WebContents* web_contents) {
206 DCHECK(web_contents == web_contents_.get());
207 web_contents_.reset();
sky 2012/10/11 01:03:54 WebContentsDestroyed is invoked from ~WebContents
206 // Close the panel after we return to the message loop (not immediately, 208 // Close the panel after we return to the message loop (not immediately,
207 // otherwise, it may destroy this object before the stack has a chance 209 // otherwise, it may destroy this object before the stack has a chance
208 // to cleanly unwind.) 210 // to cleanly unwind.)
209 MessageLoop::current()->PostTask( 211 MessageLoop::current()->PostTask(
210 FROM_HERE, 212 FROM_HERE,
211 base::Bind(&PanelHost::ClosePanel, weak_factory_.GetWeakPtr())); 213 base::Bind(&PanelHost::ClosePanel, weak_factory_.GetWeakPtr()));
212 } 214 }
213 215
214 void PanelHost::ClosePanel() { 216 void PanelHost::ClosePanel() {
215 panel_->Close(); 217 panel_->Close();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 } 253 }
252 254
253 void PanelHost::StopLoading() { 255 void PanelHost::StopLoading() {
254 content::RecordAction(UserMetricsAction("Stop")); 256 content::RecordAction(UserMetricsAction("Stop"));
255 web_contents_->Stop(); 257 web_contents_->Stop();
256 } 258 }
257 259
258 void PanelHost::Zoom(content::PageZoom zoom) { 260 void PanelHost::Zoom(content::PageZoom zoom) {
259 chrome_page_zoom::Zoom(web_contents_.get(), zoom); 261 chrome_page_zoom::Zoom(web_contents_.get(), zoom);
260 } 262 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698