Title: [88623] trunk/Source/WebCore
Revision
88623
Author
[email protected]
Date
2011-06-12 19:05:29 -0700 (Sun, 12 Jun 2011)

Log Message

2011-06-12  Adam Barth  <[email protected]>

        Reviewed by Darin Adler.

        DocumentParser::appendBytes should use size_t for length instead of int
        https://bugs.webkit.org/show_bug.cgi?id=62508

        size_t is the proper type for distances in memory, especially on 64 bit
        machines.

        * dom/DecodedDataDocumentParser.cpp:
        (WebCore::DecodedDataDocumentParser::appendBytes):
        * dom/DecodedDataDocumentParser.h:
        * dom/DocumentParser.h:
        * html/ImageDocument.cpp:
        (WebCore::ImageDocumentParser::appendBytes):
        * html/MediaDocument.cpp:
        (WebCore::MediaDocumentParser::appendBytes):
        * html/PluginDocument.cpp:
        (WebCore::PluginDocumentParser::appendBytes):
        * loader/SinkDocument.cpp:
        (WebCore::SinkDocumentParser::appendBytes):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (88622 => 88623)


--- trunk/Source/WebCore/ChangeLog	2011-06-13 02:03:25 UTC (rev 88622)
+++ trunk/Source/WebCore/ChangeLog	2011-06-13 02:05:29 UTC (rev 88623)
@@ -1,5 +1,28 @@
 2011-06-12  Adam Barth  <[email protected]>
 
+        Reviewed by Darin Adler.
+
+        DocumentParser::appendBytes should use size_t for length instead of int
+        https://bugs.webkit.org/show_bug.cgi?id=62508
+
+        size_t is the proper type for distances in memory, especially on 64 bit
+        machines.
+
+        * dom/DecodedDataDocumentParser.cpp:
+        (WebCore::DecodedDataDocumentParser::appendBytes):
+        * dom/DecodedDataDocumentParser.h:
+        * dom/DocumentParser.h:
+        * html/ImageDocument.cpp:
+        (WebCore::ImageDocumentParser::appendBytes):
+        * html/MediaDocument.cpp:
+        (WebCore::MediaDocumentParser::appendBytes):
+        * html/PluginDocument.cpp:
+        (WebCore::PluginDocumentParser::appendBytes):
+        * loader/SinkDocument.cpp:
+        (WebCore::SinkDocumentParser::appendBytes):
+
+2011-06-12  Adam Barth  <[email protected]>
+
         Reviewed by Eric Seidel.
 
         Remove FrameLoader::isProcessingUserGesture

Modified: trunk/Source/WebCore/dom/DecodedDataDocumentParser.cpp (88622 => 88623)


--- trunk/Source/WebCore/dom/DecodedDataDocumentParser.cpp	2011-06-13 02:03:25 UTC (rev 88622)
+++ trunk/Source/WebCore/dom/DecodedDataDocumentParser.cpp	2011-06-13 02:05:29 UTC (rev 88623)
@@ -37,7 +37,7 @@
 {
 }
 
-void DecodedDataDocumentParser::appendBytes(DocumentWriter* writer, const char* data, int length)
+void DecodedDataDocumentParser::appendBytes(DocumentWriter* writer, const char* data, size_t length)
 {
     if (!length)
         return;

Modified: trunk/Source/WebCore/dom/DecodedDataDocumentParser.h (88622 => 88623)


--- trunk/Source/WebCore/dom/DecodedDataDocumentParser.h	2011-06-13 02:03:25 UTC (rev 88622)
+++ trunk/Source/WebCore/dom/DecodedDataDocumentParser.h	2011-06-13 02:05:29 UTC (rev 88623)
@@ -44,7 +44,7 @@
     virtual void append(const SegmentedString&) = 0;
 
     // appendBytes and flush are used by DocumentWriter (the loader).
-    virtual void appendBytes(DocumentWriter*, const char* bytes, int length);
+    virtual void appendBytes(DocumentWriter*, const char* bytes, size_t length);
     virtual void flush(DocumentWriter*);
 };
 

Modified: trunk/Source/WebCore/dom/DocumentParser.h (88622 => 88623)


