Title: [96849] trunk/Source/WebCore
Revision
96849
Author
gav...@chromium.org
Date
2011-10-06 12:30:22 -0700 (Thu, 06 Oct 2011)

Log Message

conditionalize m_cachedScript stacks to just Chromium port
https://bugs.webkit.org/show_bug.cgi?id=69537

New stack saving telemetry code in ScriptElement shouldn't have
been put in all ports; just narrowing it to the chromium port will
save other ports the memory hit of this diagnostic code.

Reviewed by Nate Chapin.

No new tests.

* dom/ScriptElement.cpp:
(WebCore::ScriptElement::ScriptElement):
(WebCore::ScriptElement::requestScript):
(WebCore::ScriptElement::stopLoadRequest):
(WebCore::ScriptElement::notifyFinished):
* dom/ScriptElement.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (96848 => 96849)


--- trunk/Source/WebCore/ChangeLog	2011-10-06 19:28:52 UTC (rev 96848)
+++ trunk/Source/WebCore/ChangeLog	2011-10-06 19:30:22 UTC (rev 96849)
@@ -1,3 +1,23 @@
+2011-10-06  Gavin Peters  <gav...@chromium.org>
+
+        conditionalize m_cachedScript stacks to just Chromium port
+        https://bugs.webkit.org/show_bug.cgi?id=69537
+
+        New stack saving telemetry code in ScriptElement shouldn't have
+        been put in all ports; just narrowing it to the chromium port will
+        save other ports the memory hit of this diagnostic code.
+
+        Reviewed by Nate Chapin.
+
+        No new tests.
+
+        * dom/ScriptElement.cpp:
+        (WebCore::ScriptElement::ScriptElement):
+        (WebCore::ScriptElement::requestScript):
+        (WebCore::ScriptElement::stopLoadRequest):
+        (WebCore::ScriptElement::notifyFinished):
+        * dom/ScriptElement.h:
+
 2011-10-06  Arthur Hsu  <arthur...@chromium.org>
 
         Ensure font loaded before calling Skia to drawPosText in Chrome sandbox

Modified: trunk/Source/WebCore/dom/ScriptElement.cpp (96848 => 96849)


--- trunk/Source/WebCore/dom/ScriptElement.cpp	2011-10-06 19:28:52 UTC (rev 96848)
+++ trunk/Source/WebCore/dom/ScriptElement.cpp	2011-10-06 19:30:22 UTC (rev 96849)
@@ -65,8 +65,10 @@
     , m_willExecuteWhenDocumentFinishedParsing(false)
     , m_forceAsync(!parserInserted)
     , m_willExecuteInOrder(false)
+#if PLATFORM(CHROMIUM)
     , m_cachedScriptState(NeverSet)
     , m_backtraceSize(0)
+#endif
 {
     ASSERT(m_element);
 }
@@ -263,8 +265,10 @@
     }
 
     if (m_cachedScript) {
+#if PLATFORM(CHROMIUM)      
         ASSERT(m_cachedScriptState == NeverSet);
         m_cachedScriptState = Set;
+#endif
         return true;
     }
 
@@ -302,11 +306,12 @@
     if (m_cachedScript) {
         if (!m_willBeParserExecuted)
             m_cachedScript->removeClient(this);
+#if PLATFORM(CHROMIUM)
         ASSERT(m_cachedScriptState == Set);
-
         m_cachedScriptState = ZeroedInStopLoadRequest;
         m_backtraceSize = MaxBacktraceSize;
         WTFGetBacktrace(m_backtrace, &m_backtraceSize);
+#endif
         m_cachedScript = 0;
     }
 }
@@ -333,10 +338,12 @@
     else
         m_element->document()->scriptRunner()->queueScriptForExecution(this, m_cachedScript, ScriptRunner::ASYNC_EXECUTION);
 
+#if PLATFORM(CHROMIUM)
     ASSERT(m_cachedScriptState == Set);
     m_cachedScriptState = ZeroedInNotifyFinished;
     m_backtraceSize = MaxBacktraceSize;
     WTFGetBacktrace(m_backtrace, &m_backtraceSize);
+#endif
     m_cachedScript = 0;
 }
 

Modified: trunk/Source/WebCore/dom/ScriptElement.h (96848 => 96849)


--- trunk/Source/WebCore/dom/ScriptElement.h	2011-10-06 19:28:52 UTC (rev 96848)
+++ trunk/Source/WebCore/dom/ScriptElement.h	2011-10-06 19:30:22 UTC (rev 96849)
@@ -105,13 +105,14 @@
     String m_characterEncoding;
     String m_fallbackCharacterEncoding;
     
+#if PLATFORM(CHROMIUM)
     // Temporary: intended to help debug how we get notifyFinished() called when m_cachedScript is null,
     // which seems to sometimes happen (see http://code.google.com/p/chromium/issues/detail?id=75604 )
     enum {
-      NeverSet,
-      Set,
-      ZeroedInStopLoadRequest,
-      ZeroedInNotifyFinished,
+        NeverSet,
+        Set,
+        ZeroedInStopLoadRequest,
+        ZeroedInNotifyFinished,
     } m_cachedScriptState;
 
     // We grab a backtrace when we zero m_cachedScript, so that at later crashes
@@ -121,6 +122,7 @@
     };
     int m_backtraceSize;
     void* m_backtrace[MaxBacktraceSize];
+#endif
 };
 
 ScriptElement* toScriptElement(Element*);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to