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

Side by Side Diff: chrome/browser/renderer_host/browser_render_process_host.cc

Issue 159887: Ensure that we never call into WebCore::Page static methods when Page constru... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: now with comments. Created 11 years, 4 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
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 // Represents the browser side of the browser <--> renderer communication 5 // Represents the browser side of the browser <--> renderer communication
6 // channel. There will be one RenderProcessHost per renderer process. 6 // channel. There will be one RenderProcessHost per renderer process.
7 7
8 #include "chrome/browser/renderer_host/browser_render_process_host.h" 8 #include "chrome/browser/renderer_host/browser_render_process_host.h"
9 9
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 // Get the path to the renderer executable, which is the same as the 189 // Get the path to the renderer executable, which is the same as the
190 // current executable. 190 // current executable.
191 bool GetRendererPath(std::wstring* cmd_line) { 191 bool GetRendererPath(std::wstring* cmd_line) {
192 return PathService::Get(base::FILE_EXE, cmd_line); 192 return PathService::Get(base::FILE_EXE, cmd_line);
193 } 193 }
194 194
195 BrowserRenderProcessHost::BrowserRenderProcessHost(Profile* profile) 195 BrowserRenderProcessHost::BrowserRenderProcessHost(Profile* profile)
196 : RenderProcessHost(profile), 196 : RenderProcessHost(profile),
197 visible_widgets_(0), 197 visible_widgets_(0),
198 backgrounded_(true), 198 backgrounded_(true),
199 view_created_(false),
199 ALLOW_THIS_IN_INITIALIZER_LIST(cached_dibs_cleaner_( 200 ALLOW_THIS_IN_INITIALIZER_LIST(cached_dibs_cleaner_(
200 base::TimeDelta::FromSeconds(5), 201 base::TimeDelta::FromSeconds(5),
201 this, &BrowserRenderProcessHost::ClearTransportDIBCache)), 202 this, &BrowserRenderProcessHost::ClearTransportDIBCache)),
202 zygote_child_(false) { 203 zygote_child_(false) {
203 widget_helper_ = new RenderWidgetHelper(); 204 widget_helper_ = new RenderWidgetHelper();
204 205
205 registrar_.Add(this, NotificationType::USER_SCRIPTS_UPDATED, 206 registrar_.Add(this, NotificationType::USER_SCRIPTS_UPDATED,
206 NotificationService::AllSources()); 207 NotificationService::AllSources());
207 208
208 if (run_renderer_in_process()) { 209 if (run_renderer_in_process()) {
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 bool BrowserRenderProcessHost::WaitForPaintMsg(int render_widget_id, 516 bool BrowserRenderProcessHost::WaitForPaintMsg(int render_widget_id,
516 const base::TimeDelta& max_delay, 517 const base::TimeDelta& max_delay,
517 IPC::Message* msg) { 518 IPC::Message* msg) {
518 return widget_helper_->WaitForPaintMsg(render_widget_id, max_delay, msg); 519 return widget_helper_->WaitForPaintMsg(render_widget_id, max_delay, msg);
519 } 520 }
520 521
521 void BrowserRenderProcessHost::ReceivedBadMessage(uint16 msg_type) { 522 void BrowserRenderProcessHost::ReceivedBadMessage(uint16 msg_type) {
522 BadMessageTerminateProcess(msg_type, process_.handle()); 523 BadMessageTerminateProcess(msg_type, process_.handle());
523 } 524 }
524 525
526 void BrowserRenderProcessHost::ViewCreated() {
527 view_created_ = true;
528 visited_link_updater_->Update(this);
529 }
530
525 void BrowserRenderProcessHost::WidgetRestored() { 531 void BrowserRenderProcessHost::WidgetRestored() {
526 // Verify we were properly backgrounded. 532 // Verify we were properly backgrounded.
527 DCHECK_EQ(backgrounded_, (visible_widgets_ == 0)); 533 DCHECK_EQ(backgrounded_, (visible_widgets_ == 0));
528 visible_widgets_++; 534 visible_widgets_++;
529 visited_link_updater_->Update(this); 535 if (view_created_)
536 visited_link_updater_->Update(this);
530 SetBackgrounded(false); 537 SetBackgrounded(false);
531 } 538 }
532 539
533 void BrowserRenderProcessHost::WidgetHidden() { 540 void BrowserRenderProcessHost::WidgetHidden() {
534 // On startup, the browser will call Hide 541 // On startup, the browser will call Hide
535 if (backgrounded_) 542 if (backgrounded_)
536 return; 543 return;
537 544
538 DCHECK_EQ(backgrounded_, (visible_widgets_ == 0)); 545 DCHECK_EQ(backgrounded_, (visible_widgets_ == 0));
539 visible_widgets_--; 546 visible_widgets_--;
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 profile()->GetExtensionMessageService()->RemoveEventListener(event_name, 987 profile()->GetExtensionMessageService()->RemoveEventListener(event_name,
981 pid()); 988 pid());
982 } 989 }
983 } 990 }
984 991
985 void BrowserRenderProcessHost::OnExtensionCloseChannel(int port_id) { 992 void BrowserRenderProcessHost::OnExtensionCloseChannel(int port_id) {
986 if (profile()->GetExtensionMessageService()) { 993 if (profile()->GetExtensionMessageService()) {
987 profile()->GetExtensionMessageService()->CloseChannel(port_id); 994 profile()->GetExtensionMessageService()->CloseChannel(port_id);
988 } 995 }
989 } 996 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/browser_render_process_host.h ('k') | chrome/browser/renderer_host/mock_render_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698