| 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 "content/browser/loader/cross_site_resource_handler.h" | 7 #include "content/browser/loader/cross_site_resource_handler.h" |
| 8 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 8 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 9 #include "content/browser/loader/resource_request_info_impl.h" | 9 #include "content/browser/loader/resource_request_info_impl.h" |
| 10 #include "content/browser/transition_request_manager.h" | 10 #include "content/browser/transition_request_manager.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 did_defer_response_ = info->cross_site_handler()->did_defer_for_testing(); | 80 did_defer_response_ = info->cross_site_handler()->did_defer_for_testing(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void RequestComplete(net::URLRequest* url_request) override { | 83 void RequestComplete(net::URLRequest* url_request) override { |
| 84 if (is_transition_request_) { | 84 if (is_transition_request_) { |
| 85 ResourceRequestInfoImpl* info = | 85 ResourceRequestInfoImpl* info = |
| 86 ResourceRequestInfoImpl::ForRequest(request_); | 86 ResourceRequestInfoImpl::ForRequest(request_); |
| 87 TransitionLayerData transition_data; | 87 TransitionLayerData transition_data; |
| 88 did_clear_data_ = !TransitionRequestManager::GetInstance( | 88 did_clear_data_ = !TransitionRequestManager::GetInstance( |
| 89 )->GetPendingTransitionRequest(info->GetChildID(), | 89 )->HasPendingTransitionRequest(info->GetChildID(), |
| 90 info->GetRenderFrameID(), | 90 info->GetRenderFrameID(), |
| 91 request_->url(), | 91 request_->url(), |
| 92 &transition_data); | 92 &transition_data); |
| 93 } | 93 } |
| 94 } | 94 } |
| 95 | 95 |
| 96 void set_pending_transition_request(bool is_transition_request) { | 96 void set_pending_transition_request(bool is_transition_request) { |
| 97 is_transition_request_ = is_transition_request; | 97 is_transition_request_ = is_transition_request; |
| 98 } | 98 } |
| 99 | 99 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 ResourceDispatcherHost::Get()->SetDelegate(observer.get()); | 182 ResourceDispatcherHost::Get()->SetDelegate(observer.get()); |
| 183 observer->set_pending_transition_request(true); | 183 observer->set_pending_transition_request(true); |
| 184 | 184 |
| 185 NavigateToURL(shell(), embedded_test_server()->GetURL("/title1.html")); | 185 NavigateToURL(shell(), embedded_test_server()->GetURL("/title1.html")); |
| 186 WaitForLoadStop(shell()->web_contents()); | 186 WaitForLoadStop(shell()->web_contents()); |
| 187 | 187 |
| 188 EXPECT_TRUE(observer->did_clear_data()); | 188 EXPECT_TRUE(observer->did_clear_data()); |
| 189 } | 189 } |
| 190 | 190 |
| 191 } // namespace content | 191 } // namespace content |
| OLD | NEW |