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

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

Issue 155498: Noticed a crash in BrowserRenderProcessHost::SendUserScriptsUpdate due to usi... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 if (!visitedlink_master) { 571 if (!visitedlink_master) {
572 return; 572 return;
573 } 573 }
574 574
575 base::SharedMemoryHandle handle_for_process; 575 base::SharedMemoryHandle handle_for_process;
576 bool r = visitedlink_master->ShareToProcess(GetRendererProcessHandle(), 576 bool r = visitedlink_master->ShareToProcess(GetRendererProcessHandle(),
577 &handle_for_process); 577 &handle_for_process);
578 DCHECK(r); 578 DCHECK(r);
579 579
580 if (base::SharedMemory::IsHandleValid(handle_for_process)) { 580 if (base::SharedMemory::IsHandleValid(handle_for_process)) {
581 channel_->Send(new ViewMsg_VisitedLink_NewTable(handle_for_process)); 581 Send(new ViewMsg_VisitedLink_NewTable(handle_for_process));
582 } 582 }
583 } 583 }
584 584
585 void BrowserRenderProcessHost::InitUserScripts() { 585 void BrowserRenderProcessHost::InitUserScripts() {
586 UserScriptMaster* user_script_master = profile()->GetUserScriptMaster(); 586 UserScriptMaster* user_script_master = profile()->GetUserScriptMaster();
587 DCHECK(user_script_master); 587 DCHECK(user_script_master);
588 588
589 if (!user_script_master->ScriptsReady()) { 589 if (!user_script_master->ScriptsReady()) {
590 // No scripts ready. :( 590 // No scripts ready. :(
591 return; 591 return;
(...skipping 14 matching lines...) Expand all
606 void BrowserRenderProcessHost::SendUserScriptsUpdate( 606 void BrowserRenderProcessHost::SendUserScriptsUpdate(
607 base::SharedMemory *shared_memory) { 607 base::SharedMemory *shared_memory) {
608 base::SharedMemoryHandle handle_for_process; 608 base::SharedMemoryHandle handle_for_process;
609 if (!shared_memory->ShareToProcess(GetRendererProcessHandle(), 609 if (!shared_memory->ShareToProcess(GetRendererProcessHandle(),
610 &handle_for_process)) { 610 &handle_for_process)) {
611 // This can legitimately fail if the renderer asserts at startup. 611 // This can legitimately fail if the renderer asserts at startup.
612 return; 612 return;
613 } 613 }
614 614
615 if (base::SharedMemory::IsHandleValid(handle_for_process)) { 615 if (base::SharedMemory::IsHandleValid(handle_for_process)) {
616 channel_->Send(new ViewMsg_UserScripts_UpdatedScripts(handle_for_process)); 616 Send(new ViewMsg_UserScripts_UpdatedScripts(handle_for_process));
617 } 617 }
618 } 618 }
619 619
620 bool BrowserRenderProcessHost::FastShutdownIfPossible() { 620 bool BrowserRenderProcessHost::FastShutdownIfPossible() {
621 if (!process_.handle()) 621 if (!process_.handle())
622 return false; // Render process is probably crashed. 622 return false; // Render process is probably crashed.
623 if (BrowserRenderProcessHost::run_renderer_in_process()) 623 if (BrowserRenderProcessHost::run_renderer_in_process())
624 return false; // Since process mode can't do fast shutdown. 624 return false; // Since process mode can't do fast shutdown.
625 625
626 // Test if there's an unload listener. 626 // Test if there's an unload listener.
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 void BrowserRenderProcessHost::OnExtensionRemoveListener( 969 void BrowserRenderProcessHost::OnExtensionRemoveListener(
970 const std::string& event_name) { 970 const std::string& event_name) {
971 ExtensionMessageService::GetInstance(profile()->GetRequestContext())-> 971 ExtensionMessageService::GetInstance(profile()->GetRequestContext())->
972 RemoveEventListener(event_name, pid()); 972 RemoveEventListener(event_name, pid());
973 } 973 }
974 974
975 void BrowserRenderProcessHost::OnExtensionCloseChannel(int port_id) { 975 void BrowserRenderProcessHost::OnExtensionCloseChannel(int port_id) {
976 ExtensionMessageService::GetInstance(profile()->GetRequestContext())-> 976 ExtensionMessageService::GetInstance(profile()->GetRequestContext())->
977 CloseChannel(port_id); 977 CloseChannel(port_id);
978 } 978 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698