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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 request_(NULL), | 44 request_(NULL), |
45 did_defer_response_(false), | 45 did_defer_response_(false), |
46 is_transition_request_(false) { | 46 is_transition_request_(false) { |
47 } | 47 } |
48 | 48 |
49 virtual void RequestBeginning( | 49 virtual void RequestBeginning( |
50 net::URLRequest* request, | 50 net::URLRequest* request, |
51 ResourceContext* resource_context, | 51 ResourceContext* resource_context, |
52 AppCacheService* appcache_service, | 52 AppCacheService* appcache_service, |
53 ResourceType resource_type, | 53 ResourceType resource_type, |
54 int child_id, | |
55 int route_id, | |
56 ScopedVector<ResourceThrottle>* throttles) OVERRIDE { | 54 ScopedVector<ResourceThrottle>* throttles) OVERRIDE { |
57 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 55 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
58 ShellResourceDispatcherHostDelegate::RequestBeginning(request, | 56 ShellResourceDispatcherHostDelegate::RequestBeginning(request, |
59 resource_context, | 57 resource_context, |
60 appcache_service, | 58 appcache_service, |
61 resource_type, | 59 resource_type, |
62 child_id, | |
63 route_id, | |
64 throttles); | 60 throttles); |
65 request_ = request; | 61 request_ = request; |
66 | 62 |
67 ResourceRequestInfoImpl* info = | 63 ResourceRequestInfoImpl* info = |
68 ResourceRequestInfoImpl::ForRequest(request_); | 64 ResourceRequestInfoImpl::ForRequest(request_); |
69 | 65 |
70 if (is_transition_request_) { | 66 if (is_transition_request_) { |
71 TransitionRequestManager::GetInstance()->AddPendingTransitionRequestData( | 67 TransitionRequestManager::GetInstance()->AddPendingTransitionRequestData( |
72 child_id, info->GetRenderFrameID(), "*", "", ""); | 68 info->GetChildID(), info->GetRenderFrameID(), "*", "", ""); |
73 } | 69 } |
74 } | 70 } |
75 | 71 |
76 virtual void OnResponseStarted( | 72 virtual void OnResponseStarted( |
77 net::URLRequest* request, | 73 net::URLRequest* request, |
78 ResourceContext* resource_context, | 74 ResourceContext* resource_context, |
79 ResourceResponse* response, | 75 ResourceResponse* response, |
80 IPC::Sender* sender) OVERRIDE { | 76 IPC::Sender* sender) OVERRIDE { |
81 ResourceRequestInfoImpl* info = | 77 ResourceRequestInfoImpl* info = |
82 ResourceRequestInfoImpl::ForRequest(request_); | 78 ResourceRequestInfoImpl::ForRequest(request_); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 145 |
150 WaitForLoadStop(transition_web_contents.get()); | 146 WaitForLoadStop(transition_web_contents.get()); |
151 | 147 |
152 int transition_process_id = | 148 int transition_process_id = |
153 transition_web_contents->GetRenderProcessHost()->GetID(); | 149 transition_web_contents->GetRenderProcessHost()->GetID(); |
154 | 150 |
155 EXPECT_EQ(outgoing_process_id, transition_process_id); | 151 EXPECT_EQ(outgoing_process_id, transition_process_id); |
156 } | 152 } |
157 | 153 |
158 } // namespace content | 154 } // namespace content |
OLD | NEW |