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

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

Issue 2477573002: [Presentation API] (3rd) (1-UA) Split PresentationServiceDelegateImpl(PSDImpl) (Closed)
Patch Set: resolve code review comments from Mark Created 4 years, 1 month 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
5 #include "chrome/browser/media/router/presentation_service_delegate_base_impl.h"
6
7 #include "content/public/browser/render_frame_host.h"
8
9 namespace media_router {
10
11 PresentationServiceDelegateBaseImpl::PresentationServiceDelegateBaseImpl() {}
12
13 PresentationServiceDelegateBaseImpl::~PresentationServiceDelegateBaseImpl() {
14 for (auto& observer_pair : observers_)
15 observer_pair.second->OnDelegateDestroyed();
16 }
17
18 void PresentationServiceDelegateBaseImpl::AddObserver(
19 int render_process_id,
20 int render_frame_id,
21 content::PresentationServiceDelegate::Observer* observer) {
22 DCHECK(observer);
23
24 RenderFrameHostId rfh_id(render_process_id, render_frame_id);
25 DCHECK(!base::ContainsKey(observers_, rfh_id));
26 observers_[rfh_id] = observer;
27 }
28
29 void PresentationServiceDelegateBaseImpl::RemoveObserver(int render_process_id,
30 int render_frame_id) {
31 observers_.erase(RenderFrameHostId(render_process_id, render_frame_id));
32 }
33
34 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698