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

Side by Side Diff: third_party/WebKit/Source/platform/ServiceConnector.h

Issue 2610173003: Add RegisterService, split out of Connect(). (Closed)
Patch Set: . Created 3 years, 11 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
« no previous file with comments | « services/service_manager/tests/util.cc ('k') | 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef ServiceConnector_h 5 #ifndef ServiceConnector_h
6 #define ServiceConnector_h 6 #define ServiceConnector_h
7 7
8 #include "mojo/public/cpp/bindings/binding.h" 8 #include "mojo/public/cpp/bindings/binding.h"
9 #include "public/platform/Platform.h" 9 #include "public/platform/Platform.h"
10 #include "services/service_manager/public/interfaces/connector.mojom-blink.h" 10 #include "services/service_manager/public/interfaces/connector.mojom-blink.h"
(...skipping 21 matching lines...) Expand all
32 return; 32 return;
33 33
34 service_manager::mojom::blink::IdentityPtr remoteIdentity( 34 service_manager::mojom::blink::IdentityPtr remoteIdentity(
35 service_manager::mojom::blink::Identity::New()); 35 service_manager::mojom::blink::Identity::New());
36 remoteIdentity->name = serviceName; 36 remoteIdentity->name = serviceName;
37 remoteIdentity->user_id = service_manager::mojom::blink::kInheritUserID; 37 remoteIdentity->user_id = service_manager::mojom::blink::kInheritUserID;
38 remoteIdentity->instance = ""; 38 remoteIdentity->instance = "";
39 39
40 service_manager::mojom::blink::InterfaceProviderPtr remoteInterfaces; 40 service_manager::mojom::blink::InterfaceProviderPtr remoteInterfaces;
41 m_connector->Connect(std::move(remoteIdentity), 41 m_connector->Connect(std::move(remoteIdentity),
42 MakeRequest(&remoteInterfaces), nullptr, 42 MakeRequest(&remoteInterfaces),
43 base::Bind(&ServiceConnector::onConnectionCompleted)); 43 base::Bind(&ServiceConnector::onConnectionCompleted));
44 44
45 remoteInterfaces->GetInterface(Interface::Name_, request.PassMessagePipe()); 45 remoteInterfaces->GetInterface(Interface::Name_, request.PassMessagePipe());
46 } 46 }
47 47
48 private: 48 private:
49 ServiceConnector() {} 49 ServiceConnector() {}
50 50
51 static void onConnectionCompleted( 51 static void onConnectionCompleted(
52 service_manager::mojom::ConnectResult result, 52 service_manager::mojom::ConnectResult result,
53 const WTF::String& targetUserID) {} 53 const WTF::String& targetUserID) {}
54 54
55 service_manager::mojom::blink::ConnectorPtr m_connector; 55 service_manager::mojom::blink::ConnectorPtr m_connector;
56 }; 56 };
57 57
58 } // namespace blink 58 } // namespace blink
59 59
60 #endif // ServiceConnector_h 60 #endif // ServiceConnector_h
OLDNEW
« no previous file with comments | « services/service_manager/tests/util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698