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

Side by Side Diff: services/ui/public/cpp/mojo_buffer_backing.cc

Issue 2184943002: services/ui: Move some files into the client lib. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@chrome-gpu-in-mus-windows
Patch Set: . Created 4 years, 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "services/ui/common/mojo_buffer_backing.h" 5 #include "services/ui/public/cpp/mojo_buffer_backing.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 9
10 namespace ui { 10 namespace ui {
11 11
12 MojoBufferBacking::MojoBufferBacking(mojo::ScopedSharedBufferMapping mapping, 12 MojoBufferBacking::MojoBufferBacking(mojo::ScopedSharedBufferMapping mapping,
13 size_t size) 13 size_t size)
14 : mapping_(std::move(mapping)), size_(size) {} 14 : mapping_(std::move(mapping)), size_(size) {}
15 15
16 MojoBufferBacking::~MojoBufferBacking() = default; 16 MojoBufferBacking::~MojoBufferBacking() = default;
17 17
18 // static 18 // static
19 std::unique_ptr<gpu::BufferBacking> MojoBufferBacking::Create( 19 std::unique_ptr<gpu::BufferBacking> MojoBufferBacking::Create(
20 mojo::ScopedSharedBufferHandle handle, 20 mojo::ScopedSharedBufferHandle handle,
21 size_t size) { 21 size_t size) {
22 mojo::ScopedSharedBufferMapping mapping = handle->Map(size); 22 mojo::ScopedSharedBufferMapping mapping = handle->Map(size);
23 if (!mapping) 23 if (!mapping)
24 return nullptr; 24 return nullptr;
25 return base::MakeUnique<MojoBufferBacking>(std::move(mapping), size); 25 return base::MakeUnique<MojoBufferBacking>(std::move(mapping), size);
26 } 26 }
27 void* MojoBufferBacking::GetMemory() const { 27 void* MojoBufferBacking::GetMemory() const {
28 return mapping_.get(); 28 return mapping_.get();
29 } 29 }
30 size_t MojoBufferBacking::GetSize() const { 30 size_t MojoBufferBacking::GetSize() const {
31 return size_; 31 return size_;
32 } 32 }
33 33
34 } // namespace ui 34 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/public/cpp/mojo_buffer_backing.h ('k') | services/ui/public/cpp/mojo_gpu_memory_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698