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

Unified Diff: third_party/grpc/src/node/ext/channel_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/channel.cc ('k') | third_party/grpc/src/node/ext/channel_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/channel_credentials.h
diff --git a/third_party/WebKit/Source/platform/graphics/ReplayingCanvas.h b/third_party/grpc/src/node/ext/channel_credentials.h
similarity index 53%
copy from third_party/WebKit/Source/platform/graphics/ReplayingCanvas.h
copy to third_party/grpc/src/node/ext/channel_credentials.h
index 45aa5bd10c24a1e2bda1b3b2f6e2370f4860669e..89b115267f33e806ff8bb0d7154f152ba62773ad 100644
--- a/third_party/WebKit/Source/platform/graphics/ReplayingCanvas.h
+++ b/third_party/grpc/src/node/ext/channel_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,42 +28,52 @@
* 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 ReplayingCanvas_h
-#define ReplayingCanvas_h
+#ifndef NET_GRPC_NODE_CHANNEL_CREDENTIALS_H_
+#define NET_GRPC_NODE_CHANNEL_CREDENTIALS_H_
-#include "platform/graphics/InterceptingCanvas.h"
-#include "third_party/skia/include/core/SkPicture.h"
+#include <node.h>
+#include <nan.h>
+#include "grpc/grpc.h"
+#include "grpc/grpc_security.h"
-namespace blink {
+namespace grpc {
+namespace node {
-class ReplayingCanvas;
+/* Wrapper class for grpc_channel_credentials structs */
+class ChannelCredentials : public Nan::ObjectWrap {
+ public:
+ static void Init(v8::Local<v8::Object> exports);
+ static bool HasInstance(v8::Local<v8::Value> val);
+ /* Wrap a grpc_channel_credentials struct in a javascript object */
+ static v8::Local<v8::Value> WrapStruct(grpc_channel_credentials *credentials);
-template<> class CanvasInterceptor<ReplayingCanvas> : protected InterceptingCanvasBase::CanvasInterceptorBase<ReplayingCanvas> {
-public:
- CanvasInterceptor(InterceptingCanvasBase* canvas) : InterceptingCanvasBase::CanvasInterceptorBase<ReplayingCanvas>(canvas) { }
- ~CanvasInterceptor();
-};
+ /* Returns the grpc_channel_credentials struct that this object wraps */
+ grpc_channel_credentials *GetWrappedCredentials();
-class ReplayingCanvas : public InterceptingCanvas<ReplayingCanvas>, public SkPicture::AbortCallback {
-public:
- ReplayingCanvas(SkBitmap, unsigned fromStep, unsigned toStep);
+ private:
+ explicit ChannelCredentials(grpc_channel_credentials *credentials);
+ ~ChannelCredentials();
- bool abort() override;
- SkCanvas::SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec&) override;
- void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) override;
+ // Prevent copying
+ ChannelCredentials(const ChannelCredentials &);
+ ChannelCredentials &operator=(const ChannelCredentials &);
-private:
- friend class CanvasInterceptor<ReplayingCanvas>;
+ static NAN_METHOD(New);
+ static NAN_METHOD(CreateSsl);
+ static NAN_METHOD(CreateInsecure);
- void updateInRange();
+ static NAN_METHOD(Compose);
+ static Nan::Callback *constructor;
+ // Used for typechecking instances of this javascript class
+ static Nan::Persistent<v8::FunctionTemplate> fun_tpl;
- unsigned m_fromStep;
- unsigned m_toStep;
- bool m_abortDrawing;
+ grpc_channel_credentials *wrapped_credentials;
};
-} // namespace blink
+} // namespace node
+} // namespace grpc
-#endif // ReplayingCanvas_h
+#endif // NET_GRPC_NODE_CHANNEL_CREDENTIALS_H_
« no previous file with comments | « third_party/grpc/src/node/ext/channel.cc ('k') | third_party/grpc/src/node/ext/channel_credentials.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698