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

Unified Diff: third_party/grpc/src/node/ext/server_credentials.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/server.cc ('k') | third_party/grpc/src/node/ext/server_credentials.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/server_credentials.h
diff --git a/third_party/WebKit/Source/core/animation/animatable/AnimatableLengthPoint.h b/third_party/grpc/src/node/ext/server_credentials.h
similarity index 53%
copy from third_party/WebKit/Source/core/animation/animatable/AnimatableLengthPoint.h
copy to third_party/grpc/src/node/ext/server_credentials.h
index a7248c3aad9979e7178f6be90c775a4c0b7e4a20..bf279e481c64ec3768ab5ff9d490cf023cc13737 100644
--- a/third_party/WebKit/Source/core/animation/animatable/AnimatableLengthPoint.h
+++ b/third_party/grpc/src/node/ext/server_credentials.h
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2013 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,43 +28,50 @@
* 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 AnimatableLengthPoint_h
-#define AnimatableLengthPoint_h
+#ifndef NET_GRPC_NODE_SERVER_CREDENTIALS_H_
+#define NET_GRPC_NODE_SERVER_CREDENTIALS_H_
-#include "core/animation/animatable/AnimatableValue.h"
+#include <node.h>
+#include <nan.h>
+#include "grpc/grpc.h"
+#include "grpc/grpc_security.h"
-namespace blink {
+namespace grpc {
+namespace node {
-class AnimatableLengthPoint final : public AnimatableValue {
-public:
- ~AnimatableLengthPoint() override { }
- static PassRefPtr<AnimatableLengthPoint> create(PassRefPtr<AnimatableValue> x, PassRefPtr<AnimatableValue> y)
- {
- return adoptRef(new AnimatableLengthPoint(x, y));
- }
- const AnimatableValue* x() const { return m_x.get(); }
- const AnimatableValue* y() const { return m_y.get(); }
+/* Wrapper class for grpc_server_credentials structs */
+class ServerCredentials : public Nan::ObjectWrap {
+ public:
+ static void Init(v8::Local<v8::Object> exports);
+ static bool HasInstance(v8::Local<v8::Value> val);
+ /* Wrap a grpc_server_credentials struct in a javascript object */
+ static v8::Local<v8::Value> WrapStruct(grpc_server_credentials *credentials);
-protected:
- PassRefPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fraction) const override;
+ /* Returns the grpc_server_credentials struct that this object wraps */
+ grpc_server_credentials *GetWrappedServerCredentials();
-private:
- AnimatableLengthPoint(PassRefPtr<AnimatableValue> x, PassRefPtr<AnimatableValue> y)
- : m_x(x)
- , m_y(y)
- {
- }
- AnimatableType type() const override { return TypeLengthPoint; }
- bool equalTo(const AnimatableValue*) const override;
+ private:
+ explicit ServerCredentials(grpc_server_credentials *credentials);
+ ~ServerCredentials();
- RefPtr<AnimatableValue> m_x;
- RefPtr<AnimatableValue> m_y;
-};
+ // Prevent copying
+ ServerCredentials(const ServerCredentials &);
+ ServerCredentials &operator=(const ServerCredentials &);
-DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableLengthPoint, isLengthPoint());
+ static NAN_METHOD(New);
+ static NAN_METHOD(CreateSsl);
+ static NAN_METHOD(CreateInsecure);
+ static Nan::Callback *constructor;
+ // Used for typechecking instances of this javascript class
+ static Nan::Persistent<v8::FunctionTemplate> fun_tpl;
+
+ grpc_server_credentials *wrapped_credentials;
+};
-} // namespace blink
+} // namespace node
+} // namespace grpc
-#endif // AnimatableLengthPoint_h
+#endif // NET_GRPC_NODE_SERVER_CREDENTIALS_H_
« no previous file with comments | « third_party/grpc/src/node/ext/server.cc ('k') | third_party/grpc/src/node/ext/server_credentials.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698