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

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

Issue 1373023002: RTCCertificate, RTCPeerConnection.generateCertificate (WebRTC JavaScript) added. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed jochen's comments Created 5 years, 2 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
Index: third_party/WebKit/public/platform/WebRTCCertificateGenerator.h
diff --git a/third_party/WebKit/Source/core/timing/PerformanceCompositeTiming.h b/third_party/WebKit/public/platform/WebRTCCertificateGenerator.h
similarity index 59%
copy from third_party/WebKit/Source/core/timing/PerformanceCompositeTiming.h
copy to third_party/WebKit/public/platform/WebRTCCertificateGenerator.h
index e2466a537540c344e4f30221e94be45b7e620567..e5aff7b47f69ffa7fc902e17f02643f51cca1ac0 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceCompositeTiming.h
+++ b/third_party/WebKit/public/platform/WebRTCCertificateGenerator.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,35 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef PerformanceCompositeTiming_h
-#define PerformanceCompositeTiming_h
+#ifndef WebRTCCertificateGenerator_h
+#define WebRTCCertificateGenerator_h
-#include "core/timing/PerformanceEntry.h"
-#include "platform/heap/Handle.h"
-#include "wtf/Forward.h"
-#include "wtf/text/WTFString.h"
+#include "public/platform/WebCallbacks.h"
+#include "public/platform/WebRTCCertificate.h"
+#include "public/platform/WebRTCKeyParams.h"
+#include "public/platform/WebURL.h"
namespace blink {
-class Document;
-
-class PerformanceCompositeTiming final : public PerformanceEntry {
- DEFINE_WRAPPERTYPEINFO();
+// Interface defining a class that can generate WebRTCCertificates asynchronously.
+class WebRTCCertificateGenerator {
public:
- static PerformanceCompositeTiming* create(Document* requestingDocument, unsigned sourceFrame, double startTime)
- {
- return new PerformanceCompositeTiming(requestingDocument, sourceFrame, startTime);
- }
-
- unsigned sourceFrame() const;
-
- DECLARE_VIRTUAL_TRACE();
-
-private:
- PerformanceCompositeTiming(Document* requestingDocument, unsigned sourceFrame, double startTime);
- ~PerformanceCompositeTiming() override;
-
- unsigned m_sourceFrame;
- RefPtrWillBeMember<Document> m_requestingDocument;
+ virtual ~WebRTCCertificateGenerator() {}
+
+ // Start generating a certificate asynchronously. The |observer| is invoked on the
+ // same thread that called generateCertificate when the operation is completed.
+ virtual void generateCertificate(
+ const WebRTCKeyParams&,
+ const WebURL&,
+ const WebURL& firstPartyForCookies,
+ WebCallbacks<WebRTCCertificate*, void>* observer) = 0;
+
+ // Determines if the parameters should be considered valid for certificate generation.
+ // For example, if the number of bits of some parameter is too small or too large we
+ // may want to reject it for security or performance reasons.
+ virtual bool isValidKeyParams(const WebRTCKeyParams&) = 0;
};
} // namespace blink
-#endif // PerformanceCompositeTiming_h
+#endif // WebRTCCertificateGenerator_h

Powered by Google App Engine
This is Rietveld 408576698