Index: third_party/grpc/include/grpc++/impl/codegen/serialization_traits.h |
diff --git a/third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h b/third_party/grpc/include/grpc++/impl/codegen/serialization_traits.h |
similarity index 52% |
copy from third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h |
copy to third_party/grpc/include/grpc++/impl/codegen/serialization_traits.h |
index 790a0a2a1891d6b854784ca4958b91aec9e1f1c9..83c3b64eb3cce908d53c5854a680393bf146a127 100644 |
--- a/third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h |
+++ b/third_party/grpc/include/grpc++/impl/codegen/serialization_traits.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,50 +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. |
+ * |
*/ |
-#ifndef WebStorageQuotaCallbacks_h |
-#define WebStorageQuotaCallbacks_h |
- |
-#include "WebCommon.h" |
-#include "WebPrivatePtr.h" |
-#include "WebStorageQuotaError.h" |
- |
-namespace blink { |
- |
-class StorageQuotaCallbacks; |
- |
-class WebStorageQuotaCallbacks { |
-public: |
- ~WebStorageQuotaCallbacks() { reset(); } |
- WebStorageQuotaCallbacks() { } |
- WebStorageQuotaCallbacks(const WebStorageQuotaCallbacks& c) { assign(c); } |
- WebStorageQuotaCallbacks& operator=(const WebStorageQuotaCallbacks& c) |
- { |
- assign(c); |
- return *this; |
- } |
- |
- BLINK_PLATFORM_EXPORT void reset(); |
- BLINK_PLATFORM_EXPORT void assign(const WebStorageQuotaCallbacks&); |
- |
-#if INSIDE_BLINK |
- BLINK_PLATFORM_EXPORT WebStorageQuotaCallbacks(StorageQuotaCallbacks*); |
-#endif |
- |
- // Callback for WebFrameClient::queryStorageUsageAndQuota. |
- BLINK_PLATFORM_EXPORT void didQueryStorageUsageAndQuota(unsigned long long usageInBytes, unsigned long long quotaInBytes); |
- |
- // Callback for WebFrameClient::requestStorageQuota. |
- // This may return a smaller amount of quota than the requested. |
- BLINK_PLATFORM_EXPORT void didGrantStorageQuota(unsigned long long usageInBytes, unsigned long long grantedQuotaInBytes); |
+#ifndef GRPCXX_IMPL_CODEGEN_SERIALIZATION_TRAITS_H |
+#define GRPCXX_IMPL_CODEGEN_SERIALIZATION_TRAITS_H |
- BLINK_PLATFORM_EXPORT void didFail(WebStorageQuotaError); |
+namespace grpc { |
-private: |
- WebPrivatePtr<StorageQuotaCallbacks> m_private; |
-}; |
+/// Defines how to serialize and deserialize some type. |
+/// |
+/// Used for hooking different message serialization API's into GRPC. |
+/// Each SerializationTraits implementation must provide the following |
+/// functions: |
+/// static Status Serialize(const Message& msg, |
+/// grpc_byte_buffer** buffer, |
+// bool* own_buffer); |
+/// static Status Deserialize(grpc_byte_buffer* buffer, |
+/// Message* msg, |
+/// int max_message_size); |
+/// |
+/// Serialize is required to convert message to a grpc_byte_buffer, and |
+/// to store a pointer to that byte buffer at *buffer. *own_buffer should |
+/// be set to true if the caller owns said byte buffer, or false if |
+/// ownership is retained elsewhere. |
+/// |
+/// Deserialize is required to convert buffer into the message stored at |
+/// msg. max_message_size is passed in as a bound on the maximum number of |
+/// message bytes Deserialize should accept. |
+/// |
+/// Both functions return a Status, allowing them to explain what went |
+/// wrong if required. |
+template <class Message, |
+ class UnusedButHereForPartialTemplateSpecialization = void> |
+class SerializationTraits; |
-} // namespace blink |
+} // namespace grpc |
-#endif // WebStorageQuotaCallbacks_h |
+#endif // GRPCXX_IMPL_CODEGEN_SERIALIZATION_TRAITS_H |