OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * |
| 3 * Copyright 2015, Google Inc. |
| 4 * All rights reserved. |
3 * | 5 * |
4 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 7 * modification, are permitted provided that the following conditions are |
6 * met: | 8 * met: |
7 * | 9 * |
8 * * Redistributions of source code must retain the above copyright | 10 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 11 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 12 * * Redistributions in binary form must reproduce the above |
11 * copyright notice, this list of conditions and the following disclaimer | 13 * copyright notice, this list of conditions and the following disclaimer |
12 * in the documentation and/or other materials provided with the | 14 * in the documentation and/or other materials provided with the |
13 * distribution. | 15 * distribution. |
14 * * Neither the name of Google Inc. nor the names of its | 16 * * Neither the name of Google Inc. nor the names of its |
15 * contributors may be used to endorse or promote products derived from | 17 * contributors may be used to endorse or promote products derived from |
16 * this software without specific prior written permission. | 18 * this software without specific prior written permission. |
17 * | 19 * |
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (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 |
28 * 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 * |
29 */ | 32 */ |
30 | 33 |
31 #ifndef URLRegistry_h | 34 /// \mainpage gRPC C++ API |
32 #define URLRegistry_h | 35 /// |
| 36 /// The gRPC C++ API mainly consists of the following classes: |
| 37 /// - grpc::Channel, which represents the connection to an endpoint. See [the |
| 38 /// gRPC Concepts page](http://www.grpc.io/docs/guides/concepts.html) for more |
| 39 /// details. Channels are created by the factory function grpc::CreateChannel. |
| 40 /// - grpc::CompletionQueue, the producer-consumer queue used for all |
| 41 /// asynchronous communication with the gRPC runtime. |
| 42 /// - grpc::ClientContext and grpc::ServerContext, where optional configuration |
| 43 /// for an RPC can be set, such as setting custom metadata to be conveyed to the |
| 44 /// peer, compression settings, authentication, etc. |
| 45 /// - grpc::Server, representing a gRPC server, created by grpc::ServerBuilder. |
| 46 /// |
| 47 /// Refer to the |
| 48 /// [examples](https://github.com/grpc/grpc/blob/master/examples/cpp) |
| 49 /// for code putting these pieces into play. |
33 | 50 |
34 #include "core/CoreExport.h" | 51 #ifndef GRPCXX_GRPCXX_H |
35 #include "wtf/text/WTFString.h" | 52 #define GRPCXX_GRPCXX_H |
36 | 53 |
37 namespace blink { | 54 #include <grpc/grpc.h> |
38 | 55 |
39 class KURL; | 56 #include <grpc++/channel.h> |
40 class SecurityOrigin; | 57 #include <grpc++/client_context.h> |
41 class URLRegistry; | 58 #include <grpc++/completion_queue.h> |
| 59 #include <grpc++/create_channel.h> |
| 60 #include <grpc++/server.h> |
| 61 #include <grpc++/server_builder.h> |
| 62 #include <grpc++/server_context.h> |
42 | 63 |
43 class CORE_EXPORT URLRegistrable { | 64 #endif // GRPCXX_GRPCXX_H |
44 public: | |
45 virtual ~URLRegistrable() { } | |
46 virtual URLRegistry& registry() const = 0; | |
47 }; | |
48 | |
49 class CORE_EXPORT URLRegistry { | |
50 USING_FAST_MALLOC(URLRegistry); | |
51 public: | |
52 virtual ~URLRegistry() { } | |
53 virtual void registerURL(SecurityOrigin*, const KURL&, URLRegistrable*) = 0; | |
54 virtual void unregisterURL(const KURL&) = 0; | |
55 | |
56 // These are optional APIs | |
57 virtual URLRegistrable* lookup(const String&) { ASSERT_NOT_REACHED(); return
nullptr; } | |
58 virtual bool contains(const String&) { ASSERT_NOT_REACHED(); return false; } | |
59 }; | |
60 | |
61 } // namespace blink | |
62 | |
63 #endif // URLRegistry_h | |
OLD | NEW |