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

Unified Diff: chrome/browser/renderer_host/browser_render_process_host.cc

Issue 119256: Fix user scripts not getting initialized. (Closed)
Patch Set: Fix unit tests Created 11 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extensions_service_unittest.cc ('k') | chrome/test/testing_profile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/browser_render_process_host.cc
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index 9be8769cd223a2102cd5937ae539858254434bf3..829ef479354359335721f4be44b5bd89435a616e 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -483,9 +483,12 @@ void BrowserRenderProcessHost::InitExtensions() {
void BrowserRenderProcessHost::SendUserScriptsUpdate(
base::SharedMemory *shared_memory) {
base::SharedMemoryHandle handle_for_process;
- bool r = shared_memory->ShareToProcess(GetRendererProcessHandle(),
- &handle_for_process);
- DCHECK(r);
+ if (!shared_memory->ShareToProcess(GetRendererProcessHandle(),
+ &handle_for_process)) {
+ // This can legitimately fail if the renderer asserts at startup.
+ return;
+ }
+
if (base::SharedMemory::IsHandleValid(handle_for_process)) {
channel_->Send(new ViewMsg_UserScripts_UpdatedScripts(handle_for_process));
}
« no previous file with comments | « chrome/browser/extensions/extensions_service_unittest.cc ('k') | chrome/test/testing_profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698