| Index: third_party/grpc/src/core/transport/chttp2/bin_encoder.h
|
| diff --git a/third_party/WebKit/Source/platform/exported/WebSocketHandshakeRequestInfo.cpp b/third_party/grpc/src/core/transport/chttp2/bin_encoder.h
|
| similarity index 65%
|
| copy from third_party/WebKit/Source/platform/exported/WebSocketHandshakeRequestInfo.cpp
|
| copy to third_party/grpc/src/core/transport/chttp2/bin_encoder.h
|
| index 8b4e7a518178908d03bb5e2a4e20a78cc398739a..036fddf9981e103297cc01ae5a7485051a5c2225 100644
|
| --- a/third_party/WebKit/Source/platform/exported/WebSocketHandshakeRequestInfo.cpp
|
| +++ b/third_party/grpc/src/core/transport/chttp2/bin_encoder.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,38 +28,27 @@
|
| * 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.
|
| + *
|
| */
|
|
|
| -#include "public/platform/modules/websockets/WebSocketHandshakeRequestInfo.h"
|
| -
|
| -#include "platform/network/WebSocketHandshakeRequest.h"
|
| -#include "public/platform/WebString.h"
|
| -#include "public/platform/WebURL.h"
|
| -
|
| -namespace blink {
|
| -
|
| -WebSocketHandshakeRequestInfo::WebSocketHandshakeRequestInfo() : m_private(WebSocketHandshakeRequest::create())
|
| -{
|
| -}
|
| +#ifndef GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_BIN_ENCODER_H
|
| +#define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_BIN_ENCODER_H
|
|
|
| -WebSocketHandshakeRequestInfo::~WebSocketHandshakeRequestInfo()
|
| -{
|
| - m_private.reset();
|
| -}
|
| +#include <grpc/support/slice.h>
|
|
|
| -void WebSocketHandshakeRequestInfo::setURL(const WebURL& url)
|
| -{
|
| - m_private->setURL(url);
|
| -}
|
| +/* base64 encode a slice. Returns a new slice, does not take ownership of the
|
| + input */
|
| +gpr_slice grpc_chttp2_base64_encode(gpr_slice input);
|
|
|
| -void WebSocketHandshakeRequestInfo::addHeaderField(const WebString& name, const WebString& value)
|
| -{
|
| - m_private->addAndMergeHeader(name, value);
|
| -}
|
| +/* Compress a slice with the static huffman encoder detailed in the hpack
|
| + standard. Returns a new slice, does not take ownership of the input */
|
| +gpr_slice grpc_chttp2_huffman_compress(gpr_slice input);
|
|
|
| -void WebSocketHandshakeRequestInfo::setHeadersText(const WebString& text)
|
| -{
|
| - m_private->setHeadersText(text);
|
| -}
|
| +/* equivalent to:
|
| + gpr_slice x = grpc_chttp2_base64_encode(input);
|
| + gpr_slice y = grpc_chttp2_huffman_compress(x);
|
| + gpr_slice_unref(x);
|
| + return y; */
|
| +gpr_slice grpc_chttp2_base64_encode_and_huffman_compress(gpr_slice input);
|
|
|
| -} // namespace blink
|
| +#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_BIN_ENCODER_H */
|
|
|