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

Unified Diff: third_party/grpc/src/core/iomgr/resolve_address.h

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/grpc/src/core/iomgr/resolve_address.h
diff --git a/third_party/WebKit/Source/bindings/tests/idls/modules/TestPartialInterface3.idl b/third_party/grpc/src/core/iomgr/resolve_address.h
similarity index 52%
copy from third_party/WebKit/Source/bindings/tests/idls/modules/TestPartialInterface3.idl
copy to third_party/grpc/src/core/iomgr/resolve_address.h
index 353454edc1cf7f7f7f1c46679e4ef17bae851df0..01eedffa889fae5cdcca3cac0a860613f1ee2c62 100644
--- a/third_party/WebKit/Source/bindings/tests/idls/modules/TestPartialInterface3.idl
+++ b/third_party/grpc/src/core/iomgr/resolve_address.h
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2014 Google Inc. All rights reserved.
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -26,23 +28,45 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
*/
-[
- ImplementedAs=TestPartialInterfaceImplementation3,
-] partial interface TestInterface {
- const unsigned short PARTIAL3_UNSIGNED_SHORT = 0;
+#ifndef GRPC_INTERNAL_CORE_IOMGR_RESOLVE_ADDRESS_H
+#define GRPC_INTERNAL_CORE_IOMGR_RESOLVE_ADDRESS_H
+
+#include <stddef.h>
+#include "src/core/iomgr/exec_ctx.h"
+#include "src/core/iomgr/iomgr.h"
+
+#define GRPC_MAX_SOCKADDR_SIZE 128
+
+typedef struct {
+ char addr[GRPC_MAX_SOCKADDR_SIZE];
+ size_t len;
+} grpc_resolved_address;
- void voidMethodPartialOverload(DOMString value);
- static void staticVoidMethodPartialOverload(DOMString value);
+typedef struct {
+ size_t naddrs;
+ grpc_resolved_address *addrs;
+} grpc_resolved_addresses;
- Promise promiseMethodPartialOverload(Document document);
- static Promise staticPromiseMethodPartialOverload(DOMString value);
+/* Async result callback:
+ On success: addresses is the result, and the callee must call
+ grpc_resolved_addresses_destroy when it's done with them
+ On failure: addresses is NULL */
+typedef void (*grpc_resolve_cb)(grpc_exec_ctx *exec_ctx, void *arg,
+ grpc_resolved_addresses *addresses);
+/* Asynchronously resolve addr. Use default_port if a port isn't designated
+ in addr, otherwise use the port in addr. */
+/* TODO(ctiller): add a timeout here */
+void grpc_resolve_address(const char *addr, const char *default_port,
+ grpc_resolve_cb cb, void *arg);
+/* Destroy resolved addresses */
+void grpc_resolved_addresses_destroy(grpc_resolved_addresses *addresses);
- void partial2VoidMethod(DOMString value);
- void partial2VoidMethod(Node node);
- void partialVoidTestEnumModulesArgMethod(TestEnumModules arg);
- static void partial2StaticVoidMethod(DOMString value);
+/* Resolve addr in a blocking fashion. Returns NULL on failure. On success,
+ result must be freed with grpc_resolved_addresses_destroy. */
+grpc_resolved_addresses *grpc_blocking_resolve_address(
+ const char *addr, const char *default_port);
- [Unscopeable] void unscopeableVoidMethod();
-};
+#endif /* GRPC_INTERNAL_CORE_IOMGR_RESOLVE_ADDRESS_H */
« no previous file with comments | « third_party/grpc/src/core/iomgr/pollset_windows.c ('k') | third_party/grpc/src/core/iomgr/resolve_address_posix.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698