Index: third_party/grpc/src/cpp/server/insecure_server_credentials.cc |
diff --git a/third_party/WebKit/public/platform/WebContentDecryptionModule.h b/third_party/grpc/src/cpp/server/insecure_server_credentials.cc |
similarity index 66% |
copy from third_party/WebKit/public/platform/WebContentDecryptionModule.h |
copy to third_party/grpc/src/cpp/server/insecure_server_credentials.cc |
index 9a985b205d0c5223dd6dd30523df108321d7b155..ef3cae5fd720612b1ae6352a5004586cb8d53471 100644 |
--- a/third_party/WebKit/public/platform/WebContentDecryptionModule.h |
+++ b/third_party/grpc/src/cpp/server/insecure_server_credentials.cc |
@@ -1,5 +1,7 @@ |
/* |
- * Copyright (C) 2013 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,26 +28,33 @@ |
* 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 WebContentDecryptionModule_h |
-#define WebContentDecryptionModule_h |
- |
-#include "public/platform/WebContentDecryptionModuleResult.h" |
-#include "public/platform/WebContentDecryptionModuleSession.h" |
- |
-namespace blink { |
- |
-class BLINK_PLATFORM_EXPORT WebContentDecryptionModule { |
-public: |
- virtual ~WebContentDecryptionModule(); |
- |
- // Must return non-null. |
- virtual WebContentDecryptionModuleSession* createSession() = 0; |
- |
- virtual void setServerCertificate(const unsigned char* certificate, size_t certificateLength, WebContentDecryptionModuleResult) = 0; |
+#include <grpc++/security/server_credentials.h> |
+ |
+#include <grpc/grpc.h> |
+#include <grpc/support/log.h> |
+ |
+namespace grpc { |
+namespace { |
+class InsecureServerCredentialsImpl GRPC_FINAL : public ServerCredentials { |
+ public: |
+ int AddPortToServer(const grpc::string& addr, |
+ grpc_server* server) GRPC_OVERRIDE { |
+ return grpc_server_add_insecure_http2_port(server, addr.c_str()); |
+ } |
+ void SetAuthMetadataProcessor( |
+ const std::shared_ptr<AuthMetadataProcessor>& processor) GRPC_OVERRIDE { |
+ (void)processor; |
+ GPR_ASSERT(0); // Should not be called on InsecureServerCredentials. |
+ } |
}; |
+} // namespace |
-} // namespace blink |
+std::shared_ptr<ServerCredentials> InsecureServerCredentials() { |
+ return std::shared_ptr<ServerCredentials>( |
+ new InsecureServerCredentialsImpl()); |
+} |
-#endif // WebContentDecryptionModule_h |
+} // namespace grpc |