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

Side by Side Diff: content/renderer/media/android/renderer_media_session_manager.cc

Issue 1308983005: NOT FOR LANDING Implement WebMediaSession (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add forward declaration Created 4 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 #include "content/renderer/media/android/renderer_media_session_manager.h" 5 #include "content/renderer/media/android/renderer_media_session_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/common/media/media_session_messages_android.h" 8 #include "content/common/media/media_session_messages_android.h"
9 #include "content/public/renderer/render_thread.h" 9 #include "content/public/renderer/render_thread.h"
10 #include "content/renderer/media/android/webmediasession_android.h" 10 #include "content/renderer/media/android/webmediasession_android.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 static const int kDefaultMediaSessionID = 0;
15
16 RendererMediaSessionManager::RendererMediaSessionManager( 14 RendererMediaSessionManager::RendererMediaSessionManager(
17 RenderFrame* render_frame) 15 RenderFrame* render_frame)
18 : RenderFrameObserver(render_frame), 16 : RenderFrameObserver(render_frame), next_session_id_(1) {}
19 next_session_id_(kDefaultMediaSessionID + 1) {}
20 17
21 RendererMediaSessionManager::~RendererMediaSessionManager() { 18 RendererMediaSessionManager::~RendererMediaSessionManager() {
22 DCHECK(sessions_.empty()) 19 DCHECK(sessions_.empty())
23 << "RendererMediaSessionManager is owned by RenderFrameImpl and is " 20 << "RendererMediaSessionManager is owned by RenderFrameImpl and is "
24 "destroyed only after all media sessions are destroyed."; 21 "destroyed only after all media sessions are destroyed.";
25 } 22 }
26 23
27 bool RendererMediaSessionManager::OnMessageReceived(const IPC::Message& msg) { 24 bool RendererMediaSessionManager::OnMessageReceived(const IPC::Message& msg) {
28 bool handled = true; 25 bool handled = true;
29 IPC_BEGIN_MESSAGE_MAP(RendererMediaSessionManager, msg) 26 IPC_BEGIN_MESSAGE_MAP(RendererMediaSessionManager, msg)
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 pending_activation_requests_.Remove(request_id); 69 pending_activation_requests_.Remove(request_id);
73 } 70 }
74 71
75 void RendererMediaSessionManager::OnDidDeactivate(int request_id) { 72 void RendererMediaSessionManager::OnDidDeactivate(int request_id) {
76 DCHECK(pending_deactivation_requests_.Lookup(request_id)) << request_id; 73 DCHECK(pending_deactivation_requests_.Lookup(request_id)) << request_id;
77 pending_deactivation_requests_.Lookup(request_id)->onSuccess(); 74 pending_deactivation_requests_.Lookup(request_id)->onSuccess();
78 pending_deactivation_requests_.Remove(request_id); 75 pending_deactivation_requests_.Remove(request_id);
79 } 76 }
80 77
81 } // namespace content 78 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698