Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Side by Side Diff: webkit/glue/resource_fetcher.cc

Issue 9314030: Set a proper first-party URL when fetching resources via ResourceFetcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "webkit/glue/resource_fetcher.h" 5 #include "webkit/glue/resource_fetcher.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebKitPlatfo rmSupport.h" 11 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebKitPlatfo rmSupport.h"
11 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError. h" 12 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError. h"
12 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLLoader .h" 13 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLLoader .h"
13 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques t.h" 14 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques t.h"
14 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" 15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
15 16
16 using base::TimeDelta; 17 using base::TimeDelta;
17 using WebKit::WebFrame; 18 using WebKit::WebFrame;
(...skipping 25 matching lines...) Expand all
43 void ResourceFetcher::Cancel() { 44 void ResourceFetcher::Cancel() {
44 if (!completed_) { 45 if (!completed_) {
45 loader_->cancel(); 46 loader_->cancel();
46 completed_ = true; 47 completed_ = true;
47 } 48 }
48 } 49 }
49 50
50 void ResourceFetcher::Start(WebFrame* frame) { 51 void ResourceFetcher::Start(WebFrame* frame) {
51 WebURLRequest request(url_); 52 WebURLRequest request(url_);
52 request.setTargetType(target_type_); 53 request.setTargetType(target_type_);
54 request.setFirstPartyForCookies(frame->document().firstPartyForCookies());
53 frame->dispatchWillSendRequest(request); 55 frame->dispatchWillSendRequest(request);
54 56
55 loader_.reset(WebKit::webKitPlatformSupport()->createURLLoader()); 57 loader_.reset(WebKit::webKitPlatformSupport()->createURLLoader());
56 loader_->loadAsynchronously(request, this); 58 loader_->loadAsynchronously(request, this);
57 } 59 }
58 60
59 void ResourceFetcher::RunCallback(const WebURLResponse& response, 61 void ResourceFetcher::RunCallback(const WebURLResponse& response,
60 const std::string& data) { 62 const std::string& data) {
61 if (callback_.is_null()) 63 if (callback_.is_null())
62 return; 64 return;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 136 }
135 137
136 void ResourceFetcherWithTimeout::TimeoutFired() { 138 void ResourceFetcherWithTimeout::TimeoutFired() {
137 if (!completed_) { 139 if (!completed_) {
138 loader_->cancel(); 140 loader_->cancel();
139 didFail(NULL, WebURLError()); 141 didFail(NULL, WebURLError());
140 } 142 }
141 } 143 }
142 144
143 } // namespace webkit_glue 145 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698