Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Side by Side Diff: Source/core/loader/ProgressTracker.h

Issue 216083002: Revert of Revert of Make start/stop loading notifications per-frame (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/loader/FrameLoaderClient.h ('k') | Source/core/loader/ProgressTracker.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/core/loader/FrameLoaderClient.h ('k') | Source/core/loader/ProgressTracker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698