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 "ppapi/proxy/image_data.h" | 5 #include "ppapi/proxy/image_data.h" |
6 | 6 |
7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
8 #include <sys/shm.h> | 8 #include <sys/shm.h> |
9 #endif | 9 #endif |
10 | 10 |
11 #if defined(OS_MACOSX) | 11 #if defined(OS_MACOSX) |
12 #include <sys/stat.h> | 12 #include <sys/stat.h> |
13 #include <sys/mman.h> | 13 #include <sys/mman.h> |
14 #endif | 14 #endif |
15 | 15 |
16 namespace pp { | 16 namespace pp { |
17 namespace proxy { | 17 namespace proxy { |
18 | 18 |
19 ImageData::ImageData(const PP_ImageDataDesc& desc, ImageHandle handle) | 19 ImageData::ImageData(PP_Instance instance, |
20 : desc_(desc), | 20 const PP_ImageDataDesc& desc, |
| 21 ImageHandle handle) |
| 22 : PluginResource(instance), |
| 23 desc_(desc), |
21 handle_(handle), | 24 handle_(handle), |
22 mapped_data_(NULL) { | 25 mapped_data_(NULL) { |
23 } | 26 } |
24 | 27 |
25 ImageData::~ImageData() { | 28 ImageData::~ImageData() { |
26 Unmap(); | 29 Unmap(); |
27 } | 30 } |
28 | 31 |
29 ImageData* ImageData::AsImageData() { | 32 ImageData* ImageData::AsImageData() { |
30 return this; | 33 return this; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 return reinterpret_cast<ImageHandle>(i); | 88 return reinterpret_cast<ImageHandle>(i); |
86 #elif defined(OS_MACOSX) | 89 #elif defined(OS_MACOSX) |
87 return ImageHandle(i, false); | 90 return ImageHandle(i, false); |
88 #else | 91 #else |
89 return static_cast<ImageHandle>(i); | 92 return static_cast<ImageHandle>(i); |
90 #endif | 93 #endif |
91 } | 94 } |
92 | 95 |
93 } // namespace proxy | 96 } // namespace proxy |
94 } // namespace pp | 97 } // namespace pp |
OLD | NEW |