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

Side by Side Diff: chrome/common/transport_dib_mac.cc

Issue 113637: Wire up windowless plugins. Mostly Mac related, some cross (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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
« no previous file with comments | « chrome/common/plugin_messages_internal.h ('k') | chrome/plugin/plugin_main.cc » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/common/transport_dib.h" 5 #include "chrome/common/transport_dib.h"
6 6
7 #include <unistd.h> 7 #include <unistd.h>
8 #include <sys/stat.h> 8 #include <sys/stat.h>
9 9
10 #include "base/eintr_wrapper.h" 10 #include "base/eintr_wrapper.h"
(...skipping 27 matching lines...) Expand all
38 38
39 // static 39 // static
40 TransportDIB* TransportDIB::Map(TransportDIB::Handle handle) { 40 TransportDIB* TransportDIB::Map(TransportDIB::Handle handle) {
41 TransportDIB* dib = new TransportDIB(handle); 41 TransportDIB* dib = new TransportDIB(handle);
42 struct stat st; 42 struct stat st;
43 fstat(handle.fd, &st); 43 fstat(handle.fd, &st);
44 44
45 if (!dib->shared_memory_.Map(st.st_size)) { 45 if (!dib->shared_memory_.Map(st.st_size)) {
46 delete dib; 46 delete dib;
47 HANDLE_EINTR(close(handle.fd)); 47 HANDLE_EINTR(close(handle.fd));
48 return false; 48 return NULL;
49 } 49 }
50 50
51 dib->size_ = st.st_size; 51 dib->size_ = st.st_size;
52 52
53 return dib; 53 return dib;
54 } 54 }
55 55
56 skia::PlatformCanvas* TransportDIB::GetPlatformCanvas(int w, int h) { 56 skia::PlatformCanvas* TransportDIB::GetPlatformCanvas(int w, int h) {
57 return new skia::PlatformCanvas(w, h, true, 57 return new skia::PlatformCanvas(w, h, true,
58 reinterpret_cast<uint8_t*>(memory())); 58 reinterpret_cast<uint8_t*>(memory()));
59 } 59 }
60 60
61 void* TransportDIB::memory() const { 61 void* TransportDIB::memory() const {
62 return shared_memory_.memory(); 62 return shared_memory_.memory();
63 } 63 }
64 64
65 TransportDIB::Id TransportDIB::id() const { 65 TransportDIB::Id TransportDIB::id() const {
66 return shared_memory_.id(); 66 return shared_memory_.id();
67 } 67 }
68 68
69 TransportDIB::Handle TransportDIB::handle() const { 69 TransportDIB::Handle TransportDIB::handle() const {
70 return shared_memory_.handle(); 70 return shared_memory_.handle();
71 } 71 }
OLDNEW
« no previous file with comments | « chrome/common/plugin_messages_internal.h ('k') | chrome/plugin/plugin_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698