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 "ppapi/proxy/plugin_globals.h" | 5 #include "ppapi/proxy/plugin_globals.h" |
6 | 6 |
7 #include "base/task_runner.h" | 7 #include "base/task_runner.h" |
8 #include "base/threading/thread.h" | 8 #include "base/threading/thread.h" |
9 #include "ipc/ipc_message.h" | 9 #include "ipc/ipc_message.h" |
10 #include "ipc/ipc_sender.h" | 10 #include "ipc/ipc_sender.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // Since we have only one module in a plugin process, broadcast is always | 143 // Since we have only one module in a plugin process, broadcast is always |
144 // the same as "send to everybody" which is what the dispatcher implements | 144 // the same as "send to everybody" which is what the dispatcher implements |
145 // for the "instance = 0" case. | 145 // for the "instance = 0" case. |
146 LogWithSource(0, level, source, value); | 146 LogWithSource(0, level, source, value); |
147 } | 147 } |
148 | 148 |
149 MessageLoopShared* PluginGlobals::GetCurrentMessageLoop() { | 149 MessageLoopShared* PluginGlobals::GetCurrentMessageLoop() { |
150 return MessageLoopResource::GetCurrent(); | 150 return MessageLoopResource::GetCurrent(); |
151 } | 151 } |
152 | 152 |
153 base::TaskRunner* PluginGlobals::GetFileTaskRunner(PP_Instance instance) { | 153 base::TaskRunner* PluginGlobals::GetFileTaskRunner() { |
154 if (!file_thread_.get()) { | 154 if (!file_thread_.get()) { |
155 file_thread_.reset(new base::Thread("Plugin::File")); | 155 file_thread_.reset(new base::Thread("Plugin::File")); |
156 base::Thread::Options options; | 156 base::Thread::Options options; |
157 options.message_loop_type = base::MessageLoop::TYPE_IO; | 157 options.message_loop_type = base::MessageLoop::TYPE_IO; |
158 file_thread_->StartWithOptions(options); | 158 file_thread_->StartWithOptions(options); |
159 } | 159 } |
160 return file_thread_->message_loop_proxy(); | 160 return file_thread_->message_loop_proxy(); |
161 } | 161 } |
162 | 162 |
163 IPC::Sender* PluginGlobals::GetBrowserSender() { | 163 IPC::Sender* PluginGlobals::GetBrowserSender() { |
(...skipping 25 matching lines...) Expand all Loading... |
189 MessageLoopResource* PluginGlobals::loop_for_main_thread() { | 189 MessageLoopResource* PluginGlobals::loop_for_main_thread() { |
190 return loop_for_main_thread_.get(); | 190 return loop_for_main_thread_.get(); |
191 } | 191 } |
192 | 192 |
193 bool PluginGlobals::IsPluginGlobals() const { | 193 bool PluginGlobals::IsPluginGlobals() const { |
194 return true; | 194 return true; |
195 } | 195 } |
196 | 196 |
197 } // namespace proxy | 197 } // namespace proxy |
198 } // namespace ppapi | 198 } // namespace ppapi |
OLD | NEW |