Chromium Code Reviews| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 234 void WebFrameLoaderClient::dispatchWillSendRequest( | 234 void WebFrameLoaderClient::dispatchWillSendRequest( |
| 235 DocumentLoader* loader, unsigned long identifier, ResourceRequest& request, | 235 DocumentLoader* loader, unsigned long identifier, ResourceRequest& request, |
| 236 const ResourceResponse& redirectResponse) { | 236 const ResourceResponse& redirectResponse) { |
| 237 | 237 |
| 238 if (loader) { | 238 if (loader) { |
| 239 // We want to distinguish between a request for a document to be loaded into | 239 // We want to distinguish between a request for a document to be loaded into |
| 240 // the main frame, a sub-frame, or the sub-objects in that document. | 240 // the main frame, a sub-frame, or the sub-objects in that document. |
| 241 request.setTargetType(DetermineTargetTypeFromLoader(loader)); | 241 request.setTargetType(DetermineTargetTypeFromLoader(loader)); |
| 242 } | 242 } |
| 243 | 243 |
| 244 // Inherit the first party for cookies from the request's frame. However, if | |
| 245 // the request is for a main frame, the current document's | |
| 246 // firstPartyForCookies is the old document, so we leave firstPartyForCookies | |
| 247 // empty to indicate that the request is a first-party request. | |
| 248 if (request.targetType() != ResourceRequest::TargetIsMainFrame && | |
|
darin (slow to review)
2009/07/12 03:45:40
Shouldn't this kind of logic live in WebCore? Or,
abarth-chromium
2009/07/12 08:10:51
This patch is just added back some code I accident
darin (slow to review)
2009/07/12 13:05:04
OK,LGTM
| |
| 249 webframe_->frame()->document()) { | |
| 250 request.setFirstPartyForCookies( | |
| 251 webframe_->frame()->document()->firstPartyForCookies()); | |
| 252 } | |
| 253 | |
| 244 // FrameLoader::loadEmptyDocumentSynchronously() creates an empty document | 254 // FrameLoader::loadEmptyDocumentSynchronously() creates an empty document |
| 245 // with no URL. We don't like that, so we'll rename it to about:blank. | 255 // with no URL. We don't like that, so we'll rename it to about:blank. |
| 246 if (request.url().isEmpty()) | 256 if (request.url().isEmpty()) |
| 247 request.setURL(KURL("about:blank")); | 257 request.setURL(KURL("about:blank")); |
| 248 if (request.firstPartyForCookies().isEmpty()) | 258 if (request.firstPartyForCookies().isEmpty()) |
| 249 request.setFirstPartyForCookies(KURL("about:blank")); | 259 request.setFirstPartyForCookies(KURL("about:blank")); |
| 250 | 260 |
| 251 // Give the delegate a crack at the request. | 261 // Give the delegate a crack at the request. |
| 252 WebViewImpl* webview = webframe_->GetWebViewImpl(); | 262 WebViewImpl* webview = webframe_->GetWebViewImpl(); |
| 253 WebViewDelegate* d = webview->delegate(); | 263 WebViewDelegate* d = webview->delegate(); |
| (...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1507 | 1517 |
| 1508 std::string offset_str = url.ExtractFileName(); | 1518 std::string offset_str = url.ExtractFileName(); |
| 1509 int offset; | 1519 int offset; |
| 1510 if (!StringToInt(offset_str, &offset)) | 1520 if (!StringToInt(offset_str, &offset)) |
| 1511 return; | 1521 return; |
| 1512 | 1522 |
| 1513 WebViewDelegate* d = webframe_->GetWebViewImpl()->delegate(); | 1523 WebViewDelegate* d = webframe_->GetWebViewImpl()->delegate(); |
| 1514 if (d) | 1524 if (d) |
| 1515 d->NavigateBackForwardSoon(offset); | 1525 d->NavigateBackForwardSoon(offset); |
| 1516 } | 1526 } |
| OLD | NEW |