Index: public/platform/WebRTCKeyType.h |
diff --git a/Source/core/layout/compositing/CompositedSelection.h b/public/platform/WebRTCKeyType.h |
similarity index 63% |
copy from Source/core/layout/compositing/CompositedSelection.h |
copy to public/platform/WebRTCKeyType.h |
index f265d566c3a28d02a51806706287e0da6a904a44..e93fb3b549f3b60d4925250ffaa1508267ca6dbe 100644 |
--- a/Source/core/layout/compositing/CompositedSelection.h |
+++ b/public/platform/WebRTCKeyType.h |
@@ -28,36 +28,41 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef CompositedSelection_h |
-#define CompositedSelection_h |
- |
-#include "core/editing/SelectionType.h" |
-#include "core/layout/compositing/CompositedSelectionBound.h" |
-#include "platform/geometry/FloatPoint.h" |
-#include "platform/graphics/GraphicsLayer.h" |
-#include "wtf/Allocator.h" |
+#ifndef WebRTCKeyType_h |
+#define WebRTCKeyType_h |
namespace blink { |
-// The active selection region, containing compositing data for the selection |
-// end points as well as metadata for the selection region. |
-// See |WebSelection|. |
-struct CompositedSelection { |
- STACK_ALLOCATED(); |
- CompositedSelection() |
- : type(NoSelection) |
- , isEditable(false) |
- , isEmptyTextFormControl(false) |
+// Corresponds to KeyTypeFamily in webrtc. |
+enum WebRTCKeyFamily { KeyFamilyRsa, KeyFamilyEcdsa, KeyFamilyLast }; |
hbos_chromium
2015/09/21 16:12:22
Should even this enum be in its own header?
|
+ |
+// Corresponds to KeyType in webrtc. |
+class WebRTCKeyType { |
+public: |
+ static WebRTCKeyType createRSA(int modulusLength = 1024) |
+ { |
+ return WebRTCKeyType(KeyFamilyRsa, modulusLength); |
+ } |
+ static WebRTCKeyType createECDSA() |
{ |
+ return WebRTCKeyType(KeyFamilyEcdsa); |
} |
- SelectionType type; |
- CompositedSelectionBound start; |
- CompositedSelectionBound end; |
- bool isEditable; |
- bool isEmptyTextFormControl; |
+ explicit WebRTCKeyType(WebRTCKeyFamily family = KeyFamilyRsa) |
+ : WebRTCKeyType(family, family == KeyFamilyRsa ? 1024 : 0) {} |
+ |
+ WebRTCKeyFamily family() const { return m_family; } |
+ |
+private: |
+ WebRTCKeyType(WebRTCKeyFamily family, int parameter) |
+ : m_family(family), m_parameter(parameter) {} |
+ |
+ WebRTCKeyFamily m_family; |
+ // For RSA: modulusLength. |
+ // For ECDSA: N/A (curve id in the future). |
+ int m_parameter; |
}; |
} // namespace blink |
-#endif // CompositedSelection_h |
+#endif // WebRTCKeyType_h |