Index: third_party/grpc/src/cpp/client/create_channel.cc |
diff --git a/third_party/WebKit/Source/modules/encoding/TextEncoder.idl b/third_party/grpc/src/cpp/client/create_channel.cc |
similarity index 59% |
copy from third_party/WebKit/Source/modules/encoding/TextEncoder.idl |
copy to third_party/grpc/src/cpp/client/create_channel.cc |
index 736187a78fc0f9ebc66344089254eba83ce4d325..76a1b31e2f762d5402a172ce46ed5a52ea24be8e 100644 |
--- a/third_party/WebKit/Source/modules/encoding/TextEncoder.idl |
+++ b/third_party/grpc/src/cpp/client/create_channel.cc |
@@ -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,15 +28,38 @@ |
* 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. |
+ * |
*/ |
-[ |
- Exposed=(Window,Worker), |
- Constructor(optional DOMString utfLabel = "utf-8"), |
- ConstructorCallWith=ExecutionContext, |
- RaisesException=Constructor, |
- MeasureAs=TextEncoderConstructor |
-] interface TextEncoder { |
- readonly attribute DOMString encoding; |
- [MeasureAs=TextEncoderEncode] Uint8Array encode(optional USVString input = ""); |
-}; |
+#include <memory> |
+ |
+#include <grpc++/channel.h> |
+#include <grpc++/create_channel.h> |
+#include <grpc++/impl/grpc_library.h> |
+#include <grpc++/support/channel_arguments.h> |
+ |
+#include "src/cpp/client/create_channel_internal.h" |
+ |
+namespace grpc { |
+class ChannelArguments; |
+ |
+std::shared_ptr<Channel> CreateChannel( |
+ const grpc::string& target, |
+ const std::shared_ptr<ChannelCredentials>& creds) { |
+ return CreateCustomChannel(target, creds, ChannelArguments()); |
+} |
+ |
+std::shared_ptr<Channel> CreateCustomChannel( |
+ const grpc::string& target, |
+ const std::shared_ptr<ChannelCredentials>& creds, |
+ const ChannelArguments& args) { |
+ internal::GrpcLibrary |
+ init_lib; // We need to call init in case of a bad creds. |
+ return creds |
+ ? creds->CreateChannel(target, args) |
+ : CreateChannelInternal("", grpc_lame_client_channel_create( |
+ NULL, GRPC_STATUS_INVALID_ARGUMENT, |
+ "Invalid credentials.")); |
+} |
+ |
+} // namespace grpc |