| OLD | NEW |
| 1 // Copyright (c) 2006-2008 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 "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 |
| 11 #include "base/scoped_handle.h" | 11 #include "base/scoped_handle.h" |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 if (iterator == resource_clients_.end()) { | 242 if (iterator == resource_clients_.end()) { |
| 243 NOTREACHED(); | 243 NOTREACHED(); |
| 244 return NULL; | 244 return NULL; |
| 245 } | 245 } |
| 246 | 246 |
| 247 return iterator->second; | 247 return iterator->second; |
| 248 } | 248 } |
| 249 | 249 |
| 250 int WebPluginProxy::GetRendererProcessId() { |
| 251 if (channel_.get()) |
| 252 return channel_->peer_pid(); |
| 253 return 0; |
| 254 } |
| 255 |
| 250 void WebPluginProxy::DidPaint() { | 256 void WebPluginProxy::DidPaint() { |
| 251 // If we have an accumulated damaged rect, then check to see if we need to | 257 // If we have an accumulated damaged rect, then check to see if we need to |
| 252 // send out another InvalidateRect message. | 258 // send out another InvalidateRect message. |
| 253 waiting_for_paint_ = false; | 259 waiting_for_paint_ = false; |
| 254 if (!damaged_rect_.IsEmpty()) | 260 if (!damaged_rect_.IsEmpty()) |
| 255 InvalidateRect(damaged_rect_); | 261 InvalidateRect(damaged_rect_); |
| 256 } | 262 } |
| 257 | 263 |
| 258 void WebPluginProxy::OnResourceCreated(int resource_id, HANDLE cookie) { | 264 void WebPluginProxy::OnResourceCreated(int resource_id, HANDLE cookie) { |
| 259 WebPluginResourceClient* resource_client = | 265 WebPluginResourceClient* resource_client = |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 while (index != resource_clients_.end()) { | 541 while (index != resource_clients_.end()) { |
| 536 WebPluginResourceClient* client = (*index).second; | 542 WebPluginResourceClient* client = (*index).second; |
| 537 | 543 |
| 538 if (client == resource_client) { | 544 if (client == resource_client) { |
| 539 resource_clients_.erase(index++); | 545 resource_clients_.erase(index++); |
| 540 } else { | 546 } else { |
| 541 index++; | 547 index++; |
| 542 } | 548 } |
| 543 } | 549 } |
| 544 } | 550 } |
| OLD | NEW |