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 25 matching lines...) Expand all Loading... |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
39 class LocalFrame; | 39 class LocalFrame; |
40 class ResourceResponse; | 40 class ResourceResponse; |
41 struct ProgressItem; | 41 struct ProgressItem; |
42 | 42 |
43 // FIXME: This is only used on Android. Android is the only Chrome | 43 // FIXME: This is only used on Android. Android is the only Chrome |
44 // browser which shows a progress bar during loading. | 44 // browser which shows a progress bar during loading. |
45 // We should find a better way for Android to get this data and remove this! | 45 // We should find a better way for Android to get this data and remove this! |
46 class CORE_EXPORT ProgressTracker final : public NoBaseWillBeGarbageCollectedFin
alized<ProgressTracker> { | 46 class CORE_EXPORT ProgressTracker final : public GarbageCollectedFinalized<Progr
essTracker> { |
47 WTF_MAKE_NONCOPYABLE(ProgressTracker); USING_FAST_MALLOC_WILL_BE_REMOVED(Pro
gressTracker); | 47 WTF_MAKE_NONCOPYABLE(ProgressTracker); |
48 public: | 48 public: |
49 static PassOwnPtrWillBeRawPtr<ProgressTracker> create(LocalFrame*); | 49 static RawPtr<ProgressTracker> create(LocalFrame*); |
50 | 50 |
51 ~ProgressTracker(); | 51 ~ProgressTracker(); |
52 DECLARE_TRACE(); | 52 DECLARE_TRACE(); |
53 void dispose(); | 53 void dispose(); |
54 | 54 |
55 double estimatedProgress() const; | 55 double estimatedProgress() const; |
56 | 56 |
57 void progressStarted(); | 57 void progressStarted(); |
58 void progressCompleted(); | 58 void progressCompleted(); |
59 | 59 |
60 void finishedParsing(); | 60 void finishedParsing(); |
61 | 61 |
62 void incrementProgress(unsigned long identifier, const ResourceResponse&); | 62 void incrementProgress(unsigned long identifier, const ResourceResponse&); |
63 void incrementProgress(unsigned long identifier, int); | 63 void incrementProgress(unsigned long identifier, int); |
64 void completeProgress(unsigned long identifier); | 64 void completeProgress(unsigned long identifier); |
65 | 65 |
66 long long totalPageAndResourceBytesToLoad() const { return m_totalPageAndRes
ourceBytesToLoad; } | 66 long long totalPageAndResourceBytesToLoad() const { return m_totalPageAndRes
ourceBytesToLoad; } |
67 long long totalBytesReceived() const { return m_totalBytesReceived; } | 67 long long totalBytesReceived() const { return m_totalBytesReceived; } |
68 | 68 |
69 private: | 69 private: |
70 explicit ProgressTracker(LocalFrame*); | 70 explicit ProgressTracker(LocalFrame*); |
71 | 71 |
72 void incrementProgressForMainResourceOnly(unsigned long identifier, int leng
th); | 72 void incrementProgressForMainResourceOnly(unsigned long identifier, int leng
th); |
73 void sendFinalProgress(); | 73 void sendFinalProgress(); |
74 void reset(); | 74 void reset(); |
75 | 75 |
76 RawPtrWillBeMember<LocalFrame> m_frame; | 76 Member<LocalFrame> m_frame; |
77 unsigned long m_mainResourceIdentifier; | 77 unsigned long m_mainResourceIdentifier; |
78 long long m_totalPageAndResourceBytesToLoad; | 78 long long m_totalPageAndResourceBytesToLoad; |
79 long long m_totalBytesReceived; | 79 long long m_totalBytesReceived; |
80 double m_lastNotifiedProgressValue; | 80 double m_lastNotifiedProgressValue; |
81 double m_lastNotifiedProgressTime; | 81 double m_lastNotifiedProgressTime; |
82 double m_progressNotificationInterval; | 82 double m_progressNotificationInterval; |
83 double m_progressNotificationTimeInterval; | 83 double m_progressNotificationTimeInterval; |
84 bool m_finalProgressChangedSent; | 84 bool m_finalProgressChangedSent; |
85 double m_progressValue; | 85 double m_progressValue; |
86 | 86 |
87 HashMap<unsigned long, OwnPtr<ProgressItem>> m_progressItems; | 87 HashMap<unsigned long, OwnPtr<ProgressItem>> m_progressItems; |
88 }; | 88 }; |
89 | 89 |
90 } // namespace blink | 90 } // namespace blink |
91 | 91 |
92 #endif | 92 #endif |
OLD | NEW |