| OLD | NEW |
| 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/devtools/render_frame_devtools_agent_host.h" | 5 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
| 6 | 6 |
| 7 #include <tuple> | 7 #include <tuple> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/guid.h" | 10 #include "base/guid.h" |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 } | 642 } |
| 643 DCHECK(CheckConsistency()); | 643 DCHECK(CheckConsistency()); |
| 644 } | 644 } |
| 645 | 645 |
| 646 void RenderFrameDevToolsAgentHost::DidFinishNavigation( | 646 void RenderFrameDevToolsAgentHost::DidFinishNavigation( |
| 647 NavigationHandle* navigation_handle) { | 647 NavigationHandle* navigation_handle) { |
| 648 // CommitPending may destruct |this|. | 648 // CommitPending may destruct |this|. |
| 649 scoped_refptr<RenderFrameDevToolsAgentHost> protect(this); | 649 scoped_refptr<RenderFrameDevToolsAgentHost> protect(this); |
| 650 | 650 |
| 651 if (!IsBrowserSideNavigationEnabled()) { | 651 if (!IsBrowserSideNavigationEnabled()) { |
| 652 if (navigation_handle->IsErrorPage()) { | 652 if (navigation_handle->HasCommitted() && |
| 653 if (pending_ && | 653 !navigation_handle->IsErrorPage()) { |
| 654 pending_->host() == navigation_handle->GetRenderFrameHost()) { | |
| 655 DiscardPending(); | |
| 656 } | |
| 657 } else if (navigation_handle->HasCommitted()) { | |
| 658 if (pending_ && | 654 if (pending_ && |
| 659 pending_->host() == navigation_handle->GetRenderFrameHost()) { | 655 pending_->host() == navigation_handle->GetRenderFrameHost()) { |
| 660 CommitPending(); | 656 CommitPending(); |
| 661 } | 657 } |
| 662 if (session()) | 658 if (session()) |
| 663 protocol::TargetHandler::FromSession(session())->UpdateServiceWorkers(); | 659 protocol::TargetHandler::FromSession(session())->UpdateServiceWorkers(); |
| 660 } else if (pending_ && |
| 661 pending_->host() == navigation_handle->GetRenderFrameHost()) { |
| 662 DiscardPending(); |
| 664 } | 663 } |
| 665 DCHECK(CheckConsistency()); | 664 DCHECK(CheckConsistency()); |
| 666 return; | 665 return; |
| 667 } | 666 } |
| 668 | 667 |
| 669 // If the navigation is not tracked, return; | 668 // If the navigation is not tracked, return; |
| 670 if (navigating_handles_.count(navigation_handle) == 0) | 669 if (navigating_handles_.count(navigation_handle) == 0) |
| 671 return; | 670 return; |
| 672 | 671 |
| 673 // Now that the navigation is finished, remove the handle from the list of | 672 // Now that the navigation is finished, remove the handle from the list of |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1179 RenderFrameHost* host) { | 1178 RenderFrameHost* host) { |
| 1180 return (current_ && current_->host() == host) || | 1179 return (current_ && current_->host() == host) || |
| 1181 (pending_ && pending_->host() == host); | 1180 (pending_ && pending_->host() == host); |
| 1182 } | 1181 } |
| 1183 | 1182 |
| 1184 bool RenderFrameDevToolsAgentHost::IsChildFrame() { | 1183 bool RenderFrameDevToolsAgentHost::IsChildFrame() { |
| 1185 return current_ && current_->host()->GetParent(); | 1184 return current_ && current_->host()->GetParent(); |
| 1186 } | 1185 } |
| 1187 | 1186 |
| 1188 } // namespace content | 1187 } // namespace content |
| OLD | NEW |