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

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: Make trybots compile (WebRTCCertificate not including wtf/Noncopyable) 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/PerformanceRenderTiming.h b/third_party/WebKit/public/platform/WebRTCCertificateGenerator.h
similarity index 59%
copy from third_party/WebKit/Source/core/timing/PerformanceRenderTiming.h
copy to third_party/WebKit/public/platform/WebRTCCertificateGenerator.h
index 4f8df46f5c3fedabed1e521774810660d5b6e270..00d0f71d73a66aed27d149a14328d7ea5d19296f 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceRenderTiming.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 PerformanceRenderTiming_h
-#define PerformanceRenderTiming_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 PerformanceRenderTiming final : public PerformanceEntry {
- DEFINE_WRAPPERTYPEINFO();
+// Interface defining a class that can generate WebRTCCertificates asynchronously.
+class WebRTCCertificateGenerator {
public:
- static PerformanceRenderTiming* create(Document* requestingDocument, unsigned sourceFrame, double startTime, double finishTime)
- {
- return new PerformanceRenderTiming(requestingDocument, sourceFrame, startTime, finishTime);
- }
-
- unsigned sourceFrame() const;
-
- DECLARE_VIRTUAL_TRACE();
-
-private:
- PerformanceRenderTiming(Document* requestingDocument, unsigned sourceFrame, double startTime, double finishTime);
- ~PerformanceRenderTiming() override;
-
- unsigned m_sourceFrame;
- RefPtrWillBeMember<Document> m_requestingDocument;
+ virtual ~WebRTCCertificateGenerator() {}
+
+ // Start generating a certificate asynchronously. Which thread invokes the
+ // |observer| when the operation completes is implementation-specific.
Ryan Sleevi 2015/10/10 04:04:48 That seems like an _extremely_ dangerous API contr
hbos_chromium 2015/10/14 13:00:50 Good point, I'll say it must be the same thread.
+ virtual void generateCertificate(
+ const WebRTCKeyParams&,
+ const WebURL& /*url*/,
Guido Urdaneta 2015/10/08 11:13:03 don't put the parameter names inside /**/ comments
hbos_chromium 2015/10/14 13:00:50 Done.
+ 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 // PerformanceRenderTiming_h
+#endif // WebRTCCertificateGenerator_h

Powered by Google App Engine
This is Rietveld 408576698