Changeset 24509 in webkit


Ignore:
Timestamp:
Jul 21, 2007 4:41:48 AM (17 years ago)
Author:
bdash
Message:

Merge r24468.

2007-07-20 Mark Rowe <mrowe@apple.com>

Reviewed by Maciej.

Move FTPDirectoryTokenizer::m_templateDocumentData to be a function-scoped static
to avoid creating a global initializer. This fixes the build for x86_64.

  • loader/FTPDirectoryDocument.cpp: (WebCore::FTPDirectoryTokenizer::loadDocumentTemplate):
Location:
tags/Safari-5522.12/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tags/Safari-5522.12/WebCore/ChangeLog

    r24405 r24509  
     12007-07-20  Mark Rowe  <mrowe@apple.com>
     2
     3        Reviewed by Maciej.
     4
     5        Move FTPDirectoryTokenizer::m_templateDocumentData to be a function-scoped static
     6        to avoid creating a global initializer.  This fixes the build for x86_64.
     7
     8        * loader/FTPDirectoryDocument.cpp:
     9        (WebCore::FTPDirectoryTokenizer::loadDocumentTemplate):
     10
    1112007-07-18  Maciej Stachowiak  <mjs@apple.com>
    212
  • tags/Safari-5522.12/WebCore/loader/FTPDirectoryDocument.cpp

    r24384 r24509  
    9494   
    9595    ListState m_listState;
    96 
    97     static RefPtr<SharedBuffer> m_templateDocumentData;
    98     // FIXME: Instead of storing the data, we'd rather actually parse the template data into the template Document once,
    99     // store that document, then "copy" it whenever we get an FTP directory listing.  There are complexities with this
    100     // approach that make it worth putting this off.
    10196};
    102 
    103 RefPtr<SharedBuffer> FTPDirectoryTokenizer::m_templateDocumentData;
    10497
    10598FTPDirectoryTokenizer::FTPDirectoryTokenizer(HTMLDocument* doc)
     
    303296
    304297bool FTPDirectoryTokenizer::loadDocumentTemplate()
    305 {       
    306     if (!m_templateDocumentData) {
     298{
     299    static RefPtr<SharedBuffer> templateDocumentData;
     300    // FIXME: Instead of storing the data, we'd rather actually parse the template data into the template Document once,
     301    // store that document, then "copy" it whenever we get an FTP directory listing.  There are complexities with this
     302    // approach that make it worth putting this off.
     303
     304    if (!templateDocumentData) {
    307305        Settings* settings = m_doc->settings();
    308306        if (settings)
    309             m_templateDocumentData = SharedBuffer::createWithContentsOfFile(settings->ftpDirectoryTemplatePath());
    310         if (m_templateDocumentData)
    311             LOG(FTP, "Loaded FTPDirectoryTemplate of length %i\n", m_templateDocumentData->size());
    312     }
    313    
    314     if (!m_templateDocumentData) {
     307            templateDocumentData = SharedBuffer::createWithContentsOfFile(settings->ftpDirectoryTemplatePath());
     308        if (templateDocumentData)
     309            LOG(FTP, "Loaded FTPDirectoryTemplate of length %i\n", templateDocumentData->size());
     310    }
     311   
     312    if (!templateDocumentData) {
    315313        LOG_ERROR("Could not load templateData");
    316314        return false;
     
    319317    // Tokenize the template as an HTML document synchronously
    320318    setForceSynchronous(true);
    321     HTMLTokenizer::write(String(m_templateDocumentData->data(), m_templateDocumentData->size()), true);
     319    HTMLTokenizer::write(String(templateDocumentData->data(), templateDocumentData->size()), true);
    322320    setForceSynchronous(false);
    323321   
Note: See TracChangeset for help on using the changeset viewer.