Changeset 88623 in webkit


Ignore:
Timestamp:
Jun 12, 2011 7:05:29 PM (13 years ago)
Author:
abarth@webkit.org
Message:

2011-06-12 Adam Barth <abarth@webkit.org>

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):
Location:
trunk/Source/WebCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r88622 r88623  
     12011-06-12  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        DocumentParser::appendBytes should use size_t for length instead of int
     6        https://bugs.webkit.org/show_bug.cgi?id=62508
     7
     8        size_t is the proper type for distances in memory, especially on 64 bit
     9        machines.
     10
     11        * dom/DecodedDataDocumentParser.cpp:
     12        (WebCore::DecodedDataDocumentParser::appendBytes):
     13        * dom/DecodedDataDocumentParser.h:
     14        * dom/DocumentParser.h:
     15        * html/ImageDocument.cpp:
     16        (WebCore::ImageDocumentParser::appendBytes):
     17        * html/MediaDocument.cpp:
     18        (WebCore::MediaDocumentParser::appendBytes):
     19        * html/PluginDocument.cpp:
     20        (WebCore::PluginDocumentParser::appendBytes):
     21        * loader/SinkDocument.cpp:
     22        (WebCore::SinkDocumentParser::appendBytes):
     23
    1242011-06-12  Adam Barth  <abarth@webkit.org>
    225
  • trunk/Source/WebCore/dom/DecodedDataDocumentParser.cpp

    r88609 r88623  
    3838}
    3939
    40 void DecodedDataDocumentParser::appendBytes(DocumentWriter* writer, const char* data, int length)
     40void DecodedDataDocumentParser::appendBytes(DocumentWriter* writer, const char* data, size_t length)
    4141{
    4242    if (!length)
  • trunk/Source/WebCore/dom/DecodedDataDocumentParser.h

    r88609 r88623  
    4545
    4646    // appendBytes and flush are used by DocumentWriter (the loader).
    47     virtual void appendBytes(DocumentWriter*, const char* bytes, int length);
     47    virtual void appendBytes(DocumentWriter*, const char* bytes, size_t length);
    4848    virtual void flush(DocumentWriter*);
    4949};
  • trunk/Source/WebCore/dom/DocumentParser.h

    r88609 r88623  
    4747
    4848    // appendBytes and flush are used by DocumentWriter (the loader).
    49     virtual void appendBytes(DocumentWriter*, const char* bytes, int length) = 0;
     49    virtual void appendBytes(DocumentWriter*, const char* bytes, size_t length) = 0;
    5050    virtual void flush(DocumentWriter*) = 0;
    5151
  • trunk/Source/WebCore/html/ImageDocument.cpp

    r88609 r88623  
    9191    }
    9292
    93     virtual void appendBytes(DocumentWriter*, const char*, int);
     93    virtual void appendBytes(DocumentWriter*, const char*, size_t);
    9494    virtual void finish();
    9595};
     
    125125}
    126126
    127 void ImageDocumentParser::appendBytes(DocumentWriter*, const char*, int)
     127void ImageDocumentParser::appendBytes(DocumentWriter*, const char*, size_t)
    128128{
    129129    Frame* frame = document()->frame();
  • trunk/Source/WebCore/html/MediaDocument.cpp

    r88609 r88623  
    6161    }
    6262
    63     virtual void appendBytes(DocumentWriter*, const char*, int);
     63    virtual void appendBytes(DocumentWriter*, const char*, size_t);
    6464
    6565    void createDocumentStructure();
     
    104104}
    105105
    106 void MediaDocumentParser::appendBytes(DocumentWriter*, const char*, int)
     106void MediaDocumentParser::appendBytes(DocumentWriter*, const char*, size_t)
    107107{
    108108    if (m_mediaElement)
  • trunk/Source/WebCore/html/PluginDocument.cpp

    r88609 r88623  
    5959    }
    6060
    61     virtual void appendBytes(DocumentWriter*, const char*, int);
     61    virtual void appendBytes(DocumentWriter*, const char*, size_t);
    6262
    6363    void createDocumentStructure();
     
    104104}
    105105
    106 void PluginDocumentParser::appendBytes(DocumentWriter*, const char*, int)
     106void PluginDocumentParser::appendBytes(DocumentWriter*, const char*, size_t)
    107107{
    108108    if (m_embedElement)
  • trunk/Source/WebCore/loader/SinkDocument.cpp

    r88609 r88623  
    4545
    4646    // Ignore all data.
    47     virtual void appendBytes(DocumentWriter*, const char*, int) { }
     47    virtual void appendBytes(DocumentWriter*, const char*, size_t) { }
    4848};
    4949
Note: See TracChangeset for help on using the changeset viewer.