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 if (next_load_index_ == canonical_list_.size()) { | 47 canonical_list_.erase(canonical_list_.begin(), |
48 // How this case occurs is unknown. See crbug.com/111935. | 48 canonical_list_.begin() + next_load_index_ + 1); |
49 canonical_list_.clear(); | |
50 } else { | |
51 canonical_list_.erase(canonical_list_.begin(), | |
52 canonical_list_.begin() + next_load_index_ + 1); | |
53 } | |
54 | |
55 next_load_index_ = 0; | 49 next_load_index_ = 0; |
56 | 50 |
57 LoadPluginsInternal(); | 51 LoadPluginsInternal(); |
58 } | 52 } |
59 | 53 |
60 bool PluginLoaderPosix::Send(IPC::Message* message) { | 54 bool PluginLoaderPosix::Send(IPC::Message* message) { |
61 if (process_host_) | 55 if (process_host_) |
62 return process_host_->Send(message); | 56 return process_host_->Send(message); |
63 return false; | 57 return false; |
64 } | 58 } |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 174 |
181 PluginLoaderPosix::PendingCallback::PendingCallback( | 175 PluginLoaderPosix::PendingCallback::PendingCallback( |
182 scoped_refptr<base::MessageLoopProxy> loop, | 176 scoped_refptr<base::MessageLoopProxy> loop, |
183 const content::PluginService::GetPluginsCallback& cb) | 177 const content::PluginService::GetPluginsCallback& cb) |
184 : target_loop(loop), | 178 : target_loop(loop), |
185 callback(cb) { | 179 callback(cb) { |
186 } | 180 } |
187 | 181 |
188 PluginLoaderPosix::PendingCallback::~PendingCallback() { | 182 PluginLoaderPosix::PendingCallback::~PendingCallback() { |
189 } | 183 } |
OLD | NEW |