Index: third_party/grpc/src/core/census/aggregation.h |
diff --git a/third_party/WebKit/Source/modules/crypto/CryptoKey.h b/third_party/grpc/src/core/census/aggregation.h |
similarity index 50% |
copy from third_party/WebKit/Source/modules/crypto/CryptoKey.h |
copy to third_party/grpc/src/core/census/aggregation.h |
index 354a3c6113cc1f7f3b3375b69f37fa1e4fd3593a..e9bc6ada96085b9c80953773129907e89071bd77 100644 |
--- a/third_party/WebKit/Source/modules/crypto/CryptoKey.h |
+++ b/third_party/grpc/src/core/census/aggregation.h |
@@ -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,55 +28,39 @@ |
* 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 CryptoKey_h |
-#define CryptoKey_h |
- |
-#include "bindings/core/v8/ScriptWrappable.h" |
-#include "modules/crypto/NormalizeAlgorithm.h" |
-#include "platform/heap/Handle.h" |
-#include "public/platform/WebCryptoKey.h" |
-#include "wtf/Forward.h" |
-#include "wtf/text/WTFString.h" |
- |
-namespace blink { |
- |
-class CryptoResult; |
- |
-class CryptoKey final : public GarbageCollectedFinalized<CryptoKey>, public ScriptWrappable { |
- DEFINE_WRAPPERTYPEINFO(); |
-public: |
- static CryptoKey* create(const WebCryptoKey& key) |
- { |
- return new CryptoKey(key); |
- } |
- |
- ~CryptoKey(); |
+#include <stddef.h> |
- String type() const; |
- bool extractable() const; |
- ScriptValue algorithm(ScriptState*); |
- Vector<String> usages() const; |
+#ifndef GRPC_INTERNAL_CORE_CENSUS_AGGREGATION_H |
+#define GRPC_INTERNAL_CORE_CENSUS_AGGREGATION_H |
- const WebCryptoKey& key() const { return m_key; } |
- |
- // If the key cannot be used with the indicated algorithm, returns false |
- // and completes the CryptoResult with an error. |
- bool canBeUsedForAlgorithm(const WebCryptoAlgorithm&, WebCryptoKeyUsage, CryptoResult*) const; |
- |
- // On failure, these return false and complete the CryptoResult with an error. |
- static bool parseFormat(const String&, WebCryptoKeyFormat&, CryptoResult*); |
- static bool parseUsageMask(const Vector<String>&, WebCryptoKeyUsageMask&, CryptoResult*); |
- |
- DEFINE_INLINE_TRACE() { } |
- |
-protected: |
- explicit CryptoKey(const WebCryptoKey&); |
- |
- const WebCryptoKey m_key; |
+/** Structure used to describe an aggregation type. */ |
+struct census_aggregation_ops { |
+ /* Create a new aggregation. The pointer returned can be used in future calls |
+ to clone(), free(), record(), data() and reset(). */ |
+ void *(*create)(const void *create_arg); |
+ /* Make a copy of an aggregation created by create() */ |
+ void *(*clone)(const void *aggregation); |
+ /* Destroy an aggregation created by create() */ |
+ void (*free)(void *aggregation); |
+ /* Record a new value against aggregation. */ |
+ void (*record)(void *aggregation, double value); |
+ /* Return current aggregation data. The caller must cast this object into |
+ the correct type for the aggregation result. The object returned can be |
+ freed by using free_data(). */ |
+ void *(*data)(const void *aggregation); |
+ /* free data returned by data() */ |
+ void (*free_data)(void *data); |
+ /* Reset an aggregation to default (zero) values. */ |
+ void (*reset)(void *aggregation); |
+ /* Merge 'from' aggregation into 'to'. Both aggregations must be compatible */ |
+ void (*merge)(void *to, const void *from); |
+ /* Fill buffer with printable string version of aggregation contents. For |
+ debugging only. Returns the number of bytes added to buffer (a value == n |
+ implies the buffer was of insufficient size). */ |
+ size_t (*print)(const void *aggregation, char *buffer, size_t n); |
}; |
-} // namespace blink |
- |
-#endif // CryptoKey_h |
+#endif /* GRPC_INTERNAL_CORE_CENSUS_AGGREGATION_H */ |