| 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/glue/plugins/webplugin_impl.h" | 5 #include "webkit/glue/plugins/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 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1161 } | 1161 } |
| 1162 | 1162 |
| 1163 if (strcmp(method, "POST") == 0) { | 1163 if (strcmp(method, "POST") == 0) { |
| 1164 // Adds headers or form data to a request. This must be called before | 1164 // Adds headers or form data to a request. This must be called before |
| 1165 // we initiate the actual request. | 1165 // we initiate the actual request. |
| 1166 SetPostData(&info.request, buf, buf_len); | 1166 SetPostData(&info.request, buf, buf_len); |
| 1167 } | 1167 } |
| 1168 | 1168 |
| 1169 SetReferrer(&info.request, referrer_flag); | 1169 SetReferrer(&info.request, referrer_flag); |
| 1170 | 1170 |
| 1171 // Sets the routing id to associate the ResourceRequest with the RenderView. |
| 1172 webframe_->dispatchWillSendRequest(info.request); |
| 1173 |
| 1174 // Sets the appcache host id to allow retrieval from the appcache. |
| 1175 if (WebApplicationCacheHostImpl* appcache_host = |
| 1176 WebApplicationCacheHostImpl::FromFrame(webframe_)) { |
| 1177 appcache_host->willStartSubResourceRequest(info.request); |
| 1178 } |
| 1179 |
| 1171 if (WebDevToolsAgent* devtools_agent = GetDevToolsAgent()) { | 1180 if (WebDevToolsAgent* devtools_agent = GetDevToolsAgent()) { |
| 1172 devtools_agent->identifierForInitialRequest(resource_id, webframe_, | 1181 devtools_agent->identifierForInitialRequest(resource_id, webframe_, |
| 1173 info.request); | 1182 info.request); |
| 1174 devtools_agent->willSendRequest(resource_id, info.request); | 1183 devtools_agent->willSendRequest(resource_id, info.request); |
| 1175 } | 1184 } |
| 1176 | 1185 |
| 1177 info.loader.reset(webframe_->createAssociatedURLLoader()); | 1186 info.loader.reset(WebKit::webKitClient()->createURLLoader()); |
| 1178 if (!info.loader.get()) | 1187 if (!info.loader.get()) |
| 1179 return false; | 1188 return false; |
| 1180 info.loader->loadAsynchronously(info.request, this); | 1189 info.loader->loadAsynchronously(info.request, this); |
| 1181 | 1190 |
| 1182 clients_.push_back(info); | 1191 clients_.push_back(info); |
| 1183 return true; | 1192 return true; |
| 1184 } | 1193 } |
| 1185 | 1194 |
| 1186 void WebPluginImpl::CancelDocumentLoad() { | 1195 void WebPluginImpl::CancelDocumentLoad() { |
| 1187 if (webframe_) { | 1196 if (webframe_) { |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1363 WebDevToolsAgent* WebPluginImpl::GetDevToolsAgent() { | 1372 WebDevToolsAgent* WebPluginImpl::GetDevToolsAgent() { |
| 1364 if (!webframe_) | 1373 if (!webframe_) |
| 1365 return NULL; | 1374 return NULL; |
| 1366 WebView* view = webframe_->view(); | 1375 WebView* view = webframe_->view(); |
| 1367 if (!view) | 1376 if (!view) |
| 1368 return NULL; | 1377 return NULL; |
| 1369 return view->devToolsAgent(); | 1378 return view->devToolsAgent(); |
| 1370 } | 1379 } |
| 1371 | 1380 |
| 1372 } // namespace webkit_glue | 1381 } // namespace webkit_glue |
| OLD | NEW |