--- trunk/Source/WebCore/dom/DocumentParser.h	2011-06-13 02:03:25 UTC (rev 88622)
+++ trunk/Source/WebCore/dom/DocumentParser.h	2011-06-13 02:05:29 UTC (rev 88623)
@@ -46,7 +46,7 @@
     virtual void insert(const SegmentedString&) = 0;
 
     // appendBytes and flush are used by DocumentWriter (the loader).
-    virtual void appendBytes(DocumentWriter*, const char* bytes, int length) = 0;
+    virtual void appendBytes(DocumentWriter*, const char* bytes, size_t length) = 0;
     virtual void flush(DocumentWriter*) = 0;
 
     // FIXME: append() should be private, but DocumentWriter::replaceDocument

Modified: trunk/Source/WebCore/html/ImageDocument.cpp (88622 => 88623)


--- trunk/Source/WebCore/html/ImageDocument.cpp	2011-06-13 02:03:25 UTC (rev 88622)
+++ trunk/Source/WebCore/html/ImageDocument.cpp	2011-06-13 02:05:29 UTC (rev 88623)
@@ -90,7 +90,7 @@
     {
     }
 
-    virtual void appendBytes(DocumentWriter*, const char*, int);
+    virtual void appendBytes(DocumentWriter*, const char*, size_t);
     virtual void finish();
 };
 
@@ -124,7 +124,7 @@
     return frame ? frame->pageZoomFactor() : 1;
 }
 
-void ImageDocumentParser::appendBytes(DocumentWriter*, const char*, int)
+void ImageDocumentParser::appendBytes(DocumentWriter*, const char*, size_t)
 {
     Frame* frame = document()->frame();
     Settings* settings = frame->settings();

Modified: trunk/Source/WebCore/html/MediaDocument.cpp (88622 => 88623)


--- trunk/Source/WebCore/html/MediaDocument.cpp	2011-06-13 02:03:25 UTC (rev 88622)
+++ trunk/Source/WebCore/html/MediaDocument.cpp	2011-06-13 02:05:29 UTC (rev 88623)
@@ -60,7 +60,7 @@
     {
     }
 
-    virtual void appendBytes(DocumentWriter*, const char*, int);
+    virtual void appendBytes(DocumentWriter*, const char*, size_t);
 
     void createDocumentStructure();
 
@@ -103,7 +103,7 @@
     frame->loader()->activeDocumentLoader()->mainResourceLoader()->setShouldBufferData(false);
 }
 
-void MediaDocumentParser::appendBytes(DocumentWriter*, const char*, int)
+void MediaDocumentParser::appendBytes(DocumentWriter*, const char*, size_t)
 {
     if (m_mediaElement)
         return;

Modified: trunk/Source/WebCore/html/PluginDocument.cpp (88622 => 88623)


--- trunk/Source/WebCore/html/PluginDocument.cpp	2011-06-13 02:03:25 UTC (rev 88622)
+++ trunk/Source/WebCore/html/PluginDocument.cpp	2011-06-13 02:05:29 UTC (rev 88623)
@@ -58,7 +58,7 @@
     {
     }
 
-    virtual void appendBytes(DocumentWriter*, const char*, int);
+    virtual void appendBytes(DocumentWriter*, const char*, size_t);
 
     void createDocumentStructure();
 
@@ -103,7 +103,7 @@
     body->appendChild(embedElement, ec);    
 }
 
-void PluginDocumentParser::appendBytes(DocumentWriter*, const char*, int)
+void PluginDocumentParser::appendBytes(DocumentWriter*, const char*, size_t)
 {
     if (m_embedElement)
         return;

Modified: trunk/Source/WebCore/loader/SinkDocument.cpp (88622 => 88623)


--- trunk/Source/WebCore/loader/SinkDocument.cpp	2011-06-13 02:03:25 UTC (rev 88622)
+++ trunk/Source/WebCore/loader/SinkDocument.cpp	2011-06-13 02:05:29 UTC (rev 88623)
@@ -44,7 +44,7 @@
     }
 
     // Ignore all data.
-    virtual void appendBytes(DocumentWriter*, const char*, int) { }
+    virtual void appendBytes(DocumentWriter*, const char*, size_t) { }
 };
 
 SinkDocument::SinkDocument(Frame* frame, const KURL& url)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to