summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-26 20:36:43 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-26 20:36:43 +0000
commit9a33920b5720809dcd45e551319695981f98eb9b (patch)
treeaebade063cb9cd5bd9e5aa98e9cd286028344b90 /chrome
parented3456f80512a28e4e0d9b8e931a1813db33a880 (diff)
downloadchromium_src-9a33920b5720809dcd45e551319695981f98eb9b.zip
chromium_src-9a33920b5720809dcd45e551319695981f98eb9b.tar.gz
chromium_src-9a33920b5720809dcd45e551319695981f98eb9b.tar.bz2
Fix BrowserTest.ThirtyFourTabs and possibly other ui tests in single-process mode. The problem was that RenderProcess was being destructed on both threads at the same time because of the scoped_ptr.
Review URL: http://codereview.chromium.org/27228 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10507 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/browser_uitest.cc2
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc12
2 files changed, 9 insertions, 5 deletions
diff --git a/chrome/browser/browser_uitest.cc b/chrome/browser/browser_uitest.cc
index 49524cb..c88f7d9 100644
--- a/chrome/browser/browser_uitest.cc
+++ b/chrome/browser/browser_uitest.cc
@@ -90,7 +90,7 @@ TEST_F(BrowserTest, Title) {
// had a hard limit of 31 processes and this test is mainly directed at
// verifying that we don't crash when we pass this limit.
// Disabling this test http://code.google.com/p/chromium/issues/detail?id=8119
-TEST_F(BrowserTest, DISABLED_ThirtyFourTabs) {
+TEST_F(BrowserTest, ThirtyFourTabs) {
std::wstring test_file = test_data_directory_;
file_util::AppendToPath(&test_file, L"title2.html");
GURL url(net::FilePathToFileURL(test_file));
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index b1efc93..4d43423 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -71,11 +71,14 @@ namespace {
// ----------------------------------------------------------------------------
+// This class creates the IO thread for the renderer when running in
+// single-process mode. It's not used in multi-process mode.
class RendererMainThread : public base::Thread {
public:
explicit RendererMainThread(const std::wstring& channel_id)
: base::Thread("Chrome_InProcRendererThread"),
- channel_id_(channel_id) {
+ channel_id_(channel_id),
+ render_process_(NULL) {
}
protected:
@@ -84,7 +87,7 @@ class RendererMainThread : public base::Thread {
CoInitialize(NULL);
#endif
- render_process_.reset(new RenderProcess(channel_id_));
+ render_process_ = new RenderProcess(channel_id_);
// It's a little lame to manually set this flag. But the single process
// RendererThread will receive the WM_QUIT. We don't need to assert on
// this thread, so just force the flag manually.
@@ -94,7 +97,7 @@ class RendererMainThread : public base::Thread {
}
virtual void CleanUp() {
- render_process_.reset();
+ delete render_process_;
#if defined(OS_WIN)
CoUninitialize();
@@ -103,7 +106,8 @@ class RendererMainThread : public base::Thread {
private:
std::wstring channel_id_;
- scoped_ptr<RenderProcess> render_process_;
+ // Deleted in CleanUp() on the renderer thread, so don't use a smart pointer.
+ RenderProcess* render_process_;
};
// Used for a View_ID where the renderer has not been attached yet