diff options
author | Steve Block <steveblock@google.com> | 2010-02-05 14:27:46 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-02-15 10:49:50 +0000 |
commit | 5e2bc6953fe6923165b8a5d7679939693a1d58d6 (patch) | |
tree | 6ccb8c24bc2bf5e8f413e6cfae250b729b426631 /WebCore/loader | |
parent | 4a00f4fccc3cb7e9996749a05631f5d7b9de756e (diff) | |
download | external_webkit-5e2bc6953fe6923165b8a5d7679939693a1d58d6.zip external_webkit-5e2bc6953fe6923165b8a5d7679939693a1d58d6.tar.gz external_webkit-5e2bc6953fe6923165b8a5d7679939693a1d58d6.tar.bz2 |
Merge webkit.org at r54340 : Initial merge by git
Change-Id: Ib489d2ff91186ea3652522e1d586e54416a2cf44
Diffstat (limited to 'WebCore/loader')
-rw-r--r-- | WebCore/loader/FTPDirectoryDocument.cpp | 53 | ||||
-rw-r--r-- | WebCore/loader/FTPDirectoryParser.cpp | 23 | ||||
-rw-r--r-- | WebCore/loader/FrameLoader.cpp | 8 | ||||
-rw-r--r-- | WebCore/loader/MediaDocument.cpp | 8 | ||||
-rw-r--r-- | WebCore/loader/icon/IconDatabaseClient.h | 4 |
5 files changed, 36 insertions, 60 deletions
diff --git a/WebCore/loader/FTPDirectoryDocument.cpp b/WebCore/loader/FTPDirectoryDocument.cpp index 7a71d02..62173f5 100644 --- a/WebCore/loader/FTPDirectoryDocument.cpp +++ b/WebCore/loader/FTPDirectoryDocument.cpp @@ -38,14 +38,9 @@ #include "Settings.h" #include "SharedBuffer.h" #include "Text.h" -#include <wtf/StdLibExtras.h> -#if PLATFORM(QT) -#include <QDateTime> -// On Windows, use the threadsafe *_r functions provided by pthread. -#elif OS(WINDOWS) && (USE(PTHREADS) || HAVE(PTHREAD_H)) -#include <pthread.h> -#endif +#include <wtf/CurrentTime.h> +#include <wtf/StdLibExtras.h> using namespace std; @@ -200,48 +195,6 @@ static bool wasLastDayOfMonth(int year, int month, int day) return lastDays[month] == day; } -#if PLATFORM(QT) - -/*! - Replacement for localtime_r() which is not available on MinGW. - - We use this on all of Qt's platforms for portability. - */ -struct tm gmtimeQt(const QDateTime &input) -{ - tm result; - - const QDate date(input.date()); - result.tm_year = date.year() - 1900; - result.tm_mon = date.month(); - result.tm_mday = date.day(); - result.tm_wday = date.dayOfWeek(); - result.tm_yday = date.dayOfYear(); - - const QTime time(input.time()); - result.tm_sec = time.second(); - result.tm_min = time.minute(); - result.tm_hour = time.hour(); - - return result; -} - -static struct tm *localTimeQt(const time_t *const timep, struct tm *result) -{ - const QDateTime dt(QDateTime::fromTime_t(*timep)); - *result = WebCore::gmtimeQt(dt.toLocalTime()); - return result; -} - -#define localtime_r(x, y) localTimeQt(x, y) -#elif OS(WINDOWS) && !defined(localtime_r) -#if defined(_MSC_VER) && (_MSC_VER >= 1400) -#define localtime_r(x, y) localtime_s((y), (x)) -#else /* !_MSC_VER */ -#define localtime_r(x,y) (localtime(x)?(*(y)=*localtime(x),(y)):0) -#endif -#endif - static String processFileDateString(const FTPTime& fileTime) { // FIXME: Need to localize this string? @@ -267,7 +220,7 @@ static String processFileDateString(const FTPTime& fileTime) // If it was today or yesterday, lets just do that - but we have to compare to the current time struct tm now; time_t now_t = time(NULL); - localtime_r(&now_t, &now); + getLocalTime(&now_t, &now); // localtime does "year = current year - 1900", compensate for that for readability and comparison purposes now.tm_year += 1900; diff --git a/WebCore/loader/FTPDirectoryParser.cpp b/WebCore/loader/FTPDirectoryParser.cpp index 34c19a4..142f2a3 100644 --- a/WebCore/loader/FTPDirectoryParser.cpp +++ b/WebCore/loader/FTPDirectoryParser.cpp @@ -38,8 +38,27 @@ using namespace WTF; namespace WebCore { #if PLATFORM(QT) && defined(Q_WS_WIN32) -// Defined in FTPDirectoryDocument.cpp. -struct tm gmtimeQt(const QDateTime &input); + +// Replacement for gmtime_r() which is not available on MinGW. +// We use this on Win32 Qt platform for portability. +struct tm gmtimeQt(const QDateTime& input) +{ + tm result; + + QDate date(input.date()); + result.tm_year = date.year() - 1900; + result.tm_mon = date.month(); + result.tm_mday = date.day(); + result.tm_wday = date.dayOfWeek(); + result.tm_yday = date.dayOfYear(); + + QTime time(input.time()); + result.tm_sec = time.second(); + result.tm_min = time.minute(); + result.tm_hour = time.hour(); + + return result; +} static struct tm *gmtimeQt(const time_t *const timep, struct tm *result) { diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp index 6422535..9e264b5 100644 --- a/WebCore/loader/FrameLoader.cpp +++ b/WebCore/loader/FrameLoader.cpp @@ -1501,7 +1501,7 @@ bool FrameLoader::isProcessingUserGesture() Frame* frame = m_frame->tree()->top(); if (!frame->script()->canExecuteScripts()) return true; // If JavaScript is disabled, a user gesture must have initiated the navigation. - return frame->script()->processingUserGesture(); // FIXME: Use pageIsProcessingUserGesture. + return frame->script()->processingUserGesture(mainThreadNormalWorld()); // FIXME: Use pageIsProcessingUserGesture. } void FrameLoader::resetMultipleFormSubmissionProtection() @@ -3579,7 +3579,7 @@ void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest&, Pass if (!m_frame->page()) return; -#if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR) +#if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR) && USE(JSC) if (Page* page = m_frame->page()) { if (page->mainFrame() == m_frame) page->inspectorController()->resumeDebugger(); @@ -3900,7 +3900,9 @@ void FrameLoader::loadItem(HistoryItem* item, FrameLoadType loadType) // - The HistoryItem has a history state object // - Navigating to an anchor within the page, with no form data stored on the target item or the current history entry, // and the URLs in the frame tree match the history item for fragment scrolling. - bool sameDocumentNavigation = (!item->formData() && !(history()->currentItem() && history()->currentItem()->formData()) && history()->urlsMatchItem(item)) || item->documentSequenceNumber() == history()->currentItem()->documentSequenceNumber(); + HistoryItem* currentItem = history()->currentItem(); + bool sameDocumentNavigation = (!item->formData() && !(currentItem && currentItem->formData()) && history()->urlsMatchItem(item)) + || (currentItem && item->documentSequenceNumber() == currentItem->documentSequenceNumber()); #if ENABLE(WML) // All WML decks should go through the real load mechanism, not the scroll-to-anchor code diff --git a/WebCore/loader/MediaDocument.cpp b/WebCore/loader/MediaDocument.cpp index 656d0a0..a2d6276 100644 --- a/WebCore/loader/MediaDocument.cpp +++ b/WebCore/loader/MediaDocument.cpp @@ -159,12 +159,12 @@ void MediaDocument::defaultEventHandler(Event* event) HTMLVideoElement* video = static_cast<HTMLVideoElement*>(targetNode); if (event->type() == eventNames().clickEvent) { if (!video->canPlay()) { - video->pause(); + video->pause(event->fromUserGesture()); event->setDefaultHandled(); } } else if (event->type() == eventNames().dblclickEvent) { if (video->canPlay()) { - video->play(); + video->play(event->fromUserGesture()); event->setDefaultHandled(); } } @@ -186,9 +186,9 @@ void MediaDocument::defaultEventHandler(Event* event) if (keyboardEvent->keyIdentifier() == "U+0020") { // space if (video->paused()) { if (video->canPlay()) - video->play(); + video->play(event->fromUserGesture()); } else - video->pause(); + video->pause(event->fromUserGesture()); event->setDefaultHandled(); } } diff --git a/WebCore/loader/icon/IconDatabaseClient.h b/WebCore/loader/icon/IconDatabaseClient.h index 8806406..1811214 100644 --- a/WebCore/loader/icon/IconDatabaseClient.h +++ b/WebCore/loader/icon/IconDatabaseClient.h @@ -29,6 +29,8 @@ #ifndef IconDatabaseClient_h #define IconDatabaseClient_h +#include <wtf/Noncopyable.h> + // All of these client methods will be called from a non-main thread // Take appropriate measures @@ -36,7 +38,7 @@ namespace WebCore { class String; -class IconDatabaseClient { +class IconDatabaseClient : public Noncopyable { public: virtual ~IconDatabaseClient() { } virtual bool performImport() { return true; } |