Title: [104093] branches/safari-534.54-branch

Diff

Modified: branches/safari-534.54-branch/LayoutTests/ChangeLog (104092 => 104093)


--- branches/safari-534.54-branch/LayoutTests/ChangeLog	2012-01-05 00:19:09 UTC (rev 104092)
+++ branches/safari-534.54-branch/LayoutTests/ChangeLog	2012-01-05 00:29:36 UTC (rev 104093)
@@ -1,5 +1,19 @@
 2011-1-4  Lucas Forschler  <[email protected]>
 
+    Merge 96999
+
+    2011-10-07  Justin Schuh  <[email protected]>
+
+            Make isXMLMIMEType regex use TLS
+            https://bugs.webkit.org/show_bug.cgi?id=69665
+
+            Reviewed by Adam Barth.
+
+            * fast/workers/worker-multi-startup-expected.txt: Added.
+            * fast/workers/worker-multi-startup.html: Added.
+
+2011-1-4  Lucas Forschler  <[email protected]>
+
     Merge 96984
 
     2011-10-07  Sergey Glazunov  <[email protected]>

Copied: branches/safari-534.54-branch/LayoutTests/fast/workers/worker-multi-startup-expected.txt (from rev 96999, trunk/LayoutTests/fast/workers/worker-multi-startup-expected.txt) (0 => 104093)


--- branches/safari-534.54-branch/LayoutTests/fast/workers/worker-multi-startup-expected.txt	                        (rev 0)
+++ branches/safari-534.54-branch/LayoutTests/fast/workers/worker-multi-startup-expected.txt	2012-01-05 00:29:36 UTC (rev 104093)
@@ -0,0 +1,34 @@
+Test that multipe workers can be spawned simultaneously. Should print "DONE" when done.
+
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+SUCCESS: Worker context initialized
+DONE
+

Copied: branches/safari-534.54-branch/LayoutTests/fast/workers/worker-multi-startup.html (from rev 96999, trunk/LayoutTests/fast/workers/worker-multi-startup.html) (0 => 104093)


--- branches/safari-534.54-branch/LayoutTests/fast/workers/worker-multi-startup.html	                        (rev 0)
+++ branches/safari-534.54-branch/LayoutTests/fast/workers/worker-multi-startup.html	2012-01-05 00:29:36 UTC (rev 104093)
@@ -0,0 +1,31 @@
+<head>
+<p>Test that multipe workers can be spawned simultaneously.
+Should print "DONE" when done.</p>
+<div id=result></div>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+    document.getElementById("result").innerHTML += message + "<br>";
+}
+
+totalWorkers = 30;
+replies = 0;
+
+for (var i = 0; i < totalWorkers; i++) {
+    var worker = new Worker('resources/worker-init.js');
+    worker._onmessage_ = function(evt) {
+        log(evt.data);
+        if (++replies < totalWorkers)
+            return;
+        log("DONE");
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+    }
+}
+</script>
+</body>

Modified: branches/safari-534.54-branch/Source/WebCore/ChangeLog (104092 => 104093)


--- branches/safari-534.54-branch/Source/WebCore/ChangeLog	2012-01-05 00:19:09 UTC (rev 104092)
+++ branches/safari-534.54-branch/Source/WebCore/ChangeLog	2012-01-05 00:29:36 UTC (rev 104093)
@@ -1,5 +1,30 @@
 2011-1-4  Lucas Forschler  <[email protected]>
 
+    Merge 96999
+
+    2011-10-07  Justin Schuh  <[email protected]>
+
+            Make isXMLMIMEType regex use TLS
+            https://bugs.webkit.org/show_bug.cgi?id=69665
+
+            Reviewed by Adam Barth.
+
+            Test: fast/workers/worker-multi-startup.html
+
+            * dom/DOMImplementation.cpp:
+            (WebCore::XMLMIMETypeRegExp::XMLMIMETypeRegExp):
+            (WebCore::XMLMIMETypeRegExp::~XMLMIMETypeRegExp):
+            (WebCore::XMLMIMETypeRegExp::isXMLMIMEType):
+            (WebCore::DOMImplementation::isXMLMIMEType):
+            * dom/DOMImplementation.h:
+            * platform/ThreadGlobalData.cpp:
+            (WebCore::ThreadGlobalData::ThreadGlobalData):
+            (WebCore::ThreadGlobalData::destroy):
+            * platform/ThreadGlobalData.h:
+            (WebCore::ThreadGlobalData::xmlTypeRegExp):
+
+2011-1-4  Lucas Forschler  <[email protected]>
+
     Merge 96984
 
     2011-10-07  Sergey Glazunov  <[email protected]>

Modified: branches/safari-534.54-branch/Source/WebCore/dom/DOMImplementation.cpp (104092 => 104093)


--- branches/safari-534.54-branch/Source/WebCore/dom/DOMImplementation.cpp	2012-01-05 00:19:09 UTC (rev 104092)
+++ branches/safari-534.54-branch/Source/WebCore/dom/DOMImplementation.cpp	2012-01-05 00:29:36 UTC (rev 104093)
@@ -48,6 +48,7 @@
 #include "RegularExpression.h"
 #include "Settings.h"
 #include "TextDocument.h"
+#include "ThreadGlobalData.h"
 #include "XMLNames.h"
 #include <wtf/StdLibExtras.h>
 
@@ -272,13 +273,27 @@
     return sheet.release();
 }
 
