OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "config.h" | 5 #include "config.h" |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 | 10 |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 // the main frame, a sub-frame, or the sub-objects in that document. | 217 // the main frame, a sub-frame, or the sub-objects in that document. |
218 request.setTargetType(DetermineTargetTypeFromLoader(loader)); | 218 request.setTargetType(DetermineTargetTypeFromLoader(loader)); |
219 } | 219 } |
220 | 220 |
221 // Inherit the policy URL from the request's frame. However, if the request | 221 // Inherit the policy URL from the request's frame. However, if the request |
222 // is for a main frame, the current document's policyBaseURL is the old | 222 // is for a main frame, the current document's policyBaseURL is the old |
223 // document, so we leave policyURL empty to indicate that the request is a | 223 // document, so we leave policyURL empty to indicate that the request is a |
224 // first-party request. | 224 // first-party request. |
225 if (request.targetType() != ResourceRequest::TargetIsMainFrame && | 225 if (request.targetType() != ResourceRequest::TargetIsMainFrame && |
226 webframe_->frame()->document()) { | 226 webframe_->frame()->document()) { |
227 request.setPolicyURL(webframe_->frame()->document()->policyBaseURL()); | 227 request.setPolicyURL( |
| 228 webframe_->frame()->document()->firstPartyForCookies()); |
228 } | 229 } |
229 | 230 |
230 // FrameLoader::loadEmptyDocumentSynchronously() creates an empty document | 231 // FrameLoader::loadEmptyDocumentSynchronously() creates an empty document |
231 // with no URL. We don't like that, so we'll rename it to about:blank. | 232 // with no URL. We don't like that, so we'll rename it to about:blank. |
232 if (request.url().isEmpty()) | 233 if (request.url().isEmpty()) |
233 request.setURL(KURL("about:blank")); | 234 request.setURL(KURL("about:blank")); |
234 if (request.mainDocumentURL().isEmpty()) | 235 if (request.firstPartyForCookies().isEmpty()) |
235 request.setMainDocumentURL(KURL("about:blank")); | 236 request.setFirstPartyForCookies(KURL("about:blank")); |
236 | 237 |
237 // Give the delegate a crack at the request. | 238 // Give the delegate a crack at the request. |
238 WebViewImpl* webview = webframe_->GetWebViewImpl(); | 239 WebViewImpl* webview = webframe_->GetWebViewImpl(); |
239 WebViewDelegate* d = webview->delegate(); | 240 WebViewDelegate* d = webview->delegate(); |
240 if (d) { | 241 if (d) { |
241 WebRequestImpl webreq(request); | 242 WebRequestImpl webreq(request); |
242 d->WillSendRequest(webview, identifier, &webreq); | 243 d->WillSendRequest(webview, identifier, &webreq); |
243 request = webreq.frame_load_request().resourceRequest(); | 244 request = webreq.frame_load_request().resourceRequest(); |
244 } | 245 } |
245 NetAgentImpl* net_agent = GetNetAgentImpl(); | 246 NetAgentImpl* net_agent = GetNetAgentImpl(); |
(...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1658 if (!web_view) { | 1659 if (!web_view) { |
1659 return NULL; | 1660 return NULL; |
1660 } | 1661 } |
1661 WebDevToolsAgentImpl* tools_agent = web_view->GetWebDevToolsAgentImpl(); | 1662 WebDevToolsAgentImpl* tools_agent = web_view->GetWebDevToolsAgentImpl(); |
1662 if (tools_agent) { | 1663 if (tools_agent) { |
1663 return tools_agent->net_agent_impl(); | 1664 return tools_agent->net_agent_impl(); |
1664 } else { | 1665 } else { |
1665 return NULL; | 1666 return NULL; |
1666 } | 1667 } |
1667 } | 1668 } |
OLD | NEW |