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

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

Issue 5741001: Even more virtual method deinlining. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase (windows) Created 10 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/proxy/image_data.h ('k') | ppapi/proxy/plugin_resource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(const PP_ImageDataDesc& desc, ImageHandle handle) 19 ImageData::ImageData(const PP_ImageDataDesc& desc, ImageHandle handle)
20 : desc_(desc), 20 : desc_(desc),
21 handle_(handle), 21 handle_(handle),
22 mapped_data_(NULL) { 22 mapped_data_(NULL) {
23 } 23 }
24 24
25 ImageData::~ImageData() { 25 ImageData::~ImageData() {
26 Unmap(); 26 Unmap();
27 } 27 }
28 28
29 ImageData* ImageData::AsImageData() {
30 return this;
31 }
32
29 void* ImageData::Map() { 33 void* ImageData::Map() {
30 #if defined(OS_WIN) 34 #if defined(OS_WIN)
31 NOTIMPLEMENTED(); 35 NOTIMPLEMENTED();
32 return NULL; 36 return NULL;
33 #elif defined(OS_MACOSX) 37 #elif defined(OS_MACOSX)
34 struct stat st; 38 struct stat st;
35 if (fstat(handle_.fd, &st) != 0) 39 if (fstat(handle_.fd, &st) != 0)
36 return NULL; 40 return NULL;
37 void* memory = mmap(NULL, st.st_size, PROT_READ | PROT_WRITE, 41 void* memory = mmap(NULL, st.st_size, PROT_READ | PROT_WRITE,
38 MAP_SHARED, handle_.fd, 0); 42 MAP_SHARED, handle_.fd, 0);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 return reinterpret_cast<ImageHandle>(i); 86 return reinterpret_cast<ImageHandle>(i);
83 #elif defined(OS_MACOSX) 87 #elif defined(OS_MACOSX)
84 return ImageHandle(i, false); 88 return ImageHandle(i, false);
85 #else 89 #else
86 return static_cast<ImageHandle>(i); 90 return static_cast<ImageHandle>(i);
87 #endif 91 #endif
88 } 92 }
89 93
90 } // namespace proxy 94 } // namespace proxy
91 } // namespace pp 95 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/proxy/image_data.h ('k') | ppapi/proxy/plugin_resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698