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(); | 50 static PassOwnPtr<ProgressTracker> create(LocalFrame*); |
51 static unsigned long createUniqueIdentifier(); | |
52 | 51 |
53 double estimatedProgress() const; | 52 double estimatedProgress() const; |
54 | 53 |
55 void progressStarted(LocalFrame*); | 54 void progressStarted(); |
56 void progressCompleted(LocalFrame*); | 55 void progressCompleted(); |
57 | 56 |
58 void incrementProgress(unsigned long identifier, const ResourceResponse&); | 57 void incrementProgress(unsigned long identifier, const ResourceResponse&); |
59 void incrementProgress(unsigned long identifier, const char*, int); | 58 void incrementProgress(unsigned long identifier, const char*, int); |
60 void completeProgress(unsigned long identifier); | 59 void completeProgress(unsigned long identifier); |
61 | 60 |
62 long long totalPageAndResourceBytesToLoad() const { return m_totalPageAndRes
ourceBytesToLoad; } | 61 long long totalPageAndResourceBytesToLoad() const { return m_totalPageAndRes
ourceBytesToLoad; } |
63 long long totalBytesReceived() const { return m_totalBytesReceived; } | 62 long long totalBytesReceived() const { return m_totalBytesReceived; } |
64 | 63 |
65 private: | 64 private: |
66 ProgressTracker(); | 65 ProgressTracker(LocalFrame*); |
67 | 66 |
68 void reset(); | 67 void reset(); |
69 void finalProgressComplete(); | |
70 | 68 |
| 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; | |
80 | 79 |
81 int m_numProgressTrackedFrames; | |
82 HashMap<unsigned long, OwnPtr<ProgressItem> > m_progressItems; | 80 HashMap<unsigned long, OwnPtr<ProgressItem> > m_progressItems; |
83 }; | 81 }; |
84 | 82 |
85 } | 83 } |
86 | 84 |
87 #endif | 85 #endif |
OLD | NEW |