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

Side by Side Diff: chrome/browser/chrome_browser_main_extra_parts_exo.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 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 "chrome/browser/chrome_browser_main_extra_parts_exo.h" 5 #include "chrome/browser/chrome_browser_main_extra_parts_exo.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 8
9 #if defined(USE_GLIB) 9 #if defined(USE_GLIB)
10 #include <glib.h> 10 #include <glib.h>
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 // The GLib event source for wayland events. 84 // The GLib event source for wayland events.
85 GLibWaylandSource* wayland_source_; 85 GLibWaylandSource* wayland_source_;
86 86
87 DISALLOW_COPY_AND_ASSIGN(WaylandWatcher); 87 DISALLOW_COPY_AND_ASSIGN(WaylandWatcher);
88 }; 88 };
89 #else 89 #else
90 class ChromeBrowserMainExtraPartsExo::WaylandWatcher 90 class ChromeBrowserMainExtraPartsExo::WaylandWatcher
91 : public base::MessagePumpLibevent::Watcher { 91 : public base::MessagePumpLibevent::Watcher {
92 public: 92 public:
93 explicit WaylandWatcher(exo::wayland::Server* server) : server_(server) { 93 explicit WaylandWatcher(exo::wayland::Server* server)
94 : controller_(FROM_HERE), server_(server) {
94 base::MessageLoopForUI::current()->WatchFileDescriptor( 95 base::MessageLoopForUI::current()->WatchFileDescriptor(
95 server_->GetFileDescriptor(), 96 server_->GetFileDescriptor(),
96 true, // persistent 97 true, // persistent
97 base::MessagePumpLibevent::WATCH_READ, &controller_, this); 98 base::MessagePumpLibevent::WATCH_READ, &controller_, this);
98 } 99 }
99 100
100 // base::MessagePumpLibevent::Watcher: 101 // base::MessagePumpLibevent::Watcher:
101 void OnFileCanReadWithoutBlocking(int fd) override { 102 void OnFileCanReadWithoutBlocking(int fd) override {
102 server_->Dispatch(base::TimeDelta()); 103 server_->Dispatch(base::TimeDelta());
103 server_->Flush(); 104 server_->Flush();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 138 }
138 139
139 void ChromeBrowserMainExtraPartsExo::PostMainMessageLoopRun() { 140 void ChromeBrowserMainExtraPartsExo::PostMainMessageLoopRun() {
140 wayland_watcher_.reset(); 141 wayland_watcher_.reset();
141 wayland_server_.reset(); 142 wayland_server_.reset();
142 if (wm_helper_) { 143 if (wm_helper_) {
143 exo::WMHelper::SetInstance(nullptr); 144 exo::WMHelper::SetInstance(nullptr);
144 wm_helper_.reset(); 145 wm_helper_.reset();
145 } 146 }
146 } 147 }
OLDNEW
« no previous file with comments | « chrome/browser/apps/app_shim/unix_domain_socket_acceptor.cc ('k') | chrome/common/service_process_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698