Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_image_data.cc

Issue 8872045: Fix PluginImageData and mouselock NaCl example: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_image_data.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can 2 // Use of this source code is governed by a BSD-style license that can
3 // be found in the LICENSE file. 3 // be found in the LICENSE file.
4 4
5 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_image_data.h" 5 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_image_data.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 #include <string.h> 8 #include <string.h>
9 #include <sys/mman.h> 9 #include <sys/mman.h>
10 #include "srpcgen/ppb_rpc.h" 10 #include "srpcgen/ppb_rpc.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 &DoUnmap, 133 &DoUnmap,
134 }; 134 };
135 return &image_data_interface; 135 return &image_data_interface;
136 } 136 }
137 137
138 PluginImageData::PluginImageData() 138 PluginImageData::PluginImageData()
139 : shm_size_(0), 139 : shm_size_(0),
140 addr_(NULL) { 140 addr_(NULL) {
141 } 141 }
142 142
143 PluginImageData::~PluginImageData() {
144 Unmap();
145 }
146
143 bool PluginImageData::InitFromBrowserResource(PP_Resource resource) { 147 bool PluginImageData::InitFromBrowserResource(PP_Resource resource) {
144 nacl_abi_size_t desc_size = static_cast<nacl_abi_size_t>(sizeof(desc_)); 148 nacl_abi_size_t desc_size = static_cast<nacl_abi_size_t>(sizeof(desc_));
145 int32_t success = PP_FALSE; 149 int32_t success = PP_FALSE;
146 150
147 NaClSrpcError result = 151 NaClSrpcError result =
148 PpbImageDataRpcClient::PPB_ImageData_Describe( 152 PpbImageDataRpcClient::PPB_ImageData_Describe(
149 GetMainSrpcChannel(), 153 GetMainSrpcChannel(),
150 resource, 154 resource,
151 &desc_size, 155 &desc_size,
152 reinterpret_cast<char*>(&desc_), 156 reinterpret_cast<char*>(&desc_),
(...skipping 17 matching lines...) Expand all
170 } 174 }
171 175
172 void PluginImageData::Unmap() { 176 void PluginImageData::Unmap() {
173 if (addr_) { 177 if (addr_) {
174 munmap(addr_, ceil64k(shm_size_)); 178 munmap(addr_, ceil64k(shm_size_));
175 addr_ = NULL; 179 addr_ = NULL;
176 } 180 }
177 } 181 }
178 182
179 } // namespace ppapi_proxy 183 } // namespace ppapi_proxy
OLDNEW
« no previous file with comments | « ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_image_data.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698