<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[171683] trunk/Source/JavaScriptCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/171683">171683</a></dd>
<dt>Author</dt> <dd>burg@cs.washington.edu</dd>
<dt>Date</dt> <dd>2014-07-28 12:22:43 -0700 (Mon, 28 Jul 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Replay: incorrect serialization code generated for enum classes inside class scope
https://bugs.webkit.org/show_bug.cgi?id=135342
Reviewed by Timothy Hatcher.
If an enum class is defined inside of a class scope, then the enum class
cannot be forward-declared and the relevant header should be included.
Some generated code used incorrectly-scoped enum values in this situation.
* replay/scripts/CodeGeneratorReplayInputs.py:
(Generator.generate_includes.declaration.is):
(Generator.generate_enum_trait_implementation.is):
(Generator.generate_enum_trait_implementation):
Tests:
* replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.cpp: Rebaselined.
* replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.h: Rebaselined.
* replay/scripts/tests/generate-enums-with-same-base-name.json: Add enum
class types to this test case.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorereplayscriptsCodeGeneratorReplayInputspy">trunk/Source/JavaScriptCore/replay/scripts/CodeGeneratorReplayInputs.py</a></li>
<li><a href="#trunkSourceJavaScriptCorereplayscriptstestsexpectedgenerateenumswithsamebasenamejsonTestReplayInputscpp">trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorereplayscriptstestsexpectedgenerateenumswithsamebasenamejsonTestReplayInputsh">trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.h</a></li>
<li><a href="#trunkSourceJavaScriptCorereplayscriptstestsgenerateenumswithsamebasenamejson">trunk/Source/JavaScriptCore/replay/scripts/tests/generate-enums-with-same-base-name.json</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (171682 => 171683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-07-28 19:21:15 UTC (rev 171682)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-07-28 19:22:43 UTC (rev 171683)
</span><span class="lines">@@ -1,5 +1,28 @@
</span><span class="cx"> 2014-07-28 Brian J. Burg <burg@cs.washington.edu>
</span><span class="cx">
</span><ins>+ Web Replay: incorrect serialization code generated for enum classes inside class scope
+ https://bugs.webkit.org/show_bug.cgi?id=135342
+
+ Reviewed by Timothy Hatcher.
+
+ If an enum class is defined inside of a class scope, then the enum class
+ cannot be forward-declared and the relevant header should be included.
+ Some generated code used incorrectly-scoped enum values in this situation.
+
+ * replay/scripts/CodeGeneratorReplayInputs.py:
+ (Generator.generate_includes.declaration.is):
+ (Generator.generate_enum_trait_implementation.is):
+ (Generator.generate_enum_trait_implementation):
+
+ Tests:
+
+ * replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.cpp: Rebaselined.
+ * replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.h: Rebaselined.
+ * replay/scripts/tests/generate-enums-with-same-base-name.json: Add enum
+ class types to this test case.
+
+2014-07-28 Brian J. Burg <burg@cs.washington.edu>
+
</ins><span class="cx"> Web Replay: vectors of characters should be base64-encoded
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=135341
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorereplayscriptsCodeGeneratorReplayInputspy"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/replay/scripts/CodeGeneratorReplayInputs.py (171682 => 171683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/replay/scripts/CodeGeneratorReplayInputs.py        2014-07-28 19:21:15 UTC (rev 171682)
+++ trunk/Source/JavaScriptCore/replay/scripts/CodeGeneratorReplayInputs.py        2014-07-28 19:22:43 UTC (rev 171683)
</span><span class="lines">@@ -635,7 +635,7 @@
</span><span class="cx"> include_for_destructor = _type.mode is TypeModes.SHARED
</span><span class="cx"> # Enums within classes cannot be forward declared, so we include
</span><span class="cx"> # headers with the relevant class declaration.
</span><del>- include_for_enclosing_class = _type.is_enum() and _type.enclosing_class is not None
</del><ins>+ include_for_enclosing_class = _type.enclosing_class is not None
</ins><span class="cx"> # Include headers for types like URL and String which are copied, not owned or shared.
</span><span class="cx"> include_for_copyable_member = _type.mode is TypeModes.HEAVY_SCALAR
</span><span class="cx"> if (not includes_for_types) ^ (include_for_destructor or include_for_enclosing_class or include_for_copyable_member):
</span><span class="lines">@@ -801,10 +801,10 @@
</span><span class="cx"> prefix_components = []
</span><span class="cx"> if should_qualify_type:
</span><span class="cx"> prefix_components.append(_type.framework.setting('namespace'))
</span><del>- if _type.is_enum_class():
- prefix_components.append(_type.type_name())
- if _type.enclosing_class is not None:
</del><ins>+ if _type.is_enum() and _type.enclosing_class is not None:
</ins><span class="cx"> prefix_components.append(_type.enclosing_class)
</span><ins>+ elif _type.is_enum_class():
+ prefix_components.append(_type.type_name(qualified=False))
</ins><span class="cx"> prefix_components.append("")
</span><span class="cx"> enum_prefix = "::".join(prefix_components)
</span><span class="cx"> encodeLines = []
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorereplayscriptstestsexpectedgenerateenumswithsamebasenamejsonTestReplayInputscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.cpp (171682 => 171683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.cpp        2014-07-28 19:21:15 UTC (rev 171682)
+++ trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.cpp        2014-07-28 19:22:43 UTC (rev 171683)
</span><span class="lines">@@ -35,10 +35,12 @@
</span><span class="cx"> #include <platform/ExternalNamespaceImplIncludeDummy.h>
</span><span class="cx">
</span><span class="cx"> namespace Test {
</span><del>-FormCombo::FormCombo(PlatformEvent::Type eventType, FormData::Type formType)
</del><ins>+FormCombo::FormCombo(PlatformEvent1::Type eventType1, PlatformEvent2::Type eventType2, FormData1::Type formType1, FormData2::Type formType2)
</ins><span class="cx"> : NondeterministicInput<FormCombo>()
</span><del>- , m_eventType(eventType)
- , m_formType(formType)
</del><ins>+ , m_eventType1(eventType1)
+ , m_eventType2(eventType2)
+ , m_formType1(formType1)
+ , m_formType2(formType2)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -56,40 +58,50 @@
</span><span class="cx">
</span><span class="cx"> void InputTraits<Test::FormCombo>::encode(EncodedValue& encodedValue, const Test::FormCombo& input)
</span><span class="cx"> {
</span><del>- encodedValue.put<PlatformEvent::Type>(ASCIILiteral("eventType"), input.eventType());
- encodedValue.put<WebCore::FormData::Type>(ASCIILiteral("formType"), input.formType());
</del><ins>+ encodedValue.put<PlatformEvent1::Type>(ASCIILiteral("eventType1"), input.eventType1());
+ encodedValue.put<PlatformEvent2::Type>(ASCIILiteral("eventType2"), input.eventType2());
+ encodedValue.put<WebCore::FormData1::Type>(ASCIILiteral("formType1"), input.formType1());
+ encodedValue.put<WebCore::FormData2::Type>(ASCIILiteral("formType2"), input.formType2());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool InputTraits<Test::FormCombo>::decode(EncodedValue& encodedValue, std::unique_ptr<Test::FormCombo>& input)
</span><span class="cx"> {
</span><del>- PlatformEvent::Type eventType;
- if (!encodedValue.get<PlatformEvent::Type>(ASCIILiteral("eventType"), eventType))
</del><ins>+ PlatformEvent1::Type eventType1;
+ if (!encodedValue.get<PlatformEvent1::Type>(ASCIILiteral("eventType1"), eventType1))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- WebCore::FormData::Type formType;
- if (!encodedValue.get<WebCore::FormData::Type>(ASCIILiteral("formType"), formType))
</del><ins>+ PlatformEvent2::Type eventType2;
+ if (!encodedValue.get<PlatformEvent2::Type>(ASCIILiteral("eventType2"), eventType2))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- input = std::make_unique<Test::FormCombo>(eventType, formType);
</del><ins>+ WebCore::FormData1::Type formType1;
+ if (!encodedValue.get<WebCore::FormData1::Type>(ASCIILiteral("formType1"), formType1))
+ return false;
+
+ WebCore::FormData2::Type formType2;
+ if (!encodedValue.get<WebCore::FormData2::Type>(ASCIILiteral("formType2"), formType2))
+ return false;
+
+ input = std::make_unique<Test::FormCombo>(eventType1, eventType2, formType1, formType2);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><del>-EncodedValue EncodingTraits<WebCore::FormData::Type>::encodeValue(const WebCore::FormData::Type& enumValue)
</del><ins>+EncodedValue EncodingTraits<WebCore::FormData1::Type>::encodeValue(const WebCore::FormData1::Type& enumValue)
</ins><span class="cx"> {
</span><span class="cx"> EncodedValue encodedValue = EncodedValue::createArray();
</span><del>- if (enumValue & WebCore::FormData::Text) {
</del><ins>+ if (enumValue & WebCore::FormData1::Text) {
</ins><span class="cx"> encodedValue.append<String>(ASCIILiteral("Text"));
</span><del>- if (enumValue == WebCore::FormData::Text)
</del><ins>+ if (enumValue == WebCore::FormData1::Text)
</ins><span class="cx"> return encodedValue;
</span><span class="cx"> }
</span><del>- if (enumValue & WebCore::FormData::Blob) {
</del><ins>+ if (enumValue & WebCore::FormData1::Blob) {
</ins><span class="cx"> encodedValue.append<String>(ASCIILiteral("Blob"));
</span><del>- if (enumValue == WebCore::FormData::Blob)
</del><ins>+ if (enumValue == WebCore::FormData1::Blob)
</ins><span class="cx"> return encodedValue;
</span><span class="cx"> }
</span><span class="cx"> return encodedValue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool EncodingTraits<WebCore::FormData::Type>::decodeValue(EncodedValue& encodedValue, WebCore::FormData::Type& enumValue)
</del><ins>+bool EncodingTraits<WebCore::FormData1::Type>::decodeValue(EncodedValue& encodedValue, WebCore::FormData1::Type& enumValue)
</ins><span class="cx"> {
</span><span class="cx"> Vector<String> enumStrings;
</span><span class="cx"> if (!EncodingTraits<Vector<String>>::decodeValue(encodedValue, enumStrings))
</span><span class="lines">@@ -97,31 +109,54 @@
</span><span class="cx">
</span><span class="cx"> for (String enumString : enumStrings) {
</span><span class="cx"> if (enumString == "Text")
</span><del>- enumValue = static_cast<WebCore::FormData::Type>(enumValue | WebCore::FormData::Text);
</del><ins>+ enumValue = static_cast<WebCore::FormData1::Type>(enumValue | WebCore::FormData1::Text);
</ins><span class="cx"> if (enumString == "Blob")
</span><del>- enumValue = static_cast<WebCore::FormData::Type>(enumValue | WebCore::FormData::Blob);
</del><ins>+ enumValue = static_cast<WebCore::FormData1::Type>(enumValue | WebCore::FormData1::Blob);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-EncodedValue EncodingTraits<PlatformEvent::Type>::encodeValue(const PlatformEvent::Type& enumValue)
</del><ins>+EncodedValue EncodingTraits<WebCore::FormData2::Type>::encodeValue(const WebCore::FormData2::Type& enumValue)
</ins><span class="cx"> {
</span><ins>+ switch (enumValue) {
+ case WebCore::FormData2::Type::Text: return EncodedValue::createString("Text");
+ case WebCore::FormData2::Type::Blob: return EncodedValue::createString("Blob");
+ default: ASSERT_NOT_REACHED(); return EncodedValue::createString("Error!");
+ }
+}
+
+bool EncodingTraits<WebCore::FormData2::Type>::decodeValue(EncodedValue& encodedValue, WebCore::FormData2::Type& enumValue)
+{
+ String enumString = encodedValue.convertTo<String>();
+ if (enumString == "Text") {
+ enumValue = WebCore::FormData2::Type::Text;
+ return true;
+ }
+ if (enumString == "Blob") {
+ enumValue = WebCore::FormData2::Type::Blob;
+ return true;
+ }
+ return false;
+}
+
+EncodedValue EncodingTraits<PlatformEvent1::Type>::encodeValue(const PlatformEvent1::Type& enumValue)
+{
</ins><span class="cx"> EncodedValue encodedValue = EncodedValue::createArray();
</span><del>- if (enumValue & PlatformEvent::Mouse) {
</del><ins>+ if (enumValue & PlatformEvent1::Mouse) {
</ins><span class="cx"> encodedValue.append<String>(ASCIILiteral("Mouse"));
</span><del>- if (enumValue == PlatformEvent::Mouse)
</del><ins>+ if (enumValue == PlatformEvent1::Mouse)
</ins><span class="cx"> return encodedValue;
</span><span class="cx"> }
</span><del>- if (enumValue & PlatformEvent::Keyboard) {
</del><ins>+ if (enumValue & PlatformEvent1::Keyboard) {
</ins><span class="cx"> encodedValue.append<String>(ASCIILiteral("Keyboard"));
</span><del>- if (enumValue == PlatformEvent::Keyboard)
</del><ins>+ if (enumValue == PlatformEvent1::Keyboard)
</ins><span class="cx"> return encodedValue;
</span><span class="cx"> }
</span><span class="cx"> return encodedValue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool EncodingTraits<PlatformEvent::Type>::decodeValue(EncodedValue& encodedValue, PlatformEvent::Type& enumValue)
</del><ins>+bool EncodingTraits<PlatformEvent1::Type>::decodeValue(EncodedValue& encodedValue, PlatformEvent1::Type& enumValue)
</ins><span class="cx"> {
</span><span class="cx"> Vector<String> enumStrings;
</span><span class="cx"> if (!EncodingTraits<Vector<String>>::decodeValue(encodedValue, enumStrings))
</span><span class="lines">@@ -129,13 +164,36 @@
</span><span class="cx">
</span><span class="cx"> for (String enumString : enumStrings) {
</span><span class="cx"> if (enumString == "Mouse")
</span><del>- enumValue = static_cast<PlatformEvent::Type>(enumValue | PlatformEvent::Mouse);
</del><ins>+ enumValue = static_cast<PlatformEvent1::Type>(enumValue | PlatformEvent1::Mouse);
</ins><span class="cx"> if (enumString == "Keyboard")
</span><del>- enumValue = static_cast<PlatformEvent::Type>(enumValue | PlatformEvent::Keyboard);
</del><ins>+ enumValue = static_cast<PlatformEvent1::Type>(enumValue | PlatformEvent1::Keyboard);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><ins>+
+EncodedValue EncodingTraits<PlatformEvent2::Type>::encodeValue(const PlatformEvent2::Type& enumValue)
+{
+ switch (enumValue) {
+ case PlatformEvent2::Type::Mouse: return EncodedValue::createString("Mouse");
+ case PlatformEvent2::Type::Keyboard: return EncodedValue::createString("Keyboard");
+ default: ASSERT_NOT_REACHED(); return EncodedValue::createString("Error!");
+ }
+}
+
+bool EncodingTraits<PlatformEvent2::Type>::decodeValue(EncodedValue& encodedValue, PlatformEvent2::Type& enumValue)
+{
+ String enumString = encodedValue.convertTo<String>();
+ if (enumString == "Mouse") {
+ enumValue = PlatformEvent2::Type::Mouse;
+ return true;
+ }
+ if (enumString == "Keyboard") {
+ enumValue = PlatformEvent2::Type::Keyboard;
+ return true;
+ }
+ return false;
+}
</ins><span class="cx"> } // namespace JSC
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(WEB_REPLAY)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorereplayscriptstestsexpectedgenerateenumswithsamebasenamejsonTestReplayInputsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.h (171682 => 171683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.h        2014-07-28 19:21:15 UTC (rev 171682)
+++ trunk/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enums-with-same-base-name.json-TestReplayInputs.h        2014-07-28 19:22:43 UTC (rev 171683)
</span><span class="lines">@@ -33,7 +33,8 @@
</span><span class="cx"> #if ENABLE(WEB_REPLAY)
</span><span class="cx"> #include "InternalNamespaceHeaderIncludeDummy.h"
</span><span class="cx"> #include <platform/ExternalNamespaceHeaderIncludeDummy.h>
</span><del>-#include <replay/FormData.h>
</del><ins>+#include <replay/FormData1.h>
+#include <replay/FormData2.h>
</ins><span class="cx"> #include <replay/PlatformEvent.h>
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -50,32 +51,50 @@
</span><span class="cx"> static void encode(JSC::EncodedValue&, const Test::FormCombo&);
</span><span class="cx"> static bool decode(JSC::EncodedValue&, std::unique_ptr<Test::FormCombo>&);
</span><span class="cx"> };
</span><del>-template<> struct EncodingTraits<WebCore::FormData::Type> {
- typedef WebCore::FormData::Type DecodedType;
</del><ins>+template<> struct EncodingTraits<WebCore::FormData1::Type> {
+ typedef WebCore::FormData1::Type DecodedType;
</ins><span class="cx">
</span><del>- static EncodedValue encodeValue(const WebCore::FormData::Type& value);
- static bool decodeValue(EncodedValue&, WebCore::FormData::Type& value);
</del><ins>+ static EncodedValue encodeValue(const WebCore::FormData1::Type& value);
+ static bool decodeValue(EncodedValue&, WebCore::FormData1::Type& value);
</ins><span class="cx"> };
</span><span class="cx">
</span><del>-template<> struct EncodingTraits<PlatformEvent::Type> {
- typedef PlatformEvent::Type DecodedType;
</del><ins>+template<> struct EncodingTraits<WebCore::FormData2::Type> {
+ typedef WebCore::FormData2::Type DecodedType;
</ins><span class="cx">
</span><del>- static EncodedValue encodeValue(const PlatformEvent::Type& value);
- static bool decodeValue(EncodedValue&, PlatformEvent::Type& value);
</del><ins>+ static EncodedValue encodeValue(const WebCore::FormData2::Type& value);
+ static bool decodeValue(EncodedValue&, WebCore::FormData2::Type& value);
</ins><span class="cx"> };
</span><ins>+
+template<> struct EncodingTraits<PlatformEvent1::Type> {
+ typedef PlatformEvent1::Type DecodedType;
+
+ static EncodedValue encodeValue(const PlatformEvent1::Type& value);
+ static bool decodeValue(EncodedValue&, PlatformEvent1::Type& value);
+};
+
+template<> struct EncodingTraits<PlatformEvent2::Type> {
+ typedef PlatformEvent2::Type DecodedType;
+
+ static EncodedValue encodeValue(const PlatformEvent2::Type& value);
+ static bool decodeValue(EncodedValue&, PlatformEvent2::Type& value);
+};
</ins><span class="cx"> } // namespace JSC
</span><span class="cx">
</span><span class="cx"> namespace Test {
</span><span class="cx"> class FormCombo : public NondeterministicInput<FormCombo> {
</span><span class="cx"> public:
</span><del>- FormCombo(PlatformEvent::Type eventType, FormData::Type formType);
</del><ins>+ FormCombo(PlatformEvent1::Type eventType1, PlatformEvent2::Type eventType2, FormData1::Type formType1, FormData2::Type formType2);
</ins><span class="cx"> virtual ~FormCombo();
</span><span class="cx">
</span><del>- PlatformEvent::Type eventType() const { return m_eventType; }
- FormData::Type formType() const { return m_formType; }
</del><ins>+ PlatformEvent1::Type eventType1() const { return m_eventType1; }
+ PlatformEvent2::Type eventType2() const { return m_eventType2; }
+ FormData1::Type formType1() const { return m_formType1; }
+ FormData2::Type formType2() const { return m_formType2; }
</ins><span class="cx"> private:
</span><del>- PlatformEvent::Type m_eventType;
- FormData::Type m_formType;
</del><ins>+ PlatformEvent1::Type m_eventType1;
+ PlatformEvent2::Type m_eventType2;
+ FormData1::Type m_formType1;
+ FormData2::Type m_formType2;
</ins><span class="cx"> };
</span><span class="cx"> } // namespace Test
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorereplayscriptstestsgenerateenumswithsamebasenamejson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/replay/scripts/tests/generate-enums-with-same-base-name.json (171682 => 171683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/replay/scripts/tests/generate-enums-with-same-base-name.json        2014-07-28 19:21:15 UTC (rev 171682)
+++ trunk/Source/JavaScriptCore/replay/scripts/tests/generate-enums-with-same-base-name.json        2014-07-28 19:22:43 UTC (rev 171683)
</span><span class="lines">@@ -3,19 +3,33 @@
</span><span class="cx"> "JavaScriptCore": [
</span><span class="cx"> {
</span><span class="cx"> "name": "Type", "mode": "SCALAR", "storage": "uint64_t",
</span><del>- "enclosing_class": "PlatformEvent",
</del><ins>+ "enclosing_class": "PlatformEvent1",
</ins><span class="cx"> "flags": ["ENUM"],
</span><span class="cx"> "values": ["Mouse", "Keyboard"],
</span><span class="cx"> "header": "replay/PlatformEvent.h"
</span><ins>+ },
+ {
+ "name": "Type", "mode": "SCALAR",
+ "enclosing_class": "PlatformEvent2",
+ "flags": ["ENUM_CLASS"],
+ "values": ["Mouse", "Keyboard"],
+ "header": "replay/PlatformEvent.h"
</ins><span class="cx"> }
</span><span class="cx"> ],
</span><span class="cx"> "WebCore": [
</span><span class="cx"> {
</span><span class="cx"> "name": "Type", "mode": "SCALAR", "storage": "uint64_t",
</span><del>- "enclosing_class": "FormData",
</del><ins>+ "enclosing_class": "FormData1",
</ins><span class="cx"> "flags": ["ENUM"],
</span><span class="cx"> "values": ["Text", "Blob"],
</span><del>- "header": "replay/FormData.h"
</del><ins>+ "header": "replay/FormData1.h"
+ },
+ {
+ "name": "Type", "mode": "SCALAR",
+ "enclosing_class": "FormData2",
+ "flags": ["ENUM_CLASS"],
+ "values": ["Text", "Blob"],
+ "header": "replay/FormData2.h"
</ins><span class="cx"> }
</span><span class="cx"> ]
</span><span class="cx"> },
</span><span class="lines">@@ -26,8 +40,10 @@
</span><span class="cx"> "description": "Combines an event type and form data type.",
</span><span class="cx"> "queue": "SCRIPT_MEMOIZED",
</span><span class="cx"> "members": [
</span><del>- { "name": "eventType", "type": "PlatformEvent::Type" },
- { "name": "formType", "type": "FormData::Type" }
</del><ins>+ { "name": "eventType1", "type": "PlatformEvent1::Type" },
+ { "name": "eventType2", "type": "PlatformEvent2::Type" },
+ { "name": "formType1", "type": "FormData1::Type" },
+ { "name": "formType2", "type": "FormData2::Type" }
</ins><span class="cx"> ]
</span><span class="cx"> }
</span><span class="cx"> ]
</span></span></pre>
</div>
</div>
</body>
</html>