| 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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 #elif defined (OS_LINUX) | 629 #elif defined (OS_LINUX) |
| 630 void WebPluginProxy::UpdateTransform() { | 630 void WebPluginProxy::UpdateTransform() { |
| 631 } | 631 } |
| 632 | 632 |
| 633 void WebPluginProxy::SetWindowlessBuffer( | 633 void WebPluginProxy::SetWindowlessBuffer( |
| 634 const TransportDIB::Handle& windowless_buffer, | 634 const TransportDIB::Handle& windowless_buffer, |
| 635 const TransportDIB::Handle& background_buffer) { | 635 const TransportDIB::Handle& background_buffer) { |
| 636 int width = delegate_->GetRect().width(); | 636 int width = delegate_->GetRect().width(); |
| 637 int height = delegate_->GetRect().height(); | 637 int height = delegate_->GetRect().height(); |
| 638 windowless_dib_.reset(TransportDIB::Map(windowless_buffer)); | 638 windowless_dib_.reset(TransportDIB::Map(windowless_buffer)); |
| 639 windowless_canvas_.reset(windowless_dib_->GetPlatformCanvas(width, height)); | 639 if (windowless_dib_.get()) { |
| 640 windowless_canvas_.reset(windowless_dib_->GetPlatformCanvas(width, height)); |
| 641 } else { |
| 642 // This can happen if the renderer has already destroyed the TransportDIB |
| 643 // by the time we receive the handle, e.g. in case of multiple resizes. |
| 644 windowless_canvas_.reset(); |
| 645 } |
| 640 background_dib_.reset(TransportDIB::Map(background_buffer)); | 646 background_dib_.reset(TransportDIB::Map(background_buffer)); |
| 641 if (background_dib_.get()) { | 647 if (background_dib_.get()) { |
| 642 background_canvas_.reset(background_dib_->GetPlatformCanvas(width, height)); | 648 background_canvas_.reset(background_dib_->GetPlatformCanvas(width, height)); |
| 643 } else { | 649 } else { |
| 644 background_canvas_.reset(); | 650 background_canvas_.reset(); |
| 645 } | 651 } |
| 646 } | 652 } |
| 647 #endif | 653 #endif |
| 648 | 654 |
| 649 void WebPluginProxy::CancelDocumentLoad() { | 655 void WebPluginProxy::CancelDocumentLoad() { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 while (index != resource_clients_.end()) { | 688 while (index != resource_clients_.end()) { |
| 683 WebPluginResourceClient* client = (*index).second; | 689 WebPluginResourceClient* client = (*index).second; |
| 684 | 690 |
| 685 if (client == resource_client) { | 691 if (client == resource_client) { |
| 686 resource_clients_.erase(index++); | 692 resource_clients_.erase(index++); |
| 687 } else { | 693 } else { |
| 688 index++; | 694 index++; |
| 689 } | 695 } |
| 690 } | 696 } |
| 691 } | 697 } |
| OLD | NEW |