| 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 "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
| 9 #include "app/win_util.h" | 9 #include "app/win_util.h" |
| 10 #endif | 10 #endif |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 return cp_browsing_context_; | 232 return cp_browsing_context_; |
| 233 } | 233 } |
| 234 | 234 |
| 235 WebPluginProxy* WebPluginProxy::FromCPBrowsingContext( | 235 WebPluginProxy* WebPluginProxy::FromCPBrowsingContext( |
| 236 CPBrowsingContext context) { | 236 CPBrowsingContext context) { |
| 237 return GetContextMap()[context]; | 237 return GetContextMap()[context]; |
| 238 } | 238 } |
| 239 | 239 |
| 240 WebPluginResourceClient* WebPluginProxy::GetResourceClient(int id) { | 240 WebPluginResourceClient* WebPluginProxy::GetResourceClient(int id) { |
| 241 ResourceClientMap::iterator iterator = resource_clients_.find(id); | 241 ResourceClientMap::iterator iterator = resource_clients_.find(id); |
| 242 // The IPC messages which deal with streams are now asynchronous. It is |
| 243 // now possible to receive stream messages from the renderer for streams |
| 244 // which may have been cancelled by the plugin. |
| 242 if (iterator == resource_clients_.end()) { | 245 if (iterator == resource_clients_.end()) { |
| 243 NOTREACHED(); | |
| 244 return NULL; | 246 return NULL; |
| 245 } | 247 } |
| 246 | 248 |
| 247 return iterator->second; | 249 return iterator->second; |
| 248 } | 250 } |
| 249 | 251 |
| 250 int WebPluginProxy::GetRendererProcessId() { | 252 int WebPluginProxy::GetRendererProcessId() { |
| 251 if (channel_.get()) | 253 if (channel_.get()) |
| 252 return channel_->peer_pid(); | 254 return channel_->peer_pid(); |
| 253 return 0; | 255 return 0; |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 while (index != resource_clients_.end()) { | 631 while (index != resource_clients_.end()) { |
| 630 WebPluginResourceClient* client = (*index).second; | 632 WebPluginResourceClient* client = (*index).second; |
| 631 | 633 |
| 632 if (client == resource_client) { | 634 if (client == resource_client) { |
| 633 resource_clients_.erase(index++); | 635 resource_clients_.erase(index++); |
| 634 } else { | 636 } else { |
| 635 index++; | 637 index++; |
| 636 } | 638 } |
| 637 } | 639 } |
| 638 } | 640 } |
| OLD | NEW |