OLD | NEW |
(Empty) | |
| 1 <!-- |
| 2 Copyright 2016 The Chromium Authors. All rights reserved. |
| 3 Use of this source code is governed by a BSD-style license that can be |
| 4 found in the LICENSE file. |
| 5 --> |
| 6 |
| 7 <link rel="import" href="../bower_components/polymer/polymer.html"> |
| 8 <link rel="import" |
| 9 href="../bower_components/html5-history-anchor/html5-history-anchor.html"> |
| 10 |
| 11 <link rel="import" href="rpc-descriptor-util.html"> |
| 12 |
| 13 <!-- The `rpc-service` is a service page --> |
| 14 <dom-module id="rpc-service"> |
| 15 <template> |
| 16 <p>Methods:</p> |
| 17 <ul> |
| 18 <template is="dom-repeat" items="[[serviceDesc.method]]" as="method"> |
| 19 <li> |
| 20 <a is="html5-history-anchor" pushstate popstate |
| 21 href="[[method.name]]">[[method.name]]</a> |
| 22 <span class="text-muted comment"> |
| 23 [[method.source_code_info.leading_comments]] |
| 24 </span> |
| 25 </li> |
| 26 </template> |
| 27 </ul> |
| 28 </template> |
| 29 |
| 30 <script> |
| 31 'use strict'; |
| 32 |
| 33 Polymer({ |
| 34 is: 'rpc-service', |
| 35 |
| 36 properties: { |
| 37 description: Object, // FileDescriptorSet message |
| 38 service: String, |
| 39 serviceDesc: { |
| 40 type: Object, // ServiceDescriptorProto message |
| 41 computed: '_resolveServiceDesc(description, service)' |
| 42 } |
| 43 }, |
| 44 |
| 45 _resolveServiceDesc: function(desc, service) { |
| 46 var searchResult = rpcExplorer.descUtil.resolve(desc, service); |
| 47 if (!searchResult || searchResult.type != 'service') { |
| 48 return null; |
| 49 } |
| 50 return searchResult.desc; |
| 51 } |
| 52 }); |
| 53 </script> |
| 54 </dom-module> |
OLD | NEW |