| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "content/browser/frame_host/frame_navigation_entry.h" | 8 #include "content/browser/frame_host/frame_navigation_entry.h" |
| 9 #include "content/browser/frame_host/frame_tree.h" | 9 #include "content/browser/frame_host/frame_tree.h" |
| 10 #include "content/browser/frame_host/navigation_controller_impl.h" | 10 #include "content/browser/frame_host/navigation_controller_impl.h" |
| (...skipping 2032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2043 message_loop_runner_(new MessageLoopRunner) {} | 2043 message_loop_runner_(new MessageLoopRunner) {} |
| 2044 | 2044 |
| 2045 void Wait() { | 2045 void Wait() { |
| 2046 message_loop_runner_->Run(); | 2046 message_loop_runner_->Run(); |
| 2047 } | 2047 } |
| 2048 | 2048 |
| 2049 private: | 2049 private: |
| 2050 void DidFailLoad(RenderFrameHost* render_frame_host, | 2050 void DidFailLoad(RenderFrameHost* render_frame_host, |
| 2051 const GURL& validated_url, | 2051 const GURL& validated_url, |
| 2052 int error_code, | 2052 int error_code, |
| 2053 const base::string16& error_description) override { | 2053 const base::string16& error_description, |
| 2054 bool was_ignored_by_handler) override { |
| 2054 RenderFrameHostImpl* rfh = | 2055 RenderFrameHostImpl* rfh = |
| 2055 static_cast<RenderFrameHostImpl*>(render_frame_host); | 2056 static_cast<RenderFrameHostImpl*>(render_frame_host); |
| 2056 if (rfh->frame_tree_node()->frame_tree_node_id() != frame_tree_node_id_) | 2057 if (rfh->frame_tree_node()->frame_tree_node_id() != frame_tree_node_id_) |
| 2057 return; | 2058 return; |
| 2058 | 2059 |
| 2059 message_loop_runner_->Quit(); | 2060 message_loop_runner_->Quit(); |
| 2060 } | 2061 } |
| 2061 | 2062 |
| 2062 void DidFailProvisionalLoad( | 2063 void DidFailProvisionalLoad( |
| 2063 RenderFrameHost* render_frame_host, | 2064 RenderFrameHost* render_frame_host, |
| 2064 const GURL& validated_url, | 2065 const GURL& validated_url, |
| 2065 int error_code, | 2066 int error_code, |
| 2066 const base::string16& error_description) override { | 2067 const base::string16& error_description, |
| 2068 bool was_ignored_by_handler) override { |
| 2067 RenderFrameHostImpl* rfh = | 2069 RenderFrameHostImpl* rfh = |
| 2068 static_cast<RenderFrameHostImpl*>(render_frame_host); | 2070 static_cast<RenderFrameHostImpl*>(render_frame_host); |
| 2069 if (rfh->frame_tree_node()->frame_tree_node_id() != frame_tree_node_id_) | 2071 if (rfh->frame_tree_node()->frame_tree_node_id() != frame_tree_node_id_) |
| 2070 return; | 2072 return; |
| 2071 | 2073 |
| 2072 message_loop_runner_->Quit(); | 2074 message_loop_runner_->Quit(); |
| 2073 } | 2075 } |
| 2074 | 2076 |
| 2075 // The id of the FrameTreeNode whose navigations to observe. | 2077 // The id of the FrameTreeNode whose navigations to observe. |
| 2076 int frame_tree_node_id_; | 2078 int frame_tree_node_id_; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2117 // tricky. | 2119 // tricky. |
| 2118 EXPECT_EQ(nullptr, controller.GetPendingEntry()); | 2120 EXPECT_EQ(nullptr, controller.GetPendingEntry()); |
| 2119 shell()->web_contents()->Stop(); | 2121 shell()->web_contents()->Stop(); |
| 2120 watcher.Wait(); | 2122 watcher.Wait(); |
| 2121 } | 2123 } |
| 2122 | 2124 |
| 2123 ResourceDispatcherHost::Get()->SetDelegate(nullptr); | 2125 ResourceDispatcherHost::Get()->SetDelegate(nullptr); |
| 2124 } | 2126 } |
| 2125 | 2127 |
| 2126 } // namespace content | 2128 } // namespace content |
| OLD | NEW |