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

Side by Side Diff: content/browser/media/android/browser_demuxer_android.cc

Issue 142923005: Allow MessageFilters to restrict listening to specific message classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 10 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/browser/media/android/browser_demuxer_android.h" 5 #include "content/browser/media/android/browser_demuxer_android.h"
6 6
7 #include "content/common/media/media_player_messages_android.h" 7 #include "content/common/media/media_player_messages_android.h"
8 8
9 namespace content { 9 namespace content {
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 bool ClientIDExists() { 50 bool ClientIDExists() {
51 return demuxer_->demuxer_clients_.Lookup(demuxer_client_id_); 51 return demuxer_->demuxer_clients_.Lookup(demuxer_client_id_);
52 } 52 }
53 53
54 scoped_refptr<BrowserDemuxerAndroid> demuxer_; 54 scoped_refptr<BrowserDemuxerAndroid> demuxer_;
55 int demuxer_client_id_; 55 int demuxer_client_id_;
56 56
57 DISALLOW_COPY_AND_ASSIGN(Internal); 57 DISALLOW_COPY_AND_ASSIGN(Internal);
58 }; 58 };
59 59
60 BrowserDemuxerAndroid::BrowserDemuxerAndroid() {} 60 BrowserDemuxerAndroid::BrowserDemuxerAndroid()
61 : BrowserMessageFilter(MediaPlayerMsgStart) {}
61 62
62 BrowserDemuxerAndroid::~BrowserDemuxerAndroid() {} 63 BrowserDemuxerAndroid::~BrowserDemuxerAndroid() {}
63 64
64 void BrowserDemuxerAndroid::OverrideThreadForMessage( 65 void BrowserDemuxerAndroid::OverrideThreadForMessage(
65 const IPC::Message& message, 66 const IPC::Message& message,
66 BrowserThread::ID* thread) { 67 BrowserThread::ID* thread) {
67 switch (message.type()) { 68 switch (message.type()) {
68 case MediaPlayerHostMsg_DemuxerReady::ID: 69 case MediaPlayerHostMsg_DemuxerReady::ID:
69 case MediaPlayerHostMsg_ReadFromDemuxerAck::ID: 70 case MediaPlayerHostMsg_ReadFromDemuxerAck::ID:
70 case MediaPlayerHostMsg_DurationChanged::ID: 71 case MediaPlayerHostMsg_DurationChanged::ID:
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 140
140 void BrowserDemuxerAndroid::OnDurationChanged(int demuxer_client_id, 141 void BrowserDemuxerAndroid::OnDurationChanged(int demuxer_client_id,
141 const base::TimeDelta& duration) { 142 const base::TimeDelta& duration) {
142 media::DemuxerAndroidClient* client = 143 media::DemuxerAndroidClient* client =
143 demuxer_clients_.Lookup(demuxer_client_id); 144 demuxer_clients_.Lookup(demuxer_client_id);
144 if (client) 145 if (client)
145 client->OnDemuxerDurationChanged(duration); 146 client->OnDemuxerDurationChanged(duration);
146 } 147 }
147 148
148 } // namespace content 149 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_scheduler_filter.cc ('k') | content/browser/message_port_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698