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

Side by Side Diff: media/base/user_input_monitor_linux.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 | « extensions/browser/api/storage/storage_api.cc ('k') | media/base/user_input_monitor_win.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 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 "media/base/user_input_monitor.h" 5 #include "media/base/user_input_monitor.h"
6 6
7 #include <sys/select.h> 7 #include <sys/select.h>
8 #include <unistd.h> 8 #include <unistd.h>
9 #define XK_MISCELLANY 9 #define XK_MISCELLANY
10 #include <X11/keysymdef.h> 10 #include <X11/keysymdef.h>
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 void UserInputMonitorLinuxCore::OnFileCanWriteWithoutBlocking(int fd) { 287 void UserInputMonitorLinuxCore::OnFileCanWriteWithoutBlocking(int fd) {
288 NOTREACHED(); 288 NOTREACHED();
289 } 289 }
290 290
291 void UserInputMonitorLinuxCore::ProcessXEvent(xEvent* event) { 291 void UserInputMonitorLinuxCore::ProcessXEvent(xEvent* event) {
292 DCHECK(io_task_runner_->BelongsToCurrentThread()); 292 DCHECK(io_task_runner_->BelongsToCurrentThread());
293 if (event->u.u.type == MotionNotify) { 293 if (event->u.u.type == MotionNotify) {
294 SkIPoint position(SkIPoint::Make(event->u.keyButtonPointer.rootX, 294 SkIPoint position(SkIPoint::Make(event->u.keyButtonPointer.rootX,
295 event->u.keyButtonPointer.rootY)); 295 event->u.keyButtonPointer.rootY));
296 mouse_listeners_->Notify( 296 mouse_listeners_->Notify(
297 &UserInputMonitor::MouseEventListener::OnMouseMoved, position); 297 FROM_HERE, &UserInputMonitor::MouseEventListener::OnMouseMoved,
298 position);
298 } else { 299 } else {
299 ui::EventType type; 300 ui::EventType type;
300 if (event->u.u.type == KeyPress) { 301 if (event->u.u.type == KeyPress) {
301 type = ui::ET_KEY_PRESSED; 302 type = ui::ET_KEY_PRESSED;
302 } else if (event->u.u.type == KeyRelease) { 303 } else if (event->u.u.type == KeyRelease) {
303 type = ui::ET_KEY_RELEASED; 304 type = ui::ET_KEY_RELEASED;
304 } else { 305 } else {
305 NOTREACHED(); 306 NOTREACHED();
306 return; 307 return;
307 } 308 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 } // namespace 375 } // namespace
375 376
376 scoped_ptr<UserInputMonitor> UserInputMonitor::Create( 377 scoped_ptr<UserInputMonitor> UserInputMonitor::Create(
377 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, 378 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
378 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner) { 379 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner) {
379 return scoped_ptr<UserInputMonitor>( 380 return scoped_ptr<UserInputMonitor>(
380 new UserInputMonitorLinux(io_task_runner)); 381 new UserInputMonitorLinux(io_task_runner));
381 } 382 }
382 383
383 } // namespace media 384 } // namespace media
OLDNEW
« no previous file with comments | « extensions/browser/api/storage/storage_api.cc ('k') | media/base/user_input_monitor_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698