| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "config.h" | 5 #include "config.h" |
| 6 #include "webkit/glue/webplugin_impl.h" | 6 #include "webkit/glue/webplugin_impl.h" |
| 7 | 7 |
| 8 #include "Cursor.h" | 8 #include "Cursor.h" |
| 9 #include "Document.h" | 9 #include "Document.h" |
| 10 #include "DocumentLoader.h" | 10 #include "DocumentLoader.h" |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 } | 408 } |
| 409 } | 409 } |
| 410 } | 410 } |
| 411 | 411 |
| 412 bool WebPluginImpl::SetPostData(WebCore::ResourceRequest* request, | 412 bool WebPluginImpl::SetPostData(WebCore::ResourceRequest* request, |
| 413 const char *buf, | 413 const char *buf, |
| 414 uint32 length) { | 414 uint32 length) { |
| 415 std::vector<std::string> names; | 415 std::vector<std::string> names; |
| 416 std::vector<std::string> values; | 416 std::vector<std::string> values; |
| 417 std::vector<char> body; | 417 std::vector<char> body; |
| 418 #if !defined(OS_LINUX) | |
| 419 bool rv = NPAPI::PluginHost::SetPostData(buf, length, &names, &values, &body); | 418 bool rv = NPAPI::PluginHost::SetPostData(buf, length, &names, &values, &body); |
| 420 #else | |
| 421 // TODO(port): unstub once we have plugin support | |
| 422 bool rv = false; | |
| 423 NOTREACHED(); | |
| 424 #endif | |
| 425 | 419 |
| 426 for (size_t i = 0; i < names.size(); ++i) | 420 for (size_t i = 0; i < names.size(); ++i) |
| 427 request->addHTTPHeaderField(webkit_glue::StdStringToString(names[i]), | 421 request->addHTTPHeaderField(webkit_glue::StdStringToString(names[i]), |
| 428 webkit_glue::StdStringToString(values[i])); | 422 webkit_glue::StdStringToString(values[i])); |
| 429 | 423 |
| 430 WebCore::String content_type = request->httpContentType(); | 424 WebCore::String content_type = request->httpContentType(); |
| 431 if (content_type.isEmpty()) | 425 if (content_type.isEmpty()) |
| 432 request->setHTTPContentType("application/x-www-form-urlencoded"); | 426 request->setHTTPContentType("application/x-www-form-urlencoded"); |
| 433 | 427 |
| 434 RefPtr<WebCore::FormData> data = WebCore::FormData::create(); | 428 RefPtr<WebCore::FormData> data = WebCore::FormData::create(); |
| (...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1420 client_index = clients_.erase(client_index); | 1414 client_index = clients_.erase(client_index); |
| 1421 if (resource_client) | 1415 if (resource_client) |
| 1422 resource_client->DidFail(); | 1416 resource_client->DidFail(); |
| 1423 } | 1417 } |
| 1424 | 1418 |
| 1425 // This needs to be called now and not in the destructor since the | 1419 // This needs to be called now and not in the destructor since the |
| 1426 // webframe_ might not be valid anymore. | 1420 // webframe_ might not be valid anymore. |
| 1427 webframe_->set_plugin_delegate(NULL); | 1421 webframe_->set_plugin_delegate(NULL); |
| 1428 webframe_ = NULL; | 1422 webframe_ = NULL; |
| 1429 } | 1423 } |
| OLD | NEW |