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/utility/utility_thread_impl.h" | 5 #include "content/utility/utility_thread_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 IPC_MESSAGE_UNHANDLED(handled = false) | 111 IPC_MESSAGE_UNHANDLED(handled = false) |
112 IPC_END_MESSAGE_MAP() | 112 IPC_END_MESSAGE_MAP() |
113 return handled; | 113 return handled; |
114 } | 114 } |
115 | 115 |
116 void UtilityThreadImpl::OnBatchModeStarted() { | 116 void UtilityThreadImpl::OnBatchModeStarted() { |
117 batch_mode_ = true; | 117 batch_mode_ = true; |
118 } | 118 } |
119 | 119 |
120 void UtilityThreadImpl::OnBatchModeFinished() { | 120 void UtilityThreadImpl::OnBatchModeFinished() { |
121 ChildProcess::current()->ReleaseProcess(); | 121 batch_mode_ = false; |
| 122 ReleaseProcessIfNeeded(); |
122 } | 123 } |
123 | 124 |
124 #if defined(OS_POSIX) | 125 #if defined(OS_POSIX) |
125 void UtilityThreadImpl::OnLoadPlugins( | 126 void UtilityThreadImpl::OnLoadPlugins( |
126 const std::vector<base::FilePath>& plugin_paths) { | 127 const std::vector<base::FilePath>& plugin_paths) { |
127 PluginList* plugin_list = PluginList::Singleton(); | 128 PluginList* plugin_list = PluginList::Singleton(); |
128 | 129 |
129 std::vector<WebPluginInfo> plugins; | 130 std::vector<WebPluginInfo> plugins; |
130 // TODO(bauerb): If we restart loading plug-ins, we might mess up the logic in | 131 // TODO(bauerb): If we restart loading plug-ins, we might mess up the logic in |
131 // PluginList::ShouldLoadPlugin due to missing the previously loaded plug-ins | 132 // PluginList::ShouldLoadPlugin due to missing the previously loaded plug-ins |
132 // in |plugin_groups|. | 133 // in |plugin_groups|. |
133 for (size_t i = 0; i < plugin_paths.size(); ++i) { | 134 for (size_t i = 0; i < plugin_paths.size(); ++i) { |
134 WebPluginInfo plugin; | 135 WebPluginInfo plugin; |
135 if (!plugin_list->LoadPluginIntoPluginList( | 136 if (!plugin_list->LoadPluginIntoPluginList( |
136 plugin_paths[i], &plugins, &plugin)) | 137 plugin_paths[i], &plugins, &plugin)) |
137 Send(new UtilityHostMsg_LoadPluginFailed(i, plugin_paths[i])); | 138 Send(new UtilityHostMsg_LoadPluginFailed(i, plugin_paths[i])); |
138 else | 139 else |
139 Send(new UtilityHostMsg_LoadedPlugin(i, plugin)); | 140 Send(new UtilityHostMsg_LoadedPlugin(i, plugin)); |
140 } | 141 } |
141 | 142 |
142 ReleaseProcessIfNeeded(); | 143 ReleaseProcessIfNeeded(); |
143 } | 144 } |
144 #endif | 145 #endif |
145 | 146 |
146 } // namespace content | 147 } // namespace content |
OLD | NEW |