summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authormbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-25 20:21:16 +0000
committermbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-25 20:21:16 +0000
commitbd635c097dfc689674d6b21c006850a7b07f23f4 (patch)
treeb9c8bdf9edc379e288c14f64e063e29efe7635c8 /chrome_frame
parent19dc5d7922dc07b61c037ebbcc86f20dad27eab2 (diff)
downloadchromium_src-bd635c097dfc689674d6b21c006850a7b07f23f4.zip
chromium_src-bd635c097dfc689674d6b21c006850a7b07f23f4.tar.gz
chromium_src-bd635c097dfc689674d6b21c006850a7b07f23f4.tar.bz2
Enable warning 4389 as an error on windows builds. This will make
windows builds more similar to linux/mac, which already treat signed/ unsigned equality comparisons as warnings (and hence errors). BUG=44471 TEST=none Review URL: http://codereview.chromium.org/2081007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48186 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/chrome_active_document.cc6
-rw-r--r--chrome_frame/chrome_frame_activex.cc10
-rw-r--r--chrome_frame/chrome_launcher.cc4
-rw-r--r--chrome_frame/function_stub_unittest.cc10
-rw-r--r--chrome_frame/html_utils.cc11
-rw-r--r--chrome_frame/test/chrome_frame_test_utils.cc2
-rw-r--r--chrome_frame/test/exception_barrier_unittest.cc6
-rw-r--r--chrome_frame/test/html_util_unittests.cc6
-rw-r--r--chrome_frame/test/perf/chrome_frame_perftest.cc6
-rw-r--r--chrome_frame/test/util_unittests.cc6
-rw-r--r--chrome_frame/urlmon_url_request.cc6
11 files changed, 37 insertions, 36 deletions
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc
index 3dab106..894564a 100644
--- a/chrome_frame/chrome_active_document.cc
+++ b/chrome_frame/chrome_active_document.cc
@@ -873,11 +873,11 @@ bool ChromeActiveDocument::HandleContextMenuCommand(UINT cmd,
ScopedComPtr<IWebBrowser2> web_browser2;
DoQueryService(SID_SWebBrowserApp, m_spClientSite, web_browser2.Receive());
- if (cmd == context_menu_IDC_BACK) {
+ if (cmd == static_cast<UINT>(context_menu_IDC_BACK)) {
web_browser2->GoBack();
- } else if (cmd == context_menu_IDC_FORWARD) {
+ } else if (cmd == static_cast<UINT>(context_menu_IDC_FORWARD)) {
web_browser2->GoForward();
- } else if (cmd == context_menu_IDC_RELOAD) {
+ } else if (cmd == static_cast<UINT>(context_menu_IDC_RELOAD)) {
web_browser2->Refresh();
} else {
return BaseActiveX::HandleContextMenuCommand(cmd, params);
diff --git a/chrome_frame/chrome_frame_activex.cc b/chrome_frame/chrome_frame_activex.cc
index fb8721d..bd6b937 100644
--- a/chrome_frame/chrome_frame_activex.cc
+++ b/chrome_frame/chrome_frame_activex.cc
@@ -128,11 +128,11 @@ HRESULT ChromeFrameActivex::FinalConstruct() {
ChromeFrameActivex::~ChromeFrameActivex() {
// We expect these to be released during a call to SetClientSite(NULL).
- DCHECK_EQ(0, onmessage_.size());
- DCHECK_EQ(0, onloaderror_.size());
- DCHECK_EQ(0, onload_.size());
- DCHECK_EQ(0, onreadystatechanged_.size());
- DCHECK_EQ(0, onextensionready_.size());
+ DCHECK_EQ(0u, onmessage_.size());
+ DCHECK_EQ(0u, onloaderror_.size());
+ DCHECK_EQ(0u, onload_.size());
+ DCHECK_EQ(0u, onreadystatechanged_.size());
+ DCHECK_EQ(0u, onextensionready_.size());
if (chrome_wndproc_hook_) {
BOOL unhook_success = ::UnhookWindowsHookEx(chrome_wndproc_hook_);
diff --git a/chrome_frame/chrome_launcher.cc b/chrome_frame/chrome_launcher.cc
index 0303b3b..34f1e9f 100644
--- a/chrome_frame/chrome_launcher.cc
+++ b/chrome_frame/chrome_launcher.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -65,7 +65,7 @@ CommandLine* CreateLaunchCommandLine() {
}
void SanitizeCommandLine(const CommandLine& original, CommandLine* sanitized) {
- int num_sanitized_switches = 0;
+ size_t num_sanitized_switches = 0;
for (int i = 0; i < arraysize(kAllowedSwitches); ++i) {
const char* current_switch = kAllowedSwitches[i];
if (original.HasSwitch(current_switch)) {
diff --git a/chrome_frame/function_stub_unittest.cc b/chrome_frame/function_stub_unittest.cc
index 4ad2c31..3f89bec 100644
--- a/chrome_frame/function_stub_unittest.cc
+++ b/chrome_frame/function_stub_unittest.cc
@@ -74,13 +74,15 @@ class FunctionStubTest: public testing::Test {
static uintptr_t CALLBACK FooCallback0(FunctionStubTest* test) {
return test->Foo0();
}
- static uintptr_t CALLBACK FooCallback1(FunctionStubTest* test, uintptr_t arg) {
+ static uintptr_t CALLBACK FooCallback1(FunctionStubTest* test,
+ uintptr_t arg) {
return test->Foo1(arg);
}
static uintptr_t CALLBACK BarCallback0(FunctionStubTest* test) {
return test->Foo0();
}
- static uintptr_t CALLBACK BarCallback1(FunctionStubTest* test, uintptr_t arg) {
+ static uintptr_t CALLBACK BarCallback1(FunctionStubTest* test,
+ uintptr_t arg) {
return test->Foo1(arg);
}
@@ -119,10 +121,10 @@ TEST_F(FunctionStubTest, Accessors) {
// Check that the stub code is executable.
MEMORY_BASIC_INFORMATION info = {};
- EXPECT_NE(0, ::VirtualQuery(stub_->code(), &info, sizeof(info)));
+ EXPECT_NE(0u, ::VirtualQuery(stub_->code(), &info, sizeof(info)));
const DWORD kExecutableMask = PAGE_EXECUTE | PAGE_EXECUTE_READ |
PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY;
- EXPECT_NE(0, info.Protect & kExecutableMask);
+ EXPECT_NE(0u, info.Protect & kExecutableMask);
EXPECT_EQ(argument, stub_->argument());
EXPECT_TRUE(stub_->bypass_address() != NULL);
diff --git a/chrome_frame/html_utils.cc b/chrome_frame/html_utils.cc
index 9395afa..8c8d6d3 100644
--- a/chrome_frame/html_utils.cc
+++ b/chrome_frame/html_utils.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -342,15 +342,13 @@ std::string GetDefaultUserAgent() {
} else if (SUCCEEDED(hr)) {
// Truncate the extra allocation.
DCHECK(size > 0); // NOLINT
- ret.resize(size - sizeof(char)); // NOLINT
+ ret.resize(size - 1); // NOLINT
}
}
if (FAILED(hr)) {
NOTREACHED() << StringPrintf("ObtainUserAgentString==0x%08X", hr);
- return "";
- } else {
- DCHECK(ret.length() == lstrlenA(ret.c_str()));
+ return std::string();
}
return ret;
@@ -362,7 +360,8 @@ bool HasFrameBustingHeader(const std::string& http_headers) {
while (it.GetNext()) {
if (lstrcmpiA(it.name().c_str(), kXFrameOptionsHeader) == 0) {
std::string allow_all(kXFrameOptionsValueAllowAll);
- if (it.values_end() - it.values_begin() != allow_all.length() ||
+ if (it.values_end() - it.values_begin() !=
+ static_cast<int>(allow_all.length()) ||
!std::equal(it.values_begin(), it.values_end(),
allow_all.begin(),
CaseInsensitiveCompareASCII<const char>())) {
diff --git a/chrome_frame/test/chrome_frame_test_utils.cc b/chrome_frame/test/chrome_frame_test_utils.cc
index 80f2786..0659c9d 100644
--- a/chrome_frame/test/chrome_frame_test_utils.cc
+++ b/chrome_frame/test/chrome_frame_test_utils.cc
@@ -775,7 +775,7 @@ HRESULT WebBrowserEventSink::SetWebBrowser(IWebBrowser2* web_browser2) {
}
HRESULT WebBrowserEventSink::CloseWebBrowser() {
- DCHECK_EQ(process_id_to_wait_for_, 0);
+ DCHECK_EQ(process_id_to_wait_for_, 0u);
if (!web_browser2_)
return E_FAIL;
diff --git a/chrome_frame/test/exception_barrier_unittest.cc b/chrome_frame/test/exception_barrier_unittest.cc
index eeffd2a..73f006a 100644
--- a/chrome_frame/test/exception_barrier_unittest.cc
+++ b/chrome_frame/test/exception_barrier_unittest.cc
@@ -29,7 +29,7 @@ void TestSEHChainSane() {
MEMORY_BASIC_INFORMATION info = { 0 };
// Note that we pass the address of the info struct just as a handy
// moniker to anything at all inside our stack allocation
- ASSERT_NE(0, ::VirtualQuery(&info, &info, sizeof(info)));
+ ASSERT_NE(0u, ::VirtualQuery(&info, &info, sizeof(info)));
// The lower bound of our stack.
// We use the address of info as a lower bound, this assumes that if this
@@ -60,9 +60,9 @@ void TestSEHChainSane() {
ASSERT_EQ(0, (reinterpret_cast<UINT_PTR>(prev) & 0x00000003));
// find the module hosting the handler
- ASSERT_NE(0, ::VirtualQuery(curr->handler, &info, sizeof(info)));
+ ASSERT_NE(0u, ::VirtualQuery(curr->handler, &info, sizeof(info)));
wchar_t module_filename[MAX_PATH];
- ASSERT_NE(0, ::GetModuleFileName(
+ ASSERT_NE(0u, ::GetModuleFileName(
reinterpret_cast<HMODULE>(info.AllocationBase),
module_filename, ARRAYSIZE(module_filename)));
}
diff --git a/chrome_frame/test/html_util_unittests.cc b/chrome_frame/test/html_util_unittests.cc
index 1188482..5539e4a 100644
--- a/chrome_frame/test/html_util_unittests.cc
+++ b/chrome_frame/test/html_util_unittests.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -292,14 +292,14 @@ TEST_F(HtmlUtilUnittest, AddChromeFrameToUserAgentValue) {
TEST_F(HtmlUtilUnittest, GetDefaultUserAgentHeaderWithCFTag) {
std::string ua(http_utils::GetDefaultUserAgentHeaderWithCFTag());
- EXPECT_NE(0, ua.length());
+ EXPECT_NE(0u, ua.length());
EXPECT_NE(std::string::npos, ua.find("Mozilla"));
EXPECT_NE(std::string::npos, ua.find(kChromeFrameUserAgent));
}
TEST_F(HtmlUtilUnittest, GetDefaultUserAgent) {
std::string ua(http_utils::GetDefaultUserAgent());
- EXPECT_NE(0, ua.length());
+ EXPECT_NE(0u, ua.length());
EXPECT_NE(std::string::npos, ua.find("Mozilla"));
}
diff --git a/chrome_frame/test/perf/chrome_frame_perftest.cc b/chrome_frame/test/perf/chrome_frame_perftest.cc
index a3d3b99..4806865 100644
--- a/chrome_frame/test/perf/chrome_frame_perftest.cc
+++ b/chrome_frame/test/perf/chrome_frame_perftest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome_frame/test/perf/chrome_frame_perftest.h"
@@ -508,7 +508,7 @@ class ChromeFrameMemoryTest : public ChromeFramePerfTestBase {
chrome_frame_memory_test_instance_->PrintResult(
"ws_final_browser", "", trace_name + "_ws_b",
working_set_size_ / 1024, "KB", false /* not important */);
- } else if (process_id_ == GetCurrentProcessId()) {
+ } else if (process_id_ == base::GetCurrentProcId()) {
chrome_frame_memory_test_instance_->PrintResult(
"vm_current_process", "", trace_name + "_vm_c",
virtual_size_ / 1024, "KB", false /* not important */);
@@ -520,7 +520,7 @@ class ChromeFrameMemoryTest : public ChromeFramePerfTestBase {
printf("\n");
}
- int process_id_;
+ base::ProcessId process_id_;
size_t virtual_size_;
size_t working_set_size_;
// Set to true if this is the chrome browser process.
diff --git a/chrome_frame/test/util_unittests.cc b/chrome_frame/test/util_unittests.cc
index 8780d3d..81bc752 100644
--- a/chrome_frame/test/util_unittests.cc
+++ b/chrome_frame/test/util_unittests.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -24,8 +24,8 @@ TEST(UtilTests, GetModuleVersionTest) {
// Use the method that doesn't go to disk
uint32 low = 0, high = 0;
EXPECT_TRUE(GetModuleVersion(mod, &high, &low));
- EXPECT_NE(high, 0);
- EXPECT_NE(low, 0);
+ EXPECT_NE(high, 0u);
+ EXPECT_NE(low, 0u);
// Make sure they give the same results.
FileVersionInfoWin* base_info_win =
diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc
index fb7e740..922a951 100644
--- a/chrome_frame/urlmon_url_request.cc
+++ b/chrome_frame/urlmon_url_request.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -119,7 +119,7 @@ bool UrlmonUrlRequest::Read(int bytes_to_read) {
DLOG(INFO) << __FUNCTION__ << me();
// Re-entrancy check. Thou shall not call Read() while process OnReadComplete!
- DCHECK_EQ(0, pending_read_size_);
+ DCHECK_EQ(0u, pending_read_size_);
if (pending_read_size_ != 0)
return false;
@@ -1136,7 +1136,7 @@ void UrlmonUrlRequestManager::OnResponseEnd(int request_id,
DLOG(INFO) << __FUNCTION__;
DCHECK(status.status() != URLRequestStatus::CANCELED);
RequestMap::size_type n = request_map_.erase(request_id);
- DCHECK_EQ(1, n);
+ DCHECK_EQ(1u, n);
++calling_delegate_;
delegate_->OnResponseEnd(request_id, status);
--calling_delegate_;