| Index: third_party/grpc/include/grpc++/impl/codegen/rpc_method.h
|
| diff --git a/third_party/WebKit/Source/modules/crypto/KeyAlgorithm.h b/third_party/grpc/include/grpc++/impl/codegen/rpc_method.h
|
| similarity index 61%
|
| copy from third_party/WebKit/Source/modules/crypto/KeyAlgorithm.h
|
| copy to third_party/grpc/include/grpc++/impl/codegen/rpc_method.h
|
| index 54f4019cc5ccb67c0496d6d24097d623ca18e834..85d5c1cfe2a325e01db335fe88664866deac1cfb 100644
|
| --- a/third_party/WebKit/Source/modules/crypto/KeyAlgorithm.h
|
| +++ b/third_party/grpc/include/grpc++/impl/codegen/rpc_method.h
|
| @@ -1,5 +1,7 @@
|
| /*
|
| - * Copyright (C) 2013 Google Inc. All rights reserved.
|
| + *
|
| + * Copyright 2015-2016, 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,46 @@
|
| * 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 KeyAlgorithm_h
|
| -#define KeyAlgorithm_h
|
| +#ifndef GRPCXX_IMPL_CODEGEN_RPC_METHOD_H
|
| +#define GRPCXX_IMPL_CODEGEN_RPC_METHOD_H
|
|
|
| -#include "bindings/core/v8/ScriptWrappable.h"
|
| -#include "platform/heap/Handle.h"
|
| -#include "public/platform/WebCryptoKeyAlgorithm.h"
|
| -#include "wtf/Forward.h"
|
| +#include <memory>
|
|
|
| -namespace blink {
|
| +#include <grpc++/impl/codegen/channel_interface.h>
|
|
|
| -class KeyAlgorithm : public GarbageCollectedFinalized<KeyAlgorithm>, public ScriptWrappable {
|
| -public:
|
| - ~KeyAlgorithm() override;
|
| +namespace grpc {
|
|
|
| - static KeyAlgorithm* create(const WebCryptoKeyAlgorithm&);
|
| - static KeyAlgorithm* createHash(const WebCryptoAlgorithm&);
|
| +class RpcMethod {
|
| + public:
|
| + enum RpcType {
|
| + NORMAL_RPC = 0,
|
| + CLIENT_STREAMING, // request streaming
|
| + SERVER_STREAMING, // response streaming
|
| + BIDI_STREAMING
|
| + };
|
|
|
| - String name();
|
| + RpcMethod(const char* name, RpcType type)
|
| + : name_(name), method_type_(type), channel_tag_(NULL) {}
|
|
|
| - // Needed by SpecialWrapFor and for casting.
|
| - bool isAesKeyAlgorithm() const;
|
| - bool isHmacKeyAlgorithm() const;
|
| - bool isRsaHashedKeyAlgorithm() const;
|
| + RpcMethod(const char* name, RpcType type,
|
| + const std::shared_ptr<ChannelInterface>& channel)
|
| + : name_(name),
|
| + method_type_(type),
|
| + channel_tag_(channel->RegisterMethod(name)) {}
|
|
|
| - DECLARE_VIRTUAL_TRACE();
|
| + const char* name() const { return name_; }
|
| + RpcType method_type() const { return method_type_; }
|
| + void* channel_tag() const { return channel_tag_; }
|
|
|
| -protected:
|
| - explicit KeyAlgorithm(const WebCryptoKeyAlgorithm&);
|
| -
|
| - WebCryptoKeyAlgorithm m_algorithm;
|
| + private:
|
| + const char* const name_;
|
| + const RpcType method_type_;
|
| + void* const channel_tag_;
|
| };
|
|
|
| -#define DEFINE_KEY_ALGORITHM_TYPE_CASTS(thisType) \
|
| - DEFINE_TYPE_CASTS(thisType, KeyAlgorithm, value, value->is##thisType(), value.is##thisType())
|
| -
|
| -} // namespace blink
|
| +} // namespace grpc
|
|
|
| -#endif
|
| +#endif // GRPCXX_IMPL_CODEGEN_RPC_METHOD_H
|
|
|