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 29 matching lines...) Expand all Loading... |
40 struct ProgressItem; | 40 struct ProgressItem; |
41 | 41 |
42 // FIXME: This is only used on Android. Android is the only Chrome | 42 // FIXME: This is only used on Android. Android is the only Chrome |
43 // browser which shows a progress bar during loading. | 43 // browser which shows a progress bar during loading. |
44 // We should find a better way for Android to get this data and remove this! | 44 // We should find a better way for Android to get this data and remove this! |
45 class ProgressTracker { | 45 class ProgressTracker { |
46 WTF_MAKE_NONCOPYABLE(ProgressTracker); WTF_MAKE_FAST_ALLOCATED; | 46 WTF_MAKE_NONCOPYABLE(ProgressTracker); WTF_MAKE_FAST_ALLOCATED; |
47 public: | 47 public: |
48 ~ProgressTracker(); | 48 ~ProgressTracker(); |
49 | 49 |
50 static PassOwnPtr<ProgressTracker> create(LocalFrame*); | 50 static PassOwnPtr<ProgressTracker> create(); |
| 51 static unsigned long createUniqueIdentifier(); |
51 | 52 |
52 double estimatedProgress() const; | 53 double estimatedProgress() const; |
53 | 54 |
54 void progressStarted(); | 55 void progressStarted(LocalFrame*); |
55 void progressCompleted(); | 56 void progressCompleted(LocalFrame*); |
56 | 57 |
57 void incrementProgress(unsigned long identifier, const ResourceResponse&); | 58 void incrementProgress(unsigned long identifier, const ResourceResponse&); |
58 void incrementProgress(unsigned long identifier, const char*, int); | 59 void incrementProgress(unsigned long identifier, const char*, int); |
59 void completeProgress(unsigned long identifier); | 60 void completeProgress(unsigned long identifier); |
60 | 61 |
61 long long totalPageAndResourceBytesToLoad() const { return m_totalPageAndRes
ourceBytesToLoad; } | 62 long long totalPageAndResourceBytesToLoad() const { return m_totalPageAndRes
ourceBytesToLoad; } |
62 long long totalBytesReceived() const { return m_totalBytesReceived; } | 63 long long totalBytesReceived() const { return m_totalBytesReceived; } |
63 | 64 |
64 private: | 65 private: |
65 ProgressTracker(LocalFrame*); | 66 ProgressTracker(); |
66 | 67 |
67 void reset(); | 68 void reset(); |
| 69 void finalProgressComplete(); |
68 | 70 |
69 LocalFrame* m_frame; | |
70 bool m_inProgress; | |
71 long long m_totalPageAndResourceBytesToLoad; | 71 long long m_totalPageAndResourceBytesToLoad; |
72 long long m_totalBytesReceived; | 72 long long m_totalBytesReceived; |
73 double m_lastNotifiedProgressValue; | 73 double m_lastNotifiedProgressValue; |
74 double m_lastNotifiedProgressTime; | 74 double m_lastNotifiedProgressTime; |
75 double m_progressNotificationInterval; | 75 double m_progressNotificationInterval; |
76 double m_progressNotificationTimeInterval; | 76 double m_progressNotificationTimeInterval; |
77 bool m_finalProgressChangedSent; | 77 bool m_finalProgressChangedSent; |
78 double m_progressValue; | 78 double m_progressValue; |
| 79 RefPtr<LocalFrame> m_originatingProgressFrame; |
79 | 80 |
| 81 int m_numProgressTrackedFrames; |
80 HashMap<unsigned long, OwnPtr<ProgressItem> > m_progressItems; | 82 HashMap<unsigned long, OwnPtr<ProgressItem> > m_progressItems; |
81 }; | 83 }; |
82 | 84 |
83 } | 85 } |
84 | 86 |
85 #endif | 87 #endif |
OLD | NEW |