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

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: rebase 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 2015 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 <unordered_map>
mark a. foltz 2016/11/15 23:41:46 Is this needed?
zhaobin 2016/11/16 18:02:40 Done.
8
9 #include "content/public/browser/render_frame_host.h"
10
11 using content::RenderFrameHost;
mark a. foltz 2016/11/15 23:41:46 Ditto
zhaobin 2016/11/16 18:02:40 Done.
12
13 namespace media_router {
14
15 PresentationServiceDelegateBaseImpl::PresentationServiceDelegateBaseImpl() {}
16
17 PresentationServiceDelegateBaseImpl::~PresentationServiceDelegateBaseImpl() {
18 for (auto& observer_pair : observers_)
19 observer_pair.second->OnDelegateDestroyed();
20 }
21
22 void PresentationServiceDelegateBaseImpl::AddObserver(
23 int render_process_id,
24 int render_frame_id,
25 content::PresentationServiceDelegateBase::Observer* observer) {
26 DCHECK(observer);
27
28 RenderFrameHostId rfh_id(render_process_id, render_frame_id);
29 DCHECK(!base::ContainsKey(observers_, rfh_id));
30 observers_[rfh_id] = observer;
mark a. foltz 2016/11/15 23:41:46 If the DCHECKS would have failed above in a releas
zhaobin 2016/11/16 18:02:39 I dont have strong opinions but slightly prefer DC
31 }
32
33 void PresentationServiceDelegateBaseImpl::RemoveObserver(int render_process_id,
34 int render_frame_id) {
35 observers_.erase(RenderFrameHostId(render_process_id, render_frame_id));
36 }
37
38 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698