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/browser/plugin_loader_posix.h" | 5 #include "content/browser/plugin_loader_posix.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
11 #include "content/common/child_process_host_impl.h" | 11 #include "content/common/child_process_host_impl.h" |
12 #include "content/common/utility_messages.h" | 12 #include "content/common/utility_messages.h" |
13 #include "content/browser/utility_process_host_impl.h" | 13 #include "content/browser/utility_process_host_impl.h" |
14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
15 #include "webkit/plugins/npapi/plugin_list.h" | 15 #include "webkit/plugins/npapi/plugin_list.h" |
16 | 16 |
17 using content::BrowserThread; | 17 namespace content { |
18 using content::ChildProcessHost; | |
19 | 18 |
20 PluginLoaderPosix::PluginLoaderPosix() | 19 PluginLoaderPosix::PluginLoaderPosix() |
21 : next_load_index_(0) { | 20 : next_load_index_(0) { |
22 } | 21 } |
23 | 22 |
24 void PluginLoaderPosix::LoadPlugins( | 23 void PluginLoaderPosix::LoadPlugins( |
25 scoped_refptr<base::MessageLoopProxy> target_loop, | 24 scoped_refptr<base::MessageLoopProxy> target_loop, |
26 const content::PluginService::GetPluginsCallback& callback) { | 25 const PluginService::GetPluginsCallback& callback) { |
27 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 26 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
28 | 27 |
29 callbacks_.push_back(PendingCallback(target_loop, callback)); | 28 callbacks_.push_back(PendingCallback(target_loop, callback)); |
30 | 29 |
31 if (callbacks_.size() == 1) { | 30 if (callbacks_.size() == 1) { |
32 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 31 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
33 base::Bind(&PluginLoaderPosix::GetPluginsToLoad, this)); | 32 base::Bind(&PluginLoaderPosix::GetPluginsToLoad, this)); |
34 } | 33 } |
35 } | 34 } |
36 | 35 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 if (!callbacks_.empty()) { | 182 if (!callbacks_.empty()) { |
184 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 183 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
185 base::Bind(&PluginLoaderPosix::GetPluginsToLoad, this)); | 184 base::Bind(&PluginLoaderPosix::GetPluginsToLoad, this)); |
186 return false; | 185 return false; |
187 } | 186 } |
188 return true; | 187 return true; |
189 } | 188 } |
190 | 189 |
191 PluginLoaderPosix::PendingCallback::PendingCallback( | 190 PluginLoaderPosix::PendingCallback::PendingCallback( |
192 scoped_refptr<base::MessageLoopProxy> loop, | 191 scoped_refptr<base::MessageLoopProxy> loop, |
193 const content::PluginService::GetPluginsCallback& cb) | 192 const PluginService::GetPluginsCallback& cb) |
194 : target_loop(loop), | 193 : target_loop(loop), |
195 callback(cb) { | 194 callback(cb) { |
196 } | 195 } |
197 | 196 |
198 PluginLoaderPosix::PendingCallback::~PendingCallback() { | 197 PluginLoaderPosix::PendingCallback::~PendingCallback() { |
199 } | 198 } |
| 199 |
| 200 } // namespace content |
OLD | NEW |