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

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2448663003: Ensure queued Channel messages are flushed for in-process renderers (Closed)
Patch Set: Created 4 years, 1 month 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
« 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "content/browser/renderer_host/render_process_host_impl.h" 8 #include "content/browser/renderer_host/render_process_host_impl.h"
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 // As for execution sequence, this callback should have no any dependency 889 // As for execution sequence, this callback should have no any dependency
890 // on starting in-process-render-thread. 890 // on starting in-process-render-thread.
891 // So put it here to trigger ChannelMojo initialization earlier to enable 891 // So put it here to trigger ChannelMojo initialization earlier to enable
892 // in-process-render-thread using ChannelMojo there. 892 // in-process-render-thread using ChannelMojo there.
893 OnProcessLaunched(); // Fake a callback that the process is ready. 893 OnProcessLaunched(); // Fake a callback that the process is ready.
894 894
895 in_process_renderer_->StartWithOptions(options); 895 in_process_renderer_->StartWithOptions(options);
896 896
897 g_in_process_thread = in_process_renderer_->message_loop(); 897 g_in_process_thread = in_process_renderer_->message_loop();
898 898
899 // Make sure any queued messages on the channel are flushed in the case
900 // where we aren't launching a child process.
901 channel_->Flush();
899 } else { 902 } else {
900 // Build command line for renderer. We call AppendRendererCommandLine() 903 // Build command line for renderer. We call AppendRendererCommandLine()
901 // first so the process type argument will appear first. 904 // first so the process type argument will appear first.
902 base::CommandLine* cmd_line = new base::CommandLine(renderer_path); 905 base::CommandLine* cmd_line = new base::CommandLine(renderer_path);
903 if (!renderer_prefix.empty()) 906 if (!renderer_prefix.empty())
904 cmd_line->PrependWrapper(renderer_prefix); 907 cmd_line->PrependWrapper(renderer_prefix);
905 AppendRendererCommandLine(cmd_line); 908 AppendRendererCommandLine(cmd_line);
906 909
907 // Spawn the child process asynchronously to avoid blocking the UI thread. 910 // Spawn the child process asynchronously to avoid blocking the UI thread.
908 // As long as there's no renderer prefix, we can use the zygote process 911 // As long as there's no renderer prefix, we can use the zygote process
(...skipping 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after
3005 bad_message::ReceivedBadMessage(render_process_id, 3008 bad_message::ReceivedBadMessage(render_process_id,
3006 bad_message::RPH_MOJO_PROCESS_ERROR); 3009 bad_message::RPH_MOJO_PROCESS_ERROR);
3007 } 3010 }
3008 3011
3009 void RenderProcessHostImpl::CreateURLLoaderFactory( 3012 void RenderProcessHostImpl::CreateURLLoaderFactory(
3010 mojo::InterfaceRequest<mojom::URLLoaderFactory> request) { 3013 mojo::InterfaceRequest<mojom::URLLoaderFactory> request) {
3011 URLLoaderFactoryImpl::Create(resource_message_filter_, std::move(request)); 3014 URLLoaderFactoryImpl::Create(resource_message_filter_, std::move(request));
3012 } 3015 }
3013 3016
3014 } // namespace content 3017 } // namespace content
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