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

Side by Side Diff: chrome/browser/ui/webui/media_internals_proxy.h

Issue 7272036: Make MediaInternalsUI talk to MediaInternals. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Responding to comments Created 9 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 | Annotate | Revision Log
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 CHROME_BROWSER_UI_WEBUI_MEDIA_INTERNALS_PROXY_H_
6 #define CHROME_BROWSER_UI_WEBUI_MEDIA_INTERNALS_PROXY_H_
7 #pragma once
8
9 #include "base/memory/ref_counted.h"
10 #include "base/string16.h"
11 #include "chrome/browser/media/media_internals_observer.h"
12
13 class IOThread;
14 class MediaInternalsUI;
15
16 // This class is a proxy between MediaInternals (on the IO thread) and
17 // MediaInternalsUI (on the UI thread).
18 // It is ref_counted to ensure that it completes all pending Tasks on both
19 // threads before destruction.
20 class MediaInternalsProxy
Evan Stade 2011/06/29 20:13:01 seems this class should be a WebUIMessageHandler (
Scott Franklin 2011/06/29 23:47:08 As far as I can see, all of those still have proxi
Evan Stade 2011/06/30 22:24:27 Most chrome:// pages have handlers but not dedicat
21 : public MediaInternalsObserver,
22 public base::RefCountedThreadSafe<MediaInternalsProxy> {
23 public:
24 MediaInternalsProxy();
25
26 // Methods for MediaInternalsUI. Called on the UI thread.
27 // Register a UI to receive callbacks from MediaInternals.
28 void AttachUI(MediaInternalsUI* ui);
scherkus (not reviewing) 2011/06/29 18:49:32 pedantic nit: space out these methods w/ one blank
Scott Franklin 2011/06/29 23:47:08 Done.
29 // Unregister the same.
30 void DetachUI();
31 // Have MediaInternals send all the data it has.
32 void GetEverything();
33
34 // MediaInternalsObserver implementation. Called on the IO thread.
35 virtual void OnUpdate(const string16& update);
36
37 private:
38 friend class base::RefCountedThreadSafe<MediaInternalsProxy>;
39 virtual ~MediaInternalsProxy();
40
41 void ObserveMediaInternalsOnIOThread();
42 void StopObservingMediaInternalsOnIOThread();
43 void GetEverythingOnIOThread();
44 void UpdateUIOnUIThread(const string16& update);
45
46 MediaInternalsUI* ui_;
47 IOThread* io_thread_;
48
49 DISALLOW_COPY_AND_ASSIGN(MediaInternalsProxy);
50 };
51
52 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_INTERNALS_PROXY_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/media_internals_proxy.cc » ('j') | chrome/browser/ui/webui/media_internals_ui.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698