| 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 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1113 } | 1113 } |
| 1114 | 1114 |
| 1115 if (strcmp(method, "POST") == 0) { | 1115 if (strcmp(method, "POST") == 0) { |
| 1116 // Adds headers or form data to a request. This must be called before | 1116 // Adds headers or form data to a request. This must be called before |
| 1117 // we initiate the actual request. | 1117 // we initiate the actual request. |
| 1118 SetPostData(&info.request, buf, buf_len); | 1118 SetPostData(&info.request, buf, buf_len); |
| 1119 } | 1119 } |
| 1120 | 1120 |
| 1121 SetReferrer(&info.request, referrer_flag); | 1121 SetReferrer(&info.request, referrer_flag); |
| 1122 | 1122 |
| 1123 // Sets the routing id to associate the ResourceRequest with the RenderView. | |
| 1124 webframe_->dispatchWillSendRequest(info.request); | |
| 1125 | |
| 1126 // Sets the appcache host id to allow retrieval from the appcache. | |
| 1127 if (WebApplicationCacheHostImpl* appcache_host = | |
| 1128 WebApplicationCacheHostImpl::FromFrame(webframe_)) { | |
| 1129 appcache_host->willStartSubResourceRequest(info.request); | |
| 1130 } | |
| 1131 | |
| 1132 if (WebDevToolsAgent* devtools_agent = GetDevToolsAgent()) { | 1123 if (WebDevToolsAgent* devtools_agent = GetDevToolsAgent()) { |
| 1133 devtools_agent->identifierForInitialRequest(resource_id, webframe_, | 1124 devtools_agent->identifierForInitialRequest(resource_id, webframe_, |
| 1134 info.request); | 1125 info.request); |
| 1135 devtools_agent->willSendRequest(resource_id, info.request); | 1126 devtools_agent->willSendRequest(resource_id, info.request); |
| 1136 } | 1127 } |
| 1137 | 1128 |
| 1138 info.loader.reset(WebKit::webKitClient()->createURLLoader()); | 1129 info.loader.reset(webframe_->createAssociatedURLLoader()); |
| 1139 if (!info.loader.get()) | 1130 if (!info.loader.get()) |
| 1140 return false; | 1131 return false; |
| 1141 info.loader->loadAsynchronously(info.request, this); | 1132 info.loader->loadAsynchronously(info.request, this); |
| 1142 | 1133 |
| 1143 clients_.push_back(info); | 1134 clients_.push_back(info); |
| 1144 return true; | 1135 return true; |
| 1145 } | 1136 } |
| 1146 | 1137 |
| 1147 void WebPluginImpl::CancelDocumentLoad() { | 1138 void WebPluginImpl::CancelDocumentLoad() { |
| 1148 if (webframe_) { | 1139 if (webframe_) { |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1324 WebDevToolsAgent* WebPluginImpl::GetDevToolsAgent() { | 1315 WebDevToolsAgent* WebPluginImpl::GetDevToolsAgent() { |
| 1325 if (!webframe_) | 1316 if (!webframe_) |
| 1326 return NULL; | 1317 return NULL; |
| 1327 WebView* view = webframe_->view(); | 1318 WebView* view = webframe_->view(); |
| 1328 if (!view) | 1319 if (!view) |
| 1329 return NULL; | 1320 return NULL; |
| 1330 return view->devToolsAgent(); | 1321 return view->devToolsAgent(); |
| 1331 } | 1322 } |
| 1332 | 1323 |
| 1333 } // namespace webkit_glue | 1324 } // namespace webkit_glue |
| OLD | NEW |