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/browser/plugin_loader_posix.h" | 5 #include "content/browser/plugin_loader_posix.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 bool handled = true; | 37 bool handled = true; |
38 IPC_BEGIN_MESSAGE_MAP(PluginLoaderPosix, message) | 38 IPC_BEGIN_MESSAGE_MAP(PluginLoaderPosix, message) |
39 IPC_MESSAGE_HANDLER(UtilityHostMsg_LoadedPlugin, OnPluginLoaded) | 39 IPC_MESSAGE_HANDLER(UtilityHostMsg_LoadedPlugin, OnPluginLoaded) |
40 IPC_MESSAGE_HANDLER(UtilityHostMsg_LoadPluginFailed, OnPluginLoadFailed) | 40 IPC_MESSAGE_HANDLER(UtilityHostMsg_LoadPluginFailed, OnPluginLoadFailed) |
41 IPC_MESSAGE_UNHANDLED(handled = false) | 41 IPC_MESSAGE_UNHANDLED(handled = false) |
42 IPC_END_MESSAGE_MAP() | 42 IPC_END_MESSAGE_MAP() |
43 return handled; | 43 return handled; |
44 } | 44 } |
45 | 45 |
46 void PluginLoaderPosix::OnProcessCrashed(int exit_code) { | 46 void PluginLoaderPosix::OnProcessCrashed(int exit_code) { |
47 canonical_list_.erase(canonical_list_.begin(), | 47 if (next_load_index_ == canonical_list_.size()) { |
48 canonical_list_.begin() + next_load_index_ + 1); | 48 // How this case occurs is unknown. See crbug.com/111935. |
| 49 canonical_list_.clear(); |
| 50 } else { |
| 51 canonical_list_.erase(canonical_list_.begin(), |
| 52 canonical_list_.begin() + next_load_index_ + 1); |
| 53 } |
| 54 |
49 next_load_index_ = 0; | 55 next_load_index_ = 0; |
50 | 56 |
51 LoadPluginsInternal(); | 57 LoadPluginsInternal(); |
52 } | 58 } |
53 | 59 |
54 bool PluginLoaderPosix::Send(IPC::Message* message) { | 60 bool PluginLoaderPosix::Send(IPC::Message* message) { |
55 if (process_host_) | 61 if (process_host_) |
56 return process_host_->Send(message); | 62 return process_host_->Send(message); |
57 return false; | 63 return false; |
58 } | 64 } |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 180 |
175 PluginLoaderPosix::PendingCallback::PendingCallback( | 181 PluginLoaderPosix::PendingCallback::PendingCallback( |
176 scoped_refptr<base::MessageLoopProxy> loop, | 182 scoped_refptr<base::MessageLoopProxy> loop, |
177 const content::PluginService::GetPluginsCallback& cb) | 183 const content::PluginService::GetPluginsCallback& cb) |
178 : target_loop(loop), | 184 : target_loop(loop), |
179 callback(cb) { | 185 callback(cb) { |
180 } | 186 } |
181 | 187 |
182 PluginLoaderPosix::PendingCallback::~PendingCallback() { | 188 PluginLoaderPosix::PendingCallback::~PendingCallback() { |
183 } | 189 } |
OLD | NEW |