Index: third_party/WebKit/public/platform/WebRTCKeyType.h |
diff --git a/third_party/WebKit/Source/core/timing/PerformanceCompositeTiming.h b/third_party/WebKit/public/platform/WebRTCKeyType.h |
similarity index 59% |
copy from third_party/WebKit/Source/core/timing/PerformanceCompositeTiming.h |
copy to third_party/WebKit/public/platform/WebRTCKeyType.h |
index e2466a537540c344e4f30221e94be45b7e620567..2449487eb4e4ea95a83b8419ef01e931f581043c 100644 |
--- a/third_party/WebKit/Source/core/timing/PerformanceCompositeTiming.h |
+++ b/third_party/WebKit/public/platform/WebRTCKeyType.h |
@@ -1,6 +1,5 @@ |
/* |
* Copyright (C) 2015 Google Inc. All rights reserved. |
- * Copyright (C) 2015 Intel Inc. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -29,38 +28,53 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef PerformanceCompositeTiming_h |
-#define PerformanceCompositeTiming_h |
+#ifndef WebRTCKeyType_h |
+#define WebRTCKeyType_h |
-#include "core/timing/PerformanceEntry.h" |
-#include "platform/heap/Handle.h" |
-#include "wtf/Forward.h" |
-#include "wtf/text/WTFString.h" |
+#include "WebCommon.h" |
namespace blink { |
-class Document; |
+// Corresponds to KeyTypeFamily in webrtc. |
+enum WebRTCKeyFamily { WebRTCKeyFamilyRsa, WebRTCKeyFamilyEcdsa, WebRTCKeyFamilyNull }; |
-class PerformanceCompositeTiming final : public PerformanceEntry { |
- DEFINE_WRAPPERTYPEINFO(); |
+// Corresponds to KeyType in webrtc. |
+class WebRTCKeyType { |
public: |
- static PerformanceCompositeTiming* create(Document* requestingDocument, unsigned sourceFrame, double startTime) |
+ static WebRTCKeyType createRSA(int modulusLength) |
{ |
- return new PerformanceCompositeTiming(requestingDocument, sourceFrame, startTime); |
+ return WebRTCKeyType(WebRTCKeyFamilyRsa, modulusLength); |
+ } |
+ static WebRTCKeyType createECDSA() |
+ { |
+ return WebRTCKeyType(WebRTCKeyFamilyEcdsa, -1); |
} |
- unsigned sourceFrame() const; |
+ WebRTCKeyType() |
+ : WebRTCKeyType(WebRTCKeyFamilyNull, -1) {} |
- DECLARE_VIRTUAL_TRACE(); |
+ WebRTCKeyFamily family() const { return m_family; } |
+ int rsaModulusLength() const |
+ { |
+ BLINK_ASSERT(m_family == WebRTCKeyFamilyRsa); |
+ return m_parameter; |
+ } |
private: |
- PerformanceCompositeTiming(Document* requestingDocument, unsigned sourceFrame, double startTime); |
- ~PerformanceCompositeTiming() override; |
+ WebRTCKeyType(WebRTCKeyFamily family, int parameter) |
+ : m_family(family), m_parameter(parameter) |
+ { |
+ if (family == WebRTCKeyFamilyRsa) { |
+ BLINK_ASSERT(parameter >= 1024 && parameter <= 8192); |
+ } |
+ } |
- unsigned m_sourceFrame; |
- RefPtrWillBeMember<Document> m_requestingDocument; |
+ WebRTCKeyFamily m_family; |
+ // For RSA: modulusLength. |
+ // For ECDSA: N/A (curve id in the future). |
+ int m_parameter; |
}; |
} // namespace blink |
-#endif // PerformanceCompositeTiming_h |
+#endif // WebRTCKeyType_h |