Index: third_party/grpc/src/cpp/client/insecure_credentials.cc |
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/EmptyWidget.js b/third_party/grpc/src/cpp/client/insecure_credentials.cc |
similarity index 60% |
copy from third_party/WebKit/Source/devtools/front_end/ui/EmptyWidget.js |
copy to third_party/grpc/src/cpp/client/insecure_credentials.cc |
index 23eefbda4fe79e2129f81d6d209a68115c260da4..1293203b932cdb1b4d6e272265c7b70cb70319cd 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/ui/EmptyWidget.js |
+++ b/third_party/grpc/src/cpp/client/insecure_credentials.cc |
@@ -1,5 +1,7 @@ |
/* |
- * Copyright (C) 2011 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,34 +28,41 @@ |
* 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. |
+ * |
*/ |
-/** |
- * @constructor |
- * @extends {WebInspector.VBox} |
- */ |
-WebInspector.EmptyWidget = function(text) |
-{ |
- WebInspector.VBox.call(this); |
- this.registerRequiredCSS("ui/emptyWidget.css"); |
- this.element.classList.add("empty-view"); |
- this.textElement = this.element.createChild("span"); |
- this._text = text; |
-} |
+#include <grpc++/security/credentials.h> |
+ |
+#include <grpc/grpc.h> |
+#include <grpc/support/log.h> |
+#include <grpc++/channel.h> |
+#include <grpc++/support/channel_arguments.h> |
+#include <grpc++/support/config.h> |
+#include "src/cpp/client/create_channel_internal.h" |
+ |
+namespace grpc { |
-WebInspector.EmptyWidget.prototype = { |
- wasShown: function() |
- { |
- this.textElement.textContent = this._text; |
- }, |
+namespace { |
+class InsecureChannelCredentialsImpl GRPC_FINAL : public ChannelCredentials { |
+ public: |
+ std::shared_ptr<grpc::Channel> CreateChannel( |
+ const string& target, const grpc::ChannelArguments& args) GRPC_OVERRIDE { |
+ grpc_channel_args channel_args; |
+ args.SetChannelArgs(&channel_args); |
+ return CreateChannelInternal( |
+ "", |
+ grpc_insecure_channel_create(target.c_str(), &channel_args, nullptr)); |
+ } |
- set text(text) |
- { |
- this._text = text; |
- if (this.isShowing()) |
- this.textElement.textContent = this._text; |
- }, |
+ SecureChannelCredentials* AsSecureCredentials() GRPC_OVERRIDE { |
+ return nullptr; |
+ } |
+}; |
+} // namespace |
- __proto__: WebInspector.VBox.prototype |
+std::shared_ptr<ChannelCredentials> InsecureChannelCredentials() { |
+ return std::shared_ptr<ChannelCredentials>( |
+ new InsecureChannelCredentialsImpl()); |
} |
+} // namespace grpc |