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

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

Issue 301973003: Introduce IPC::ChannelProxy::Create*() and IPC::SynChannel::Create*() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 530
531 // Find the renderer before creating the channel so if this fails early we 531 // Find the renderer before creating the channel so if this fails early we
532 // return without creating the channel. 532 // return without creating the channel.
533 base::FilePath renderer_path = ChildProcessHost::GetChildPath(flags); 533 base::FilePath renderer_path = ChildProcessHost::GetChildPath(flags);
534 if (renderer_path.empty()) 534 if (renderer_path.empty())
535 return false; 535 return false;
536 536
537 // Setup the IPC channel. 537 // Setup the IPC channel.
538 const std::string channel_id = 538 const std::string channel_id =
539 IPC::Channel::GenerateVerifiedChannelID(std::string()); 539 IPC::Channel::GenerateVerifiedChannelID(std::string());
540 channel_.reset( 540 channel_ = IPC::ChannelProxy::CreateServer(
541 new IPC::ChannelProxy(channel_id, 541 channel_id,
542 IPC::Channel::MODE_SERVER, 542 this,
543 this, 543 BrowserThread::GetMessageLoopProxyForThread(
544 BrowserThread::GetMessageLoopProxyForThread( 544 BrowserThread::IO).get());
545 BrowserThread::IO).get()));
546 545
547 // Setup the Mojo channel. 546 // Setup the Mojo channel.
548 mojo_application_host_.reset(new MojoApplicationHost()); 547 mojo_application_host_.reset(new MojoApplicationHost());
549 mojo_application_host_->Init(); 548 mojo_application_host_->Init();
550 549
551 // Call the embedder first so that their IPC filters have priority. 550 // Call the embedder first so that their IPC filters have priority.
552 GetContentClient()->browser()->RenderProcessWillLaunch(this); 551 GetContentClient()->browser()->RenderProcessWillLaunch(this);
553 552
554 CreateMessageFilters(); 553 CreateMessageFilters();
555 554
(...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after
2071 const base::StringPiece& service_name, 2070 const base::StringPiece& service_name,
2072 mojo::ScopedMessagePipeHandle handle) { 2071 mojo::ScopedMessagePipeHandle handle) {
2073 mojo_activation_required_ = true; 2072 mojo_activation_required_ = true;
2074 MaybeActivateMojo(); 2073 MaybeActivateMojo();
2075 2074
2076 mojo_application_host_->service_provider()->ConnectToService( 2075 mojo_application_host_->service_provider()->ConnectToService(
2077 mojo::String::From(service_name), handle.Pass()); 2076 mojo::String::From(service_name), handle.Pass());
2078 } 2077 }
2079 2078
2080 } // namespace content 2079 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698