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

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 2112923002: Fix crash when destroying a RenderWidgetHost that holds the pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: send privileged request through webcontents Created 4 years, 5 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
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 "content/browser/renderer_host/render_widget_host_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <set> 9 #include <set>
10 #include <tuple> 10 #include <tuple>
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after
1726 1726
1727 void RenderWidgetHostImpl::OnLockMouse(bool user_gesture, 1727 void RenderWidgetHostImpl::OnLockMouse(bool user_gesture,
1728 bool last_unlocked_by_target, 1728 bool last_unlocked_by_target,
1729 bool privileged) { 1729 bool privileged) {
1730 if (pending_mouse_lock_request_) { 1730 if (pending_mouse_lock_request_) {
1731 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); 1731 Send(new ViewMsg_LockMouse_ACK(routing_id_, false));
1732 return; 1732 return;
1733 } 1733 }
1734 1734
1735 pending_mouse_lock_request_ = true; 1735 pending_mouse_lock_request_ = true;
1736 if (delegate_) {
1737 delegate_->RequestToLockMouse(this, user_gesture, last_unlocked_by_target,
1738 privileged && allow_privileged_mouse_lock_);
1739 return;
1740 }
1741
1736 if (privileged && allow_privileged_mouse_lock_) { 1742 if (privileged && allow_privileged_mouse_lock_) {
1737 // Directly approve to lock the mouse. 1743 // Directly approve to lock the mouse.
1738 GotResponseToLockMouseRequest(true); 1744 GotResponseToLockMouseRequest(true);
1739 } else { 1745 } else {
1740 if (delegate_) { 1746 // Otherwise, just reject it.
1741 delegate_->RequestToLockMouse(this, user_gesture,
1742 last_unlocked_by_target);
1743 return;
1744 }
1745 // If there's no delegate, just reject it.
1746 GotResponseToLockMouseRequest(false); 1747 GotResponseToLockMouseRequest(false);
1747 } 1748 }
1748 } 1749 }
1749 1750
1750 void RenderWidgetHostImpl::OnUnlockMouse() { 1751 void RenderWidgetHostImpl::OnUnlockMouse() {
1751 RejectMouseLockOrUnlockIfNecessary(); 1752 RejectMouseLockOrUnlockIfNecessary();
1752 } 1753 }
1753 1754
1754 void RenderWidgetHostImpl::OnShowDisambiguationPopup( 1755 void RenderWidgetHostImpl::OnShowDisambiguationPopup(
1755 const gfx::Rect& rect_pixels, 1756 const gfx::Rect& rect_pixels,
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
2154 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; 2155 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL;
2155 } 2156 }
2156 2157
2157 BrowserAccessibilityManager* 2158 BrowserAccessibilityManager*
2158 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { 2159 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() {
2159 return delegate_ ? 2160 return delegate_ ?
2160 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; 2161 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL;
2161 } 2162 }
2162 2163
2163 } // namespace content 2164 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698