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 10 matching lines...) Expand all Loading... |
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef ProgressTracker_h | 26 #ifndef ProgressTracker_h |
27 #define ProgressTracker_h | 27 #define ProgressTracker_h |
28 | 28 |
29 #include "core/CoreExport.h" | 29 #include "core/CoreExport.h" |
30 #include "platform/heap/Handle.h" | 30 #include "platform/heap/Handle.h" |
| 31 #include "platform/network/ResourceLoadPriority.h" |
31 #include "wtf/Allocator.h" | 32 #include "wtf/Allocator.h" |
32 #include "wtf/Forward.h" | 33 #include "wtf/Forward.h" |
33 #include "wtf/HashMap.h" | 34 #include "wtf/HashMap.h" |
34 #include "wtf/Noncopyable.h" | 35 #include "wtf/Noncopyable.h" |
35 #include <memory> | 36 #include <memory> |
36 | 37 |
37 namespace blink { | 38 namespace blink { |
38 | 39 |
39 class LocalFrame; | 40 class LocalFrame; |
40 class Resource; | 41 class Resource; |
(...skipping 12 matching lines...) Expand all Loading... |
53 DECLARE_TRACE(); | 54 DECLARE_TRACE(); |
54 void dispose(); | 55 void dispose(); |
55 | 56 |
56 double estimatedProgress() const; | 57 double estimatedProgress() const; |
57 | 58 |
58 void progressStarted(); | 59 void progressStarted(); |
59 void progressCompleted(); | 60 void progressCompleted(); |
60 | 61 |
61 void finishedParsing(); | 62 void finishedParsing(); |
62 | 63 |
63 void willStartLoading(unsigned long identifier); | 64 void willStartLoading(unsigned long identifier, ResourceLoadPriority); |
64 void incrementProgress(unsigned long identifier, const ResourceResponse&); | 65 void incrementProgress(unsigned long identifier, const ResourceResponse&); |
65 void incrementProgress(unsigned long identifier, int); | 66 void incrementProgress(unsigned long identifier, int); |
66 void completeProgress(unsigned long identifier); | 67 void completeProgress(unsigned long identifier); |
67 | 68 |
68 private: | 69 private: |
69 explicit ProgressTracker(LocalFrame*); | 70 explicit ProgressTracker(LocalFrame*); |
70 | 71 |
71 void incrementProgressForMainResourceOnly(unsigned long identifier, int leng
th); | 72 void incrementProgressForMainResourceOnly(unsigned long identifier, int leng
th); |
72 void maybeSendProgress(); | 73 void maybeSendProgress(); |
73 void sendFinalProgress(); | 74 void sendFinalProgress(); |
74 void reset(); | 75 void reset(); |
75 | 76 |
76 Member<LocalFrame> m_frame; | 77 Member<LocalFrame> m_frame; |
77 double m_lastNotifiedProgressValue; | 78 double m_lastNotifiedProgressValue; |
78 double m_lastNotifiedProgressTime; | 79 double m_lastNotifiedProgressTime; |
79 bool m_finishedParsing; | 80 bool m_finishedParsing; |
80 double m_progressValue; | 81 double m_progressValue; |
81 | 82 |
82 HashMap<unsigned long, std::unique_ptr<ProgressItem>> m_progressItems; | 83 HashMap<unsigned long, std::unique_ptr<ProgressItem>> m_progressItems; |
83 }; | 84 }; |
84 | 85 |
85 } // namespace blink | 86 } // namespace blink |
86 | 87 |
87 #endif | 88 #endif |
OLD | NEW |