]> khamidou — GitHub mirrors - electron.git/commitdiff
Make all the windows code compile for Chrome 31.
authorCheng Zhao <zcbenz@gmail.com>
Tue, 17 Dec 2013 06:01:40 +0000 (14:01 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 17 Dec 2013 09:52:57 +0000 (17:52 +0800)
13 files changed:
app/atom_main_delegate.cc
browser/api/atom_api_auto_updater.cc
browser/api/atom_api_window.cc
browser/ui/file_dialog_win.cc
browser/ui/message_box_win.cc
browser/ui/win/native_menu_win.cc
common.gypi
common/crash_reporter/crash_reporter_win.cc
common/crash_reporter/win/crash_service.cc
common/crash_reporter/win/crash_service_main.cc
common/node_bindings.cc
common/node_bindings_win.cc
common/platform_util_win.cc

index 47718e22baa3626f11eb577d93a0ce55ec38c015..705d91c14a3461985b3680655c10a1235aa0e8ea 100644 (file)
@@ -23,17 +23,20 @@ AtomMainDelegate::~AtomMainDelegate() {
 bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
   // Disable logging out to debug.log on Windows
 #if defined(OS_WIN)
-  logging::InitLogging(
-      L"debug.log",
+  logging::LoggingSettings settings;
 #if defined(DEBUG)
-      logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG ,
+  settings.logging_dest = logging::LOG_TO_ALL;
+  settings.log_file = L"debug.log";
+  settings.lock_log = logging::LOCK_LOG_FILE;
+  settings.delete_old = logging::DELETE_OLD_LOG_FILE;
 #else
-      logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG,
-#endif  // defined(NDEBUG)
-      logging::LOCK_LOG_FILE,
-      logging::DELETE_OLD_LOG_FILE,
-      logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS);
-  logging::SetLogItems(true, false, true, false);
+  settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
+#endif
+  settings.dcheck_state =
+      logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS;
+  logging::InitLogging(settings);
+  // Logging with pid, tid and timestamp.
+  logging::SetLogItems(true, true, true, false);
 #endif  // defined(OS_WIN)
 
   return brightray::MainDelegate::BasicStartupComplete(exit_code);
index 70fa172966994b1859f35b3a7b7545e5a2b683df..bfb55252e3f9df7ccbb402019c78ba81210a5d72 100644 (file)
@@ -8,10 +8,7 @@
 #include "browser/auto_updater.h"
 #include "common/v8/native_type_conversions.h"
 
-#undef CHECK
-#undef DISALLOW_COPY_AND_ASSIGN
-#include "vendor/node/src/node.h"
-#include "vendor/node/src/node_internals.h"
+#include "common/v8/node_common.h"
 
 namespace atom {
 
index 59c54fbcb3b0a8d6beb515815170b3878eb13670..b2faf6b4a7ea8a352961ceac2d8a8c70e5249769 100644 (file)
@@ -12,9 +12,9 @@
 #include "content/public/browser/render_process_host.h"
 #include "ui/gfx/point.h"
 #include "ui/gfx/size.h"
-#include "vendor/node/src/node_buffer.h"
 
 #include "common/v8/node_common.h"
+#include "vendor/node/src/node_buffer.h"
 
 using content::NavigationController;
 using node::ObjectWrap;
index fa5f6912d02f2f9b5baffb941d66bf2347d75936..1f806dd5380f18affa5c3798ceaa7baa75c081ed 100644 (file)
@@ -11,9 +11,9 @@
 
 #include "base/file_util.h"
 #include "base/i18n/case_conversion.h"
-#include "base/string_util.h"
+#include "base/strings/string_util.h"
 #include "base/strings/string_split.h"
-#include "base/utf_string_conversions.h"
+#include "base/strings/utf_string_conversions.h"
 #include "base/win/registry.h"
 #include "browser/native_window.h"
 #include "third_party/wtl/include/atlapp.h"
index 68267c6ddb9d72d731cf0e5108b804e74ff7a88a..d7714931174a375a58d47ba5dbc1928b3ba28d4b 100644 (file)
@@ -5,10 +5,10 @@
 #include "browser/ui/message_box.h"
 
 #include "base/callback.h"
-#include "base/message_loop.h"
+#include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
-#include "base/string_util.h"
-#include "base/utf_string_conversions.h"
+#include "base/strings/string_util.h"
+#include "base/strings/utf_string_conversions.h"
 #include "browser/native_window.h"
 #include "skia/ext/skia_utils_win.h"
 #include "ui/views/controls/button/label_button.h"
index 5a9bf640dcfd0b3341df025033be483e9b21b355..9ed6b8306402cbf8b47853415ef8b3bff54212e6 100644 (file)
@@ -8,22 +8,22 @@
 
 #include "base/bind.h"
 #include "base/logging.h"
-#include "base/message_loop.h"
+#include "base/message_loop/message_loop.h"
 #include "base/stl_util.h"
-#include "base/string_util.h"
+#include "base/strings/string_util.h"
 #include "base/win/wrapped_window_proc.h"
 #include "browser/ui/win/menu_2.h"
 #include "ui/base/accelerators/accelerator.h"
-#include "ui/base/keycodes/keyboard_codes.h"
+#include "ui/events/keycodes/keyboard_codes.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/l10n/l10n_util_win.h"
 #include "ui/base/models/menu_model.h"
-#include "ui/base/win/hwnd_util.h"
 #include "ui/gfx/canvas.h"
 #include "ui/gfx/font.h"
 #include "ui/gfx/image/image.h"
 #include "ui/gfx/image/image_skia.h"
 #include "ui/gfx/rect.h"
+#include "ui/gfx/win/hwnd_util.h"
 #include "ui/native_theme/native_theme.h"
 #include "ui/native_theme/native_theme_win.h"
 #include "ui/views/controls/menu/menu_config.h"
@@ -84,8 +84,8 @@ class NativeMenuWin::MenuHostWindow {
     RegisterClass();
     hwnd_ = CreateWindowEx(l10n_util::GetExtendedStyles(), kWindowClassName,
                            L"", 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL);
-    ui::CheckWindowCreated(hwnd_);
-    ui::SetWindowUserData(hwnd_, this);
+    gfx::CheckWindowCreated(hwnd_);
+    gfx::SetWindowUserData(hwnd_, this);
   }
 
   ~MenuHostWindow() {
@@ -353,7 +353,7 @@ class NativeMenuWin::MenuHostWindow {
                                              WPARAM w_param,
                                              LPARAM l_param) {
     MenuHostWindow* host =
-        reinterpret_cast<MenuHostWindow*>(ui::GetWindowUserData(window));
+        reinterpret_cast<MenuHostWindow*>(gfx::GetWindowUserData(window));
     // host is null during initial construction.
     LRESULT l_result = 0;
     if (!host || !host->ProcessWindowMessage(window, message, w_param, l_param,
index 5975647d2724d63e9874ce840bb49cdc2692262c..36aa9f7aee31e2126404df0b126294f6bffcb1e1 100644 (file)
@@ -43,6 +43,7 @@
           4189,  #
           4131,  # uses old-style declarator
           4133,  # incompatible types
+          4146,  # unary minus operator applied to unsigned type, result still unsigned
           4152,  # function/data pointer conversion in expression
           4206,  # translation unit is empty
           4204,  # non-constant aggregate initializer
@@ -53,6 +54,7 @@
           4505,  # unreferenced local function has been removed
           4701,  # potentially uninitialized local variable 'sizew' used
           4706,  # assignment within conditional expression
+          4804,  #  unsafe use of type 'bool' in operation
           4996,  #
         ],
         'msvs_settings': {
index e62986b0800d601df59626373c08e24cea4d8c8d..2403b3b90bee45b273e2c98546f263a32dfe32de 100644 (file)
@@ -7,8 +7,8 @@
 #include "base/file_util.h"
 #include "base/logging.h"
 #include "base/memory/singleton.h"
-#include "base/string_util.h"
-#include "base/utf_string_conversions.h"
+#include "base/strings/string_util.h"
+#include "base/strings/utf_string_conversions.h"
 
 namespace crash_reporter {
 
index 3cbbf33242fd9df78e847e3edb2c66e34f55ea64..0a16dc96a0f170ce5ab367870fde996390d41d4e 100644 (file)
@@ -350,7 +350,7 @@ void CrashService::OnClientDumpRequest(void* context,
     file_util::CreateDirectoryW(alternate_dump_location);
     alternate_dump_location = alternate_dump_location.Append(
         dump_location.BaseName());
-    file_util::Move(dump_location, alternate_dump_location);
+    base::Move(dump_location, alternate_dump_location);
     dump_location = alternate_dump_location;
   }
 
index 649f35847480b63d9c06a9a19dcc62d1af2f9a5e..b62fd538f2c25c581c94d78b441ba132f2204fed 100644 (file)
@@ -8,7 +8,7 @@
 #include "base/command_line.h"
 #include "base/file_util.h"
 #include "base/logging.h"
-#include "base/string_util.h"
+#include "base/strings/string_util.h"
 #include "common/crash_reporter/win/crash_service.h"
 
 namespace crash_service {
@@ -26,7 +26,7 @@ bool GetCrashServiceDirectory(const std::wstring& application_name,
   if (!file_util::GetTempDir(&temp_dir))
     return false;
   temp_dir = temp_dir.Append(application_name + L" Crashes");
-  if (!file_util::PathExists(temp_dir)) {
+  if (!base::PathExists(temp_dir)) {
     if (!file_util::CreateDirectory(temp_dir))
       return false;
   }
@@ -56,14 +56,14 @@ int Main(const wchar_t* cmd) {
   GetCrashServiceDirectory(application_name, &operating_dir);
   base::FilePath log_file = operating_dir.Append(kStandardLogFile);
 
-  // Logging out to a file.
-  logging::InitLogging(
-      log_file.value().c_str(),
-      logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG ,
-      logging::LOCK_LOG_FILE,
-      logging::DELETE_OLD_LOG_FILE,
-      logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS);
-  logging::SetLogItems(true, false, true, false);
+  // Logging to stderr (to help with debugging failures on the
+  // buildbots) and to a file.
+  logging::LoggingSettings settings;
+  settings.logging_dest = logging::LOG_TO_ALL;
+  settings.log_file = log_file.value().c_str();
+  logging::InitLogging(settings);
+  // Logging with pid, tid and timestamp.
+  logging::SetLogItems(true, true, true, false);
 
   VLOG(1) << "Session start. cmdline is [" << cmd << "]";
 
index 98cca1829b3ce793a1e357a1aad241ad7b0ff357..14e6b03b9dedd258b4eefd81b545913aaf6d9e6a 100644 (file)
@@ -110,7 +110,7 @@ node::Environment* NodeBindings::CreateEnvironment(
 #endif
 
   // Feed node the path to initialization script.
-  base::FilePath exec_path(args[0]);
+  base::FilePath exec_path(CommandLine::ForCurrentProcess()->argv()[0]);
   PathService::Get(base::FILE_EXE, &exec_path);
   base::FilePath resources_path =
 #if defined(OS_MACOSX)
@@ -118,7 +118,7 @@ node::Environment* NodeBindings::CreateEnvironment(
                     exec_path.DirName().DirName().DirName().DirName().DirName()
                              .Append("Resources");
 #else
-      exec_path.DirName().Append("resources");
+      exec_path.DirName().AppendASCII("resources");
 #endif
   base::FilePath script_path =
       resources_path.AppendASCII(is_browser_ ? "browser" : "renderer")
index f9177d78fe3b7136eced7a593e84cad32e1b0858..15f5b32c268352ea5a2842ff0e220b6da3d456bb 100644 (file)
@@ -9,7 +9,6 @@
 #include "base/logging.h"
 
 extern "C" {
-#include "vendor/node/deps/uv/include/uv-private/ngx-queue.h"
 #include "vendor/node/deps/uv/src/win/internal.h"
 }
 
@@ -32,7 +31,7 @@ void NodeBindingsWin::PollEvents() {
                uv_loop_->endgame_handles == NULL &&
                !uv_loop_->stop_flag &&
                (uv_loop_->active_handles > 0 ||
-                !ngx_queue_empty(&uv_loop_->active_reqs));
+                !QUEUE_EMPTY(&uv_loop_->active_reqs));
 
   // When there is no other types of events, we block on the IOCP.
   if (block) {
index e00655796917473fc7bbf5534417ff7ca9e85065..076167540c6c37a09910b9e093f63175066cdb3e 100644 (file)
 #include "base/bind_helpers.h"
 #include "base/files/file_path.h"
 #include "base/logging.h"
-#include "base/string_util.h"
-#include "base/utf_string_conversions.h"
+#include "base/strings/string_util.h"
+#include "base/strings/utf_string_conversions.h"
 #include "base/win/registry.h"
 #include "base/win/scoped_co_mem.h"
 #include "base/win/scoped_comptr.h"
 #include "base/win/windows_version.h"
-#include "googleurl/src/gurl.h"
+#include "url/gurl.h"
 #include "ui/base/win/shell.h"
 
 namespace {