OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_PLUGIN_LOADER_POSIX_H_ |
| 6 #define CONTENT_BROWSER_PLUGIN_LOADER_POSIX_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/memory/ref_counted.h" |
| 11 #include "content/browser/plugin_service.h" |
| 12 #include "content/browser/utility_process_host.h" |
| 13 #include "webkit/plugins/webplugininfo.h" |
| 14 |
| 15 namespace base { |
| 16 class MessageLoopProxy; |
| 17 } |
| 18 |
| 19 class PluginLoaderPosix : public UtilityProcessHost::Client { |
| 20 public: |
| 21 // Must be called on the IO thread. |
| 22 static void LoadPlugins(base::MessageLoopProxy* target_loop, |
| 23 const PluginService::GetPluginsCallback& callback); |
| 24 |
| 25 // UtilityProcessHost::Client: |
| 26 virtual void OnProcessCrashed(int exit_code) OVERRIDE; |
| 27 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 28 |
| 29 private: |
| 30 PluginLoaderPosix(base::MessageLoopProxy* target_loop, |
| 31 const PluginService::GetPluginsCallback& callback); |
| 32 virtual ~PluginLoaderPosix(); |
| 33 |
| 34 void OnGotPlugins(const std::vector<webkit::WebPluginInfo>& plugins); |
| 35 |
| 36 // The callback and message loop on which the callback will be run when the |
| 37 // plugin loading process has been completed. |
| 38 scoped_refptr<base::MessageLoopProxy> target_loop_; |
| 39 PluginService::GetPluginsCallback callback_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(PluginLoaderPosix); |
| 42 }; |
| 43 |
| 44 #endif // CONTENT_BROWSER_PLUGIN_LOADER_POSIX_H_ |
OLD | NEW |