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

Side by Side Diff: content/browser/loader/render_view_host_tracker.h

Issue 12600018: ResourceScheduler should use renderer notifications instead of MRUCache to track renderers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reverse destruction order Created 7 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 | « no previous file | content/browser/loader/render_view_host_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) 2013 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_BROWSER_LOADER_RENDER_VIEW_HOST_TRACKER_H_
6 #define CONTENT_BROWSER_LOADER_RENDER_VIEW_HOST_TRACKER_H_
7
8 #include <set>
9
10 #include "content/public/browser/notification_observer.h"
11 #include "content/public/browser/notification_registrar.h"
12 #include "content/public/browser/render_view_host_observer.h"
13
14 namespace content {
15
16 // The ResourceDispatcherHost needs to know when renderers are created and
17 // destroyed. That happens on the UI thread, but the ResourceDispatcherHost
18 // operates on the IO thread. RenderViewHostTracker listens for renderer
19 // notifications on the UI thread, then bounces them over to the IO thread so
20 // the ResourceDispatcherHost can be notified.
21 class CONTENT_EXPORT RenderViewHostTracker : public NotificationObserver {
22 public:
23 RenderViewHostTracker();
24 virtual ~RenderViewHostTracker();
25
26 private:
27 class Observer : public RenderViewHostObserver {
28 public:
29 Observer(RenderViewHost* rvh,
30 RenderViewHostTracker* tracker);
31 virtual ~Observer();
32
33 private:
34 // RenderViewHostObserver interface:
35 virtual void RenderViewHostDestroyed(RenderViewHost* rvh) OVERRIDE;
36
37 RenderViewHostTracker* tracker_;
38 };
39
40 friend class Observer;
41 typedef std::set<Observer*> ObserverSet;
42
43 // NotificationObserver interface:
44 virtual void Observe(int type,
45 const NotificationSource& source,
46 const NotificationDetails& details) OVERRIDE;
47
48 void RemoveObserver(Observer* observer);
49
50 content::NotificationRegistrar registrar_;
51 ObserverSet observers_;
52 };
53
54 } // namespace content
55
56 #endif // CONTENT_BROWSER_LOADER_RENDER_VIEW_HOST_TRACKER_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/loader/render_view_host_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698