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

Side by Side Diff: chrome/browser/media/router/discovery/dial/dial_media_sink_service_proxy.h

Issue 2965843002: [Media Router] Support dual discovery (Closed)
Patch Set: clean up and fix unit tests Created 3 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 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_MEDIA_SINK_SERVICE_PROXY _H_ 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_MEDIA_SINK_SERVICE_PROXY _H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_MEDIA_SINK_SERVICE_PROXY _H_ 6 #define CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_MEDIA_SINK_SERVICE_PROXY _H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 content::BrowserContext* context); 43 content::BrowserContext* context);
44 44
45 // Starts discovery of DIAL devices on IO thread. Caller is responsible for 45 // Starts discovery of DIAL devices on IO thread. Caller is responsible for
46 // calling Stop() before destroying this object.. 46 // calling Stop() before destroying this object..
47 void Start() override; 47 void Start() override;
48 48
49 // Stops discovery of DIAL devices on IO thread. The callback passed to 49 // Stops discovery of DIAL devices on IO thread. The callback passed to
50 // Start() is cleared. 50 // Start() is cleared.
51 void Stop() override; 51 void Stop() override;
52 52
53 // MediaSinkService implementation.
54 void AddObserver(Observer* observer) override;
55 void RemoveObserver(Observer* observer) override;
56
53 void SetDialMediaSinkServiceForTest( 57 void SetDialMediaSinkServiceForTest(
54 std::unique_ptr<DialMediaSinkServiceImpl> dial_media_sink_service); 58 std::unique_ptr<DialMediaSinkServiceImpl> dial_media_sink_service);
55 59
56 private: 60 private:
57 friend class DialMediaSinkServiceProxyTest; 61 friend class DialMediaSinkServiceProxyTest;
58 friend class base::DeleteHelper<DialMediaSinkServiceProxy>; 62 friend class base::DeleteHelper<DialMediaSinkServiceProxy>;
59 friend struct content::BrowserThread::DeleteOnThread< 63 friend struct content::BrowserThread::DeleteOnThread<
60 content::BrowserThread::IO>; 64 content::BrowserThread::IO>;
61 friend class base::RefCountedThreadSafe<DialMediaSinkServiceProxy>; 65 friend class base::RefCountedThreadSafe<DialMediaSinkServiceProxy>;
62 66
63 ~DialMediaSinkServiceProxy() override; 67 ~DialMediaSinkServiceProxy() override;
64 68
65 // Starts DIAL discovery. 69 // Starts DIAL discovery.
66 void StartOnIOThread(); 70 void StartOnIOThread();
67 71
68 // Stops DIAL discovery. 72 // Stops DIAL discovery.
69 void StopOnIOThread(); 73 void StopOnIOThread();
70 74
71 // Callback passed to |dial_media_sink_service_| ctor. When invoked, post task 75 // Callback passed to |dial_media_sink_service_| ctor. When invoked, post task
72 // to UI thread and invoke |sink_discovery_callback_|. 76 // to UI thread and invoke |sink_discovery_callback_|.
73 void OnSinksDiscoveredOnIOThread(std::vector<MediaSinkInternal> sinks); 77 void OnSinksDiscoveredOnIOThread(std::vector<MediaSinkInternal> sinks);
74 78
75 private: 79 private:
76 std::unique_ptr<DialMediaSinkServiceImpl> dial_media_sink_service_; 80 std::unique_ptr<DialMediaSinkServiceImpl> dial_media_sink_service_;
77 81
78 scoped_refptr<net::URLRequestContextGetter> request_context_; 82 scoped_refptr<net::URLRequestContextGetter> request_context_;
79 83
84 Observer* observer_;
85
80 DISALLOW_COPY_AND_ASSIGN(DialMediaSinkServiceProxy); 86 DISALLOW_COPY_AND_ASSIGN(DialMediaSinkServiceProxy);
81 }; 87 };
82 88
83 } // namespace media_router 89 } // namespace media_router
84 90
85 #endif // CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_MEDIA_SINK_SERVICE_PR OXY_H_ 91 #endif // CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_MEDIA_SINK_SERVICE_PR OXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698