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

Side by Side Diff: chrome/browser/media/router/presentation_service_delegate_observers.cc

Issue 2477573002: [Presentation API] (3rd) (1-UA) Split PresentationServiceDelegateImpl(PSDImpl) (Closed)
Patch Set: fix windows compile error 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
(Empty)
1 // Copyright 2016 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 #include "chrome/browser/media/router/presentation_service_delegate_observers.h"
5
6 namespace media_router {
7
8 PresentationServiceDelegateObservers::PresentationServiceDelegateObservers() {}
9
10 PresentationServiceDelegateObservers::~PresentationServiceDelegateObservers() {
11 for (auto& observer_pair : observers_)
12 observer_pair.second->OnDelegateDestroyed();
13 }
14
15 void PresentationServiceDelegateObservers::AddObserver(
16 int render_process_id,
17 int render_frame_id,
18 content::PresentationServiceDelegate::Observer* observer) {
19 DCHECK(observer);
20
21 RenderFrameHostId rfh_id(render_process_id, render_frame_id);
22 DCHECK(!base::ContainsKey(observers_, rfh_id));
23 observers_[rfh_id] = observer;
24 }
25
26 void PresentationServiceDelegateObservers::RemoveObserver(int render_process_id,
27 int render_frame_id) {
28 observers_.erase(RenderFrameHostId(render_process_id, render_frame_id));
29 }
30
31 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698