Make all the windows code compile for Chrome 31.

This commit is contained in:
Cheng Zhao 2013-12-17 14:01:40 +08:00
parent 6e079d8bc4
commit 0215c2fbee
13 changed files with 47 additions and 46 deletions

View file

@ -23,17 +23,20 @@ AtomMainDelegate::~AtomMainDelegate() {
bool AtomMainDelegate::BasicStartupComplete(int* exit_code) { bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
// Disable logging out to debug.log on Windows // Disable logging out to debug.log on Windows
#if defined(OS_WIN) #if defined(OS_WIN)
logging::InitLogging( logging::LoggingSettings settings;
L"debug.log",
#if defined(DEBUG) #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 #else
logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
#endif // defined(NDEBUG) #endif
logging::LOCK_LOG_FILE, settings.dcheck_state =
logging::DELETE_OLD_LOG_FILE, logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS;
logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); logging::InitLogging(settings);
logging::SetLogItems(true, false, true, false); // Logging with pid, tid and timestamp.
logging::SetLogItems(true, true, true, false);
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
return brightray::MainDelegate::BasicStartupComplete(exit_code); return brightray::MainDelegate::BasicStartupComplete(exit_code);

View file

@ -8,10 +8,7 @@
#include "browser/auto_updater.h" #include "browser/auto_updater.h"
#include "common/v8/native_type_conversions.h" #include "common/v8/native_type_conversions.h"
#undef CHECK #include "common/v8/node_common.h"
#undef DISALLOW_COPY_AND_ASSIGN
#include "vendor/node/src/node.h"
#include "vendor/node/src/node_internals.h"
namespace atom { namespace atom {

View file

@ -12,9 +12,9 @@
#include "content/public/browser/render_process_host.h" #include "content/public/browser/render_process_host.h"
#include "ui/gfx/point.h" #include "ui/gfx/point.h"
#include "ui/gfx/size.h" #include "ui/gfx/size.h"
#include "vendor/node/src/node_buffer.h"
#include "common/v8/node_common.h" #include "common/v8/node_common.h"
#include "vendor/node/src/node_buffer.h"
using content::NavigationController; using content::NavigationController;
using node::ObjectWrap; using node::ObjectWrap;

View file

@ -11,9 +11,9 @@
#include "base/file_util.h" #include "base/file_util.h"
#include "base/i18n/case_conversion.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/strings/string_split.h"
#include "base/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/win/registry.h" #include "base/win/registry.h"
#include "browser/native_window.h" #include "browser/native_window.h"
#include "third_party/wtl/include/atlapp.h" #include "third_party/wtl/include/atlapp.h"

View file

@ -5,10 +5,10 @@
#include "browser/ui/message_box.h" #include "browser/ui/message_box.h"
#include "base/callback.h" #include "base/callback.h"
#include "base/message_loop.h" #include "base/message_loop/message_loop.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/string_util.h" #include "base/strings/string_util.h"
#include "base/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "browser/native_window.h" #include "browser/native_window.h"
#include "skia/ext/skia_utils_win.h" #include "skia/ext/skia_utils_win.h"
#include "ui/views/controls/button/label_button.h" #include "ui/views/controls/button/label_button.h"

View file

@ -8,22 +8,22 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/message_loop.h" #include "base/message_loop/message_loop.h"
#include "base/stl_util.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 "base/win/wrapped_window_proc.h"
#include "browser/ui/win/menu_2.h" #include "browser/ui/win/menu_2.h"
#include "ui/base/accelerators/accelerator.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.h"
#include "ui/base/l10n/l10n_util_win.h" #include "ui/base/l10n/l10n_util_win.h"
#include "ui/base/models/menu_model.h" #include "ui/base/models/menu_model.h"
#include "ui/base/win/hwnd_util.h"
#include "ui/gfx/canvas.h" #include "ui/gfx/canvas.h"
#include "ui/gfx/font.h" #include "ui/gfx/font.h"
#include "ui/gfx/image/image.h" #include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia.h" #include "ui/gfx/image/image_skia.h"
#include "ui/gfx/rect.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.h"
#include "ui/native_theme/native_theme_win.h" #include "ui/native_theme/native_theme_win.h"
#include "ui/views/controls/menu/menu_config.h" #include "ui/views/controls/menu/menu_config.h"
@ -84,8 +84,8 @@ class NativeMenuWin::MenuHostWindow {
RegisterClass(); RegisterClass();
hwnd_ = CreateWindowEx(l10n_util::GetExtendedStyles(), kWindowClassName, hwnd_ = CreateWindowEx(l10n_util::GetExtendedStyles(), kWindowClassName,
L"", 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL); L"", 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL);
ui::CheckWindowCreated(hwnd_); gfx::CheckWindowCreated(hwnd_);
ui::SetWindowUserData(hwnd_, this); gfx::SetWindowUserData(hwnd_, this);
} }
~MenuHostWindow() { ~MenuHostWindow() {
@ -353,7 +353,7 @@ class NativeMenuWin::MenuHostWindow {
WPARAM w_param, WPARAM w_param,
LPARAM l_param) { LPARAM l_param) {
MenuHostWindow* host = MenuHostWindow* host =
reinterpret_cast<MenuHostWindow*>(ui::GetWindowUserData(window)); reinterpret_cast<MenuHostWindow*>(gfx::GetWindowUserData(window));
// host is null during initial construction. // host is null during initial construction.
LRESULT l_result = 0; LRESULT l_result = 0;
if (!host || !host->ProcessWindowMessage(window, message, w_param, l_param, if (!host || !host->ProcessWindowMessage(window, message, w_param, l_param,

View file

@ -43,6 +43,7 @@
4189, # 4189, #
4131, # uses old-style declarator 4131, # uses old-style declarator
4133, # incompatible types 4133, # incompatible types
4146, # unary minus operator applied to unsigned type, result still unsigned
4152, # function/data pointer conversion in expression 4152, # function/data pointer conversion in expression
4206, # translation unit is empty 4206, # translation unit is empty
4204, # non-constant aggregate initializer 4204, # non-constant aggregate initializer
@ -53,6 +54,7 @@
4505, # unreferenced local function has been removed 4505, # unreferenced local function has been removed
4701, # potentially uninitialized local variable 'sizew' used 4701, # potentially uninitialized local variable 'sizew' used
4706, # assignment within conditional expression 4706, # assignment within conditional expression
4804, # unsafe use of type 'bool' in operation
4996, # 4996, #
], ],
'msvs_settings': { 'msvs_settings': {

View file

@ -7,8 +7,8 @@
#include "base/file_util.h" #include "base/file_util.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/singleton.h" #include "base/memory/singleton.h"
#include "base/string_util.h" #include "base/strings/string_util.h"
#include "base/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
namespace crash_reporter { namespace crash_reporter {

View file

@ -350,7 +350,7 @@ void CrashService::OnClientDumpRequest(void* context,
file_util::CreateDirectoryW(alternate_dump_location); file_util::CreateDirectoryW(alternate_dump_location);
alternate_dump_location = alternate_dump_location.Append( alternate_dump_location = alternate_dump_location.Append(
dump_location.BaseName()); dump_location.BaseName());
file_util::Move(dump_location, alternate_dump_location); base::Move(dump_location, alternate_dump_location);
dump_location = alternate_dump_location; dump_location = alternate_dump_location;
} }

View file

@ -8,7 +8,7 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/file_util.h" #include "base/file_util.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/string_util.h" #include "base/strings/string_util.h"
#include "common/crash_reporter/win/crash_service.h" #include "common/crash_reporter/win/crash_service.h"
namespace crash_service { namespace crash_service {
@ -26,7 +26,7 @@ bool GetCrashServiceDirectory(const std::wstring& application_name,
if (!file_util::GetTempDir(&temp_dir)) if (!file_util::GetTempDir(&temp_dir))
return false; return false;
temp_dir = temp_dir.Append(application_name + L" Crashes"); 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)) if (!file_util::CreateDirectory(temp_dir))
return false; return false;
} }
@ -56,14 +56,14 @@ int Main(const wchar_t* cmd) {
GetCrashServiceDirectory(application_name, &operating_dir); GetCrashServiceDirectory(application_name, &operating_dir);
base::FilePath log_file = operating_dir.Append(kStandardLogFile); base::FilePath log_file = operating_dir.Append(kStandardLogFile);
// Logging out to a file. // Logging to stderr (to help with debugging failures on the
logging::InitLogging( // buildbots) and to a file.
log_file.value().c_str(), logging::LoggingSettings settings;
logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG , settings.logging_dest = logging::LOG_TO_ALL;
logging::LOCK_LOG_FILE, settings.log_file = log_file.value().c_str();
logging::DELETE_OLD_LOG_FILE, logging::InitLogging(settings);
logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); // Logging with pid, tid and timestamp.
logging::SetLogItems(true, false, true, false); logging::SetLogItems(true, true, true, false);
VLOG(1) << "Session start. cmdline is [" << cmd << "]"; VLOG(1) << "Session start. cmdline is [" << cmd << "]";

View file

@ -110,7 +110,7 @@ node::Environment* NodeBindings::CreateEnvironment(
#endif #endif
// Feed node the path to initialization script. // 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); PathService::Get(base::FILE_EXE, &exec_path);
base::FilePath resources_path = base::FilePath resources_path =
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
@ -118,7 +118,7 @@ node::Environment* NodeBindings::CreateEnvironment(
exec_path.DirName().DirName().DirName().DirName().DirName() exec_path.DirName().DirName().DirName().DirName().DirName()
.Append("Resources"); .Append("Resources");
#else #else
exec_path.DirName().Append("resources"); exec_path.DirName().AppendASCII("resources");
#endif #endif
base::FilePath script_path = base::FilePath script_path =
resources_path.AppendASCII(is_browser_ ? "browser" : "renderer") resources_path.AppendASCII(is_browser_ ? "browser" : "renderer")

View file

@ -9,7 +9,6 @@
#include "base/logging.h" #include "base/logging.h"
extern "C" { extern "C" {
#include "vendor/node/deps/uv/include/uv-private/ngx-queue.h"
#include "vendor/node/deps/uv/src/win/internal.h" #include "vendor/node/deps/uv/src/win/internal.h"
} }
@ -32,7 +31,7 @@ void NodeBindingsWin::PollEvents() {
uv_loop_->endgame_handles == NULL && uv_loop_->endgame_handles == NULL &&
!uv_loop_->stop_flag && !uv_loop_->stop_flag &&
(uv_loop_->active_handles > 0 || (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. // When there is no other types of events, we block on the IOCP.
if (block) { if (block) {

View file

@ -14,13 +14,13 @@
#include "base/bind_helpers.h" #include "base/bind_helpers.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/string_util.h" #include "base/strings/string_util.h"
#include "base/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/win/registry.h" #include "base/win/registry.h"
#include "base/win/scoped_co_mem.h" #include "base/win/scoped_co_mem.h"
#include "base/win/scoped_comptr.h" #include "base/win/scoped_comptr.h"
#include "base/win/windows_version.h" #include "base/win/windows_version.h"
#include "googleurl/src/gurl.h" #include "url/gurl.h"
#include "ui/base/win/shell.h" #include "ui/base/win/shell.h"
namespace { namespace {