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

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

Issue 1860743002: Add a flag to change when android's progress bar completes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing flag default Created 4 years, 5 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
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 19 matching lines...) Expand all
30 #include "platform/heap/Handle.h" 30 #include "platform/heap/Handle.h"
31 #include "wtf/Allocator.h" 31 #include "wtf/Allocator.h"
32 #include "wtf/Forward.h" 32 #include "wtf/Forward.h"
33 #include "wtf/HashMap.h" 33 #include "wtf/HashMap.h"
34 #include "wtf/Noncopyable.h" 34 #include "wtf/Noncopyable.h"
35 #include <memory> 35 #include <memory>
36 36
37 namespace blink { 37 namespace blink {
38 38
39 class LocalFrame; 39 class LocalFrame;
40 class Resource;
40 class ResourceResponse; 41 class ResourceResponse;
41 struct ProgressItem; 42 struct ProgressItem;
42 43
43 // FIXME: This is only used on Android. Android is the only Chrome 44 // FIXME: This is only used on Android. Android is the only Chrome
44 // browser which shows a progress bar during loading. 45 // browser which shows a progress bar during loading.
45 // We should find a better way for Android to get this data and remove this! 46 // We should find a better way for Android to get this data and remove this!
46 class CORE_EXPORT ProgressTracker final : public GarbageCollectedFinalized<Progr essTracker> { 47 class CORE_EXPORT ProgressTracker final : public GarbageCollectedFinalized<Progr essTracker> {
47 WTF_MAKE_NONCOPYABLE(ProgressTracker); 48 WTF_MAKE_NONCOPYABLE(ProgressTracker);
48 public: 49 public:
49 static ProgressTracker* create(LocalFrame*); 50 static ProgressTracker* create(LocalFrame*);
50 51
51 ~ProgressTracker(); 52 ~ProgressTracker();
52 DECLARE_TRACE(); 53 DECLARE_TRACE();
53 void dispose(); 54 void dispose();
54 55
55 double estimatedProgress() const; 56 double estimatedProgress() const;
56 57
57 void progressStarted(); 58 void progressStarted();
58 void progressCompleted(); 59 void progressCompleted();
59 60
60 void finishedParsing(); 61 void finishedParsing();
61 62
63 void willStartLoading(unsigned long identifier);
62 void incrementProgress(unsigned long identifier, const ResourceResponse&); 64 void incrementProgress(unsigned long identifier, const ResourceResponse&);
63 void incrementProgress(unsigned long identifier, int); 65 void incrementProgress(unsigned long identifier, int);
64 void completeProgress(unsigned long identifier); 66 void completeProgress(unsigned long identifier);
65 67
66 long long totalPageAndResourceBytesToLoad() const { return m_totalPageAndRes ourceBytesToLoad; }
67 long long totalBytesReceived() const { return m_totalBytesReceived; }
68
69 private: 68 private:
70 explicit ProgressTracker(LocalFrame*); 69 explicit ProgressTracker(LocalFrame*);
71 70
72 void incrementProgressForMainResourceOnly(unsigned long identifier, int leng th); 71 void incrementProgressForMainResourceOnly(unsigned long identifier, int leng th);
72 void maybeSendProgress();
73 void sendFinalProgress(); 73 void sendFinalProgress();
74 void reset(); 74 void reset();
75 75
76 Member<LocalFrame> m_frame; 76 Member<LocalFrame> m_frame;
77 unsigned long m_mainResourceIdentifier;
78 long long m_totalPageAndResourceBytesToLoad;
79 long long m_totalBytesReceived;
80 double m_lastNotifiedProgressValue; 77 double m_lastNotifiedProgressValue;
81 double m_lastNotifiedProgressTime; 78 double m_lastNotifiedProgressTime;
82 double m_progressNotificationInterval; 79 bool m_finishedParsing;
83 double m_progressNotificationTimeInterval;
84 bool m_finalProgressChangedSent;
85 double m_progressValue; 80 double m_progressValue;
86 81
87 HashMap<unsigned long, std::unique_ptr<ProgressItem>> m_progressItems; 82 HashMap<unsigned long, std::unique_ptr<ProgressItem>> m_progressItems;
88 }; 83 };
89 84
90 } // namespace blink 85 } // namespace blink
91 86
92 #endif 87 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoaderTypes.h ('k') | third_party/WebKit/Source/core/loader/ProgressTracker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698