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

Unified Diff: runtime/bin/eventhandler_linux.cc

Issue 2974233002: VM: Re-format to use at most one newline between functions (Closed)
Patch Set: Rebase and merge Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/eventhandler_linux.h ('k') | runtime/bin/eventhandler_macos.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/eventhandler_linux.cc
diff --git a/runtime/bin/eventhandler_linux.cc b/runtime/bin/eventhandler_linux.cc
index 4ff0865b81534fa5ee645724d89c5e7552ebe853..7217da1b86bbc5e45c947fbe9d17808b8e859ce4 100644
--- a/runtime/bin/eventhandler_linux.cc
+++ b/runtime/bin/eventhandler_linux.cc
@@ -22,8 +22,8 @@
#include "bin/dartutils.h"
#include "bin/fdutils.h"
-#include "bin/log.h"
#include "bin/lockers.h"
+#include "bin/log.h"
#include "bin/socket.h"
#include "bin/thread.h"
#include "platform/utils.h"
@@ -44,14 +44,12 @@ intptr_t DescriptorInfo::GetPollEvents() {
return events;
}
-
// Unregister the file descriptor for a DescriptorInfo structure with
// epoll.
static void RemoveFromEpollInstance(intptr_t epoll_fd_, DescriptorInfo* di) {
VOID_NO_RETRY_EXPECTED(epoll_ctl(epoll_fd_, EPOLL_CTL_DEL, di->fd(), NULL));
}
-
static void AddToEpollInstance(intptr_t epoll_fd_, DescriptorInfo* di) {
struct epoll_event event;
event.events = EPOLLRDHUP | di->GetPollEvents();
@@ -72,7 +70,6 @@ static void AddToEpollInstance(intptr_t epoll_fd_, DescriptorInfo* di) {
}
}
-
EventHandlerImplementation::EventHandlerImplementation()
: socket_map_(&HashMap::SamePointerValue, 16) {
intptr_t result;
@@ -124,14 +121,12 @@ EventHandlerImplementation::EventHandlerImplementation()
}
}
-
static void DeleteDescriptorInfo(void* info) {
DescriptorInfo* di = reinterpret_cast<DescriptorInfo*>(info);
di->Close();
delete di;
}
-
EventHandlerImplementation::~EventHandlerImplementation() {
socket_map_.Clear(DeleteDescriptorInfo);
VOID_TEMP_FAILURE_RETRY(close(epoll_fd_));
@@ -140,7 +135,6 @@ EventHandlerImplementation::~EventHandlerImplementation() {
VOID_TEMP_FAILURE_RETRY(close(interrupt_fds_[1]));
}
-
void EventHandlerImplementation::UpdateEpollInstance(intptr_t old_mask,
DescriptorInfo* di) {
intptr_t new_mask = di->Mask();
@@ -155,7 +149,6 @@ void EventHandlerImplementation::UpdateEpollInstance(intptr_t old_mask,
}
}
-
DescriptorInfo* EventHandlerImplementation::GetDescriptorInfo(
intptr_t fd,
bool is_listening) {
@@ -178,7 +171,6 @@ DescriptorInfo* EventHandlerImplementation::GetDescriptorInfo(
return di;
}
-
void EventHandlerImplementation::WakeupHandler(intptr_t id,
Dart_Port dart_port,
int64_t data) {
@@ -200,7 +192,6 @@ void EventHandlerImplementation::WakeupHandler(intptr_t id,
}
}
-
void EventHandlerImplementation::HandleInterruptFd() {
const intptr_t MAX_MESSAGES = kInterruptMessageSize;
InterruptMessage msg[MAX_MESSAGES];
@@ -292,7 +283,6 @@ void EventHandlerImplementation::HandleInterruptFd() {
}
}
-
#ifdef DEBUG_POLL
static void PrintEventMask(intptr_t fd, intptr_t events) {
Log::Print("%d ", fd);
@@ -325,7 +315,6 @@ static void PrintEventMask(intptr_t fd, intptr_t events) {
}
#endif
-
intptr_t EventHandlerImplementation::GetPollEvents(intptr_t events,
DescriptorInfo* di) {
#ifdef DEBUG_POLL
@@ -348,7 +337,6 @@ intptr_t EventHandlerImplementation::GetPollEvents(intptr_t events,
return event_mask;
}
-
void EventHandlerImplementation::HandleEvents(struct epoll_event* events,
int size) {
bool interrupt_seen = false;
@@ -386,7 +374,6 @@ void EventHandlerImplementation::HandleEvents(struct epoll_event* events,
}
}
-
void EventHandlerImplementation::Poll(uword args) {
ThreadSignalBlocker signal_blocker(SIGPROF);
static const intptr_t kMaxEvents = 16;
@@ -411,7 +398,6 @@ void EventHandlerImplementation::Poll(uword args) {
handler->NotifyShutdownDone();
}
-
void EventHandlerImplementation::Start(EventHandler* handler) {
int result = Thread::Start(&EventHandlerImplementation::Poll,
reinterpret_cast<uword>(handler));
@@ -420,25 +406,21 @@ void EventHandlerImplementation::Start(EventHandler* handler) {
}
}
-
void EventHandlerImplementation::Shutdown() {
SendData(kShutdownId, 0, 0);
}
-
void EventHandlerImplementation::SendData(intptr_t id,
Dart_Port dart_port,
int64_t data) {
WakeupHandler(id, dart_port, data);
}
-
void* EventHandlerImplementation::GetHashmapKeyFromFd(intptr_t fd) {
// The hashmap does not support keys with value 0.
return reinterpret_cast<void*>(fd + 1);
}
-
uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) {
// The hashmap does not support keys with value 0.
return dart::Utils::WordHash(fd + 1);
« no previous file with comments | « runtime/bin/eventhandler_linux.h ('k') | runtime/bin/eventhandler_macos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698