+static const char* const validXMLMIMETypeChars = "[0-9a-zA-Z_\\-+~!$\\^{}|.%'`#&*]"; // per RFCs: 3023, 2045
+
+XMLMIMETypeRegExp::XMLMIMETypeRegExp() :
+    m_regex(adoptPtr(new RegularExpression(WTF::makeString("^", validXMLMIMETypeChars, "+/", validXMLMIMETypeChars, "+\\+xml$"), TextCaseSensitive)))
+{
+}
+
+XMLMIMETypeRegExp::~XMLMIMETypeRegExp()
+{
+}
+
+bool XMLMIMETypeRegExp::isXMLMIMEType(const String& mimeType)
+{
+    return m_regex->match(mimeType) > -1;
+}
+
 bool DOMImplementation::isXMLMIMEType(const String& mimeType)
 {
     if (mimeType == "text/xml" || mimeType == "application/xml" || mimeType == "text/xsl")
         return true;
-    static const char* const validChars = "[0-9a-zA-Z_\\-+~!$\\^{}|.%'`#&*]"; // per RFCs: 3023, 2045
-    DEFINE_STATIC_LOCAL(RegularExpression, xmlTypeRegExp, (String("^") + validChars + "+/" + validChars + "+\\+xml$", TextCaseSensitive));
-    return xmlTypeRegExp.match(mimeType) > -1;
+    return threadGlobalData().xmlTypeRegExp().isXMLMIMEType(mimeType);
 }
 
 bool DOMImplementation::isTextMIMEType(const String& mimeType)

Modified: branches/safari-534.54-branch/Source/WebCore/dom/DOMImplementation.h (104092 => 104093)


--- branches/safari-534.54-branch/Source/WebCore/dom/DOMImplementation.h	2012-01-05 00:19:09 UTC (rev 104092)
+++ branches/safari-534.54-branch/Source/WebCore/dom/DOMImplementation.h	2012-01-05 00:29:36 UTC (rev 104093)
@@ -37,6 +37,7 @@
 class Frame;
 class HTMLDocument;
 class KURL;
+class RegularExpression;
 
 typedef int ExceptionCode;
 
@@ -73,6 +74,18 @@
     Document* m_document;
 };
 
+class XMLMIMETypeRegExp {
+public:
+    XMLMIMETypeRegExp();
+    ~XMLMIMETypeRegExp();
+    bool isXMLMIMEType(const String& mimeType);
+
+    WTF_MAKE_NONCOPYABLE(XMLMIMETypeRegExp);
+private:
+    OwnPtr<RegularExpression> m_regex;
+};
+
+
 } // namespace WebCore
 
 #endif

Modified: branches/safari-534.54-branch/Source/WebCore/platform/ThreadGlobalData.cpp (104092 => 104093)


--- branches/safari-534.54-branch/Source/WebCore/platform/ThreadGlobalData.cpp	2012-01-05 00:19:09 UTC (rev 104092)
+++ branches/safari-534.54-branch/Source/WebCore/platform/ThreadGlobalData.cpp	2012-01-05 00:29:36 UTC (rev 104093)
@@ -27,6 +27,7 @@
 #include "config.h"
 #include "ThreadGlobalData.h"
 
+#include "DOMImplementation.h"
 #include "EventNames.h"
 #include "ThreadTimers.h"
 #include <wtf/MainThread.h>
@@ -59,6 +60,7 @@
 ThreadGlobalData::ThreadGlobalData()
     : m_eventNames(new EventNames)
     , m_threadTimers(new ThreadTimers)
+    , m_xmlTypeRegExp(new XMLMIMETypeRegExp)
 #ifndef NDEBUG
     , m_isMainThread(isMainThread())
 #endif
@@ -98,6 +100,8 @@
     m_eventNames = 0;
     delete m_threadTimers;
     m_threadTimers = 0;
+    delete m_xmlTypeRegExp;
+    m_xmlTypeRegExp = 0;
 }
 
 } // namespace WebCore

Modified: branches/safari-534.54-branch/Source/WebCore/platform/ThreadGlobalData.h (104092 => 104093)


--- branches/safari-534.54-branch/Source/WebCore/platform/ThreadGlobalData.h	2012-01-05 00:19:09 UTC (rev 104092)
+++ branches/safari-534.54-branch/Source/WebCore/platform/ThreadGlobalData.h	2012-01-05 00:29:36 UTC (rev 104093)
@@ -44,6 +44,7 @@
     struct ICUConverterWrapper;
     struct TECConverterWrapper;
     class ThreadTimers;
+    class XMLMIMETypeRegExp;
 
     class ThreadGlobalData {
         WTF_MAKE_NONCOPYABLE(ThreadGlobalData);
@@ -54,6 +55,7 @@
 
         EventNames& eventNames() { return *m_eventNames; }
         ThreadTimers& threadTimers() { return *m_threadTimers; }
+        XMLMIMETypeRegExp& xmlTypeRegExp() { return *m_xmlTypeRegExp; } 
 
 #if USE(ICU_UNICODE)
         ICUConverterWrapper& cachedConverterICU() { return *m_cachedConverterICU; }
@@ -66,6 +68,7 @@
     private:
         EventNames* m_eventNames;
         ThreadTimers* m_threadTimers;
+        XMLMIMETypeRegExp* m_xmlTypeRegExp; 
 
 #ifndef NDEBUG
         bool m_isMainThread;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to