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

Side by Side Diff: remoting/host/linux/audio_pipe_reader.cc

Issue 877993003: Pass FROM_HERE to ObserverListThreadSafe::Notify to improve profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « net/cert/nss_cert_database.cc ('k') | ui/compositor/compositor_vsync_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "remoting/host/linux/audio_pipe_reader.h" 5 #include "remoting/host/linux/audio_pipe_reader.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <sys/stat.h> 8 #include <sys/stat.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 // to read |bytes_to_read| bytes, but in case it's misbehaving we need to make 186 // to read |bytes_to_read| bytes, but in case it's misbehaving we need to make
187 // sure that |stream_position_bytes| doesn't go out of sync with the current 187 // sure that |stream_position_bytes| doesn't go out of sync with the current
188 // stream position. 188 // stream position.
189 if (stream_position_bytes - last_capture_position_ > pipe_buffer_size_) 189 if (stream_position_bytes - last_capture_position_ > pipe_buffer_size_)
190 last_capture_position_ = stream_position_bytes - pipe_buffer_size_; 190 last_capture_position_ = stream_position_bytes - pipe_buffer_size_;
191 DCHECK_LE(last_capture_position_, stream_position_bytes); 191 DCHECK_LE(last_capture_position_, stream_position_bytes);
192 192
193 // Dispatch asynchronous notification to the stream observers. 193 // Dispatch asynchronous notification to the stream observers.
194 scoped_refptr<base::RefCountedString> data_ref = 194 scoped_refptr<base::RefCountedString> data_ref =
195 base::RefCountedString::TakeString(&data); 195 base::RefCountedString::TakeString(&data);
196 observers_->Notify(&StreamObserver::OnDataRead, data_ref); 196 observers_->Notify(FROM_HERE, &StreamObserver::OnDataRead, data_ref);
197 } 197 }
198 198
199 void AudioPipeReader::WaitForPipeReadable() { 199 void AudioPipeReader::WaitForPipeReadable() {
200 timer_.Stop(); 200 timer_.Stop();
201 base::MessageLoopForIO::current()->WatchFileDescriptor( 201 base::MessageLoopForIO::current()->WatchFileDescriptor(
202 pipe_.GetPlatformFile(), false, base::MessageLoopForIO::WATCH_READ, 202 pipe_.GetPlatformFile(), false, base::MessageLoopForIO::WATCH_READ,
203 &file_descriptor_watcher_, this); 203 &file_descriptor_watcher_, this);
204 } 204 }
205 205
206 // static 206 // static
207 void AudioPipeReaderTraits::Destruct(const AudioPipeReader* audio_pipe_reader) { 207 void AudioPipeReaderTraits::Destruct(const AudioPipeReader* audio_pipe_reader) {
208 audio_pipe_reader->task_runner_->DeleteSoon(FROM_HERE, audio_pipe_reader); 208 audio_pipe_reader->task_runner_->DeleteSoon(FROM_HERE, audio_pipe_reader);
209 } 209 }
210 210
211 } // namespace remoting 211 } // namespace remoting
OLDNEW
« no previous file with comments | « net/cert/nss_cert_database.cc ('k') | ui/compositor/compositor_vsync_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698