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

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

Issue 46026: Get rid of stashing a frame pointer with ResourceRequest and just store the r... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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 | « webkit/glue/webframeloaderclient_impl.cc ('k') | webkit/glue/weburlrequest.h » ('j') | 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) 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 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 MSVC_PUSH_WARNING_LEVEL(0); 10 MSVC_PUSH_WARNING_LEVEL(0);
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 if (!client) { 1234 if (!client) {
1235 NOTREACHED(); 1235 NOTREACHED();
1236 return false; 1236 return false;
1237 } 1237 }
1238 1238
1239 WebCore::KURL kurl = webkit_glue::GURLToKURL(url); 1239 WebCore::KURL kurl = webkit_glue::GURLToKURL(url);
1240 1240
1241 ClientInfo info; 1241 ClientInfo info;
1242 info.id = resource_id; 1242 info.id = resource_id;
1243 info.client = client; 1243 info.client = client;
1244 info.request.setFrame(frame());
1245 info.request.setURL(kurl); 1244 info.request.setURL(kurl);
1246 info.request.setOriginPid(delegate_->GetProcessId()); 1245 info.request.setRequestorProcessID(delegate_->GetProcessId());
1247 info.request.setTargetType(WebCore::ResourceRequest::TargetIsObject); 1246 info.request.setTargetType(WebCore::ResourceRequest::TargetIsObject);
1248 info.request.setHTTPMethod(method); 1247 info.request.setHTTPMethod(method);
1249 1248
1250 if (range_info) 1249 if (range_info)
1251 info.request.addHTTPHeaderField("Range", range_info); 1250 info.request.addHTTPHeaderField("Range", range_info);
1252 1251
1253 WebCore::String referrer; 1252 WebCore::String referrer;
1254 // GetURL/PostURL requests initiated explicitly by plugins should specify the 1253 // GetURL/PostURL requests initiated explicitly by plugins should specify the
1255 // plugin SRC url as the referrer if it is available. 1254 // plugin SRC url as the referrer if it is available.
1256 if (use_plugin_src_as_referrer && !plugin_url_.spec().empty()) { 1255 if (use_plugin_src_as_referrer && !plugin_url_.spec().empty()) {
1257 referrer = webkit_glue::StdStringToString(plugin_url_.spec()); 1256 referrer = webkit_glue::StdStringToString(plugin_url_.spec());
1258 } else { 1257 } else {
1259 referrer = frame()->loader()->outgoingReferrer(); 1258 referrer = frame()->loader()->outgoingReferrer();
1260 } 1259 }
1261 1260
1262 if (!WebCore::FrameLoader::shouldHideReferrer(kurl, referrer)) 1261 if (!WebCore::FrameLoader::shouldHideReferrer(kurl, referrer))
1263 info.request.setHTTPReferrer(referrer); 1262 info.request.setHTTPReferrer(referrer);
1264 1263
1265 if (strcmp(method, "POST") == 0) { 1264 if (strcmp(method, "POST") == 0) {
1266 // Adds headers or form data to a request. This must be called before 1265 // Adds headers or form data to a request. This must be called before
1267 // we initiate the actual request. 1266 // we initiate the actual request.
1268 SetPostData(&info.request, buf, buf_len); 1267 SetPostData(&info.request, buf, buf_len);
1269 } 1268 }
1270 1269
1271 info.handle = WebCore::ResourceHandle::create(info.request, this, frame(), 1270 // Sets the routing id to associate the ResourceRequest with the RenderView.
1272 false, false); 1271 WebCore::ResourceResponse response;
1272 frame()->loader()->client()->dispatchWillSendRequest(
1273 NULL, 0, info.request, response);
1274
1275 info.handle = WebCore::ResourceHandle::create(
1276 info.request, this, NULL, false, false);
1273 if (!info.handle) { 1277 if (!info.handle) {
1274 return false; 1278 return false;
1275 } 1279 }
1276 1280
1277 clients_.push_back(info); 1281 clients_.push_back(info);
1278 return true; 1282 return true;
1279 } 1283 }
1280 1284
1281 void WebPluginImpl::CancelDocumentLoad() { 1285 void WebPluginImpl::CancelDocumentLoad() {
1282 if (frame()->loader()->activeDocumentLoader()) { 1286 if (frame()->loader()->activeDocumentLoader()) {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1426 client_index = clients_.erase(client_index); 1430 client_index = clients_.erase(client_index);
1427 if (resource_client) 1431 if (resource_client)
1428 resource_client->DidFail(); 1432 resource_client->DidFail();
1429 } 1433 }
1430 1434
1431 // This needs to be called now and not in the destructor since the 1435 // This needs to be called now and not in the destructor since the
1432 // webframe_ might not be valid anymore. 1436 // webframe_ might not be valid anymore.
1433 webframe_->set_plugin_delegate(NULL); 1437 webframe_->set_plugin_delegate(NULL);
1434 webframe_ = NULL; 1438 webframe_ = NULL;
1435 } 1439 }
OLDNEW
« no previous file with comments | « webkit/glue/webframeloaderclient_impl.cc ('k') | webkit/glue/weburlrequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698