| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/plugin/webplugin_proxy.h" | 5 #include "chrome/plugin/webplugin_proxy.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #if defined(OS_LINUX) | 8 #if defined(OS_LINUX) |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 #endif | 10 #endif |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 return cp_browsing_context_; | 280 return cp_browsing_context_; |
| 281 } | 281 } |
| 282 | 282 |
| 283 WebPluginProxy* WebPluginProxy::FromCPBrowsingContext( | 283 WebPluginProxy* WebPluginProxy::FromCPBrowsingContext( |
| 284 CPBrowsingContext context) { | 284 CPBrowsingContext context) { |
| 285 return GetContextMap()[context]; | 285 return GetContextMap()[context]; |
| 286 } | 286 } |
| 287 | 287 |
| 288 WebPluginResourceClient* WebPluginProxy::GetResourceClient(int id) { | 288 WebPluginResourceClient* WebPluginProxy::GetResourceClient(int id) { |
| 289 ResourceClientMap::iterator iterator = resource_clients_.find(id); | 289 ResourceClientMap::iterator iterator = resource_clients_.find(id); |
| 290 // The IPC messages which deal with streams are now asynchronous. It is |
| 291 // now possible to receive stream messages from the renderer for streams |
| 292 // which may have been cancelled by the plugin. |
| 290 if (iterator == resource_clients_.end()) { | 293 if (iterator == resource_clients_.end()) { |
| 291 NOTREACHED(); | |
| 292 return NULL; | 294 return NULL; |
| 293 } | 295 } |
| 294 | 296 |
| 295 return iterator->second; | 297 return iterator->second; |
| 296 } | 298 } |
| 297 | 299 |
| 298 int WebPluginProxy::GetRendererProcessId() { | 300 int WebPluginProxy::GetRendererProcessId() { |
| 299 if (channel_.get()) | 301 if (channel_.get()) |
| 300 return channel_->peer_pid(); | 302 return channel_->peer_pid(); |
| 301 return 0; | 303 return 0; |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 const char* range_info, | 648 const char* range_info, |
| 647 intptr_t existing_stream, | 649 intptr_t existing_stream, |
| 648 bool notify_needed, | 650 bool notify_needed, |
| 649 intptr_t notify_data) { | 651 intptr_t notify_data) { |
| 650 | 652 |
| 651 Send(new PluginHostMsg_InitiateHTTPRangeRequest(route_id_, url, | 653 Send(new PluginHostMsg_InitiateHTTPRangeRequest(route_id_, url, |
| 652 range_info, existing_stream, | 654 range_info, existing_stream, |
| 653 notify_needed, notify_data)); | 655 notify_needed, notify_data)); |
| 654 } | 656 } |
| 655 | 657 |
| 658 void WebPluginProxy::SetDeferResourceLoading(int resource_id, bool defer) { |
| 659 Send(new PluginHostMsg_DeferResourceLoading(route_id_, resource_id, defer)); |
| 660 } |
| 661 |
| 656 void WebPluginProxy::OnPaint(const gfx::Rect& damaged_rect) { | 662 void WebPluginProxy::OnPaint(const gfx::Rect& damaged_rect) { |
| 657 child_process_logging::ScopedActiveURLSetter url_setter(page_url_); | 663 child_process_logging::ScopedActiveURLSetter url_setter(page_url_); |
| 658 | 664 |
| 659 Paint(damaged_rect); | 665 Paint(damaged_rect); |
| 660 Send(new PluginHostMsg_InvalidateRect(route_id_, damaged_rect)); | 666 Send(new PluginHostMsg_InvalidateRect(route_id_, damaged_rect)); |
| 661 } | 667 } |
| 662 | 668 |
| 663 bool WebPluginProxy::IsOffTheRecord() { | 669 bool WebPluginProxy::IsOffTheRecord() { |
| 664 return channel_->off_the_record(); | 670 return channel_->off_the_record(); |
| 665 } | 671 } |
| 666 | 672 |
| 667 void WebPluginProxy::ResourceClientDeleted( | 673 void WebPluginProxy::ResourceClientDeleted( |
| 668 WebPluginResourceClient* resource_client) { | 674 WebPluginResourceClient* resource_client) { |
| 669 ResourceClientMap::iterator index = resource_clients_.begin(); | 675 ResourceClientMap::iterator index = resource_clients_.begin(); |
| 670 while (index != resource_clients_.end()) { | 676 while (index != resource_clients_.end()) { |
| 671 WebPluginResourceClient* client = (*index).second; | 677 WebPluginResourceClient* client = (*index).second; |
| 672 | 678 |
| 673 if (client == resource_client) { | 679 if (client == resource_client) { |
| 674 resource_clients_.erase(index++); | 680 resource_clients_.erase(index++); |
| 675 } else { | 681 } else { |
| 676 index++; | 682 index++; |
| 677 } | 683 } |
| 678 } | 684 } |
| 679 } | 685 } |
| OLD | NEW |