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 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 MSVC_PUSH_WARNING_LEVEL(0); | 10 MSVC_PUSH_WARNING_LEVEL(0); |
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1035 } | 1035 } |
1036 } | 1036 } |
1037 } | 1037 } |
1038 } | 1038 } |
1039 | 1039 |
1040 void WebPluginImpl::didReceiveData(WebCore::ResourceHandle* handle, | 1040 void WebPluginImpl::didReceiveData(WebCore::ResourceHandle* handle, |
1041 const char *buffer, | 1041 const char *buffer, |
1042 int length, int) { | 1042 int length, int) { |
1043 WebPluginResourceClient* client = GetClientFromHandle(handle); | 1043 WebPluginResourceClient* client = GetClientFromHandle(handle); |
1044 if (client) { | 1044 if (client) { |
1045 MultipartResponseDelegate* multi_part_handler = | 1045 MultiPartResponseHandlerMap::iterator index = |
1046 multi_part_response_map_[client]; | 1046 multi_part_response_map_.find(client); |
1047 if (multi_part_handler) { | 1047 if (index != multi_part_response_map_.end()) { |
| 1048 MultipartResponseDelegate* multi_part_handler = (*index).second; |
| 1049 DCHECK(multi_part_handler != NULL); |
1048 multi_part_handler->OnReceivedData(buffer, length); | 1050 multi_part_handler->OnReceivedData(buffer, length); |
1049 } else { | 1051 } else { |
1050 client->DidReceiveData(buffer, length, 0); | 1052 client->DidReceiveData(buffer, length, 0); |
1051 } | 1053 } |
1052 } | 1054 } |
1053 } | 1055 } |
1054 | 1056 |
1055 void WebPluginImpl::didFinishLoading(WebCore::ResourceHandle* handle) { | 1057 void WebPluginImpl::didFinishLoading(WebCore::ResourceHandle* handle) { |
1056 WebPluginResourceClient* client = GetClientFromHandle(handle); | 1058 WebPluginResourceClient* client = GetClientFromHandle(handle); |
1057 if (client) { | 1059 if (client) { |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1408 client_index = clients_.erase(client_index); | 1410 client_index = clients_.erase(client_index); |
1409 if (resource_client) | 1411 if (resource_client) |
1410 resource_client->DidFail(); | 1412 resource_client->DidFail(); |
1411 } | 1413 } |
1412 | 1414 |
1413 // This needs to be called now and not in the destructor since the | 1415 // This needs to be called now and not in the destructor since the |
1414 // webframe_ might not be valid anymore. | 1416 // webframe_ might not be valid anymore. |
1415 webframe_->set_plugin_delegate(NULL); | 1417 webframe_->set_plugin_delegate(NULL); |
1416 webframe_ = NULL; | 1418 webframe_ = NULL; |
1417 } | 1419 } |
OLD | NEW |