<!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  &lt;burg@cs.washington.edu&gt;
</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  &lt;burg@cs.washington.edu&gt;
+
</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(&quot;&quot;)
</span><span class="cx">         enum_prefix = &quot;::&quot;.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 &lt;platform/ExternalNamespaceImplIncludeDummy.h&gt;
</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&lt;FormCombo&gt;()
</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&lt;Test::FormCombo&gt;::encode(EncodedValue&amp; encodedValue, const Test::FormCombo&amp; input)
</span><span class="cx"> {
</span><del>-    encodedValue.put&lt;PlatformEvent::Type&gt;(ASCIILiteral(&quot;eventType&quot;), input.eventType());
-    encodedValue.put&lt;WebCore::FormData::Type&gt;(ASCIILiteral(&quot;formType&quot;), input.formType());
</del><ins>+    encodedValue.put&lt;PlatformEvent1::Type&gt;(ASCIILiteral(&quot;eventType1&quot;), input.eventType1());
+    encodedValue.put&lt;PlatformEvent2::Type&gt;(ASCIILiteral(&quot;eventType2&quot;), input.eventType2());
+    encodedValue.put&lt;WebCore::FormData1::Type&gt;(ASCIILiteral(&quot;formType1&quot;), input.formType1());
+    encodedValue.put&lt;WebCore::FormData2::Type&gt;(ASCIILiteral(&quot;formType2&quot;), input.formType2());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool InputTraits&lt;Test::FormCombo&gt;::decode(EncodedValue&amp; encodedValue, std::unique_ptr&lt;Test::FormCombo&gt;&amp; input)
</span><span class="cx"> {
</span><del>-    PlatformEvent::Type eventType;
-    if (!encodedValue.get&lt;PlatformEvent::Type&gt;(ASCIILiteral(&quot;eventType&quot;), eventType))
</del><ins>+    PlatformEvent1::Type eventType1;
+    if (!encodedValue.get&lt;PlatformEvent1::Type&gt;(ASCIILiteral(&quot;eventType1&quot;), eventType1))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    WebCore::FormData::Type formType;
-    if (!encodedValue.get&lt;WebCore::FormData::Type&gt;(ASCIILiteral(&quot;formType&quot;), formType))
</del><ins>+    PlatformEvent2::Type eventType2;
+    if (!encodedValue.get&lt;PlatformEvent2::Type&gt;(ASCIILiteral(&quot;eventType2&quot;), eventType2))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    input = std::make_unique&lt;Test::FormCombo&gt;(eventType, formType);
</del><ins>+    WebCore::FormData1::Type formType1;
+    if (!encodedValue.get&lt;WebCore::FormData1::Type&gt;(ASCIILiteral(&quot;formType1&quot;), formType1))
+        return false;
+
+    WebCore::FormData2::Type formType2;
+    if (!encodedValue.get&lt;WebCore::FormData2::Type&gt;(ASCIILiteral(&quot;formType2&quot;), formType2))
+        return false;
+
+    input = std::make_unique&lt;Test::FormCombo&gt;(eventType1, eventType2, formType1, formType2);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><del>-EncodedValue EncodingTraits&lt;WebCore::FormData::Type&gt;::encodeValue(const WebCore::FormData::Type&amp; enumValue)
</del><ins>+EncodedValue EncodingTraits&lt;WebCore::FormData1::Type&gt;::encodeValue(const WebCore::FormData1::Type&amp; enumValue)
</ins><span class="cx"> {
</span><span class="cx">     EncodedValue encodedValue = EncodedValue::createArray();
</span><del>-    if (enumValue &amp; WebCore::FormData::Text) {
</del><ins>+    if (enumValue &amp; WebCore::FormData1::Text) {
</ins><span class="cx">         encodedValue.append&lt;String&gt;(ASCIILiteral(&quot;Text&quot;));
</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 &amp; WebCore::FormData::Blob) {
</del><ins>+    if (enumValue &amp; WebCore::FormData1::Blob) {
</ins><span class="cx">         encodedValue.append&lt;String&gt;(ASCIILiteral(&quot;Blob&quot;));
</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&lt;WebCore::FormData::Type&gt;::decodeValue(EncodedValue&amp; encodedValue, WebCore::FormData::Type&amp; enumValue)
</del><ins>+bool EncodingTraits&lt;WebCore::FormData1::Type&gt;::decodeValue(EncodedValue&amp; encodedValue, WebCore::FormData1::Type&amp; enumValue)
</ins><span class="cx"> {
</span><span class="cx">     Vector&lt;String&gt; enumStrings;
</span><span class="cx">     if (!EncodingTraits&lt;Vector&lt;String&gt;&gt;::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 == &quot;Text&quot;)
</span><del>-            enumValue = static_cast&lt;WebCore::FormData::Type&gt;(enumValue | WebCore::FormData::Text);
</del><ins>+            enumValue = static_cast&lt;WebCore::FormData1::Type&gt;(enumValue | WebCore::FormData1::Text);
</ins><span class="cx">         if (enumString == &quot;Blob&quot;)
</span><del>-            enumValue = static_cast&lt;WebCore::FormData::Type&gt;(enumValue | WebCore::FormData::Blob);
</del><ins>+            enumValue = static_cast&lt;WebCore::FormData1::Type&gt;(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&lt;PlatformEvent::Type&gt;::encodeValue(const PlatformEvent::Type&amp; enumValue)
</del><ins>+EncodedValue EncodingTraits&lt;WebCore::FormData2::Type&gt;::encodeValue(const WebCore::FormData2::Type&amp; enumValue)
</ins><span class="cx"> {
</span><ins>+    switch (enumValue) {
+    case WebCore::FormData2::Type::Text: return EncodedValue::createString(&quot;Text&quot;);
+    case WebCore::FormData2::Type::Blob: return EncodedValue::createString(&quot;Blob&quot;);
+    default: ASSERT_NOT_REACHED(); return EncodedValue::createString(&quot;Error!&quot;);
+    }
+}
+
+bool EncodingTraits&lt;WebCore::FormData2::Type&gt;::decodeValue(EncodedValue&amp; encodedValue, WebCore::FormData2::Type&amp; enumValue)
+{
+    String enumString = encodedValue.convertTo&lt;String&gt;();
+    if (enumString == &quot;Text&quot;) {
+        enumValue = WebCore::FormData2::Type::Text;
+        return true;
+    }
+    if (enumString == &quot;Blob&quot;) {
+        enumValue = WebCore::FormData2::Type::Blob;
+        return true;
+    }
+    return false;
+}
+
+EncodedValue EncodingTraits&lt;PlatformEvent1::Type&gt;::encodeValue(const PlatformEvent1::Type&amp; enumValue)
+{
</ins><span class="cx">     EncodedValue encodedValue = EncodedValue::createArray();
</span><del>-    if (enumValue &amp; PlatformEvent::Mouse) {
</del><ins>+    if (enumValue &amp; PlatformEvent1::Mouse) {
</ins><span class="cx">         encodedValue.append&lt;String&gt;(ASCIILiteral(&quot;Mouse&quot;));
</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 &amp; PlatformEvent::Keyboard) {
</del><ins>+    if (enumValue &amp; PlatformEvent1::Keyboard) {
</ins><span class="cx">         encodedValue.append&lt;String&gt;(ASCIILiteral(&quot;Keyboard&quot;));
</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&lt;PlatformEvent::Type&gt;::decodeValue(EncodedValue&amp; encodedValue, PlatformEvent::Type&amp; enumValue)
</del><ins>+bool EncodingTraits&lt;PlatformEvent1::Type&gt;::decodeValue(EncodedValue&amp; encodedValue, PlatformEvent1::Type&amp; enumValue)
</ins><span class="cx"> {
</span><span class="cx">     Vector&lt;String&gt; enumStrings;
</span><span class="cx">     if (!EncodingTraits&lt;Vector&lt;String&gt;&gt;::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 == &quot;Mouse&quot;)
</span><del>-            enumValue = static_cast&lt;PlatformEvent::Type&gt;(enumValue | PlatformEvent::Mouse);
</del><ins>+            enumValue = static_cast&lt;PlatformEvent1::Type&gt;(enumValue | PlatformEvent1::Mouse);
</ins><span class="cx">         if (enumString == &quot;Keyboard&quot;)
</span><del>-            enumValue = static_cast&lt;PlatformEvent::Type&gt;(enumValue | PlatformEvent::Keyboard);
</del><ins>+            enumValue = static_cast&lt;PlatformEvent1::Type&gt;(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&lt;PlatformEvent2::Type&gt;::encodeValue(const PlatformEvent2::Type&amp; enumValue)
+{
+    switch (enumValue) {
+    case PlatformEvent2::Type::Mouse: return EncodedValue::createString(&quot;Mouse&quot;);
+    case PlatformEvent2::Type::Keyboard: return EncodedValue::createString(&quot;Keyboard&quot;);
+    default: ASSERT_NOT_REACHED(); return EncodedValue::createString(&quot;Error!&quot;);
+    }
+}
+
+bool EncodingTraits&lt;PlatformEvent2::Type&gt;::decodeValue(EncodedValue&amp; encodedValue, PlatformEvent2::Type&amp; enumValue)
+{
+    String enumString = encodedValue.convertTo&lt;String&gt;();
+    if (enumString == &quot;Mouse&quot;) {
+        enumValue = PlatformEvent2::Type::Mouse;
+        return true;
+    }
+    if (enumString == &quot;Keyboard&quot;) {
+        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 &quot;InternalNamespaceHeaderIncludeDummy.h&quot;
</span><span class="cx"> #include &lt;platform/ExternalNamespaceHeaderIncludeDummy.h&gt;
</span><del>-#include &lt;replay/FormData.h&gt;
</del><ins>+#include &lt;replay/FormData1.h&gt;
+#include &lt;replay/FormData2.h&gt;
</ins><span class="cx"> #include &lt;replay/PlatformEvent.h&gt;
</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&amp;, const Test::FormCombo&amp;);
</span><span class="cx">     static bool decode(JSC::EncodedValue&amp;, std::unique_ptr&lt;Test::FormCombo&gt;&amp;);
</span><span class="cx"> };
</span><del>-template&lt;&gt; struct EncodingTraits&lt;WebCore::FormData::Type&gt; {
-    typedef WebCore::FormData::Type DecodedType;
</del><ins>+template&lt;&gt; struct EncodingTraits&lt;WebCore::FormData1::Type&gt; {
+    typedef WebCore::FormData1::Type DecodedType;
</ins><span class="cx"> 
</span><del>-    static EncodedValue encodeValue(const WebCore::FormData::Type&amp; value);
-    static bool decodeValue(EncodedValue&amp;, WebCore::FormData::Type&amp; value);
</del><ins>+    static EncodedValue encodeValue(const WebCore::FormData1::Type&amp; value);
+    static bool decodeValue(EncodedValue&amp;, WebCore::FormData1::Type&amp; value);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-template&lt;&gt; struct EncodingTraits&lt;PlatformEvent::Type&gt; {
-    typedef PlatformEvent::Type DecodedType;
</del><ins>+template&lt;&gt; struct EncodingTraits&lt;WebCore::FormData2::Type&gt; {
+    typedef WebCore::FormData2::Type DecodedType;
</ins><span class="cx"> 
</span><del>-    static EncodedValue encodeValue(const PlatformEvent::Type&amp; value);
-    static bool decodeValue(EncodedValue&amp;, PlatformEvent::Type&amp; value);
</del><ins>+    static EncodedValue encodeValue(const WebCore::FormData2::Type&amp; value);
+    static bool decodeValue(EncodedValue&amp;, WebCore::FormData2::Type&amp; value);
</ins><span class="cx"> };
</span><ins>+
+template&lt;&gt; struct EncodingTraits&lt;PlatformEvent1::Type&gt; {
+    typedef PlatformEvent1::Type DecodedType;
+
+    static EncodedValue encodeValue(const PlatformEvent1::Type&amp; value);
+    static bool decodeValue(EncodedValue&amp;, PlatformEvent1::Type&amp; value);
+};
+
+template&lt;&gt; struct EncodingTraits&lt;PlatformEvent2::Type&gt; {
+    typedef PlatformEvent2::Type DecodedType;
+
+    static EncodedValue encodeValue(const PlatformEvent2::Type&amp; value);
+    static bool decodeValue(EncodedValue&amp;, PlatformEvent2::Type&amp; 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&lt;FormCombo&gt; {
</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">         &quot;JavaScriptCore&quot;: [
</span><span class="cx">             {
</span><span class="cx">                 &quot;name&quot;: &quot;Type&quot;, &quot;mode&quot;: &quot;SCALAR&quot;, &quot;storage&quot;: &quot;uint64_t&quot;,
</span><del>-                &quot;enclosing_class&quot;: &quot;PlatformEvent&quot;,
</del><ins>+                &quot;enclosing_class&quot;: &quot;PlatformEvent1&quot;,
</ins><span class="cx">                 &quot;flags&quot;: [&quot;ENUM&quot;],
</span><span class="cx">                 &quot;values&quot;: [&quot;Mouse&quot;, &quot;Keyboard&quot;],
</span><span class="cx">                 &quot;header&quot;: &quot;replay/PlatformEvent.h&quot;
</span><ins>+            },
+            {
+                &quot;name&quot;: &quot;Type&quot;, &quot;mode&quot;: &quot;SCALAR&quot;,
+                &quot;enclosing_class&quot;: &quot;PlatformEvent2&quot;,
+                &quot;flags&quot;: [&quot;ENUM_CLASS&quot;],
+                &quot;values&quot;: [&quot;Mouse&quot;, &quot;Keyboard&quot;],
+                &quot;header&quot;: &quot;replay/PlatformEvent.h&quot;
</ins><span class="cx">             }
</span><span class="cx">         ],
</span><span class="cx">         &quot;WebCore&quot;: [
</span><span class="cx">             {
</span><span class="cx">                 &quot;name&quot;: &quot;Type&quot;, &quot;mode&quot;: &quot;SCALAR&quot;, &quot;storage&quot;: &quot;uint64_t&quot;,
</span><del>-                &quot;enclosing_class&quot;: &quot;FormData&quot;,
</del><ins>+                &quot;enclosing_class&quot;: &quot;FormData1&quot;,
</ins><span class="cx">                 &quot;flags&quot;: [&quot;ENUM&quot;],
</span><span class="cx">                 &quot;values&quot;: [&quot;Text&quot;, &quot;Blob&quot;],
</span><del>-                &quot;header&quot;: &quot;replay/FormData.h&quot;
</del><ins>+                &quot;header&quot;: &quot;replay/FormData1.h&quot;
+            },
+            {
+                &quot;name&quot;: &quot;Type&quot;, &quot;mode&quot;: &quot;SCALAR&quot;,
+                &quot;enclosing_class&quot;: &quot;FormData2&quot;,
+                &quot;flags&quot;: [&quot;ENUM_CLASS&quot;],
+                &quot;values&quot;: [&quot;Text&quot;, &quot;Blob&quot;],
+                &quot;header&quot;: &quot;replay/FormData2.h&quot;
</ins><span class="cx">             }
</span><span class="cx">         ]
</span><span class="cx">     },
</span><span class="lines">@@ -26,8 +40,10 @@
</span><span class="cx">             &quot;description&quot;: &quot;Combines an event type and form data type.&quot;,
</span><span class="cx">             &quot;queue&quot;: &quot;SCRIPT_MEMOIZED&quot;,
</span><span class="cx">             &quot;members&quot;: [
</span><del>-                { &quot;name&quot;: &quot;eventType&quot;, &quot;type&quot;: &quot;PlatformEvent::Type&quot; },
-                { &quot;name&quot;: &quot;formType&quot;, &quot;type&quot;: &quot;FormData::Type&quot; }
</del><ins>+                { &quot;name&quot;: &quot;eventType1&quot;, &quot;type&quot;: &quot;PlatformEvent1::Type&quot; },
+                { &quot;name&quot;: &quot;eventType2&quot;, &quot;type&quot;: &quot;PlatformEvent2::Type&quot; },
+                { &quot;name&quot;: &quot;formType1&quot;, &quot;type&quot;: &quot;FormData1::Type&quot; },
+                { &quot;name&quot;: &quot;formType2&quot;, &quot;type&quot;: &quot;FormData2::Type&quot; }
</ins><span class="cx">             ]
</span><span class="cx">         }
</span><span class="cx">     ]
</span></span></pre>
</div>
</div>

</body>
</html>