OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <cmath> | 5 #include <cmath> |
6 | 6 |
7 #include "chrome/renderer/pepper_plugin_delegate_impl.h" | 7 #include "chrome/renderer/pepper_plugin_delegate_impl.h" |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/surface/transport_dib.h" | 10 #include "app/surface/transport_dib.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 PlatformImage2DImpl(int width, int height, TransportDIB* dib) | 58 PlatformImage2DImpl(int width, int height, TransportDIB* dib) |
59 : width_(width), | 59 : width_(width), |
60 height_(height), | 60 height_(height), |
61 dib_(dib) { | 61 dib_(dib) { |
62 } | 62 } |
63 | 63 |
64 virtual skia::PlatformCanvas* Map() { | 64 virtual skia::PlatformCanvas* Map() { |
65 return dib_->GetPlatformCanvas(width_, height_); | 65 return dib_->GetPlatformCanvas(width_, height_); |
66 } | 66 } |
67 | 67 |
68 virtual intptr_t GetSharedMemoryHandle() const { | 68 virtual intptr_t GetSharedMemoryHandle(uint32* byte_count) const { |
69 return reinterpret_cast<intptr_t>(dib_.get()); | 69 *byte_count = dib_->size(); |
| 70 #if defined(OS_WIN) |
| 71 return reinterpret_cast<intptr_t>(dib_->handle()); |
| 72 #else |
| 73 return static_cast<intptr_t>(dib_->handle()); |
| 74 #endif |
70 } | 75 } |
71 | 76 |
72 virtual TransportDIB* GetTransportDIB() const { | 77 virtual TransportDIB* GetTransportDIB() const { |
73 return dib_.get(); | 78 return dib_.get(); |
74 } | 79 } |
75 | 80 |
76 private: | 81 private: |
77 int width_; | 82 int width_; |
78 int height_; | 83 int height_; |
79 scoped_ptr<TransportDIB> dib_; | 84 scoped_ptr<TransportDIB> dib_; |
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 } | 807 } |
803 | 808 |
804 void PepperPluginDelegateImpl::DidStopLoading() { | 809 void PepperPluginDelegateImpl::DidStopLoading() { |
805 render_view_->DidStopLoadingForPlugin(); | 810 render_view_->DidStopLoadingForPlugin(); |
806 } | 811 } |
807 | 812 |
808 void PepperPluginDelegateImpl::SetContentRestriction(int restrictions) { | 813 void PepperPluginDelegateImpl::SetContentRestriction(int restrictions) { |
809 render_view_->Send(new ViewHostMsg_UpdateContentRestrictions( | 814 render_view_->Send(new ViewHostMsg_UpdateContentRestrictions( |
810 render_view_->routing_id(), restrictions)); | 815 render_view_->routing_id(), restrictions)); |
811 } | 816 } |
OLD | NEW |