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

Side by Side Diff: ui/ozone/platform/drm/gpu/drm_device.cc

Issue 2695593009: Use the location where FileDescriptorWatcher is created to track the libevent handlers (Closed)
Patch Set: fix mac. Created 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/ozone/platform/drm/gpu/drm_device.h" 5 #include "ui/ozone/platform/drm/gpu/drm_device.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <sys/mman.h> 8 #include <sys/mman.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 #include <xf86drm.h> 10 #include <xf86drm.h>
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 uint64_t next_id_; 345 uint64_t next_id_;
346 346
347 std::vector<PageFlip> callbacks_; 347 std::vector<PageFlip> callbacks_;
348 348
349 DISALLOW_COPY_AND_ASSIGN(PageFlipManager); 349 DISALLOW_COPY_AND_ASSIGN(PageFlipManager);
350 }; 350 };
351 351
352 class DrmDevice::IOWatcher : public base::MessagePumpLibevent::Watcher { 352 class DrmDevice::IOWatcher : public base::MessagePumpLibevent::Watcher {
353 public: 353 public:
354 IOWatcher(int fd, DrmDevice::PageFlipManager* page_flip_manager) 354 IOWatcher(int fd, DrmDevice::PageFlipManager* page_flip_manager)
355 : page_flip_manager_(page_flip_manager), fd_(fd) { 355 : page_flip_manager_(page_flip_manager), controller_(FROM_HERE), fd_(fd) {
356 Register(); 356 Register();
357 } 357 }
358 358
359 ~IOWatcher() override { Unregister(); } 359 ~IOWatcher() override { Unregister(); }
360 360
361 private: 361 private:
362 void Register() { 362 void Register() {
363 DCHECK(base::MessageLoopForIO::IsCurrent()); 363 DCHECK(base::MessageLoopForIO::IsCurrent());
364 base::MessageLoopForIO::current()->WatchFileDescriptor( 364 base::MessageLoopForIO::current()->WatchFileDescriptor(
365 fd_, true, base::MessageLoopForIO::WATCH_READ, &controller_, this); 365 fd_, true, base::MessageLoopForIO::WATCH_READ, &controller_, this);
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 reinterpret_cast<unsigned char*>(ctm_blob_data.get()), 818 reinterpret_cast<unsigned char*>(ctm_blob_data.get()),
819 sizeof(DrmColorCtm))) 819 sizeof(DrmColorCtm)))
820 return false; 820 return false;
821 } 821 }
822 } 822 }
823 823
824 return true; 824 return true;
825 } 825 }
826 826
827 } // namespace ui 827 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/platform/x11/x11_event_source_libevent.cc ('k') | ui/ozone/platform/wayland/fake_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698