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/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // each plugin in the order specified by the list. It sends an IPC message | 35 // each plugin in the order specified by the list. It sends an IPC message |
36 // to the browser after each load, indicating success or failure. The two | 36 // to the browser after each load, indicating success or failure. The two |
37 // processes synchronize the position in the vector that will be used to | 37 // processes synchronize the position in the vector that will be used to |
38 // attempt to load the next plugin. | 38 // attempt to load the next plugin. |
39 // 4. If the child dies during this process, the host forks another child and | 39 // 4. If the child dies during this process, the host forks another child and |
40 // resumes loading at the position past the plugin that it just attempted to | 40 // resumes loading at the position past the plugin that it just attempted to |
41 // load, bypassing the problematic plugin. | 41 // load, bypassing the problematic plugin. |
42 // 5. This algorithm continues until the canonical list has been walked to the | 42 // 5. This algorithm continues until the canonical list has been walked to the |
43 // end, after which the list of loaded plugins is set on the PluginList and | 43 // end, after which the list of loaded plugins is set on the PluginList and |
44 // the completion callback is run. | 44 // the completion callback is run. |
45 class PluginLoaderPosix : public UtilityProcessHost::Client, | 45 class CONTENT_EXPORT PluginLoaderPosix : public UtilityProcessHost::Client, |
46 IPC::Message::Sender { | 46 IPC::Message::Sender { |
47 public: | 47 public: |
48 PluginLoaderPosix(); | 48 PluginLoaderPosix(); |
49 | 49 |
50 // Must be called from the IO thread. | 50 // Must be called from the IO thread. |
51 void LoadPlugins(scoped_refptr<base::MessageLoopProxy> target_loop, | 51 void LoadPlugins(scoped_refptr<base::MessageLoopProxy> target_loop, |
52 const PluginService::GetPluginsCallback& callback); | 52 const PluginService::GetPluginsCallback& callback); |
53 | 53 |
54 // UtilityProcessHost::Client: | 54 // UtilityProcessHost::Client: |
55 virtual void OnProcessCrashed(int exit_code) OVERRIDE; | 55 virtual void OnProcessCrashed(int exit_code) OVERRIDE; |
56 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 56 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 std::vector<PendingCallback> callbacks_; | 111 std::vector<PendingCallback> callbacks_; |
112 | 112 |
113 // The time at which plugin loading started. | 113 // The time at which plugin loading started. |
114 base::TimeTicks load_start_time_; | 114 base::TimeTicks load_start_time_; |
115 | 115 |
116 friend class MockPluginLoaderPosix; | 116 friend class MockPluginLoaderPosix; |
117 DISALLOW_COPY_AND_ASSIGN(PluginLoaderPosix); | 117 DISALLOW_COPY_AND_ASSIGN(PluginLoaderPosix); |
118 }; | 118 }; |
119 | 119 |
120 #endif // CONTENT_BROWSER_PLUGIN_LOADER_POSIX_H_ | 120 #endif // CONTENT_BROWSER_PLUGIN_LOADER_POSIX_H_ |
OLD | NEW |