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/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
11 #include "base/time.h" | 12 #include "base/time.h" |
12 #include "content/browser/plugin_service.h" | 13 #include "content/browser/plugin_service.h" |
13 #include "content/browser/utility_process_host.h" | 14 #include "content/browser/utility_process_host.h" |
14 #include "ipc/ipc_message.h" | 15 #include "ipc/ipc_message.h" |
15 #include "webkit/plugins/webplugininfo.h" | 16 #include "webkit/plugins/webplugininfo.h" |
16 | 17 |
17 class FilePath; | 18 class FilePath; |
18 class UtilityProcessHost; | 19 class UtilityProcessHost; |
19 | 20 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 71 |
71 virtual ~PluginLoaderPosix(); | 72 virtual ~PluginLoaderPosix(); |
72 | 73 |
73 // Called on the FILE thread to get the list of plugin paths to probe. | 74 // Called on the FILE thread to get the list of plugin paths to probe. |
74 void GetPluginsToLoad(); | 75 void GetPluginsToLoad(); |
75 | 76 |
76 // Must be called on the IO thread. | 77 // Must be called on the IO thread. |
77 virtual void LoadPluginsInternal(); | 78 virtual void LoadPluginsInternal(); |
78 | 79 |
79 // Message handlers. | 80 // Message handlers. |
80 void OnPluginLoaded(uint32_t index, const webkit::WebPluginInfo& plugin); | 81 void OnPluginLoaded(uint32 index, const webkit::WebPluginInfo& plugin); |
81 void OnPluginLoadFailed(uint32_t index, const FilePath& plugin_path); | 82 void OnPluginLoadFailed(uint32 index, const FilePath& plugin_path); |
82 | 83 |
83 // Checks if the plugin path is an internal plugin, and, if it is, adds it to | 84 // Checks if the plugin path is an internal plugin, and, if it is, adds it to |
84 // |loaded_plugins_|. | 85 // |loaded_plugins_|. |
85 bool MaybeAddInternalPlugin(const FilePath& plugin_path); | 86 bool MaybeAddInternalPlugin(const FilePath& plugin_path); |
86 | 87 |
87 // Runs all the registered callbacks on each's target loop if the condition | 88 // Runs all the registered callbacks on each's target loop if the condition |
88 // for ending the load process is done (i.e. the |next_load_index_| is outside | 89 // for ending the load process is done (i.e. the |next_load_index_| is outside |
89 // the ranage of the |canonical_list_|). | 90 // the ranage of the |canonical_list_|). |
90 bool MaybeRunPendingCallbacks(); | 91 bool MaybeRunPendingCallbacks(); |
91 | 92 |
(...skipping 19 matching lines...) Expand all Loading... |
111 std::vector<PendingCallback> callbacks_; | 112 std::vector<PendingCallback> callbacks_; |
112 | 113 |
113 // The time at which plugin loading started. | 114 // The time at which plugin loading started. |
114 base::TimeTicks load_start_time_; | 115 base::TimeTicks load_start_time_; |
115 | 116 |
116 friend class MockPluginLoaderPosix; | 117 friend class MockPluginLoaderPosix; |
117 DISALLOW_COPY_AND_ASSIGN(PluginLoaderPosix); | 118 DISALLOW_COPY_AND_ASSIGN(PluginLoaderPosix); |
118 }; | 119 }; |
119 | 120 |
120 #endif // CONTENT_BROWSER_PLUGIN_LOADER_POSIX_H_ | 121 #endif // CONTENT_BROWSER_PLUGIN_LOADER_POSIX_H_ |
OLD | NEW |