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

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

Issue 6310008: Revert 71458 - Blow away BackgroundContents when RenderView goes away.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
188 RendererPreferences BackgroundContents::GetRendererPrefs( 178 RendererPreferences BackgroundContents::GetRendererPrefs(
189 Profile* profile) const { 179 Profile* profile) const {
190 RendererPreferences preferences; 180 RendererPreferences preferences;
191 renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile); 181 renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile);
192 return preferences; 182 return preferences;
193 } 183 }
194 184
195 WebPreferences BackgroundContents::GetWebkitPrefs() { 185 WebPreferences BackgroundContents::GetWebkitPrefs() {
196 // TODO(rafaelw): Consider enabling the webkit_prefs.dom_paste_enabled for 186 // TODO(rafaelw): Consider enabling the webkit_prefs.dom_paste_enabled for
197 // apps. 187 // apps.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 BackgroundContents* 243 BackgroundContents*
254 BackgroundContents::GetBackgroundContentsByID(int render_process_id, 244 BackgroundContents::GetBackgroundContentsByID(int render_process_id,
255 int render_view_id) { 245 int render_view_id) {
256 RenderViewHost* render_view_host = 246 RenderViewHost* render_view_host =
257 RenderViewHost::FromID(render_process_id, render_view_id); 247 RenderViewHost::FromID(render_process_id, render_view_id);
258 if (!render_view_host) 248 if (!render_view_host)
259 return NULL; 249 return NULL;
260 250
261 return render_view_host->delegate()->GetAsBackgroundContents(); 251 return render_view_host->delegate()->GetAsBackgroundContents();
262 } 252 }
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