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

Side by Side Diff: ppapi/proxy/image_data.cc

Issue 6334016: Refactor PPAPI proxy resource handling to maintain which host they came from,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 months 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
OLDNEW
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(PP_Instance instance, 19 ImageData::ImageData(PP_Instance instance,
20 SerializedResource resource,
20 const PP_ImageDataDesc& desc, 21 const PP_ImageDataDesc& desc,
21 ImageHandle handle) 22 ImageHandle handle)
22 : PluginResource(instance), 23 : PluginResource(instance, resource),
23 desc_(desc), 24 desc_(desc),
24 handle_(handle), 25 handle_(handle),
25 mapped_data_(NULL) { 26 mapped_data_(NULL) {
26 } 27 }
27 28
28 ImageData::~ImageData() { 29 ImageData::~ImageData() {
29 Unmap(); 30 Unmap();
30 } 31 }
31 32
32 ImageData* ImageData::AsImageData() { 33 ImageData* ImageData::AsImageData() {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 return reinterpret_cast<ImageHandle>(i); 89 return reinterpret_cast<ImageHandle>(i);
89 #elif defined(OS_MACOSX) 90 #elif defined(OS_MACOSX)
90 return ImageHandle(i, false); 91 return ImageHandle(i, false);
91 #else 92 #else
92 return static_cast<ImageHandle>(i); 93 return static_cast<ImageHandle>(i);
93 #endif 94 #endif
94 } 95 }
95 96
96 } // namespace proxy 97 } // namespace proxy
97 } // namespace pp 98 } // namespace pp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698