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

Side by Side Diff: content/renderer/load_progress_tracker.h

Issue 263973003: Move LoadProgressTracker to the browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: final comment Created 6 years, 7 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 | « content/content_renderer.gypi ('k') | content/renderer/load_progress_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_LOAD_PROGRESS_TRACKER_H_
6 #define CONTENT_RENDERER_LOAD_PROGRESS_TRACKER_H_
7
8 #include "base/containers/hash_tables.h"
9 #include "base/logging.h"
10 #include "base/memory/weak_ptr.h"
11 #include "base/time/time.h"
12
13 namespace content {
14 class RenderViewImpl;
15
16 class LoadProgressTracker {
17 public:
18 explicit LoadProgressTracker(RenderViewImpl* render_view);
19 ~LoadProgressTracker();
20
21 void DidStartLoading(int frame_routing_id);
22 void DidStopLoading(int frame_routing_id);
23
24 void DidChangeLoadProgress(int frame_routing_id, double progress);
25
26 private:
27 void ResetStates();
28
29 void SendChangeLoadProgress();
30
31 RenderViewImpl* render_view_;
32
33 // ProgressMap maps RenderFrame routing ids to a double representing that
34 // frame's completion (from 0 to 1).
35 typedef base::hash_map<int, double> ProgressMap;
36 ProgressMap progresses_;
37 double total_progress_;
38
39 base::TimeTicks last_time_progress_sent_;
40
41 base::WeakPtrFactory<LoadProgressTracker> weak_factory_;
42
43 DISALLOW_COPY_AND_ASSIGN(LoadProgressTracker);
44 };
45
46 } // namespace content
47
48 #endif // CONTENT_RENDERER_LOAD_PROGRESS_TRACKER_H_
OLDNEW
« no previous file with comments | « content/content_renderer.gypi ('k') | content/renderer/load_progress_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698