| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/public/test/mock_render_thread.h" | 5 #include "content/public/test/mock_render_thread.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 void MockRenderThread::SetResourceDispatcherDelegate( | 122 void MockRenderThread::SetResourceDispatcherDelegate( |
| 123 ResourceDispatcherDelegate* delegate) { | 123 ResourceDispatcherDelegate* delegate) { |
| 124 } | 124 } |
| 125 | 125 |
| 126 void MockRenderThread::RecordAction(const base::UserMetricsAction& action) { | 126 void MockRenderThread::RecordAction(const base::UserMetricsAction& action) { |
| 127 } | 127 } |
| 128 | 128 |
| 129 void MockRenderThread::RecordComputedAction(const std::string& action) { | 129 void MockRenderThread::RecordComputedAction(const std::string& action) { |
| 130 } | 130 } |
| 131 | 131 |
| 132 scoped_ptr<base::SharedMemory> | 132 std::unique_ptr<base::SharedMemory> |
| 133 MockRenderThread::HostAllocateSharedMemoryBuffer( | 133 MockRenderThread::HostAllocateSharedMemoryBuffer(size_t buffer_size) { |
| 134 size_t buffer_size) { | 134 std::unique_ptr<base::SharedMemory> shared_buf(new base::SharedMemory); |
| 135 scoped_ptr<base::SharedMemory> shared_buf(new base::SharedMemory); | |
| 136 if (!shared_buf->CreateAnonymous(buffer_size)) { | 135 if (!shared_buf->CreateAnonymous(buffer_size)) { |
| 137 NOTREACHED() << "Cannot map shared memory buffer"; | 136 NOTREACHED() << "Cannot map shared memory buffer"; |
| 138 return scoped_ptr<base::SharedMemory>(); | 137 return std::unique_ptr<base::SharedMemory>(); |
| 139 } | 138 } |
| 140 | 139 |
| 141 return scoped_ptr<base::SharedMemory>(shared_buf.release()); | 140 return std::unique_ptr<base::SharedMemory>(shared_buf.release()); |
| 142 } | 141 } |
| 143 | 142 |
| 144 cc::SharedBitmapManager* MockRenderThread::GetSharedBitmapManager() { | 143 cc::SharedBitmapManager* MockRenderThread::GetSharedBitmapManager() { |
| 145 return &shared_bitmap_manager_; | 144 return &shared_bitmap_manager_; |
| 146 } | 145 } |
| 147 | 146 |
| 148 void MockRenderThread::RegisterExtension(v8::Extension* extension) { | 147 void MockRenderThread::RegisterExtension(v8::Extension* extension) { |
| 149 blink::WebScriptController::registerExtension(extension); | 148 blink::WebScriptController::registerExtension(extension); |
| 150 } | 149 } |
| 151 | 150 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 void MockRenderThread::OnDuplicateSection( | 247 void MockRenderThread::OnDuplicateSection( |
| 249 base::SharedMemoryHandle renderer_handle, | 248 base::SharedMemoryHandle renderer_handle, |
| 250 base::SharedMemoryHandle* browser_handle) { | 249 base::SharedMemoryHandle* browser_handle) { |
| 251 // We don't have to duplicate the input handles since RenderViewTest does not | 250 // We don't have to duplicate the input handles since RenderViewTest does not |
| 252 // separate a browser process from a renderer process. | 251 // separate a browser process from a renderer process. |
| 253 *browser_handle = renderer_handle; | 252 *browser_handle = renderer_handle; |
| 254 } | 253 } |
| 255 #endif // defined(OS_WIN) | 254 #endif // defined(OS_WIN) |
| 256 | 255 |
| 257 } // namespace content | 256 } // namespace content |
| OLD | NEW |