summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-06 21:22:34 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-06 21:22:34 +0000
commit7bd36e7cf3b557ea11aa5daa1a46d5fd2e8a8de3 (patch)
treecc7ac60c3bb78a9b68801e33f9a23b2447a9d42a /content
parent36ec945b8dfe6998aa5c2bb9be37bdd8560274f3 (diff)
downloadchromium_src-7bd36e7cf3b557ea11aa5daa1a46d5fd2e8a8de3.zip
chromium_src-7bd36e7cf3b557ea11aa5daa1a46d5fd2e8a8de3.tar.gz
chromium_src-7bd36e7cf3b557ea11aa5daa1a46d5fd2e8a8de3.tar.bz2
Revert 120102 - Merge 120098 - PluginLoaderPosix: Fix the case where the utility process crashes after all plugins have been loaded.
This was causing a crash on load on my system. BUG=111935 TEST=none R=rsesek Review URL: https://chromiumcodereview.appspot.com/9297049 TBR=jhawkins@chromium.org Review URL: https://chromiumcodereview.appspot.com/9316047 TBR=jhawkins@chromium.org Review URL: https://chromiumcodereview.appspot.com/9343003 git-svn-id: svn://svn.chromium.org/chrome/branches/1025/src@120613 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/plugin_loader_posix.cc10
-rw-r--r--content/browser/plugin_loader_posix_unittest.cc45
2 files changed, 3 insertions, 52 deletions
diff --git a/content/browser/plugin_loader_posix.cc b/content/browser/plugin_loader_posix.cc
index 5d506e6..9701a72 100644
--- a/content/browser/plugin_loader_posix.cc
+++ b/content/browser/plugin_loader_posix.cc
@@ -44,14 +44,8 @@ bool PluginLoaderPosix::OnMessageReceived(const IPC::Message& message) {
}
void PluginLoaderPosix::OnProcessCrashed(int exit_code) {
- if (next_load_index_ == canonical_list_.size()) {
- // How this case occurs is unknown. See crbug.com/111935.
- canonical_list_.clear();
- } else {
- canonical_list_.erase(canonical_list_.begin(),
- canonical_list_.begin() + next_load_index_ + 1);
- }
-
+ canonical_list_.erase(canonical_list_.begin(),
+ canonical_list_.begin() + next_load_index_ + 1);
next_load_index_ = 0;
LoadPluginsInternal();
diff --git a/content/browser/plugin_loader_posix_unittest.cc b/content/browser/plugin_loader_posix_unittest.cc
index 990832a..85e66ad 100644
--- a/content/browser/plugin_loader_posix_unittest.cc
+++ b/content/browser/plugin_loader_posix_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -170,49 +170,6 @@ TEST_F(PluginLoaderPosixTest, ThreeSuccessfulLoads) {
EXPECT_EQ(1, did_callback);
}
-TEST_F(PluginLoaderPosixTest, ThreeSuccessfulLoadsThenCrash) {
- int did_callback = 0;
- content::PluginService::GetPluginsCallback callback =
- base::Bind(&VerifyCallback, base::Unretained(&did_callback));
-
- plugin_loader()->LoadPlugins(message_loop()->message_loop_proxy(), callback);
-
- EXPECT_CALL(*plugin_loader(), LoadPluginsInternal()).Times(2);
- message_loop()->RunAllPending();
-
- AddThreePlugins();
-
- EXPECT_EQ(0u, plugin_loader()->next_load_index());
-
- const std::vector<webkit::WebPluginInfo>& plugins(
- plugin_loader()->loaded_plugins());
-
- plugin_loader()->TestOnPluginLoaded(0, plugin1_);
- EXPECT_EQ(1u, plugin_loader()->next_load_index());
- EXPECT_EQ(1u, plugins.size());
- EXPECT_EQ(plugin1_.name, plugins[0].name);
-
- message_loop()->RunAllPending();
- EXPECT_EQ(0, did_callback);
-
- plugin_loader()->TestOnPluginLoaded(1, plugin2_);
- EXPECT_EQ(2u, plugin_loader()->next_load_index());
- EXPECT_EQ(2u, plugins.size());
- EXPECT_EQ(plugin2_.name, plugins[1].name);
-
- message_loop()->RunAllPending();
- EXPECT_EQ(0, did_callback);
-
- plugin_loader()->TestOnPluginLoaded(2, plugin3_);
- EXPECT_EQ(3u, plugins.size());
- EXPECT_EQ(plugin3_.name, plugins[2].name);
-
- message_loop()->RunAllPending();
- EXPECT_EQ(1, did_callback);
-
- plugin_loader()->OnProcessCrashed(42);
-}
-
TEST_F(PluginLoaderPosixTest, TwoFailures) {
int did_callback = 0;
content::PluginService::GetPluginsCallback callback =