OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 ProgressEvent::ProgressEvent() | 31 ProgressEvent::ProgressEvent() |
32 : m_lengthComputable(false) | 32 : m_lengthComputable(false) |
33 , m_loaded(0) | 33 , m_loaded(0) |
34 , m_total(0) | 34 , m_total(0) |
35 { | 35 { |
36 } | 36 } |
37 | 37 |
38 ProgressEvent::ProgressEvent(const AtomicString& type, const ProgressEventInit&
initializer) | 38 ProgressEvent::ProgressEvent(const AtomicString& type, const ProgressEventInit&
initializer) |
39 : Event(type, initializer) | 39 : Event(type, initializer) |
40 , m_lengthComputable(false) | 40 , m_lengthComputable(initializer.lengthComputable()) |
41 , m_loaded(0) | 41 , m_loaded(initializer.loaded()) |
42 , m_total(0) | 42 , m_total(initializer.total()) |
43 { | 43 { |
44 if (initializer.hasLengthComputable()) | |
45 m_lengthComputable = initializer.lengthComputable(); | |
46 if (initializer.hasLoaded()) | |
47 m_loaded = initializer.loaded(); | |
48 if (initializer.hasTotal()) | |
49 m_total = initializer.total(); | |
50 } | 44 } |
51 | 45 |
52 ProgressEvent::ProgressEvent(const AtomicString& type, bool lengthComputable, un
signed long long loaded, unsigned long long total) | 46 ProgressEvent::ProgressEvent(const AtomicString& type, bool lengthComputable, un
signed long long loaded, unsigned long long total) |
53 : Event(type, false, true) | 47 : Event(type, false, true) |
54 , m_lengthComputable(lengthComputable) | 48 , m_lengthComputable(lengthComputable) |
55 , m_loaded(loaded) | 49 , m_loaded(loaded) |
56 , m_total(total) | 50 , m_total(total) |
57 { | 51 { |
58 } | 52 } |
59 | 53 |
60 const AtomicString& ProgressEvent::interfaceName() const | 54 const AtomicString& ProgressEvent::interfaceName() const |
61 { | 55 { |
62 return EventNames::ProgressEvent; | 56 return EventNames::ProgressEvent; |
63 } | 57 } |
64 | 58 |
65 DEFINE_TRACE(ProgressEvent) | 59 DEFINE_TRACE(ProgressEvent) |
66 { | 60 { |
67 Event::trace(visitor); | 61 Event::trace(visitor); |
68 } | 62 } |
69 | 63 |
70 } | 64 } |
OLD | NEW |