From fa9e939745d0dbd369a0e52c68c6c9410403ec92 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 22 Jul 2013 15:25:39 +0800 Subject: [PATCH] Cleanup the node bindings code. --- common/node_bindings.cc | 7 ++++--- common/node_bindings.h | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/common/node_bindings.cc b/common/node_bindings.cc index fb0c2f63e2c9..a8116026a789 100644 --- a/common/node_bindings.cc +++ b/common/node_bindings.cc @@ -5,18 +5,19 @@ #include "common/node_bindings.h" #include "base/command_line.h" -#include "base/files/file_path.h" #include "base/logging.h" #include "base/message_loop.h" -#include "base/strings/utf_string_conversions.h" #include "content/public/browser/browser_thread.h" -#include "v8/include/v8.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "vendor/node/src/node.h" #include "vendor/node/src/node_internals.h" #include "vendor/node/src/node_javascript.h" +#if defined(OS_WIN) +#include "base/strings/utf_string_conversions.h" +#endif + using content::BrowserThread; namespace atom { diff --git a/common/node_bindings.h b/common/node_bindings.h index 78d0fe9f6504..3c2d20ae2157 100644 --- a/common/node_bindings.h +++ b/common/node_bindings.h @@ -61,18 +61,6 @@ class NodeBindings { // Main thread's libuv loop. uv_loop_t* uv_loop_; - // Dummy handle to make uv's loop not quit. - uv_async_t dummy_uv_handle_; - - // Thread for polling events. - uv_thread_t embed_thread_; - - // Whether we're done. - bool embed_closed_; - - // Semaphore to wait for main loop in the embed thread. - uv_sem_t embed_sem_; - private: // Thread to poll uv events. static void EmbedThreadRunner(void *arg); @@ -80,6 +68,18 @@ class NodeBindings { // Called when uv's watcher queue changes. static void OnWatcherQueueChanged(uv_loop_t* loop); + // Whether the libuv loop has ended. + bool embed_closed_; + + // Dummy handle to make uv's loop not quit. + uv_async_t dummy_uv_handle_; + + // Thread for polling events. + uv_thread_t embed_thread_; + + // Semaphore to wait for main loop in the embed thread. + uv_sem_t embed_sem_; + DISALLOW_COPY_AND_ASSIGN(NodeBindings); };