MCPcopy Create free account
hub / github.com/chromium/crashpad / InitializeWithClient

Method InitializeWithClient

handler/linux/exception_handler_server.cc:255–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253}
254
255bool ExceptionHandlerServer::InitializeWithClient(ScopedFileHandle sock,
256 bool multiple_clients) {
257 INITIALIZATION_STATE_SET_INITIALIZING(initialized_);
258
259 pollfd_.reset(epoll_create1(EPOLL_CLOEXEC));
260 if (!pollfd_.is_valid()) {
261 PLOG(ERROR) << "epoll_create1";
262 return false;
263 }
264
265 shutdown_event_ = std::make_unique<Event>();
266 shutdown_event_->type = Event::Type::kShutdown;
267 shutdown_event_->fd.reset(eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK));
268 if (!shutdown_event_->fd.is_valid()) {
269 PLOG(ERROR) << "eventfd";
270 return false;
271 }
272
273 epoll_event poll_event;
274 poll_event.events = EPOLLIN;
275 poll_event.data.ptr = shutdown_event_.get();
276 if (epoll_ctl(pollfd_.get(),
277 EPOLL_CTL_ADD,
278 shutdown_event_->fd.get(),
279 &poll_event) != 0) {
280 PLOG(ERROR) << "epoll_ctl";
281 return false;
282 }
283
284 if (!InstallClientSocket(std::move(sock),
285 multiple_clients ? Event::Type::kSharedSocketMessage
286 : Event::Type::kClientMessage)) {
287 return false;
288 }
289
290 INITIALIZATION_STATE_SET_VALID(initialized_);
291 return true;
292}
293
294void ExceptionHandlerServer::Run(Delegate* delegate) {
295 INITIALIZATION_STATE_DCHECK_VALID(initialized_);

Callers 2

HandlerMainFunction · 0.80
SetUpMethod · 0.80

Calls 3

resetMethod · 0.45
is_validMethod · 0.45
getMethod · 0.45

Tested by 1

SetUpMethod · 0.64