| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // Always start progress at initialProgressValue. This helps provide feedback as | 46 // Always start progress at initialProgressValue. This helps provide feedback as |
| 47 // soon as a load starts. | 47 // soon as a load starts. |
| 48 static const double initialProgressValue = 0.1; | 48 static const double initialProgressValue = 0.1; |
| 49 | 49 |
| 50 static const int progressItemDefaultEstimatedLength = 1024 * 1024; | 50 static const int progressItemDefaultEstimatedLength = 1024 * 1024; |
| 51 | 51 |
| 52 static const double progressNotificationInterval = 0.02; | 52 static const double progressNotificationInterval = 0.02; |
| 53 static const double progressNotificationTimeInterval = 0.1; | 53 static const double progressNotificationTimeInterval = 0.1; |
| 54 | 54 |
| 55 struct ProgressItem { | 55 struct ProgressItem { |
| 56 WTF_MAKE_NONCOPYABLE(ProgressItem); USING_FAST_MALLOC(ProgressItem); | 56 WTF_MAKE_NONCOPYABLE(ProgressItem); |
| 57 USING_FAST_MALLOC(ProgressItem); |
| 57 public: | 58 public: |
| 58 ProgressItem(long long length) | 59 ProgressItem(long long length) |
| 59 : bytesReceived(0) | 60 : bytesReceived(0) |
| 60 , estimatedLength(length) { } | 61 , estimatedLength(length) { } |
| 61 | 62 |
| 62 long long bytesReceived; | 63 long long bytesReceived; |
| 63 long long estimatedLength; | 64 long long estimatedLength; |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 ProgressTracker* ProgressTracker::create(LocalFrame* frame) | 67 ProgressTracker* ProgressTracker::create(LocalFrame* frame) |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 { | 231 { |
| 231 ProgressItem* item = m_progressItems.get(identifier); | 232 ProgressItem* item = m_progressItems.get(identifier); |
| 232 if (!item) | 233 if (!item) |
| 233 return; | 234 return; |
| 234 | 235 |
| 235 item->estimatedLength = item->bytesReceived; | 236 item->estimatedLength = item->bytesReceived; |
| 236 maybeSendProgress(); | 237 maybeSendProgress(); |
| 237 } | 238 } |
| 238 | 239 |
| 239 } // namespace blink | 240 } // namespace blink |
| OLD | NEW |