OLD | NEW |
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 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 resource_client->DidFail(resource_id); | 1212 resource_client->DidFail(resource_id); |
1213 return; | 1213 return; |
1214 } | 1214 } |
1215 | 1215 |
1216 // CreateResourceClient() sends a synchronous IPC message so it's possible | 1216 // CreateResourceClient() sends a synchronous IPC message so it's possible |
1217 // that TearDownPluginInstance() may have been called in the nested | 1217 // that TearDownPluginInstance() may have been called in the nested |
1218 // message loop. If so, don't start the request. | 1218 // message loop. If so, don't start the request. |
1219 if (!delegate_) | 1219 if (!delegate_) |
1220 return; | 1220 return; |
1221 | 1221 |
1222 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 1222 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
1223 switches::kDisableDirectNPAPIRequests)) { | 1223 switches::kDisableDirectNPAPIRequests)) { |
1224 // We got here either because the plugin called GetURL/PostURL, or because | 1224 // We got here either because the plugin called GetURL/PostURL, or because |
1225 // we're fetching the data for an embed tag. If we're in multi-process mode, | 1225 // we're fetching the data for an embed tag. If we're in multi-process mode, |
1226 // we want to fetch the data in the plugin process as the renderer won't be | 1226 // we want to fetch the data in the plugin process as the renderer won't be |
1227 // able to request any origin when site isolation is in place. So bounce | 1227 // able to request any origin when site isolation is in place. So bounce |
1228 // this request back to the plugin process which will use ResourceDispatcher | 1228 // this request back to the plugin process which will use ResourceDispatcher |
1229 // to fetch the url. | 1229 // to fetch the url. |
1230 | 1230 |
1231 // TODO(jam): any better way of getting this? Can't find a way to get | 1231 // TODO(jam): any better way of getting this? Can't find a way to get |
1232 // frame()->loader()->outgoingReferrer() which | 1232 // frame()->loader()->outgoingReferrer() which |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1530 case PLUGIN_SRC: | 1530 case PLUGIN_SRC: |
1531 webframe_->setReferrerForRequest(*request, plugin_url_); | 1531 webframe_->setReferrerForRequest(*request, plugin_url_); |
1532 break; | 1532 break; |
1533 | 1533 |
1534 default: | 1534 default: |
1535 break; | 1535 break; |
1536 } | 1536 } |
1537 } | 1537 } |
1538 | 1538 |
1539 } // namespace content | 1539 } // namespace content |
OLD | NEW |