Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(997)

Unified Diff: third_party/WebKit/public/platform/WebRTCKeyType.h

Issue 1311853005: RTCCertificate and RTCPeerConnection.generateCertificate added to JavaScript (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Chromium implementation of Blink interfaces. Addressed comments. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/public/platform/WebRTCConfiguration.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « third_party/WebKit/public/platform/WebRTCConfiguration.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698