~ubuntu-branches/ubuntu/lucid/webkit/lucid-updates

« back to all changes in this revision

Viewing changes to WebCore/html/ISODateTime.h

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2010-01-06 21:25:06 UTC
  • mfrom: (1.2.6 upstream) (4.3.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100106212506-gd0czn4zrwf1j19l
* New upstream release
- adds basic Content-Encoding support, thanks to soup
  (Closes: #529271)
- fixes over-advertising content types as supported by
  the media player (Closes: #559420)
* debian/control:
- updated libsoup build requirement (>= 2.28.2)
* debian/libwebkit-1.0-2.symbols:
- updated with new symbols
* debian/copyright:
- updated information since 1.1.17
* Imported patch from https://bugs.webkit.org/show_bug.cgi?id=30623
- I am shipping this patch because I believe it is correct, it is the
  way to go, it fixes a race, and it needs testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#ifndef ISODateTime_h
32
32
#define ISODateTime_h
33
33
 
 
34
#include <limits>
34
35
#include <wtf/unicode/Unicode.h>
35
36
 
36
37
namespace WebCore {
52
53
        , m_month(0)
53
54
        , m_year(0)
54
55
        , m_week(0)
 
56
        , m_type(Invalid)
55
57
    {
56
58
    }
57
59
 
86
88
    // Sets year, month, monthDay, hour, minute, second and millisecond, and adjusts timezone.
87
89
    bool parseDateTime(const UChar* src, unsigned length, unsigned start, unsigned& end);
88
90
 
 
91
    // Returns the number of milliseconds from 1970-01-01 00:00:00 UTC.
 
92
    // For an ISODateTime initialized with parseDateTimeLocal(),
 
93
    // millisecondsSinceEpoch() returns a value for UTC timezone.
 
94
    double millisecondsSinceEpoch() const;
 
95
    static inline double invalidMilliseconds() { return std::numeric_limits<double>::quiet_NaN(); }
 
96
 
89
97
private:
90
98
    // Returns the maximum week number in this ISODateTime's year.
91
99
    // The result is either of 52 and 53.
94
102
    bool addDay(int);
95
103
    bool addMinute(int);
96
104
    bool parseTimeZone(const UChar* src, unsigned length, unsigned start, unsigned& end);
 
105
    // Helper for millisecondsSinceEpoch().
 
106
    double millisecondsSinceEpochForTime() const;
97
107
 
98
108
    // m_weekDay values
99
109
    enum {
114
124
    int m_month;  // 0:January - 11:December
115
125
    int m_year;  //  1582 -
116
126
    int m_week;  // 1 - 53
 
127
 
 
128
    enum Type {
 
129
        Invalid,
 
130
        Date,
 
131
        DateTime,
 
132
        DateTimeLocal,
 
133
        Month,
 
134
        Time,
 
135
        Week,
 
136
    };
 
137
    Type m_type;
117
138
};
118
139
 
119
140