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

Unified Diff: runtime/bin/eventhandler_android.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_android.h ('k') | runtime/bin/eventhandler_fuchsia.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/eventhandler_android.cc
diff --git a/runtime/bin/eventhandler_android.cc b/runtime/bin/eventhandler_android.cc
index b1a424f2f9359c10edd7f47bc1f28d6b62cf8fe5..29eb1b289465e3c38aab3716e8aaf2812ca680ea 100644
--- a/runtime/bin/eventhandler_android.cc
+++ b/runtime/bin/eventhandler_android.cc
@@ -21,8 +21,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 "bin/utils.h"
@@ -50,14 +50,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();
@@ -78,7 +76,6 @@ static void AddToEpollInstance(intptr_t epoll_fd_, DescriptorInfo* di) {
}
}
-
EventHandlerImplementation::EventHandlerImplementation()
: socket_map_(&HashMap::SamePointerValue, 16) {
intptr_t result;
@@ -117,14 +114,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_));
@@ -132,7 +127,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();
@@ -147,7 +141,6 @@ void EventHandlerImplementation::UpdateEpollInstance(intptr_t old_mask,
}
}
-
DescriptorInfo* EventHandlerImplementation::GetDescriptorInfo(
intptr_t fd,
bool is_listening) {
@@ -170,7 +163,6 @@ DescriptorInfo* EventHandlerImplementation::GetDescriptorInfo(
return di;
}
-
void EventHandlerImplementation::WakeupHandler(intptr_t id,
Dart_Port dart_port,
int64_t data) {
@@ -192,7 +184,6 @@ void EventHandlerImplementation::WakeupHandler(intptr_t id,
}
}
-
void EventHandlerImplementation::HandleInterruptFd() {
const intptr_t MAX_MESSAGES = kInterruptMessageSize;
InterruptMessage msg[MAX_MESSAGES];
@@ -276,7 +267,6 @@ void EventHandlerImplementation::HandleInterruptFd() {
}
}
-
#ifdef DEBUG_POLL
static void PrintEventMask(intptr_t fd, intptr_t events) {
Log::Print("%d ", fd);
@@ -309,7 +299,6 @@ static void PrintEventMask(intptr_t fd, intptr_t events) {
}
#endif
-
intptr_t EventHandlerImplementation::GetPollEvents(intptr_t events,
DescriptorInfo* di) {
#ifdef DEBUG_POLL
@@ -332,7 +321,6 @@ intptr_t EventHandlerImplementation::GetPollEvents(intptr_t events,
return event_mask;
}
-
void EventHandlerImplementation::HandleEvents(struct epoll_event* events,
int size) {
bool interrupt_seen = false;
@@ -362,7 +350,6 @@ void EventHandlerImplementation::HandleEvents(struct epoll_event* events,
}
}
-
int64_t EventHandlerImplementation::GetTimeout() {
if (!timeout_queue_.HasTimeout()) {
return kInfinityTimeout;
@@ -372,7 +359,6 @@ int64_t EventHandlerImplementation::GetTimeout() {
return (millis < 0) ? 0 : millis;
}
-
void EventHandlerImplementation::HandleTimeout() {
if (timeout_queue_.HasTimeout()) {
int64_t millis = timeout_queue_.CurrentTimeout() -
@@ -384,7 +370,6 @@ void EventHandlerImplementation::HandleTimeout() {
}
}
-
void EventHandlerImplementation::Poll(uword args) {
ThreadSignalBlocker signal_blocker(SIGPROF);
static const intptr_t kMaxEvents = 16;
@@ -415,7 +400,6 @@ void EventHandlerImplementation::Poll(uword args) {
handler->NotifyShutdownDone();
}
-
void EventHandlerImplementation::Start(EventHandler* handler) {
int result = Thread::Start(&EventHandlerImplementation::Poll,
reinterpret_cast<uword>(handler));
@@ -424,25 +408,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_android.h ('k') | runtime/bin/eventhandler_fuchsia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698