| 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_
|
|
|