Index: public/platform/WebRTCKeyType.h |
diff --git a/Source/core/timing/PerformanceCompositeTiming.h b/public/platform/WebRTCKeyType.h |
similarity index 64% |
copy from Source/core/timing/PerformanceCompositeTiming.h |
copy to public/platform/WebRTCKeyType.h |
index e2466a537540c344e4f30221e94be45b7e620567..e93fb3b549f3b60d4925250ffaa1508267ca6dbe 100644 |
--- a/Source/core/timing/PerformanceCompositeTiming.h |
+++ b/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,41 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef PerformanceCompositeTiming_h |
-#define PerformanceCompositeTiming_h |
- |
-#include "core/timing/PerformanceEntry.h" |
-#include "platform/heap/Handle.h" |
-#include "wtf/Forward.h" |
-#include "wtf/text/WTFString.h" |
+#ifndef WebRTCKeyType_h |
+#define WebRTCKeyType_h |
namespace blink { |
-class Document; |
+// Corresponds to KeyTypeFamily in webrtc. |
+enum WebRTCKeyFamily { KeyFamilyRsa, KeyFamilyEcdsa, KeyFamilyLast }; |
jochen (gone - plz use gerrit)
2015/09/22 15:48:53
enum values should start with the enum's name, i.e
hbos_chromium
2015/09/28 08:10:16
Done.
|
-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 = 1024) |
jochen (gone - plz use gerrit)
2015/09/22 15:48:53
what's a negative modules? also, do we really need
hbos_chromium
2015/09/28 08:10:16
Added a BLINK_ASSERT sanity check. Removed default
|
+ { |
+ return WebRTCKeyType(KeyFamilyRsa, modulusLength); |
+ } |
+ static WebRTCKeyType createECDSA() |
{ |
- return new PerformanceCompositeTiming(requestingDocument, sourceFrame, startTime); |
+ return WebRTCKeyType(KeyFamilyEcdsa); |
} |
- unsigned sourceFrame() const; |
+ explicit WebRTCKeyType(WebRTCKeyFamily family = KeyFamilyRsa) |
jochen (gone - plz use gerrit)
2015/09/22 15:48:53
if you have factory methods, the ctor should be pr
hbos_chromium
2015/09/28 08:10:16
Need a public default constructor if I want to use
|
+ : WebRTCKeyType(family, family == KeyFamilyRsa ? 1024 : 0) {} |
- DECLARE_VIRTUAL_TRACE(); |
+ WebRTCKeyFamily family() const { return m_family; } |
private: |
- PerformanceCompositeTiming(Document* requestingDocument, unsigned sourceFrame, double startTime); |
- ~PerformanceCompositeTiming() override; |
+ WebRTCKeyType(WebRTCKeyFamily family, int parameter) |
+ : m_family(family), m_parameter(parameter) {} |
- 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; |
jochen (gone - plz use gerrit)
2015/09/22 15:48:53
why do you store this, there's no getter for this
hbos_chromium
2015/09/28 08:10:16
Added getter. It will be used to convert from blin
|
}; |
} // namespace blink |
-#endif // PerformanceCompositeTiming_h |
+#endif // WebRTCKeyType_h |