Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: chrome/browser/tab_contents/background_contents.cc

Issue 6226002: Blow away BackgroundContents when RenderView goes away. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome
Patch Set: Removed queueing code in unit test Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/tab_contents/background_contents.h" 5 #include "chrome/browser/tab_contents/background_contents.h"
6 6
7 #include "chrome/browser/background_contents_service.h" 7 #include "chrome/browser/background_contents_service.h"
8 #include "chrome/browser/browsing_instance.h" 8 #include "chrome/browser/browsing_instance.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/renderer_host/render_view_host.h" 10 #include "chrome/browser/renderer_host/render_view_host.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 168
169 void BackgroundContents::Close(RenderViewHost* render_view_host) { 169 void BackgroundContents::Close(RenderViewHost* render_view_host) {
170 Profile* profile = render_view_host->process()->profile(); 170 Profile* profile = render_view_host->process()->profile();
171 NotificationService::current()->Notify( 171 NotificationService::current()->Notify(
172 NotificationType::BACKGROUND_CONTENTS_CLOSED, 172 NotificationType::BACKGROUND_CONTENTS_CLOSED,
173 Source<Profile>(profile), 173 Source<Profile>(profile),
174 Details<BackgroundContents>(this)); 174 Details<BackgroundContents>(this));
175 delete this; 175 delete this;
176 } 176 }
177 177
178 void BackgroundContents::RenderViewGone(RenderViewHost* rvh,
179 base::TerminationStatus status,
180 int error_code) {
181 // Our RenderView went away, so we should go away also, so killing the process
182 // via the TaskManager doesn't permanently leave a BackgroundContents hanging
183 // around the system, blocking future instances from being created
184 // (http://crbug.com/65189).
185 delete this;
186 }
187
178 RendererPreferences BackgroundContents::GetRendererPrefs( 188 RendererPreferences BackgroundContents::GetRendererPrefs(
179 Profile* profile) const { 189 Profile* profile) const {
180 RendererPreferences preferences; 190 RendererPreferences preferences;
181 renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile); 191 renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile);
182 return preferences; 192 return preferences;
183 } 193 }
184 194
185 WebPreferences BackgroundContents::GetWebkitPrefs() { 195 WebPreferences BackgroundContents::GetWebkitPrefs() {
186 // TODO(rafaelw): Consider enabling the webkit_prefs.dom_paste_enabled for 196 // TODO(rafaelw): Consider enabling the webkit_prefs.dom_paste_enabled for
187 // apps. 197 // apps.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 BackgroundContents* 253 BackgroundContents*
244 BackgroundContents::GetBackgroundContentsByID(int render_process_id, 254 BackgroundContents::GetBackgroundContentsByID(int render_process_id,
245 int render_view_id) { 255 int render_view_id) {
246 RenderViewHost* render_view_host = 256 RenderViewHost* render_view_host =
247 RenderViewHost::FromID(render_process_id, render_view_id); 257 RenderViewHost::FromID(render_process_id, render_view_id);
248 if (!render_view_host) 258 if (!render_view_host)
249 return NULL; 259 return NULL;
250 260
251 return render_view_host->delegate()->GetAsBackgroundContents(); 261 return render_view_host->delegate()->GetAsBackgroundContents();
252 } 262 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/background_contents.h ('k') | chrome/browser/task_manager/task_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698