OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2015 Google Inc. All rights reserved. | 2 * |
3 * Copyright (C) 2015 Intel Inc. All rights reserved. | 3 * Copyright 2015-2016, Google Inc. |
| 4 * All rights reserved. |
4 * | 5 * |
5 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 7 * modification, are permitted provided that the following conditions are |
7 * met: | 8 * met: |
8 * | 9 * |
9 * * Redistributions of source code must retain the above copyright | 10 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 11 * notice, this list of conditions and the following disclaimer. |
11 * * Redistributions in binary form must reproduce the above | 12 * * Redistributions in binary form must reproduce the above |
12 * copyright notice, this list of conditions and the following disclaimer | 13 * copyright notice, this list of conditions and the following disclaimer |
13 * in the documentation and/or other materials provided with the | 14 * in the documentation and/or other materials provided with the |
14 * distribution. | 15 * distribution. |
15 * * Neither the name of Google Inc. nor the names of its | 16 * * Neither the name of Google Inc. nor the names of its |
16 * contributors may be used to endorse or promote products derived from | 17 * contributors may be used to endorse or promote products derived from |
17 * this software without specific prior written permission. | 18 * this software without specific prior written permission. |
18 * | 19 * |
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 31 * |
30 */ | 32 */ |
31 | 33 |
32 #ifndef PerformanceCompositeTiming_h | 34 #ifndef GRPC_INTERNAL_COMPILER_PYTHON_GENERATOR_H |
33 #define PerformanceCompositeTiming_h | 35 #define GRPC_INTERNAL_COMPILER_PYTHON_GENERATOR_H |
34 | 36 |
35 #include "core/timing/PerformanceEntry.h" | 37 #include <utility> |
36 #include "platform/heap/Handle.h" | |
37 #include "wtf/Forward.h" | |
38 #include "wtf/text/WTFString.h" | |
39 | 38 |
40 namespace blink { | 39 #include "src/compiler/config.h" |
41 | 40 |
42 class Document; | 41 namespace grpc_python_generator { |
43 | 42 |
44 class PerformanceCompositeTiming final : public PerformanceEntry { | 43 // Data pertaining to configuration of the generator with respect to anything |
45 DEFINE_WRAPPERTYPEINFO(); | 44 // that may be used internally at Google. |
46 public: | 45 struct GeneratorConfiguration { |
47 static PerformanceCompositeTiming* create(Document* requestingDocument, unsi
gned sourceFrame, double startTime) | 46 grpc::string beta_package_root; |
48 { | |
49 return new PerformanceCompositeTiming(requestingDocument, sourceFrame, s
tartTime); | |
50 } | |
51 | |
52 unsigned sourceFrame() const; | |
53 | |
54 DECLARE_VIRTUAL_TRACE(); | |
55 | |
56 protected: | |
57 void buildJSONValue(V8ObjectBuilder&) const override; | |
58 | |
59 private: | |
60 PerformanceCompositeTiming(Document* requestingDocument, unsigned sourceFram
e, double startTime); | |
61 ~PerformanceCompositeTiming() override; | |
62 | |
63 unsigned m_sourceFrame; | |
64 Member<Document> m_requestingDocument; | |
65 }; | 47 }; |
66 | 48 |
67 } // namespace blink | 49 class PythonGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { |
| 50 public: |
| 51 PythonGrpcGenerator(const GeneratorConfiguration& config); |
| 52 ~PythonGrpcGenerator(); |
68 | 53 |
69 #endif // PerformanceCompositeTiming_h | 54 bool Generate(const grpc::protobuf::FileDescriptor* file, |
| 55 const grpc::string& parameter, |
| 56 grpc::protobuf::compiler::GeneratorContext* context, |
| 57 grpc::string* error) const; |
| 58 private: |
| 59 GeneratorConfiguration config_; |
| 60 }; |
| 61 |
| 62 std::pair<bool, grpc::string> GetServices( |
| 63 const grpc::protobuf::FileDescriptor* file, |
| 64 const GeneratorConfiguration& config); |
| 65 |
| 66 } // namespace grpc_python_generator |
| 67 |
| 68 #endif // GRPC_INTERNAL_COMPILER_PYTHON_GENERATOR_H |
OLD | NEW |