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

Side by Side Diff: content/public/browser/presentation_service_delegate.cc

Issue 2477573002: [Presentation API] (3rd) (1-UA) Split PresentationServiceDelegateImpl(PSDImpl) (Closed)
Patch Set: merge with master Created 4 years 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 "content/public/browser/presentation_service_delegate.h"
5
6 namespace content {
7
8 PresentationServiceDelegate::PresentationServiceDelegate() {}
9
10 PresentationServiceDelegate::~PresentationServiceDelegate() {
11 for (auto& observer_pair : observers_)
12 observer_pair.second->OnDelegateDestroyed();
13 }
14
15 void PresentationServiceDelegate::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 PresentationServiceDelegate::RemoveObserver(int render_process_id,
27 int render_frame_id) {
28 observers_.erase(RenderFrameHostID(render_process_id, render_frame_id));
29 }
30
31 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698