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

Side by Side Diff: chrome/browser/renderer_host/render_widget_host_view_win.cc

Issue 284019: Speculative fix for a crash where RenderWidgetHostViewWin tries to access a d... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/renderer_host/render_widget_host_view_win.h" 5 #include "chrome/browser/renderer_host/render_widget_host_view_win.h"
6 6
7 #include "app/gfx/canvas.h" 7 #include "app/gfx/canvas.h"
8 #include "app/gfx/gdi_util.h" 8 #include "app/gfx/gdi_util.h"
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/l10n_util_win.h" 10 #include "app/l10n_util_win.h"
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 DestroyWindow(); 623 DestroyWindow();
624 } 624 }
625 625
626 void RenderWidgetHostViewWin::Destroy() { 626 void RenderWidgetHostViewWin::Destroy() {
627 // We've been told to destroy. 627 // We've been told to destroy.
628 // By clearing close_on_deactivate_, we prevent further deactivations 628 // By clearing close_on_deactivate_, we prevent further deactivations
629 // (caused by windows messages resulting from the DestroyWindow) from 629 // (caused by windows messages resulting from the DestroyWindow) from
630 // triggering further destructions. The deletion of this is handled by 630 // triggering further destructions. The deletion of this is handled by
631 // OnFinalMessage(); 631 // OnFinalMessage();
632 close_on_deactivate_ = false; 632 close_on_deactivate_ = false;
633
634 // In case OnFinalMessage() does not get called before DestroyWindow()
635 // returns, make sure we don't try to access |render_widget_host_| later.
636 // http://crbug.com/24248
637 render_widget_host_ = NULL;
638
633 DestroyWindow(); 639 DestroyWindow();
634 } 640 }
635 641
636 void RenderWidgetHostViewWin::SetTooltipText(const std::wstring& tooltip_text) { 642 void RenderWidgetHostViewWin::SetTooltipText(const std::wstring& tooltip_text) {
637 // Clamp the tooltip length to kMaxTooltipLength so that we don't 643 // Clamp the tooltip length to kMaxTooltipLength so that we don't
638 // accidentally DOS the user with a mega tooltip (since Windows doesn't seem 644 // accidentally DOS the user with a mega tooltip (since Windows doesn't seem
639 // to do this itself). 645 // to do this itself).
640 const std::wstring& new_tooltip_text = 646 const std::wstring& new_tooltip_text =
641 l10n_util::TruncateString(tooltip_text, kMaxTooltipLength); 647 l10n_util::TruncateString(tooltip_text, kMaxTooltipLength);
642 648
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 1265
1260 // Create a reference to BrowserAccessibility which MSAA will marshall to 1266 // Create a reference to BrowserAccessibility which MSAA will marshall to
1261 // the client. 1267 // the client.
1262 reference_result = LresultFromObject(IID_IAccessible, wparam, 1268 reference_result = LresultFromObject(IID_IAccessible, wparam,
1263 static_cast<IAccessible*>(browser_accessibility_root_)); 1269 static_cast<IAccessible*>(browser_accessibility_root_));
1264 } 1270 }
1265 return reference_result; 1271 return reference_result;
1266 } 1272 }
1267 1273
1268 void RenderWidgetHostViewWin::OnFinalMessage(HWND window) { 1274 void RenderWidgetHostViewWin::OnFinalMessage(HWND window) {
1269 render_widget_host_->ViewDestroyed(); 1275 if (render_widget_host_)
1276 render_widget_host_->ViewDestroyed();
1270 delete this; 1277 delete this;
1271 } 1278 }
1272 1279
1273 void RenderWidgetHostViewWin::TrackMouseLeave(bool track) { 1280 void RenderWidgetHostViewWin::TrackMouseLeave(bool track) {
1274 if (track == track_mouse_leave_) 1281 if (track == track_mouse_leave_)
1275 return; 1282 return;
1276 track_mouse_leave_ = track; 1283 track_mouse_leave_ = track;
1277 1284
1278 DCHECK(m_hWnd); 1285 DCHECK(m_hWnd);
1279 1286
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1349 // WM_LBUTTONDOWN. 1356 // WM_LBUTTONDOWN.
1350 SetFocus(); 1357 SetFocus();
1351 } 1358 }
1352 } 1359 }
1353 1360
1354 void RenderWidgetHostViewWin::ShutdownHost() { 1361 void RenderWidgetHostViewWin::ShutdownHost() {
1355 shutdown_factory_.RevokeAll(); 1362 shutdown_factory_.RevokeAll();
1356 render_widget_host_->Shutdown(); 1363 render_widget_host_->Shutdown();
1357 // Do not touch any members at this point, |this| has been deleted. 1364 // Do not touch any members at this point, |this| has been deleted.
1358 } 1365 }
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