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

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

Issue 2557053002: Use LocalFrame::client() than getting the FrameLoader and then call client() on it. (Closed)
Patch Set: Rebase Created 3 years, 11 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 "platform/network/ResourceLoadPriority.h" 31 #include "platform/network/ResourceLoadPriority.h"
32 #include "wtf/Allocator.h" 32 #include "wtf/Allocator.h"
33 #include "wtf/Forward.h" 33 #include "wtf/Forward.h"
34 #include "wtf/HashMap.h" 34 #include "wtf/HashMap.h"
35 #include "wtf/Noncopyable.h" 35 #include "wtf/Noncopyable.h"
36 #include <memory> 36 #include <memory>
37 37
38 namespace blink { 38 namespace blink {
39 39
40 class FrameLoaderClient;
40 class LocalFrame; 41 class LocalFrame;
41 class ResourceResponse; 42 class ResourceResponse;
42 struct ProgressItem; 43 struct ProgressItem;
43 44
44 // FIXME: This is only used on Android. Android is the only Chrome 45 // FIXME: This is only used on Android. Android is the only Chrome
45 // browser which shows a progress bar during loading. 46 // browser which shows a progress bar during loading.
46 // We should find a better way for Android to get this data and remove this! 47 // We should find a better way for Android to get this data and remove this!
47 class CORE_EXPORT ProgressTracker final 48 class CORE_EXPORT ProgressTracker final
48 : public GarbageCollectedFinalized<ProgressTracker> { 49 : public GarbageCollectedFinalized<ProgressTracker> {
49 WTF_MAKE_NONCOPYABLE(ProgressTracker); 50 WTF_MAKE_NONCOPYABLE(ProgressTracker);
(...skipping 13 matching lines...) Expand all
63 void finishedParsing(); 64 void finishedParsing();
64 65
65 void willStartLoading(unsigned long identifier, ResourceLoadPriority); 66 void willStartLoading(unsigned long identifier, ResourceLoadPriority);
66 void incrementProgress(unsigned long identifier, const ResourceResponse&); 67 void incrementProgress(unsigned long identifier, const ResourceResponse&);
67 void incrementProgress(unsigned long identifier, int); 68 void incrementProgress(unsigned long identifier, int);
68 void completeProgress(unsigned long identifier); 69 void completeProgress(unsigned long identifier);
69 70
70 private: 71 private:
71 explicit ProgressTracker(LocalFrame*); 72 explicit ProgressTracker(LocalFrame*);
72 73
73 void incrementProgressForMainResourceOnly(unsigned long identifier, 74 FrameLoaderClient* frameLoaderClient() const;
74 int length); 75
75 void maybeSendProgress(); 76 void maybeSendProgress();
76 void sendFinalProgress(); 77 void sendFinalProgress();
77 void reset(); 78 void reset();
78 79
79 Member<LocalFrame> m_frame; 80 Member<LocalFrame> m_frame;
80 double m_lastNotifiedProgressValue; 81 double m_lastNotifiedProgressValue;
81 double m_lastNotifiedProgressTime; 82 double m_lastNotifiedProgressTime;
82 bool m_finishedParsing; 83 bool m_finishedParsing;
83 double m_progressValue; 84 double m_progressValue;
84 85
85 HashMap<unsigned long, std::unique_ptr<ProgressItem>> m_progressItems; 86 HashMap<unsigned long, std::unique_ptr<ProgressItem>> m_progressItems;
86 }; 87 };
87 88
88 } // namespace blink 89 } // namespace blink
89 90
90 #endif 91 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContext.cpp ('k') | third_party/WebKit/Source/core/loader/ProgressTracker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698