OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/child/child_shared_bitmap_manager.h" | 5 #include "content/child/child_shared_bitmap_manager.h" |
6 | 6 |
7 #include "base/debug/alias.h" | 7 #include "base/debug/alias.h" |
8 #include "base/process/process_metrics.h" | 8 #include "base/process/process_metrics.h" |
9 #include "content/child/child_thread.h" | 9 #include "content/child/child_thread.h" |
10 #include "content/common/child_process_messages.h" | 10 #include "content/common/child_process_messages.h" |
11 #include "ui/gfx/size.h" | 11 #include "ui/gfx/geometry/size.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 class ChildSharedBitmap : public SharedMemoryBitmap { | 17 class ChildSharedBitmap : public SharedMemoryBitmap { |
18 public: | 18 public: |
19 ChildSharedBitmap(scoped_refptr<ThreadSafeSender> sender, | 19 ChildSharedBitmap(scoped_refptr<ThreadSafeSender> sender, |
20 base::SharedMemory* shared_memory, | 20 base::SharedMemory* shared_memory, |
21 const cc::SharedBitmapId& id) | 21 const cc::SharedBitmapId& id) |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 if (!mem->ShareToProcess(base::GetCurrentProcessHandle(), &handle_to_send)) | 146 if (!mem->ShareToProcess(base::GetCurrentProcessHandle(), &handle_to_send)) |
147 return scoped_ptr<cc::SharedBitmap>(); | 147 return scoped_ptr<cc::SharedBitmap>(); |
148 #endif | 148 #endif |
149 sender_->Send(new ChildProcessHostMsg_AllocatedSharedBitmap( | 149 sender_->Send(new ChildProcessHostMsg_AllocatedSharedBitmap( |
150 mem->mapped_size(), handle_to_send, id)); | 150 mem->mapped_size(), handle_to_send, id)); |
151 | 151 |
152 return make_scoped_ptr(new ChildSharedBitmap(sender_, mem, id)); | 152 return make_scoped_ptr(new ChildSharedBitmap(sender_, mem, id)); |
153 } | 153 } |
154 | 154 |
155 } // namespace content | 155 } // namespace content |
OLD | NEW |