| OLD | NEW |
| 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 2190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2201 if (!ShouldDispatchBeforeUnload()) { | 2201 if (!ShouldDispatchBeforeUnload()) { |
| 2202 DCHECK(!(IsBrowserSideNavigationEnabled() && for_navigation)); | 2202 DCHECK(!(IsBrowserSideNavigationEnabled() && for_navigation)); |
| 2203 frame_tree_node_->render_manager()->OnBeforeUnloadACK( | 2203 frame_tree_node_->render_manager()->OnBeforeUnloadACK( |
| 2204 for_navigation, true, base::TimeTicks::Now()); | 2204 for_navigation, true, base::TimeTicks::Now()); |
| 2205 return; | 2205 return; |
| 2206 } | 2206 } |
| 2207 TRACE_EVENT_ASYNC_BEGIN1("navigation", "RenderFrameHostImpl BeforeUnload", | 2207 TRACE_EVENT_ASYNC_BEGIN1("navigation", "RenderFrameHostImpl BeforeUnload", |
| 2208 this, "&RenderFrameHostImpl", (void*)this); | 2208 this, "&RenderFrameHostImpl", (void*)this); |
| 2209 | 2209 |
| 2210 // This may be called more than once (if the user clicks the tab close button | 2210 // This may be called more than once (if the user clicks the tab close button |
| 2211 // several times, or if she clicks the tab close button then the browser close | 2211 // several times, or if they click the tab close button then the browser close |
| 2212 // button), and we only send the message once. | 2212 // button), and we only send the message once. |
| 2213 if (is_waiting_for_beforeunload_ack_) { | 2213 if (is_waiting_for_beforeunload_ack_) { |
| 2214 // Some of our close messages could be for the tab, others for cross-site | 2214 // Some of our close messages could be for the tab, others for cross-site |
| 2215 // transitions. We always want to think it's for closing the tab if any | 2215 // transitions. We always want to think it's for closing the tab if any |
| 2216 // of the messages were, since otherwise it might be impossible to close | 2216 // of the messages were, since otherwise it might be impossible to close |
| 2217 // (if there was a cross-site "close" request pending when the user clicked | 2217 // (if there was a cross-site "close" request pending when the user clicked |
| 2218 // the close button). We want to keep the "for cross site" flag only if | 2218 // the close button). We want to keep the "for cross site" flag only if |
| 2219 // both the old and the new ones are also for cross site. | 2219 // both the old and the new ones are also for cross site. |
| 2220 unload_ack_is_for_navigation_ = | 2220 unload_ack_is_for_navigation_ = |
| 2221 unload_ack_is_for_navigation_ && for_navigation; | 2221 unload_ack_is_for_navigation_ && for_navigation; |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2906 // handler after it's destroyed so it can't run after the RFHI is destroyed. | 2906 // handler after it's destroyed so it can't run after the RFHI is destroyed. |
| 2907 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( | 2907 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( |
| 2908 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); | 2908 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); |
| 2909 } | 2909 } |
| 2910 | 2910 |
| 2911 void RenderFrameHostImpl::DeleteWebBluetoothService() { | 2911 void RenderFrameHostImpl::DeleteWebBluetoothService() { |
| 2912 web_bluetooth_service_.reset(); | 2912 web_bluetooth_service_.reset(); |
| 2913 } | 2913 } |
| 2914 | 2914 |
| 2915 } // namespace content | 2915 } // namespace content |
| OLD | NEW |