| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/plugins/npapi/webplugin_impl.h" | 5 #include "webkit/plugins/npapi/webplugin_impl.h" |
| 6 | 6 |
| 7 #include "base/linked_ptr.h" | 7 #include "base/linked_ptr.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1171 } | 1171 } |
| 1172 | 1172 |
| 1173 if (strcmp(method, "POST") == 0) { | 1173 if (strcmp(method, "POST") == 0) { |
| 1174 // Adds headers or form data to a request. This must be called before | 1174 // Adds headers or form data to a request. This must be called before |
| 1175 // we initiate the actual request. | 1175 // we initiate the actual request. |
| 1176 SetPostData(&info.request, buf, buf_len); | 1176 SetPostData(&info.request, buf, buf_len); |
| 1177 } | 1177 } |
| 1178 | 1178 |
| 1179 SetReferrer(&info.request, referrer_flag); | 1179 SetReferrer(&info.request, referrer_flag); |
| 1180 | 1180 |
| 1181 // Sets the routing id to associate the ResourceRequest with the RenderView. | |
| 1182 webframe_->dispatchWillSendRequest(info.request); | |
| 1183 | |
| 1184 // Sets the appcache host id to allow retrieval from the appcache. | |
| 1185 if (WebApplicationCacheHostImpl* appcache_host = | |
| 1186 WebApplicationCacheHostImpl::FromFrame(webframe_)) { | |
| 1187 appcache_host->willStartSubResourceRequest(info.request); | |
| 1188 } | |
| 1189 | |
| 1190 if (WebDevToolsAgent* devtools_agent = GetDevToolsAgent()) { | 1181 if (WebDevToolsAgent* devtools_agent = GetDevToolsAgent()) { |
| 1191 devtools_agent->identifierForInitialRequest(resource_id, webframe_, | 1182 devtools_agent->identifierForInitialRequest(resource_id, webframe_, |
| 1192 info.request); | 1183 info.request); |
| 1193 devtools_agent->willSendRequest(resource_id, info.request); | 1184 devtools_agent->willSendRequest(resource_id, info.request); |
| 1194 } | 1185 } |
| 1195 | 1186 |
| 1196 info.loader.reset(WebKit::webKitClient()->createURLLoader()); | 1187 info.loader.reset(webframe_->createAssociatedURLLoader()); |
| 1197 if (!info.loader.get()) | 1188 if (!info.loader.get()) |
| 1198 return false; | 1189 return false; |
| 1199 info.loader->loadAsynchronously(info.request, this); | 1190 info.loader->loadAsynchronously(info.request, this); |
| 1200 | 1191 |
| 1201 clients_.push_back(info); | 1192 clients_.push_back(info); |
| 1202 return true; | 1193 return true; |
| 1203 } | 1194 } |
| 1204 | 1195 |
| 1205 void WebPluginImpl::CancelDocumentLoad() { | 1196 void WebPluginImpl::CancelDocumentLoad() { |
| 1206 if (webframe_) { | 1197 if (webframe_) { |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1387 if (!webframe_) | 1378 if (!webframe_) |
| 1388 return NULL; | 1379 return NULL; |
| 1389 WebView* view = webframe_->view(); | 1380 WebView* view = webframe_->view(); |
| 1390 if (!view) | 1381 if (!view) |
| 1391 return NULL; | 1382 return NULL; |
| 1392 return view->devToolsAgent(); | 1383 return view->devToolsAgent(); |
| 1393 } | 1384 } |
| 1394 | 1385 |
| 1395 } // namespace npapi | 1386 } // namespace npapi |
| 1396 } // namespace webkit | 1387 } // namespace webkit |
| OLD | NEW |