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

Unified Diff: third_party/grpc/src/cpp/client/create_channel.cc

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
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
« no previous file with comments | « third_party/grpc/src/cpp/client/client_context.cc ('k') | third_party/grpc/src/cpp/client/create_channel_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698