| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Julien Chaffraix <jchaffraix@webkit.org> All right reserv
ed. | 2 * Copyright (C) 2010 Julien Chaffraix <jchaffraix@webkit.org> All right reserv
ed. |
| 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 { | 60 { |
| 61 m_isSet = false; | 61 m_isSet = false; |
| 62 | 62 |
| 63 m_lengthComputable = false; | 63 m_lengthComputable = false; |
| 64 m_loaded = 0; | 64 m_loaded = 0; |
| 65 m_total = 0; | 65 m_total = 0; |
| 66 } | 66 } |
| 67 | 67 |
| 68 Event* XMLHttpRequestProgressEventThrottle::DeferredEvent::take() | 68 Event* XMLHttpRequestProgressEventThrottle::DeferredEvent::take() |
| 69 { | 69 { |
| 70 ASSERT(m_isSet); | 70 DCHECK(m_isSet); |
| 71 | 71 |
| 72 Event* event = ProgressEvent::create(EventTypeNames::progress, m_lengthCompu
table, m_loaded, m_total); | 72 Event* event = ProgressEvent::create(EventTypeNames::progress, m_lengthCompu
table, m_loaded, m_total); |
| 73 clear(); | 73 clear(); |
| 74 return event; | 74 return event; |
| 75 } | 75 } |
| 76 | 76 |
| 77 XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle(XMLHttp
Request* target) | 77 XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle(XMLHttp
Request* target) |
| 78 : TimerBase(TaskRunnerHelper::get(TaskType::Networking, target->getExecution
Context())) | 78 : TimerBase(TaskRunnerHelper::get(TaskType::Networking, target->getExecution
Context())) |
| 79 , m_target(target) | 79 , m_target(target) |
| 80 , m_hasDispatchedProgressProgressEvent(false) | 80 , m_hasDispatchedProgressProgressEvent(false) |
| 81 { | 81 { |
| 82 ASSERT(target); | 82 DCHECK(target); |
| 83 } | 83 } |
| 84 | 84 |
| 85 XMLHttpRequestProgressEventThrottle::~XMLHttpRequestProgressEventThrottle() | 85 XMLHttpRequestProgressEventThrottle::~XMLHttpRequestProgressEventThrottle() |
| 86 { | 86 { |
| 87 } | 87 } |
| 88 | 88 |
| 89 void XMLHttpRequestProgressEventThrottle::dispatchProgressEvent(const AtomicStri
ng& type, bool lengthComputable, unsigned long long loaded, unsigned long long t
otal) | 89 void XMLHttpRequestProgressEventThrottle::dispatchProgressEvent(const AtomicStri
ng& type, bool lengthComputable, unsigned long long loaded, unsigned long long t
otal) |
| 90 { | 90 { |
| 91 // Given that ResourceDispatcher doesn't deliver an event when suspended, | 91 // Given that ResourceDispatcher doesn't deliver an event when suspended, |
| 92 // we don't have to worry about event dispatching while suspended. | 92 // we don't have to worry about event dispatching while suspended. |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 // event-handler could insert new active DOM objects to the list. | 176 // event-handler could insert new active DOM objects to the list. |
| 177 startOneShot(0, BLINK_FROM_HERE); | 177 startOneShot(0, BLINK_FROM_HERE); |
| 178 } | 178 } |
| 179 | 179 |
| 180 DEFINE_TRACE(XMLHttpRequestProgressEventThrottle) | 180 DEFINE_TRACE(XMLHttpRequestProgressEventThrottle) |
| 181 { | 181 { |
| 182 visitor->trace(m_target); | 182 visitor->trace(m_target); |
| 183 } | 183 } |
| 184 | 184 |
| 185 } // namespace blink | 185 } // namespace blink |
| OLD | NEW |