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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2341503002: Fix race condition causing DCHECK(ack_pending_) to trip. (Closed)
Patch Set: Update test Created 4 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after
1783 frame_tree_node_->IsMainFrame() 1783 frame_tree_node_->IsMainFrame()
1784 ? render_view_host_->GetWidget()->GetView() 1784 ? render_view_host_->GetWidget()->GetView()
1785 : frame_tree_node_->frame_tree() 1785 : frame_tree_node_->frame_tree()
1786 ->GetMainFrame() 1786 ->GetMainFrame()
1787 ->render_view_host_->GetWidget() 1787 ->render_view_host_->GetWidget()
1788 ->GetView()); 1788 ->GetView());
1789 } 1789 }
1790 1790
1791 void RenderFrameHostImpl::OnAccessibilityEvents( 1791 void RenderFrameHostImpl::OnAccessibilityEvents(
1792 const std::vector<AccessibilityHostMsg_EventParams>& params, 1792 const std::vector<AccessibilityHostMsg_EventParams>& params,
1793 int reset_token) { 1793 int reset_token, int ack_token) {
1794 // Don't process this IPC if either we're waiting on a reset and this 1794 // Don't process this IPC if either we're waiting on a reset and this
1795 // IPC doesn't have the matching token ID, or if we're not waiting on a 1795 // IPC doesn't have the matching token ID, or if we're not waiting on a
1796 // reset but this message includes a reset token. 1796 // reset but this message includes a reset token.
1797 if (accessibility_reset_token_ != reset_token) { 1797 if (accessibility_reset_token_ != reset_token) {
1798 Send(new AccessibilityMsg_Events_ACK(routing_id_)); 1798 Send(new AccessibilityMsg_Events_ACK(routing_id_, ack_token));
1799 return; 1799 return;
1800 } 1800 }
1801 accessibility_reset_token_ = 0; 1801 accessibility_reset_token_ = 0;
1802 1802
1803 RenderWidgetHostViewBase* view = GetViewForAccessibility(); 1803 RenderWidgetHostViewBase* view = GetViewForAccessibility();
1804 1804
1805 AccessibilityMode accessibility_mode = delegate_->GetAccessibilityMode(); 1805 AccessibilityMode accessibility_mode = delegate_->GetAccessibilityMode();
1806 if ((accessibility_mode != AccessibilityModeOff) && view && is_active()) { 1806 if ((accessibility_mode != AccessibilityModeOff) && view && is_active()) {
1807 if (accessibility_mode & AccessibilityModeFlagPlatform) 1807 if (accessibility_mode & AccessibilityModeFlagPlatform)
1808 GetOrCreateBrowserAccessibilityManager(); 1808 GetOrCreateBrowserAccessibilityManager();
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1858 } else { 1858 } else {
1859 CHECK(ax_tree_for_testing_->Unserialize(detail.update)) 1859 CHECK(ax_tree_for_testing_->Unserialize(detail.update))
1860 << ax_tree_for_testing_->error(); 1860 << ax_tree_for_testing_->error();
1861 } 1861 }
1862 accessibility_testing_callback_.Run(this, detail.event_type, detail.id); 1862 accessibility_testing_callback_.Run(this, detail.event_type, detail.id);
1863 } 1863 }
1864 } 1864 }
1865 } 1865 }
1866 1866
1867 // Always send an ACK or the renderer can be in a bad state. 1867 // Always send an ACK or the renderer can be in a bad state.
1868 Send(new AccessibilityMsg_Events_ACK(routing_id_)); 1868 Send(new AccessibilityMsg_Events_ACK(routing_id_, ack_token));
1869 } 1869 }
1870 1870
1871 void RenderFrameHostImpl::OnAccessibilityLocationChanges( 1871 void RenderFrameHostImpl::OnAccessibilityLocationChanges(
1872 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params) { 1872 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params) {
1873 if (accessibility_reset_token_) 1873 if (accessibility_reset_token_)
1874 return; 1874 return;
1875 1875
1876 RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>( 1876 RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>(
1877 render_view_host_->GetWidget()->GetView()); 1877 render_view_host_->GetWidget()->GetView());
1878 if (view && is_active()) { 1878 if (view && is_active()) {
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after
3056 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( 3056 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind(
3057 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); 3057 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this)));
3058 return web_bluetooth_service_.get(); 3058 return web_bluetooth_service_.get();
3059 } 3059 }
3060 3060
3061 void RenderFrameHostImpl::DeleteWebBluetoothService() { 3061 void RenderFrameHostImpl::DeleteWebBluetoothService() {
3062 web_bluetooth_service_.reset(); 3062 web_bluetooth_service_.reset();
3063 } 3063 }
3064 3064
3065 } // namespace content 3065 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/common/accessibility_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698