| 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 "chrome/renderer/webplugin_delegate_proxy.h" | 5 #include "chrome/renderer/webplugin_delegate_proxy.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <atlbase.h> | 10 #include <atlbase.h> |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 void WillSendRequest(const GURL& url) { | 92 void WillSendRequest(const GURL& url) { |
| 93 DCHECK(channel_ != NULL); | 93 DCHECK(channel_ != NULL); |
| 94 channel_->Send(new PluginMsg_WillSendRequest(instance_id_, resource_id_, | 94 channel_->Send(new PluginMsg_WillSendRequest(instance_id_, resource_id_, |
| 95 url)); | 95 url)); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void DidReceiveResponse(const std::string& mime_type, | 98 void DidReceiveResponse(const std::string& mime_type, |
| 99 const std::string& headers, | 99 const std::string& headers, |
| 100 uint32 expected_length, | 100 uint32 expected_length, |
| 101 uint32 last_modified, | 101 uint32 last_modified, |
| 102 bool request_is_seekable, | 102 bool request_is_seekable) { |
| 103 bool* cancel) { | |
| 104 DCHECK(channel_ != NULL); | 103 DCHECK(channel_ != NULL); |
| 105 PluginMsg_DidReceiveResponseParams params; | 104 PluginMsg_DidReceiveResponseParams params; |
| 106 params.id = resource_id_; | 105 params.id = resource_id_; |
| 107 params.mime_type = mime_type; | 106 params.mime_type = mime_type; |
| 108 params.headers = headers; | 107 params.headers = headers; |
| 109 params.expected_length = expected_length; | 108 params.expected_length = expected_length; |
| 110 params.last_modified = last_modified; | 109 params.last_modified = last_modified; |
| 111 params.request_is_seekable = request_is_seekable; | 110 params.request_is_seekable = request_is_seekable; |
| 112 // Grab a reference on the underlying channel so it does not get | 111 // Grab a reference on the underlying channel so it does not get |
| 113 // deleted from under us. | 112 // deleted from under us. |
| 114 scoped_refptr<PluginChannelHost> channel_ref(channel_); | 113 scoped_refptr<PluginChannelHost> channel_ref(channel_); |
| 115 channel_->Send(new PluginMsg_DidReceiveResponse(instance_id_, params, | 114 channel_->Send(new PluginMsg_DidReceiveResponse(instance_id_, params)); |
| 116 cancel)); | |
| 117 } | 115 } |
| 118 | 116 |
| 119 void DidReceiveData(const char* buffer, int length, int data_offset) { | 117 void DidReceiveData(const char* buffer, int length, int data_offset) { |
| 120 DCHECK(channel_ != NULL); | 118 DCHECK(channel_ != NULL); |
| 121 DCHECK(length > 0); | 119 DCHECK(length > 0); |
| 122 std::vector<char> data; | 120 std::vector<char> data; |
| 123 data.resize(static_cast<size_t>(length)); | 121 data.resize(static_cast<size_t>(length)); |
| 124 memcpy(&data.front(), buffer, length); | 122 memcpy(&data.front(), buffer, length); |
| 125 // Grab a reference on the underlying channel so it does not get | 123 // Grab a reference on the underlying channel so it does not get |
| 126 // deleted from under us. | 124 // deleted from under us. |
| (...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1039 plugin_->CancelDocumentLoad(); | 1037 plugin_->CancelDocumentLoad(); |
| 1040 } | 1038 } |
| 1041 | 1039 |
| 1042 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( | 1040 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( |
| 1043 const std::string& url, const std::string& range_info, | 1041 const std::string& url, const std::string& range_info, |
| 1044 intptr_t existing_stream, bool notify_needed, intptr_t notify_data) { | 1042 intptr_t existing_stream, bool notify_needed, intptr_t notify_data) { |
| 1045 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), | 1043 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), |
| 1046 existing_stream, notify_needed, | 1044 existing_stream, notify_needed, |
| 1047 notify_data); | 1045 notify_data); |
| 1048 } | 1046 } |
| OLD | NEW |