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

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

Issue 252633003: Introduce worker_devtools_agent_route_id for EmbeddedWorker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: RenderProcessHostImpl::GetNextRoutingIDForProcess Created 6 years, 8 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) 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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 #endif 454 #endif
455 delete host; 455 delete host;
456 return; 456 return;
457 } 457 }
458 default: 458 default:
459 NOTREACHED() << "There should be only one RenderProcessHost when running " 459 NOTREACHED() << "There should be only one RenderProcessHost when running "
460 << "in-process."; 460 << "in-process.";
461 } 461 }
462 } 462 }
463 463
464 // static
464 void RenderProcessHostImpl::RegisterRendererMainThreadFactory( 465 void RenderProcessHostImpl::RegisterRendererMainThreadFactory(
465 RendererMainThreadFactoryFunction create) { 466 RendererMainThreadFactoryFunction create) {
466 g_renderer_main_thread_factory = create; 467 g_renderer_main_thread_factory = create;
467 } 468 }
468 469
470 // static
471 int RenderProcessHostImpl::GetNextRoutingIDForProcess(int render_process_id) {
472 RenderWidgetHelper* helper =
kinuko 2014/04/28 04:31:29 Would be safer to receive this as scoped_refptr
horo 2014/04/28 04:51:23 Done.
473 RenderWidgetHelper::FromProcessHostID(render_process_id);
474 if (!helper)
475 return MSG_ROUTING_NONE; // Maybe null in unittest.
476 return helper->GetNextRoutingID();
477 }
478
469 RenderProcessHostImpl::~RenderProcessHostImpl() { 479 RenderProcessHostImpl::~RenderProcessHostImpl() {
470 #ifndef NDEBUG 480 #ifndef NDEBUG
471 DCHECK(is_self_deleted_) 481 DCHECK(is_self_deleted_)
472 << "RenderProcessHostImpl is destroyed by something other than itself"; 482 << "RenderProcessHostImpl is destroyed by something other than itself";
473 #endif 483 #endif
474 484
475 // Make sure to clean up the in-process renderer before the channel, otherwise 485 // Make sure to clean up the in-process renderer before the channel, otherwise
476 // it may still run and have its IPCs fail, causing asserts. 486 // it may still run and have its IPCs fail, causing asserts.
477 in_process_renderer_.reset(); 487 in_process_renderer_.reset();
478 488
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after
2065 mojo::ScopedMessagePipeHandle handle) { 2075 mojo::ScopedMessagePipeHandle handle) {
2066 if (!mojo_application_host_->did_activate()) 2076 if (!mojo_application_host_->did_activate())
2067 mojo_application_host_->Activate(this, GetHandle()); 2077 mojo_application_host_->Activate(this, GetHandle());
2068 2078
2069 mojo::AllocationScope scope; 2079 mojo::AllocationScope scope;
2070 mojo_application_host_->shell_client()->AcceptConnection(service_name, 2080 mojo_application_host_->shell_client()->AcceptConnection(service_name,
2071 handle.Pass()); 2081 handle.Pass());
2072 } 2082 }
2073 2083
2074 } // namespace content 2084 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698