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

Side by Side Diff: content/browser/mojo/mojo_application_host.cc

Issue 2019973002: [mojo-edk] Bind a child token to child launches and port reservations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "content/browser/mojo/mojo_application_host.h" 5 #include "content/browser/mojo/mojo_application_host.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 20 matching lines...) Expand all
31 service_registry_->Bind(std::move(services)); 31 service_registry_->Bind(std::move(services));
32 service_registry_->BindRemoteServiceProvider(std::move(exposed_services)); 32 service_registry_->BindRemoteServiceProvider(std::move(exposed_services));
33 } 33 }
34 34
35 mojo::Binding<mojom::ApplicationSetup> binding_; 35 mojo::Binding<mojom::ApplicationSetup> binding_;
36 ServiceRegistryImpl* service_registry_; 36 ServiceRegistryImpl* service_registry_;
37 }; 37 };
38 38
39 } // namespace 39 } // namespace
40 40
41 MojoApplicationHost::MojoApplicationHost() 41 MojoApplicationHost::MojoApplicationHost(const std::string& child_token)
42 : token_(mojo::edk::GenerateRandomToken()) { 42 : token_(mojo::edk::GenerateRandomToken()) {
43 #if defined(OS_ANDROID) 43 #if defined(OS_ANDROID)
44 service_registry_android_ = 44 service_registry_android_ =
45 ServiceRegistryAndroid::Create(&service_registry_); 45 ServiceRegistryAndroid::Create(&service_registry_);
46 #endif 46 #endif
47 47
48 mojo::ScopedMessagePipeHandle pipe = 48 mojo::ScopedMessagePipeHandle pipe =
49 mojo::edk::CreateParentMessagePipe(token_); 49 mojo::edk::CreateParentMessagePipe(token_, child_token);
50 DCHECK(pipe.is_valid()); 50 DCHECK(pipe.is_valid());
51 application_setup_.reset(new ApplicationSetupImpl( 51 application_setup_.reset(new ApplicationSetupImpl(
52 &service_registry_, 52 &service_registry_,
53 mojo::MakeRequest<mojom::ApplicationSetup>(std::move(pipe)))); 53 mojo::MakeRequest<mojom::ApplicationSetup>(std::move(pipe))));
54 } 54 }
55 55
56 MojoApplicationHost::~MojoApplicationHost() { 56 MojoApplicationHost::~MojoApplicationHost() {
57 } 57 }
58 58
59 } // namespace content 59 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/mojo/mojo_application_host.h ('k') | content/browser/mojo/mojo_child_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698