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

Unified Diff: ui/surface/transport_dib_win.cc

Issue 1320783002: Make SharedMemoryHandle a class on windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ipc_global
Patch Set: Rebase. Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/surface/transport_dib.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/surface/transport_dib_win.cc
diff --git a/ui/surface/transport_dib_win.cc b/ui/surface/transport_dib_win.cc
index e8d36adbd5a5454c36e64bb46ac18b5bbbe6d762..af55af284349ca9648a9088d4c14f3024efc0dae 100644
--- a/ui/surface/transport_dib_win.cc
+++ b/ui/surface/transport_dib_win.cc
@@ -20,10 +20,8 @@ TransportDIB::TransportDIB()
TransportDIB::~TransportDIB() {
}
-TransportDIB::TransportDIB(HANDLE handle)
- : shared_memory_(handle, false /* read write */),
- size_(0) {
-}
+TransportDIB::TransportDIB(base::SharedMemoryHandle handle)
+ : shared_memory_(handle, false /* read write */), size_(0) {}
// static
TransportDIB* TransportDIB::Create(size_t size, uint32 sequence_num) {
@@ -55,7 +53,7 @@ TransportDIB* TransportDIB::CreateWithHandle(Handle handle) {
// static
bool TransportDIB::is_valid_handle(Handle dib) {
- return dib != NULL;
+ return dib.IsValid();
}
skia::PlatformCanvas* TransportDIB::GetPlatformCanvas(int w, int h) {
@@ -66,9 +64,9 @@ skia::PlatformCanvas* TransportDIB::GetPlatformCanvas(int w, int h) {
// We can't check the canvas size before mapping, but it's safe because
// Windows will fail to map the section if the dimensions of the canvas
// are too large.
- skia::PlatformCanvas* canvas =
- skia::CreatePlatformCanvas(w, h, true, shared_memory_.handle(),
- skia::RETURN_NULL_ON_FAILURE);
+ skia::PlatformCanvas* canvas = skia::CreatePlatformCanvas(
+ w, h, true, shared_memory_.handle().GetHandle(),
+ skia::RETURN_NULL_ON_FAILURE);
// Calculate the size for the memory region backing the canvas.
if (canvas)
@@ -85,7 +83,7 @@ bool TransportDIB::Map() {
if (!shared_memory_.Map(0 /* map whole shared memory segment */)) {
LOG(ERROR) << "Failed to map transport DIB"
- << " handle:" << shared_memory_.handle()
+ << " handle:" << shared_memory_.handle().GetHandle()
<< " error:" << ::GetLastError();
return false;
}
« no previous file with comments | « ui/surface/transport_dib.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698