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 "chrome/renderer/chrome_mock_render_thread.h" | 5 #include "chrome/renderer/chrome_mock_render_thread.h" |
6 | 6 |
7 #include "base/single_thread_task_runner.h" | 7 #include "base/single_thread_task_runner.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 #if defined(ENABLE_EXTENSIONS) | 10 #if defined(ENABLE_EXTENSIONS) |
11 #include "extensions/common/extension_messages.h" | 11 #include "extensions/common/extension_messages.h" |
12 #endif | 12 #endif |
13 | 13 |
14 ChromeMockRenderThread::ChromeMockRenderThread() { | 14 ChromeMockRenderThread::ChromeMockRenderThread() { |
15 } | 15 } |
16 | 16 |
17 ChromeMockRenderThread::~ChromeMockRenderThread() { | 17 ChromeMockRenderThread::~ChromeMockRenderThread() { |
18 } | 18 } |
19 | 19 |
20 scoped_refptr<base::SingleThreadTaskRunner> | 20 scoped_refptr<base::SingleThreadTaskRunner> |
21 ChromeMockRenderThread::GetIOMessageLoopProxy() { | 21 ChromeMockRenderThread::GetIOTaskRunner() { |
22 return io_task_runner_; | 22 return io_task_runner_; |
23 } | 23 } |
24 | 24 |
25 void ChromeMockRenderThread::set_io_message_loop_proxy( | 25 void ChromeMockRenderThread::set_io_task_runner( |
26 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) { | 26 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) { |
27 io_task_runner_ = task_runner; | 27 io_task_runner_ = task_runner; |
28 } | 28 } |
29 | 29 |
30 bool ChromeMockRenderThread::OnMessageReceived(const IPC::Message& msg) { | 30 bool ChromeMockRenderThread::OnMessageReceived(const IPC::Message& msg) { |
31 if (content::MockRenderThread::OnMessageReceived(msg)) | 31 if (content::MockRenderThread::OnMessageReceived(msg)) |
32 return true; | 32 return true; |
33 | 33 |
34 // Some messages we do special handling. | 34 // Some messages we do special handling. |
35 #if defined(ENABLE_EXTENSIONS) | 35 #if defined(ENABLE_EXTENSIONS) |
(...skipping 12 matching lines...) Expand all Loading... |
48 #if defined(ENABLE_EXTENSIONS) | 48 #if defined(ENABLE_EXTENSIONS) |
49 void ChromeMockRenderThread::OnOpenChannelToExtension( | 49 void ChromeMockRenderThread::OnOpenChannelToExtension( |
50 int routing_id, | 50 int routing_id, |
51 const ExtensionMsg_ExternalConnectionInfo& info, | 51 const ExtensionMsg_ExternalConnectionInfo& info, |
52 const std::string& channel_name, | 52 const std::string& channel_name, |
53 bool include_tls_channel_id, | 53 bool include_tls_channel_id, |
54 int* port_id) { | 54 int* port_id) { |
55 *port_id = 0; | 55 *port_id = 0; |
56 } | 56 } |
57 #endif | 57 #endif |
OLD | NEW |