aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/node/ext/call_credentials.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/node/ext/call_credentials.h')
-rw-r--r--src/node/ext/call_credentials.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/node/ext/call_credentials.h b/src/node/ext/call_credentials.h
index a9bfe30f94..1f35595f3d 100644
--- a/src/node/ext/call_credentials.h
+++ b/src/node/ext/call_credentials.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -34,8 +34,11 @@
#ifndef GRPC_NODE_CALL_CREDENTIALS_H_
#define GRPC_NODE_CALL_CREDENTIALS_H_
+#include <list>
+
#include <node.h>
#include <nan.h>
+#include <uv.h>
#include "grpc/grpc_security.h"
namespace grpc {
@@ -73,17 +76,20 @@ class CallCredentials : public Nan::ObjectWrap {
/* Auth metadata plugin functionality */
-typedef struct plugin_state {
- Nan::Callback *callback;
-} plugin_state;
-
typedef struct plugin_callback_data {
- plugin_state *state;
const char *service_url;
grpc_credentials_plugin_metadata_cb cb;
void *user_data;
} plugin_callback_data;
+typedef struct plugin_state {
+ Nan::Callback *callback;
+ std::list<plugin_callback_data*> *pending_callbacks;
+ uv_mutex_t plugin_mutex;
+ // async.data == this
+ uv_async_t plugin_async;
+} plugin_state;
+
void plugin_get_metadata(void *state, grpc_auth_metadata_context context,
grpc_credentials_plugin_metadata_cb cb,
void *user_data);