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

Unified Diff: third_party/grpc/src/node/ext/channel.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
« no previous file with comments | « third_party/grpc/src/node/ext/call_credentials.cc ('k') | third_party/grpc/src/node/ext/channel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/grpc/src/node/ext/channel.h
diff --git a/third_party/WebKit/public/web/WebFindOptions.h b/third_party/grpc/src/node/ext/channel.h
similarity index 53%
copy from third_party/WebKit/public/web/WebFindOptions.h
copy to third_party/grpc/src/node/ext/channel.h
index 3c3200741e840dd148f4b24446e69868d3e08311..9ec28e15af04accf6499c800abd56947a417b513 100644
--- a/third_party/WebKit/public/web/WebFindOptions.h
+++ b/third_party/grpc/src/node/ext/channel.h
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2009 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,41 +28,56 @@
* 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.
+ *
*/
-#ifndef WebFindOptions_h
-#define WebFindOptions_h
+#ifndef NET_GRPC_NODE_CHANNEL_H_
+#define NET_GRPC_NODE_CHANNEL_H_
+
+#include <node.h>
+#include <nan.h>
+#include "grpc/grpc.h"
+
+namespace grpc {
+namespace node {
-#include "../platform/WebString.h"
+bool ParseChannelArgs(v8::Local<v8::Value> args_val,
+ grpc_channel_args **channel_args_ptr);
-namespace blink {
+void DeallocateChannelArgs(grpc_channel_args *channel_args);
-// Options used when performing a find-in-page query.
-struct WebFindOptions {
- // Whether to search forward or backward within the page.
- bool forward;
+/* Wrapper class for grpc_channel structs */
+class Channel : public Nan::ObjectWrap {
+ public:
+ static void Init(v8::Local<v8::Object> exports);
+ static bool HasInstance(v8::Local<v8::Value> val);
+ /* This is used to typecheck javascript objects before converting them to
+ this type */
+ static v8::Persistent<v8::Value> prototype;
- // Whether search should be case-sensitive.
- bool matchCase;
+ /* Returns the grpc_channel struct that this object wraps */
+ grpc_channel *GetWrappedChannel();
- // Whether this operation is the first request or a follow-up.
- bool findNext;
+ private:
+ explicit Channel(grpc_channel *channel);
+ ~Channel();
- // Whether this operation should look for matches only at the start of words.
- bool wordStart;
+ // Prevent copying
+ Channel(const Channel &);
+ Channel &operator=(const Channel &);
- // When combined with wordStart, accepts a match in the middle of a word if the match begins with
- // an uppercase letter followed by a lowercase or non-letter. Accepts several other intra-word matches.
- bool medialCapitalAsWordStart;
+ static NAN_METHOD(New);
+ static NAN_METHOD(Close);
+ static NAN_METHOD(GetTarget);
+ static NAN_METHOD(GetConnectivityState);
+ static NAN_METHOD(WatchConnectivityState);
+ static Nan::Callback *constructor;
+ static Nan::Persistent<v8::FunctionTemplate> fun_tpl;
- WebFindOptions()
- : forward(true)
- , matchCase(false)
- , findNext(false)
- , wordStart(false)
- , medialCapitalAsWordStart(false) { }
+ grpc_channel *wrapped_channel;
};
-} // namespace blink
+} // namespace node
+} // namespace grpc
-#endif
+#endif // NET_GRPC_NODE_CHANNEL_H_
« no previous file with comments | « third_party/grpc/src/node/ext/call_credentials.cc ('k') | third_party/grpc/src/node/ext/channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698