OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CONTENT_BROWSER_PLUGIN_LOADER_POSIX_H_ | 5 #ifndef CONTENT_BROWSER_PLUGIN_LOADER_POSIX_H_ |
6 #define CONTENT_BROWSER_PLUGIN_LOADER_POSIX_H_ | 6 #define CONTENT_BROWSER_PLUGIN_LOADER_POSIX_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/time.h" | 12 #include "base/time.h" |
13 #include "content/browser/plugin_service.h" | 13 #include "content/browser/plugin_service_impl.h" |
14 #include "content/browser/utility_process_host.h" | 14 #include "content/browser/utility_process_host.h" |
15 #include "ipc/ipc_message.h" | 15 #include "ipc/ipc_message.h" |
16 #include "webkit/plugins/webplugininfo.h" | 16 #include "webkit/plugins/webplugininfo.h" |
17 | 17 |
18 class FilePath; | 18 class FilePath; |
19 class UtilityProcessHost; | 19 class UtilityProcessHost; |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 class MessageLoopProxy; | 22 class MessageLoopProxy; |
23 } | 23 } |
(...skipping 18 matching lines...) Expand all Loading... |
42 // load, bypassing the problematic plugin. | 42 // load, bypassing the problematic plugin. |
43 // 5. This algorithm continues until the canonical list has been walked to the | 43 // 5. This algorithm continues until the canonical list has been walked to the |
44 // end, after which the list of loaded plugins is set on the PluginList and | 44 // end, after which the list of loaded plugins is set on the PluginList and |
45 // the completion callback is run. | 45 // the completion callback is run. |
46 class CONTENT_EXPORT PluginLoaderPosix : public UtilityProcessHost::Client, | 46 class CONTENT_EXPORT PluginLoaderPosix : public UtilityProcessHost::Client, |
47 IPC::Message::Sender { | 47 IPC::Message::Sender { |
48 public: | 48 public: |
49 PluginLoaderPosix(); | 49 PluginLoaderPosix(); |
50 | 50 |
51 // Must be called from the IO thread. | 51 // Must be called from the IO thread. |
52 void LoadPlugins(scoped_refptr<base::MessageLoopProxy> target_loop, | 52 void LoadPlugins( |
53 const PluginService::GetPluginsCallback& callback); | 53 scoped_refptr<base::MessageLoopProxy> target_loop, |
| 54 const content::PluginService::GetPluginsCallback& callback); |
54 | 55 |
55 // UtilityProcessHost::Client: | 56 // UtilityProcessHost::Client: |
56 virtual void OnProcessCrashed(int exit_code) OVERRIDE; | 57 virtual void OnProcessCrashed(int exit_code) OVERRIDE; |
57 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 58 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
58 | 59 |
59 // IPC::Message::Sender: | 60 // IPC::Message::Sender: |
60 virtual bool Send(IPC::Message* msg) OVERRIDE; | 61 virtual bool Send(IPC::Message* msg) OVERRIDE; |
61 | 62 |
62 private: | 63 private: |
63 struct PendingCallback { | 64 struct PendingCallback { |
64 PendingCallback(scoped_refptr<base::MessageLoopProxy> target_loop, | 65 PendingCallback(scoped_refptr<base::MessageLoopProxy> target_loop, |
65 const PluginService::GetPluginsCallback& callback); | 66 const content::PluginService::GetPluginsCallback& callback); |
66 ~PendingCallback(); | 67 ~PendingCallback(); |
67 | 68 |
68 scoped_refptr<base::MessageLoopProxy> target_loop; | 69 scoped_refptr<base::MessageLoopProxy> target_loop; |
69 PluginService::GetPluginsCallback callback; | 70 content::PluginService::GetPluginsCallback callback; |
70 }; | 71 }; |
71 | 72 |
72 virtual ~PluginLoaderPosix(); | 73 virtual ~PluginLoaderPosix(); |
73 | 74 |
74 // Called on the FILE thread to get the list of plugin paths to probe. | 75 // Called on the FILE thread to get the list of plugin paths to probe. |
75 void GetPluginsToLoad(); | 76 void GetPluginsToLoad(); |
76 | 77 |
77 // Must be called on the IO thread. | 78 // Must be called on the IO thread. |
78 virtual void LoadPluginsInternal(); | 79 virtual void LoadPluginsInternal(); |
79 | 80 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 std::vector<PendingCallback> callbacks_; | 113 std::vector<PendingCallback> callbacks_; |
113 | 114 |
114 // The time at which plugin loading started. | 115 // The time at which plugin loading started. |
115 base::TimeTicks load_start_time_; | 116 base::TimeTicks load_start_time_; |
116 | 117 |
117 friend class MockPluginLoaderPosix; | 118 friend class MockPluginLoaderPosix; |
118 DISALLOW_COPY_AND_ASSIGN(PluginLoaderPosix); | 119 DISALLOW_COPY_AND_ASSIGN(PluginLoaderPosix); |
119 }; | 120 }; |
120 | 121 |
121 #endif // CONTENT_BROWSER_PLUGIN_LOADER_POSIX_H_ | 122 #endif // CONTENT_BROWSER_PLUGIN_LOADER_POSIX_H_ |
OLD | NEW |