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

Side by Side Diff: content/renderer/npapi/webplugin_impl.cc

Issue 618583003: [ServiceWorker] Set setSkipServiceWorker flag of the request from NPAPI plugins (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « content/child/npapi/plugin_url_fetcher.cc ('k') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/renderer/npapi/webplugin_impl.h" 5 #include "content/renderer/npapi/webplugin_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/crash_logging.h" 9 #include "base/debug/crash_logging.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 return INVALID_URL; 727 return INVALID_URL;
728 } 728 }
729 729
730 WebURLRequest request(complete_url); 730 WebURLRequest request(complete_url);
731 SetReferrer(&request, referrer_flag); 731 SetReferrer(&request, referrer_flag);
732 732
733 request.setHTTPMethod(WebString::fromUTF8(method)); 733 request.setHTTPMethod(WebString::fromUTF8(method));
734 request.setFirstPartyForCookies( 734 request.setFirstPartyForCookies(
735 webframe_->document().firstPartyForCookies()); 735 webframe_->document().firstPartyForCookies());
736 request.setHasUserGesture(popups_allowed); 736 request.setHasUserGesture(popups_allowed);
737 // ServiceWorker is disabled for NPAPI.
738 request.setSkipServiceWorker(true);
737 if (len > 0) { 739 if (len > 0) {
738 if (!SetPostData(&request, buf, len)) { 740 if (!SetPostData(&request, buf, len)) {
739 // Uhoh - we're in trouble. There isn't a good way 741 // Uhoh - we're in trouble. There isn't a good way
740 // to recover at this point. Break out. 742 // to recover at this point. Break out.
741 NOTREACHED(); 743 NOTREACHED();
742 return ROUTED; 744 return ROUTED;
743 } 745 }
744 } 746 }
745 747
746 container_->loadFrameRequest( 748 container_->loadFrameRequest(
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 info.request.initialize(); 1283 info.request.initialize();
1282 info.request.setURL(url); 1284 info.request.setURL(url);
1283 info.request.setFirstPartyForCookies( 1285 info.request.setFirstPartyForCookies(
1284 webframe_->document().firstPartyForCookies()); 1286 webframe_->document().firstPartyForCookies());
1285 info.request.setRequestorProcessID(delegate_->GetProcessId()); 1287 info.request.setRequestorProcessID(delegate_->GetProcessId());
1286 // TODO(mkwst): Is this a request for a plugin object itself 1288 // TODO(mkwst): Is this a request for a plugin object itself
1287 // (RequestContextObject), or a request that the plugin makes 1289 // (RequestContextObject), or a request that the plugin makes
1288 // (RequestContextPlugin)? 1290 // (RequestContextPlugin)?
1289 info.request.setRequestContext(WebURLRequest::RequestContextPlugin); 1291 info.request.setRequestContext(WebURLRequest::RequestContextPlugin);
1290 info.request.setHTTPMethod(WebString::fromUTF8(method)); 1292 info.request.setHTTPMethod(WebString::fromUTF8(method));
1293 // ServiceWorker is disabled for NPAPI.
1294 info.request.setSkipServiceWorker(true);
1291 info.pending_failure_notification = false; 1295 info.pending_failure_notification = false;
1292 info.notify_redirects = notify_redirects; 1296 info.notify_redirects = notify_redirects;
1293 info.is_plugin_src_load = is_plugin_src_load; 1297 info.is_plugin_src_load = is_plugin_src_load;
1294 info.data_offset = 0; 1298 info.data_offset = 0;
1295 1299
1296 if (range_info) { 1300 if (range_info) {
1297 info.request.addHTTPHeaderField(WebString::fromUTF8("Range"), 1301 info.request.addHTTPHeaderField(WebString::fromUTF8("Range"),
1298 WebString::fromUTF8(range_info)); 1302 WebString::fromUTF8(range_info));
1299 } 1303 }
1300 1304
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 case PLUGIN_SRC: 1529 case PLUGIN_SRC:
1526 webframe_->setReferrerForRequest(*request, plugin_url_); 1530 webframe_->setReferrerForRequest(*request, plugin_url_);
1527 break; 1531 break;
1528 1532
1529 default: 1533 default:
1530 break; 1534 break;
1531 } 1535 }
1532 } 1536 }
1533 1537
1534 } // namespace content 1538 } // namespace content
OLDNEW
« no previous file with comments | « content/child/npapi/plugin_url_fetcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698