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

Unified Diff: public/platform/WebRTCCertificate.h

Issue 1311853005: RTCCertificate and RTCPeerConnection.generateCertificate added to JavaScript (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed guidou's 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
Index: public/platform/WebRTCCertificate.h
diff --git a/Source/core/timing/PerformanceCompositeTiming.h b/public/platform/WebRTCCertificate.h
similarity index 52%
copy from Source/core/timing/PerformanceCompositeTiming.h
copy to public/platform/WebRTCCertificate.h
index 976273518c1d4b9758df83c7de0fef1dd159bfc9..6167c38def1e44c7e8cd25d50cde43b6350a41c3 100644
--- a/Source/core/timing/PerformanceCompositeTiming.h
+++ b/public/platform/WebRTCCertificate.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,40 +28,47 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef PerformanceCompositeTiming_h
-#define PerformanceCompositeTiming_h
+#ifndef WebRTCCertificate_h
+#define WebRTCCertificate_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/WebURL.h"
+#include "wtf/Noncopyable.h"
namespace blink {
-class Document;
-
-class PerformanceCompositeTiming final : public PerformanceEntry {
- DEFINE_WRAPPERTYPEINFO();
+// Interface defining what blink needs to know about certificates (abstracting away
+// Chrome and WebRTC layer implementation details). You can create shallow copies of the
+// WebRTCCertificate. When all copies are destroyed, the implementation-specific data must
+// be freed.
jochen (gone - plz use gerrit) 2015/09/15 08:04:19 why is this restriction required?
hbos_chromium 2015/09/21 16:12:22 See previous message about why the shallow copying
+class WebRTCCertificate {
jochen (gone - plz use gerrit) 2015/09/15 08:04:19 should there be a method for getting the keyType?
hbos_chromium 2015/09/21 16:12:22 Done.
+ WTF_MAKE_NONCOPYABLE(WebRTCCertificate);
public:
- static PerformanceCompositeTiming* create(Document* requestingDocument, unsigned sourceFrame, double startTime)
- {
- return new PerformanceCompositeTiming(requestingDocument, sourceFrame, startTime);
- }
-
- unsigned sourceFrame() const;
+ WebRTCCertificate() = default;
+ virtual ~WebRTCCertificate() = default;
- bool isComposite() override { return true; }
+ // Copies the WebRTCCertificate object without copying the underlying
+ // implementation-specific (WebRTC layer) certificate. When all copies are destroyed
+ // the underlying data is freed.
+ virtual WebRTCCertificate* shallowCopy() const = 0;
jochen (gone - plz use gerrit) 2015/09/15 08:04:19 does it matter that it's a shallow copy?
hbos_chromium 2015/09/21 16:12:22 (Originals and shallow copies are "equals". Beside
- DECLARE_VIRTUAL_TRACE();
+ virtual double expires() const = 0;
jochen (gone - plz use gerrit) 2015/09/15 08:04:19 it's unclear what this should return. please add a
hbos_chromium 2015/09/21 16:12:22 Keeping the name due to the specs so that everythi
+};
-private:
- PerformanceCompositeTiming(Document* requestingDocument, unsigned sourceFrame, double startTime);
- ~PerformanceCompositeTiming() override;
+// Interface defining a class that can generate WebRTCCertificates asynchronously.
+class WebRTCCertificateGenerator {
jochen (gone - plz use gerrit) 2015/09/15 08:04:19 please move this class to a separate header
hbos_chromium 2015/09/21 16:12:22 Done.
+public:
+ virtual ~WebRTCCertificateGenerator() { }
- unsigned m_sourceFrame;
- RefPtrWillBeMember<Document> m_requestingDocument;
+ // Start generating a certificate. The observer's onGenerateComplete is called when
+ // the asynchronous operation finished (whether or not successful).
+ virtual void generateCertificate(
+ int keyType,
jochen (gone - plz use gerrit) 2015/09/15 08:04:19 should be an enum? (which in turn should live in i
hbos_chromium 2015/09/21 16:12:22 Moved to new file and changed to parameterizable c
+ const WebURL& /*url*/,
+ const WebURL& /*firstPartyForCookies*/,
+ WebCallbacks<WebRTCCertificate*, void>* observer) = 0;
};
} // namespace blink
-#endif // PerformanceCompositeTiming_h
+#endif // WebRTCCertificate_h

Powered by Google App Engine
This is Rietveld 408576698