| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "base/gfx/rect.h" | 5 #include "base/gfx/rect.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "net/base/escape.h" | 10 #include "net/base/escape.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 &byte_range_upper_bound_)) { | 90 &byte_range_upper_bound_)) { |
| 91 NOTREACHED(); | 91 NOTREACHED(); |
| 92 return; | 92 return; |
| 93 } | 93 } |
| 94 | 94 |
| 95 resource_response_ = response; | 95 resource_response_ = response; |
| 96 } | 96 } |
| 97 | 97 |
| 98 // Receives individual part data from a multipart response. | 98 // Receives individual part data from a multipart response. |
| 99 virtual void didReceiveData( | 99 virtual void didReceiveData( |
| 100 WebURLLoader*, const char* data, int data_size, long long) { | 100 WebURLLoader*, const char* data, int data_size) { |
| 101 // TODO(ananta) | 101 // TODO(ananta) |
| 102 // We should defer further loads on multipart resources on the same lines | 102 // We should defer further loads on multipart resources on the same lines |
| 103 // as regular resources requested by plugins to prevent reentrancy. | 103 // as regular resources requested by plugins to prevent reentrancy. |
| 104 resource_client_->DidReceiveData( | 104 resource_client_->DidReceiveData( |
| 105 data, data_size, byte_range_lower_bound_); | 105 data, data_size, byte_range_lower_bound_); |
| 106 } | 106 } |
| 107 | 107 |
| 108 virtual void didFinishLoading(WebURLLoader*) {} | 108 virtual void didFinishLoading(WebURLLoader*) {} |
| 109 virtual void didFail(WebURLLoader*, const WebURLError&) {} | 109 virtual void didFail(WebURLLoader*, const WebURLError&) {} |
| 110 | 110 |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 ClientInfo* client_info = GetClientInfoFromLoader(loader); | 706 ClientInfo* client_info = GetClientInfoFromLoader(loader); |
| 707 if (client_info) { | 707 if (client_info) { |
| 708 client_info->pending_failure_notification = true; | 708 client_info->pending_failure_notification = true; |
| 709 } | 709 } |
| 710 } | 710 } |
| 711 } | 711 } |
| 712 } | 712 } |
| 713 | 713 |
| 714 void WebPluginImpl::didReceiveData(WebURLLoader* loader, | 714 void WebPluginImpl::didReceiveData(WebURLLoader* loader, |
| 715 const char *buffer, | 715 const char *buffer, |
| 716 int length, long long) { | 716 int length) { |
| 717 WebPluginResourceClient* client = GetClientFromLoader(loader); | 717 WebPluginResourceClient* client = GetClientFromLoader(loader); |
| 718 if (!client) | 718 if (!client) |
| 719 return; | 719 return; |
| 720 MultiPartResponseHandlerMap::iterator index = | 720 MultiPartResponseHandlerMap::iterator index = |
| 721 multi_part_response_map_.find(client); | 721 multi_part_response_map_.find(client); |
| 722 if (index != multi_part_response_map_.end()) { | 722 if (index != multi_part_response_map_.end()) { |
| 723 MultipartResponseDelegate* multi_part_handler = (*index).second; | 723 MultipartResponseDelegate* multi_part_handler = (*index).second; |
| 724 DCHECK(multi_part_handler != NULL); | 724 DCHECK(multi_part_handler != NULL); |
| 725 multi_part_handler->OnReceivedData(buffer, length); | 725 multi_part_handler->OnReceivedData(buffer, length); |
| 726 } else { | 726 } else { |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 client_index = clients_.erase(client_index); | 1047 client_index = clients_.erase(client_index); |
| 1048 } | 1048 } |
| 1049 | 1049 |
| 1050 // This needs to be called now and not in the destructor since the | 1050 // This needs to be called now and not in the destructor since the |
| 1051 // webframe_ might not be valid anymore. | 1051 // webframe_ might not be valid anymore. |
| 1052 webframe_ = NULL; | 1052 webframe_ = NULL; |
| 1053 method_factory_.RevokeAll(); | 1053 method_factory_.RevokeAll(); |
| 1054 } | 1054 } |
| 1055 | 1055 |
| 1056 } // namespace webkit_glue | 1056 } // namespace webkit_glue |
| OLD | NEW |