diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-05 12:31:02 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-05 12:31:02 +0000 |
commit | 7e242b5aae22d77d2447c11041e7b01c49d133c3 (patch) | |
tree | 3015e7cac08f39c4ba66d53f4485a257ca3cd9d7 /chrome/browser | |
parent | 9193185e11c562ad867007376f71ef9cefc08b17 (diff) | |
download | chromium_src-7e242b5aae22d77d2447c11041e7b01c49d133c3.zip chromium_src-7e242b5aae22d77d2447c11041e7b01c49d133c3.tar.gz chromium_src-7e242b5aae22d77d2447c11041e7b01c49d133c3.tar.bz2 |
Usual round of porting in chrome/
- make following unit tests run and pass on Linux:
browser/cache_manager_host_unittest.cc
browser/google_url_tracker_unittest.cc
- trivial cleanups needed for GCC
- remove CacheManagerHost and ResolveProxyMsgHelper from temporary scaffolding stubs and use real implementations instead
- update chrome.xcodeproj to reflect above change
Review URL: http://codereview.chromium.org/20057
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9215 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/browser.scons | 6 | ||||
-rw-r--r-- | chrome/browser/cache_manager_host.cc | 8 | ||||
-rw-r--r-- | chrome/browser/cache_manager_host_unittest.cc | 38 | ||||
-rw-r--r-- | chrome/browser/safe_browsing/protocol_manager.cc | 5 |
4 files changed, 28 insertions, 29 deletions
diff --git a/chrome/browser/browser.scons b/chrome/browser/browser.scons index 5c4fd8b..7924f91 100644 --- a/chrome/browser/browser.scons +++ b/chrome/browser/browser.scons @@ -687,7 +687,6 @@ if not env.Bit('windows'): 'browser_shutdown.cc', 'browser_url_handler.cc', 'browsing_data_remover.cc', - 'cache_manager_host.cc', 'cert_store.cc', 'character_encoding.cc', 'chrome_plugin_host.cc', @@ -708,7 +707,6 @@ if not env.Bit('windows'): 'download/save_item.cc', 'download/save_package.cc', 'download/save_page_model.cc', - 'extensions/extension_protocols.cc', 'drag_utils.cc', 'encoding_menu_controller_delegate.cc', 'external_protocol_handler.cc', @@ -736,10 +734,8 @@ if not env.Bit('windows'): 'net/dns_global.cc', 'net/dns_master.cc', 'net/dns_slave.cc', - 'net/resolve_proxy_msg_helper.cc', 'google_update.cc', 'password_manager/encryptor.cc', - 'password_manager/ie7_password.cc', 'password_manager/password_manager.cc', 'plugin_installer.cc', 'plugin_process_host.cc', @@ -767,7 +763,6 @@ if not env.Bit('windows'): 'sessions/session_backend.cc', 'sessions/session_restore.cc', 'sessions/session_service.cc', - 'sessions/session_types.cc', 'sessions/tab_restore_service.cc', 'shell_integration.cc', 'ssl/ssl_blocking_page.cc', @@ -804,6 +799,7 @@ if not env.Bit('windows'): 'importer/firefox_profile_lock_win.cc', 'js_before_unload_handler_win.cc', 'jsmessage_box_handler_win.cc', + 'password_manager/ie7_password.cc', 'password_manager/password_form_manager_win.cc', 'renderer_host/backing_store_win.cc', 'renderer_host/render_widget_host_view_win.cc', diff --git a/chrome/browser/cache_manager_host.cc b/chrome/browser/cache_manager_host.cc index 38db812..4423184 100644 --- a/chrome/browser/cache_manager_host.cc +++ b/chrome/browser/cache_manager_host.cc @@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <algorithm> - #include "chrome/browser/cache_manager_host.h" +#include <algorithm> + +#include "base/compiler_specific.h" #include "base/sys_info.h" #include "base/time.h" #include "chrome/browser/browser_process.h" @@ -54,8 +55,7 @@ CacheManagerHost* CacheManagerHost::GetInstance() { CacheManagerHost::CacheManagerHost() : global_size_limit_(GetDefaultGlobalSizeLimit()), -#pragma warning(suppress: 4355) // Okay to pass "this" here. - revise_allocation_factory_(this) { + ALLOW_THIS_IN_INITIALIZER_LIST(revise_allocation_factory_(this)) { } CacheManagerHost::~CacheManagerHost() { diff --git a/chrome/browser/cache_manager_host_unittest.cc b/chrome/browser/cache_manager_host_unittest.cc index fe35bb3..e04c12c 100644 --- a/chrome/browser/cache_manager_host_unittest.cc +++ b/chrome/browser/cache_manager_host_unittest.cc @@ -81,7 +81,7 @@ class CacheManagerHostTest : public testing::Test { KEEP_LIVE_WITH_HEADROOM = CacheManagerHost::KEEP_LIVE_WITH_HEADROOM, KEEP_LIVE = CacheManagerHost::KEEP_LIVE, }; - + private: MessageLoop message_loop_; }; @@ -118,16 +118,16 @@ static bool operator==(const CacheManager::UsageStats& lhs, TEST_F(CacheManagerHostTest, AddRemoveRendererTest) { CacheManagerHost* h = CacheManagerHost::GetInstance(); - EXPECT_EQ(0, active_renderers(h).size()); - EXPECT_EQ(0, inactive_renderers(h).size()); + EXPECT_EQ(0U, active_renderers(h).size()); + EXPECT_EQ(0U, inactive_renderers(h).size()); h->Add(kRendererID); - EXPECT_EQ(1, active_renderers(h).count(kRendererID)); - EXPECT_EQ(0, inactive_renderers(h).count(kRendererID)); + EXPECT_EQ(1U, active_renderers(h).count(kRendererID)); + EXPECT_EQ(0U, inactive_renderers(h).count(kRendererID)); h->Remove(kRendererID); - EXPECT_EQ(0, active_renderers(h).size()); - EXPECT_EQ(0, inactive_renderers(h).size()); + EXPECT_EQ(0U, active_renderers(h).size()); + EXPECT_EQ(0U, inactive_renderers(h).size()); } TEST_F(CacheManagerHostTest, ActiveInactiveTest) { @@ -136,16 +136,16 @@ TEST_F(CacheManagerHostTest, ActiveInactiveTest) { h->Add(kRendererID); h->ObserveActivity(kRendererID); - EXPECT_EQ(1, active_renderers(h).count(kRendererID)); - EXPECT_EQ(0, inactive_renderers(h).count(kRendererID)); + EXPECT_EQ(1U, active_renderers(h).count(kRendererID)); + EXPECT_EQ(0U, inactive_renderers(h).count(kRendererID)); SimulateInactivity(h, kRendererID); - EXPECT_EQ(0, active_renderers(h).count(kRendererID)); - EXPECT_EQ(1, inactive_renderers(h).count(kRendererID)); + EXPECT_EQ(0U, active_renderers(h).count(kRendererID)); + EXPECT_EQ(1U, inactive_renderers(h).count(kRendererID)); h->ObserveActivity(kRendererID); - EXPECT_EQ(1, active_renderers(h).count(kRendererID)); - EXPECT_EQ(0, inactive_renderers(h).count(kRendererID)); + EXPECT_EQ(1U, active_renderers(h).count(kRendererID)); + EXPECT_EQ(0U, inactive_renderers(h).count(kRendererID)); h->Remove(kRendererID); } @@ -155,11 +155,11 @@ TEST_F(CacheManagerHostTest, ObserveStatsTest) { h->Add(kRendererID); - EXPECT_EQ(1, stats(h).size()); + EXPECT_EQ(1U, stats(h).size()); h->ObserveStats(kRendererID, kStats); - EXPECT_EQ(1, stats(h).size()); + EXPECT_EQ(1U, stats(h).size()); EXPECT_TRUE(kStats == stats(h)[kRendererID]); h->Remove(kRendererID); @@ -173,7 +173,7 @@ TEST_F(CacheManagerHostTest, SetGlobalSizeLimitTest) { EXPECT_EQ(limit, h->global_size_limit()); h->SetGlobalSizeLimit(0); - EXPECT_EQ(0, h->global_size_limit()); + EXPECT_EQ(0U, h->global_size_limit()); } TEST_F(CacheManagerHostTest, GatherStatsTest) { @@ -210,7 +210,7 @@ TEST_F(CacheManagerHostTest, GatherStatsTest) { } TEST_F(CacheManagerHostTest, GetSizeTest) { - EXPECT_EQ(0, GetSize(DIVIDE_EVENLY, kStats)); + EXPECT_EQ(0U, GetSize(DIVIDE_EVENLY, kStats)); EXPECT_LT(256 * 1024u + 512, GetSize(KEEP_CURRENT_WITH_HEADROOM, kStats)); EXPECT_EQ(256 * 1024u + 512, GetSize(KEEP_CURRENT, kStats)); EXPECT_LT(256 * 1024u, GetSize(KEEP_LIVE_WITH_HEADROOM, kStats)); @@ -248,7 +248,7 @@ TEST_F(CacheManagerHostTest, AttemptTacticTest) { KEEP_LIVE, kStats2, &strategy)); - EXPECT_EQ(2, strategy.size()); + EXPECT_EQ(2U, strategy.size()); AllocationStrategy::iterator iter = strategy.begin(); while (iter != strategy.end()) { @@ -287,7 +287,7 @@ TEST_F(CacheManagerHostTest, AddToStrategyTest) { kExtraBytesToAllocate, &strategy); - EXPECT_EQ(2, strategy.size()); + EXPECT_EQ(2U, strategy.size()); size_t total_bytes = 0; AllocationStrategy::iterator iter = strategy.begin(); diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc index 5086e22..df83f8e 100644 --- a/chrome/browser/safe_browsing/protocol_manager.cc +++ b/chrome/browser/safe_browsing/protocol_manager.cc @@ -243,6 +243,9 @@ void SafeBrowsingProtocolManager::OnURLFetchComplete( UpdateFinished(true); } break; + default: + NOTREACHED(); + break; } } else if (response_code >= 300) { @@ -590,4 +593,4 @@ void SafeBrowsingProtocolManager::UpdateFinished(bool success) { UMA_HISTOGRAM_COUNTS(L"SB2.UpdateSize", update_size_); update_size_ = 0; sb_service_->UpdateFinished(success); -}
\ No newline at end of file +} |