diff options
| author | avi <avi@chromium.org> | 2015-12-25 18:18:31 -0800 |
|---|---|---|
| committer | Commit bot <commit-bot@chromium.org> | 2015-12-26 02:19:43 +0000 |
| commit | 664c07b4a56436648cc9339c18d3bd27ae220964 (patch) | |
| tree | fc307cecfc6ec1b9d18a154f8d218c1c473e9ef6 | |
| parent | b896c715dd14ec1f7ac800350b40eeb6de2ba868 (diff) | |
| download | chromium_src-664c07b4a56436648cc9339c18d3bd27ae220964.zip chromium_src-664c07b4a56436648cc9339c18d3bd27ae220964.tar.gz chromium_src-664c07b4a56436648cc9339c18d3bd27ae220964.tar.bz2 | |
Switch to standard integer types in chrome/browser/, part 4 of 4.
BUG=138542
TBR=thakis@chromium.org
NOPRESUBMIT=true
Review URL: https://codereview.chromium.org/1545223002
Cr-Commit-Position: refs/heads/master@{#366884}
579 files changed, 2088 insertions, 1231 deletions
diff --git a/chrome/browser/shell_integration.cc b/chrome/browser/shell_integration.cc index c1f8346..8c519c5 100644 --- a/chrome/browser/shell_integration.cc +++ b/chrome/browser/shell_integration.cc @@ -14,6 +14,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/threading/thread_restrictions.h" #include "base/timer/timer.h" +#include "build/build_config.h" #include "chrome/browser/policy/policy_path_parser.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" diff --git a/chrome/browser/shell_integration.h b/chrome/browser/shell_integration.h index 39d477c..b9a5bb3 100644 --- a/chrome/browser/shell_integration.h +++ b/chrome/browser/shell_integration.h @@ -7,11 +7,12 @@ #include <string> -#include "base/basictypes.h" #include "base/files/file_path.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/strings/string16.h" #include "base/time/time.h" +#include "build/build_config.h" #include "ui/gfx/image/image_family.h" #include "url/gurl.h" diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc index e10795d..c521d292 100644 --- a/chrome/browser/shell_integration_linux.cc +++ b/chrome/browser/shell_integration_linux.cc @@ -5,6 +5,7 @@ #include "chrome/browser/shell_integration_linux.h" #include <fcntl.h> +#include <stddef.h> #if defined(USE_GLIB) #include <glib.h> diff --git a/chrome/browser/shell_integration_linux.h b/chrome/browser/shell_integration_linux.h index 9899c3e..c91bac2 100644 --- a/chrome/browser/shell_integration_linux.h +++ b/chrome/browser/shell_integration_linux.h @@ -7,7 +7,6 @@ #include <string> -#include "base/basictypes.h" #include "base/files/file_path.h" #include "chrome/browser/web_applications/web_app.h" #include "url/gurl.h" diff --git a/chrome/browser/shell_integration_linux_unittest.cc b/chrome/browser/shell_integration_linux_unittest.cc index d99a8c8..96a18a0 100644 --- a/chrome/browser/shell_integration_linux_unittest.cc +++ b/chrome/browser/shell_integration_linux_unittest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/shell_integration_linux.h" +#include <stddef.h> + #include <algorithm> #include <cstdlib> #include <map> @@ -15,6 +17,7 @@ #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" +#include "base/macros.h" #include "base/message_loop/message_loop.h" #include "base/stl_util.h" #include "base/strings/string_util.h" diff --git a/chrome/browser/shell_integration_win.cc b/chrome/browser/shell_integration_win.cc index 6ed09cf..a3b8529 100644 --- a/chrome/browser/shell_integration_win.cc +++ b/chrome/browser/shell_integration_win.cc @@ -8,11 +8,14 @@ #include <shlwapi.h> #include <shobjidl.h> #include <propkey.h> // Needs to come after shobjidl.h. +#include <stddef.h> +#include <stdint.h> #include "base/bind.h" #include "base/command_line.h" #include "base/files/file_enumerator.h" #include "base/files/file_util.h" +#include "base/macros.h" #include "base/message_loop/message_loop.h" #include "base/metrics/histogram_macros.h" #include "base/path_service.h" @@ -469,7 +472,7 @@ void ShellIntegration::MigrateChromiumShortcuts() { // This needs to happen eventually (e.g. so that the appid is fixed and the // run-time Chrome icon is merged with the taskbar shortcut), but this is not // urgent and shouldn't delay Chrome startup. - static const int64 kMigrateChromiumShortcutsDelaySeconds = 15; + static const int64_t kMigrateChromiumShortcutsDelaySeconds = 15; BrowserThread::PostDelayedTask( BrowserThread::FILE, FROM_HERE, base::Bind(&MigrateChromiumShortcutsCallback), diff --git a/chrome/browser/shell_integration_win_unittest.cc b/chrome/browser/shell_integration_win_unittest.cc index 4bf9893..e6ec360 100644 --- a/chrome/browser/shell_integration_win_unittest.cc +++ b/chrome/browser/shell_integration_win_unittest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/shell_integration.h" +#include <stddef.h> + #include <vector> #include "base/files/file_path.h" diff --git a/chrome/browser/signin/account_fetcher_service_factory.h b/chrome/browser/signin/account_fetcher_service_factory.h index ac4bc83..6540954 100644 --- a/chrome/browser/signin/account_fetcher_service_factory.h +++ b/chrome/browser/signin/account_fetcher_service_factory.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SIGNIN_ACCOUNT_FETCHER_SERVICE_FACTORY_H_ #define CHROME_BROWSER_SIGNIN_ACCOUNT_FETCHER_SERVICE_FACTORY_H_ +#include "base/macros.h" #include "base/memory/singleton.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" diff --git a/chrome/browser/signin/account_reconcilor_unittest.cc b/chrome/browser/signin/account_reconcilor_unittest.cc index 8e600ab..ec0baeb 100644 --- a/chrome/browser/signin/account_reconcilor_unittest.cc +++ b/chrome/browser/signin/account_reconcilor_unittest.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/command_line.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" diff --git a/chrome/browser/signin/account_tracker_service_factory.h b/chrome/browser/signin/account_tracker_service_factory.h index dad1a60..d1dd810 100644 --- a/chrome/browser/signin/account_tracker_service_factory.h +++ b/chrome/browser/signin/account_tracker_service_factory.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SIGNIN_ACCOUNT_TRACKER_SERVICE_FACTORY_H_ #define CHROME_BROWSER_SIGNIN_ACCOUNT_TRACKER_SERVICE_FACTORY_H_ +#include "base/macros.h" #include "base/memory/singleton.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" diff --git a/chrome/browser/signin/chrome_proximity_auth_client.cc b/chrome/browser/signin/chrome_proximity_auth_client.cc index 7ae7736..0c18b23 100644 --- a/chrome/browser/signin/chrome_proximity_auth_client.cc +++ b/chrome/browser/signin/chrome_proximity_auth_client.cc @@ -4,10 +4,13 @@ #include "chrome/browser/signin/chrome_proximity_auth_client.h" +#include <stdint.h> + #include "base/logging.h" #include "base/prefs/pref_service.h" #include "base/sys_info.h" #include "base/version.h" +#include "build/build_config.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_window.h" #include "chrome/browser/signin/easy_unlock_service.h" @@ -110,7 +113,7 @@ cryptauth::DeviceClassifier ChromeProximityAuthClient::GetDeviceClassifier() { cryptauth::DeviceClassifier device_classifier; #if defined(OS_CHROMEOS) - int32 major_version, minor_version, bugfix_version; + int32_t major_version, minor_version, bugfix_version; // TODO(tengs): base::OperatingSystemVersionNumbers only works for ChromeOS. // We need to get different numbers for other platforms. base::SysInfo::OperatingSystemVersionNumbers(&major_version, &minor_version, diff --git a/chrome/browser/signin/chrome_signin_client.cc b/chrome/browser/signin/chrome_signin_client.cc index 6995990..f4804e7 100644 --- a/chrome/browser/signin/chrome_signin_client.cc +++ b/chrome/browser/signin/chrome_signin_client.cc @@ -4,9 +4,12 @@ #include "chrome/browser/signin/chrome_signin_client.h" +#include <stddef.h> + #include "base/command_line.h" #include "base/prefs/pref_service.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/content_settings/cookie_settings_factory.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" diff --git a/chrome/browser/signin/chrome_signin_client.h b/chrome/browser/signin/chrome_signin_client.h index 8227363..cbf3c60 100644 --- a/chrome/browser/signin/chrome_signin_client.h +++ b/chrome/browser/signin/chrome_signin_client.h @@ -5,8 +5,9 @@ #ifndef CHROME_BROWSER_SIGNIN_CHROME_SIGNIN_CLIENT_H_ #define CHROME_BROWSER_SIGNIN_CHROME_SIGNIN_CLIENT_H_ -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" +#include "build/build_config.h" #include "components/signin/core/browser/signin_client.h" #include "components/signin/core/browser/signin_error_controller.h" #include "google_apis/gaia/gaia_oauth_client.h" diff --git a/chrome/browser/signin/chrome_signin_client_unittest.cc b/chrome/browser/signin/chrome_signin_client_unittest.cc index c97a0a9..c39cd4b 100644 --- a/chrome/browser/signin/chrome_signin_client_unittest.cc +++ b/chrome/browser/signin/chrome_signin_client_unittest.cc @@ -7,6 +7,7 @@ #include "base/bind.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" +#include "build/build_config.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/chrome_signin_client_factory.h" #include "chrome/test/base/testing_profile.h" diff --git a/chrome/browser/signin/chrome_signin_helper.cc b/chrome/browser/signin/chrome_signin_helper.cc index 9118ea6..6787db2 100644 --- a/chrome/browser/signin/chrome_signin_helper.cc +++ b/chrome/browser/signin/chrome_signin_helper.cc @@ -5,6 +5,7 @@ #include "chrome/browser/signin/chrome_signin_helper.h" #include "base/strings/string_util.h" +#include "build/build_config.h" #include "chrome/browser/prefs/incognito_mode_prefs.h" #include "chrome/browser/profiles/profile_io_data.h" #include "chrome/browser/signin/account_reconcilor_factory.h" diff --git a/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.cc b/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.cc index b307e5f..81c0f4f0 100644 --- a/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.cc +++ b/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.cc @@ -7,6 +7,7 @@ #include <string> #include <vector> +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_info_cache.h" diff --git a/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.h b/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.h index be6a2ab..d5152a8 100644 --- a/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.h +++ b/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.h @@ -6,6 +6,7 @@ #define CHROME_BROWSER_SIGNIN_CHROME_SIGNIN_STATUS_METRICS_PROVIDER_DELEGATE_H_ #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "chrome/browser/signin/signin_manager_factory.h" #include "chrome/browser/ui/browser_list_observer.h" #include "components/signin/core/browser/signin_status_metrics_provider_delegate.h" diff --git a/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate_unittest.cc b/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate_unittest.cc index 453c89f..8f7e0b8 100644 --- a/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate_unittest.cc +++ b/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate_unittest.cc @@ -4,6 +4,7 @@ #include "chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.h" +#include "build/build_config.h" #include "components/signin/core/browser/signin_status_metrics_provider.h" #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/signin/cross_device_promo.cc b/chrome/browser/signin/cross_device_promo.cc index 913d65e..2d42567 100644 --- a/chrome/browser/signin/cross_device_promo.cc +++ b/chrome/browser/signin/cross_device_promo.cc @@ -4,6 +4,8 @@ #include "chrome/browser/signin/cross_device_promo.h" +#include <stdint.h> + #include "base/metrics/histogram_macros.h" #include "base/prefs/pref_service.h" #include "base/rand_util.h" @@ -321,7 +323,7 @@ bool CrossDevicePromo::CheckPromoEligibility() { // The missing preference indicates CheckPromoEligibility() has never been // called. Determine when to call the DeviceActivityFetcher for the first // time. - const uint64 milliseconds_until_next_activity_fetch = base::RandGenerator( + const uint64_t milliseconds_until_next_activity_fetch = base::RandGenerator( delay_until_next_device_activity_fetch_.InMilliseconds()); const base::Time time_of_next_device_activity_fetch = base::Time::Now() + base::TimeDelta::FromMilliseconds( diff --git a/chrome/browser/signin/cross_device_promo.h b/chrome/browser/signin/cross_device_promo.h index d577e4b..5990a94 100644 --- a/chrome/browser/signin/cross_device_promo.h +++ b/chrome/browser/signin/cross_device_promo.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SIGNIN_CROSS_DEVICE_PROMO_H_ #define CHROME_BROWSER_SIGNIN_CROSS_DEVICE_PROMO_H_ +#include "base/macros.h" #include "base/observer_list.h" #include "base/timer/timer.h" #include "components/keyed_service/core/keyed_service.h" diff --git a/chrome/browser/signin/cross_device_promo_factory.h b/chrome/browser/signin/cross_device_promo_factory.h index 866db32..1f9a5fe 100644 --- a/chrome/browser/signin/cross_device_promo_factory.h +++ b/chrome/browser/signin/cross_device_promo_factory.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SIGNIN_CROSS_DEVICE_PROMO_FACTORY_H_ #define CHROME_BROWSER_SIGNIN_CROSS_DEVICE_PROMO_FACTORY_H_ +#include "base/macros.h" #include "base/memory/singleton.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" diff --git a/chrome/browser/signin/cross_device_promo_unittest.cc b/chrome/browser/signin/cross_device_promo_unittest.cc index ff5a7f2..6d74e02 100644 --- a/chrome/browser/signin/cross_device_promo_unittest.cc +++ b/chrome/browser/signin/cross_device_promo_unittest.cc @@ -4,6 +4,9 @@ #include "chrome/browser/signin/cross_device_promo.h" +#include <stdint.h> + +#include "base/macros.h" #include "base/metrics/field_trial.h" #include "base/run_loop.h" #include "base/test/histogram_tester.h" @@ -35,7 +38,7 @@ namespace { typedef std::map<std::string, std::string> VariationsMap; -int64 InTwoHours() { +int64_t InTwoHours() { return (base::Time::Now() + base::TimeDelta::FromHours(2)).ToInternalValue(); } @@ -413,16 +416,16 @@ TEST_F(CrossDevicePromoTest, NumDevicesEligibility) { // Ensure we appropriate schedule a check for device activity. { base::HistogramTester test_missing_list_devices; - int64 earliest_time_to_check_list_devices = + int64_t earliest_time_to_check_list_devices = base::Time::Now().ToInternalValue(); EXPECT_FALSE(promo()->CheckPromoEligibilityForTesting()); - int64 latest_time_to_check_list_devices = InTwoHours(); + int64_t latest_time_to_check_list_devices = InTwoHours(); test_missing_list_devices.ExpectUniqueSample( "Signin.XDevicePromo.Eligibility", signin_metrics::UNKNOWN_COUNT_DEVICES, 1); EXPECT_TRUE( prefs()->HasPrefPath(prefs::kCrossDevicePromoNextFetchListDevicesTime)); - int64 when_to_check_list_devices = + int64_t when_to_check_list_devices = prefs()->GetInt64(prefs::kCrossDevicePromoNextFetchListDevicesTime); EXPECT_LT(earliest_time_to_check_list_devices, when_to_check_list_devices); EXPECT_GT(latest_time_to_check_list_devices, when_to_check_list_devices); @@ -431,7 +434,7 @@ TEST_F(CrossDevicePromoTest, NumDevicesEligibility) { // Don't reschedule the device activity check if there's one pending. { base::HistogramTester test_unknown_devices; - int64 list_devices_time = InTwoHours(); + int64_t list_devices_time = InTwoHours(); prefs()->SetInt64(prefs::kCrossDevicePromoNextFetchListDevicesTime, list_devices_time); EXPECT_FALSE(promo()->CheckPromoEligibilityForTesting()); @@ -549,7 +552,7 @@ TEST_F(CrossDevicePromoTest, FetchDeviceResults) { { base::HistogramTester test_no_devices; std::vector<DeviceActivityFetcher::DeviceActivity> devices; - int64 in_two_hours = InTwoHours(); + int64_t in_two_hours = InTwoHours(); promo()->OnFetchDeviceActivitySuccess(devices); EXPECT_LE( in_two_hours, @@ -574,7 +577,7 @@ TEST_F(CrossDevicePromoTest, FetchDeviceResults) { device.name = "Aslan"; devices.push_back(device); - int64 in_two_hours = InTwoHours(); + int64_t in_two_hours = InTwoHours(); promo()->OnFetchDeviceActivitySuccess(devices); EXPECT_LE( in_two_hours, @@ -604,7 +607,7 @@ TEST_F(CrossDevicePromoTest, FetchDeviceResults) { device.name = "Aslan"; devices.push_back(device); - int64 in_two_hours = InTwoHours(); + int64_t in_two_hours = InTwoHours(); promo()->OnFetchDeviceActivitySuccess(devices); EXPECT_LE( in_two_hours, @@ -639,7 +642,7 @@ TEST_F(CrossDevicePromoTest, FetchDeviceResults) { device2.name = "Balrog"; devices.push_back(device2); - int64 in_two_hours = InTwoHours(); + int64_t in_two_hours = InTwoHours(); promo()->OnFetchDeviceActivitySuccess(devices); EXPECT_LE( in_two_hours, diff --git a/chrome/browser/signin/easy_unlock_app_manager.cc b/chrome/browser/signin/easy_unlock_app_manager.cc index 62bdf66..9a9aff6 100644 --- a/chrome/browser/signin/easy_unlock_app_manager.cc +++ b/chrome/browser/signin/easy_unlock_app_manager.cc @@ -6,6 +6,8 @@ #include "base/command_line.h" #include "base/location.h" +#include "base/macros.h" +#include "build/build_config.h" #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_api.h" #include "chrome/browser/extensions/component_loader.h" #include "chrome/browser/extensions/extension_service.h" diff --git a/chrome/browser/signin/easy_unlock_app_manager_unittest.cc b/chrome/browser/signin/easy_unlock_app_manager_unittest.cc index 8ae5b87..9902e64 100644 --- a/chrome/browser/signin/easy_unlock_app_manager_unittest.cc +++ b/chrome/browser/signin/easy_unlock_app_manager_unittest.cc @@ -4,11 +4,15 @@ #include "chrome/browser/signin/easy_unlock_app_manager.h" +#include <stddef.h> + #include <string> #include "base/command_line.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/run_loop.h" +#include "build/build_config.h" #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_api.h" #include "chrome/browser/extensions/component_loader.h" #include "chrome/browser/extensions/extension_service.h" diff --git a/chrome/browser/signin/easy_unlock_auth_attempt.cc b/chrome/browser/signin/easy_unlock_auth_attempt.cc index fced561..c15bafb 100644 --- a/chrome/browser/signin/easy_unlock_auth_attempt.cc +++ b/chrome/browser/signin/easy_unlock_auth_attempt.cc @@ -7,6 +7,7 @@ #include "base/bind.h" #include "base/command_line.h" #include "base/logging.h" +#include "build/build_config.h" #include "chrome/browser/signin/easy_unlock_app_manager.h" #include "components/proximity_auth/screenlock_bridge.h" #include "components/proximity_auth/switches.h" diff --git a/chrome/browser/signin/easy_unlock_auth_attempt_unittest.cc b/chrome/browser/signin/easy_unlock_auth_attempt_unittest.cc index 0f4b6ff..f7971f5 100644 --- a/chrome/browser/signin/easy_unlock_auth_attempt_unittest.cc +++ b/chrome/browser/signin/easy_unlock_auth_attempt_unittest.cc @@ -4,7 +4,10 @@ #include "chrome/browser/signin/easy_unlock_auth_attempt.h" +#include <stddef.h> + #include "base/macros.h" +#include "build/build_config.h" #include "chrome/browser/signin/easy_unlock_app_manager.h" #include "components/proximity_auth/screenlock_bridge.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/signin/easy_unlock_screenlock_state_handler.cc b/chrome/browser/signin/easy_unlock_screenlock_state_handler.cc index 79f51b5..ed7eee6 100644 --- a/chrome/browser/signin/easy_unlock_screenlock_state_handler.cc +++ b/chrome/browser/signin/easy_unlock_screenlock_state_handler.cc @@ -4,9 +4,12 @@ #include "chrome/browser/signin/easy_unlock_screenlock_state_handler.h" +#include <stddef.h> + #include "base/bind.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/signin/easy_unlock_metrics.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" diff --git a/chrome/browser/signin/easy_unlock_screenlock_state_handler.h b/chrome/browser/signin/easy_unlock_screenlock_state_handler.h index 88e6a3d..fe20d3e 100644 --- a/chrome/browser/signin/easy_unlock_screenlock_state_handler.h +++ b/chrome/browser/signin/easy_unlock_screenlock_state_handler.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "base/strings/string16.h" #include "components/proximity_auth/screenlock_bridge.h" #include "components/proximity_auth/screenlock_state.h" diff --git a/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc b/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc index 69aec94..9591acc 100644 --- a/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc +++ b/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc @@ -4,9 +4,12 @@ #include "chrome/browser/signin/easy_unlock_screenlock_state_handler.h" +#include <stddef.h> + #include <string> #include <vector> +#include "base/macros.h" #include "base/strings/string16.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" diff --git a/chrome/browser/signin/easy_unlock_service.cc b/chrome/browser/signin/easy_unlock_service.cc index 5fa9535..921d785 100644 --- a/chrome/browser/signin/easy_unlock_service.cc +++ b/chrome/browser/signin/easy_unlock_service.cc @@ -10,6 +10,7 @@ #include "base/command_line.h" #include "base/guid.h" #include "base/logging.h" +#include "base/macros.h" #include "base/metrics/histogram_macros.h" #include "base/prefs/pref_registry_simple.h" #include "base/prefs/pref_service.h" @@ -19,6 +20,7 @@ #include "base/time/time.h" #include "base/values.h" #include "base/version.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/chrome_proximity_auth_client.h" diff --git a/chrome/browser/signin/easy_unlock_service.h b/chrome/browser/signin/easy_unlock_service.h index 6910d99..8711a53 100644 --- a/chrome/browser/signin/easy_unlock_service.h +++ b/chrome/browser/signin/easy_unlock_service.h @@ -13,6 +13,7 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" +#include "build/build_config.h" #include "chrome/browser/signin/chrome_proximity_auth_client.h" #include "chrome/browser/signin/easy_unlock_auth_attempt.h" #include "chrome/browser/signin/easy_unlock_metrics.h" diff --git a/chrome/browser/signin/easy_unlock_service_factory.cc b/chrome/browser/signin/easy_unlock_service_factory.cc index f48e3b0..c781772 100644 --- a/chrome/browser/signin/easy_unlock_service_factory.cc +++ b/chrome/browser/signin/easy_unlock_service_factory.cc @@ -6,6 +6,7 @@ #include "base/command_line.h" #include "base/memory/singleton.h" +#include "build/build_config.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" diff --git a/chrome/browser/signin/easy_unlock_service_regular.cc b/chrome/browser/signin/easy_unlock_service_regular.cc index a5b817a1..8a290da 100644 --- a/chrome/browser/signin/easy_unlock_service_regular.cc +++ b/chrome/browser/signin/easy_unlock_service_regular.cc @@ -4,6 +4,8 @@ #include "chrome/browser/signin/easy_unlock_service_regular.h" +#include <stdint.h> + #include "base/base64url.h" #include "base/bind.h" #include "base/command_line.h" @@ -13,6 +15,7 @@ #include "base/sys_info.h" #include "base/time/default_clock.h" #include "base/values.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" @@ -619,7 +622,8 @@ cryptauth::GcmDeviceInfo EasyUnlockServiceRegular::GetGcmDeviceInfo() { ash::DisplayManager* display_manager = ash::Shell::GetInstance()->display_manager(); - int64 primary_display_id = display_manager->GetPrimaryDisplayCandidate().id(); + int64_t primary_display_id = + display_manager->GetPrimaryDisplayCandidate().id(); ash::DisplayInfo display_info = display_manager->GetDisplayInfo(primary_display_id); gfx::Rect bounds = display_info.bounds_in_native(); diff --git a/chrome/browser/signin/easy_unlock_service_regular.h b/chrome/browser/signin/easy_unlock_service_regular.h index 9998d88..e4ec2e0 100644 --- a/chrome/browser/signin/easy_unlock_service_regular.h +++ b/chrome/browser/signin/easy_unlock_service_regular.h @@ -12,6 +12,7 @@ #include "base/memory/scoped_ptr.h" #include "base/prefs/pref_change_registrar.h" #include "base/time/time.h" +#include "build/build_config.h" #include "chrome/browser/signin/easy_unlock_service.h" #include "components/proximity_auth/cryptauth/cryptauth_device_manager.h" #include "components/proximity_auth/screenlock_bridge.h" diff --git a/chrome/browser/signin/easy_unlock_service_signin_chromeos.cc b/chrome/browser/signin/easy_unlock_service_signin_chromeos.cc index 18aa774..7868b69 100644 --- a/chrome/browser/signin/easy_unlock_service_signin_chromeos.cc +++ b/chrome/browser/signin/easy_unlock_service_signin_chromeos.cc @@ -4,8 +4,9 @@ #include "chrome/browser/signin/easy_unlock_service_signin_chromeos.h" +#include <stdint.h> + #include "base/base64url.h" -#include "base/basictypes.h" #include "base/bind.h" #include "base/command_line.h" #include "base/location.h" @@ -30,15 +31,15 @@ namespace { // The maximum allowed backoff interval when waiting for cryptohome to start. -uint32 kMaxCryptohomeBackoffIntervalMs = 10000u; +uint32_t kMaxCryptohomeBackoffIntervalMs = 10000u; // If the data load fails, the initial interval after which the load will be // retried. Further intervals will exponentially increas by factor 2. -uint32 kInitialCryptohomeBackoffIntervalMs = 200u; +uint32_t kInitialCryptohomeBackoffIntervalMs = 200u; // Calculates the backoff interval that should be used next. // |backoff| The last backoff interval used. -uint32 GetNextBackoffInterval(uint32 backoff) { +uint32_t GetNextBackoffInterval(uint32_t backoff) { if (backoff == 0u) return kInitialCryptohomeBackoffIntervalMs; return backoff * 2; @@ -46,7 +47,7 @@ uint32 GetNextBackoffInterval(uint32 backoff) { void LoadDataForUser( const AccountId& account_id, - uint32 backoff_ms, + uint32_t backoff_ms, const chromeos::EasyUnlockKeyManager::GetDeviceDataListCallback& callback); // Callback passed to |LoadDataForUser()|. @@ -57,7 +58,7 @@ void LoadDataForUser( // it invokes |callback| with the |LoadDataForUser| results. void RetryDataLoadOnError( const AccountId& account_id, - uint32 backoff_ms, + uint32_t backoff_ms, const chromeos::EasyUnlockKeyManager::GetDeviceDataListCallback& callback, bool success, const chromeos::EasyUnlockDeviceKeyDataList& data_list) { @@ -66,7 +67,7 @@ void RetryDataLoadOnError( return; } - uint32 next_backoff_ms = GetNextBackoffInterval(backoff_ms); + uint32_t next_backoff_ms = GetNextBackoffInterval(backoff_ms); if (next_backoff_ms > kMaxCryptohomeBackoffIntervalMs) { callback.Run(false, data_list); return; @@ -81,7 +82,7 @@ void RetryDataLoadOnError( // Loads device data list associated with the user's Easy unlock keys. void LoadDataForUser( const AccountId& account_id, - uint32 backoff_ms, + uint32_t backoff_ms, const chromeos::EasyUnlockKeyManager::GetDeviceDataListCallback& callback) { chromeos::EasyUnlockKeyManager* key_manager = chromeos::UserSessionManager::GetInstance()->GetEasyUnlockKeyManager(); @@ -204,7 +205,7 @@ EasyUnlockService::TurnOffFlowStatus std::string EasyUnlockServiceSignin::GetChallenge() const { const UserData* data = FindLoadedDataForCurrentUser(); // TODO(xiyuan): Use correct remote device instead of hard coded first one. - uint32 device_index = 0; + uint32_t device_index = 0; if (!data || data->devices.size() <= device_index) return std::string(); return data->devices[device_index].challenge; @@ -213,7 +214,7 @@ std::string EasyUnlockServiceSignin::GetChallenge() const { std::string EasyUnlockServiceSignin::GetWrappedSecret() const { const UserData* data = FindLoadedDataForCurrentUser(); // TODO(xiyuan): Use correct remote device instead of hard coded first one. - uint32 device_index = 0; + uint32_t device_index = 0; if (!data || data->devices.size() <= device_index) return std::string(); return data->devices[device_index].wrapped_secret; diff --git a/chrome/browser/signin/easy_unlock_service_unittest_chromeos.cc b/chrome/browser/signin/easy_unlock_service_unittest_chromeos.cc index 7436778..074695c 100644 --- a/chrome/browser/signin/easy_unlock_service_unittest_chromeos.cc +++ b/chrome/browser/signin/easy_unlock_service_unittest_chromeos.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + #include <map> #include <string> diff --git a/chrome/browser/signin/fake_gaia_cookie_manager_service.h b/chrome/browser/signin/fake_gaia_cookie_manager_service.h index 442b24a..fbb7c79 100644 --- a/chrome/browser/signin/fake_gaia_cookie_manager_service.h +++ b/chrome/browser/signin/fake_gaia_cookie_manager_service.h @@ -6,6 +6,7 @@ #include "components/signin/core/browser/gaia_cookie_manager_service.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "net/url_request/test_url_fetcher_factory.h" diff --git a/chrome/browser/signin/fake_signin_manager_builder.cc b/chrome/browser/signin/fake_signin_manager_builder.cc index 887dade..ad1a6d4 100644 --- a/chrome/browser/signin/fake_signin_manager_builder.cc +++ b/chrome/browser/signin/fake_signin_manager_builder.cc @@ -4,6 +4,7 @@ #include "chrome/browser/signin/fake_signin_manager_builder.h" +#include "build/build_config.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/account_tracker_service_factory.h" #include "chrome/browser/signin/chrome_signin_client_factory.h" diff --git a/chrome/browser/signin/fake_signin_manager_builder.h b/chrome/browser/signin/fake_signin_manager_builder.h index 0896bed..31ee5cb 100644 --- a/chrome/browser/signin/fake_signin_manager_builder.h +++ b/chrome/browser/signin/fake_signin_manager_builder.h @@ -9,6 +9,7 @@ #include "base/memory/scoped_ptr.h" +#include "build/build_config.h" #include "components/signin/core/browser/fake_signin_manager.h" namespace content { diff --git a/chrome/browser/signin/local_auth.h b/chrome/browser/signin/local_auth.h index 570b5bc..4d591f4 100644 --- a/chrome/browser/signin/local_auth.h +++ b/chrome/browser/signin/local_auth.h @@ -9,6 +9,8 @@ #ifndef CHROME_BROWSER_SIGNIN_LOCAL_AUTH_H_ #define CHROME_BROWSER_SIGNIN_LOCAL_AUTH_H_ +#include <stddef.h> + #include <string> #include "base/gtest_prod_util.h" diff --git a/chrome/browser/signin/local_auth_unittest.cc b/chrome/browser/signin/local_auth_unittest.cc index e647cce..b989ea0 100644 --- a/chrome/browser/signin/local_auth_unittest.cc +++ b/chrome/browser/signin/local_auth_unittest.cc @@ -4,8 +4,11 @@ #include "chrome/browser/signin/local_auth.h" +#include <stddef.h> + #include "base/base64.h" #include "base/prefs/pref_service.h" +#include "build/build_config.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" diff --git a/chrome/browser/signin/mutable_profile_oauth2_token_service_delegate.cc b/chrome/browser/signin/mutable_profile_oauth2_token_service_delegate.cc index bd8bcd6..37045a6 100644 --- a/chrome/browser/signin/mutable_profile_oauth2_token_service_delegate.cc +++ b/chrome/browser/signin/mutable_profile_oauth2_token_service_delegate.cc @@ -4,6 +4,9 @@ #include "chrome/browser/signin/mutable_profile_oauth2_token_service_delegate.h" +#include <stddef.h> + +#include "base/macros.h" #include "base/profiler/scoped_tracker.h" #include "components/signin/core/browser/signin_client.h" #include "components/signin/core/browser/signin_metrics.h" diff --git a/chrome/browser/signin/mutable_profile_oauth2_token_service_delegate.h b/chrome/browser/signin/mutable_profile_oauth2_token_service_delegate.h index 0c4faea..0353fc4 100644 --- a/chrome/browser/signin/mutable_profile_oauth2_token_service_delegate.h +++ b/chrome/browser/signin/mutable_profile_oauth2_token_service_delegate.h @@ -6,6 +6,7 @@ #define CHROME_BROWSER_SIGNIN_MUTABLE_PROFILE_OAUTH2_TOKEN_SERVICE_DELEGATE_H_ #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/memory/scoped_vector.h" #include "base/threading/thread_checker.h" #include "components/signin/core/browser/account_tracker_service.h" diff --git a/chrome/browser/signin/mutable_profile_oauth2_token_service_delegate_unittest.cc b/chrome/browser/signin/mutable_profile_oauth2_token_service_delegate_unittest.cc index 7e8c81b..da1a15a 100644 --- a/chrome/browser/signin/mutable_profile_oauth2_token_service_delegate_unittest.cc +++ b/chrome/browser/signin/mutable_profile_oauth2_token_service_delegate_unittest.cc @@ -5,10 +5,11 @@ #include "chrome/browser/signin/mutable_profile_oauth2_token_service_delegate.h" #include "base/command_line.h" -#include "base/run_loop.h" #include "base/prefs/pref_registry_simple.h" #include "base/prefs/scoped_user_pref_update.h" #include "base/prefs/testing_pref_service.h" +#include "base/run_loop.h" +#include "build/build_config.h" #include "components/signin/core/browser/profile_oauth2_token_service.h" #include "components/signin/core/browser/signin_error_controller.h" #include "components/signin/core/browser/test_signin_client.h" diff --git a/chrome/browser/signin/oauth2_token_service_delegate_android.cc b/chrome/browser/signin/oauth2_token_service_delegate_android.cc index 2fb5a1c..fac9e00 100644 --- a/chrome/browser/signin/oauth2_token_service_delegate_android.cc +++ b/chrome/browser/signin/oauth2_token_service_delegate_android.cc @@ -10,6 +10,7 @@ #include "base/android/jni_string.h" #include "base/bind.h" #include "base/logging.h" +#include "base/macros.h" #include "chrome/browser/profiles/profile_android.h" #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" #include "chrome/browser/sync/profile_sync_service_android.h" diff --git a/chrome/browser/signin/oauth2_token_service_delegate_android.h b/chrome/browser/signin/oauth2_token_service_delegate_android.h index dec7930..dc09834 100644 --- a/chrome/browser/signin/oauth2_token_service_delegate_android.h +++ b/chrome/browser/signin/oauth2_token_service_delegate_android.h @@ -12,6 +12,7 @@ #include "base/android/jni_weak_ref.h" #include "base/android/scoped_java_ref.h" #include "base/callback.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "components/signin/core/browser/account_tracker_service.h" diff --git a/chrome/browser/signin/profile_oauth2_token_service_factory.cc b/chrome/browser/signin/profile_oauth2_token_service_factory.cc index 41e074f..f4cfc41 100644 --- a/chrome/browser/signin/profile_oauth2_token_service_factory.cc +++ b/chrome/browser/signin/profile_oauth2_token_service_factory.cc @@ -4,6 +4,7 @@ #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" +#include "build/build_config.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/account_tracker_service_factory.h" #include "chrome/browser/signin/chrome_signin_client_factory.h" diff --git a/chrome/browser/signin/profile_oauth2_token_service_factory.h b/chrome/browser/signin/profile_oauth2_token_service_factory.h index b43a1cf..6292753 100644 --- a/chrome/browser/signin/profile_oauth2_token_service_factory.h +++ b/chrome/browser/signin/profile_oauth2_token_service_factory.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SIGNIN_PROFILE_OAUTH2_TOKEN_SERVICE_FACTORY_H_ #define CHROME_BROWSER_SIGNIN_PROFILE_OAUTH2_TOKEN_SERVICE_FACTORY_H_ +#include "base/macros.h" #include "base/memory/singleton.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" diff --git a/chrome/browser/signin/signin_error_notifier_ash.cc b/chrome/browser/signin/signin_error_notifier_ash.cc index fd266c7..cf91363 100644 --- a/chrome/browser/signin/signin_error_notifier_ash.cc +++ b/chrome/browser/signin/signin_error_notifier_ash.cc @@ -8,8 +8,10 @@ #include "ash/shell_delegate.h" #include "ash/system/system_notifier.h" #include "base/logging.h" +#include "base/macros.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/browser/notifications/notification.h" diff --git a/chrome/browser/signin/signin_error_notifier_ash.h b/chrome/browser/signin/signin_error_notifier_ash.h index c371fb3..6421613 100644 --- a/chrome/browser/signin/signin_error_notifier_ash.h +++ b/chrome/browser/signin/signin_error_notifier_ash.h @@ -7,8 +7,8 @@ #include <string> -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/strings/string16.h" #include "components/keyed_service/core/keyed_service.h" #include "components/signin/core/browser/signin_error_controller.h" diff --git a/chrome/browser/signin/signin_error_notifier_ash_unittest.cc b/chrome/browser/signin/signin_error_notifier_ash_unittest.cc index 79f363b..e28f6ec 100644 --- a/chrome/browser/signin/signin_error_notifier_ash_unittest.cc +++ b/chrome/browser/signin/signin_error_notifier_ash_unittest.cc @@ -4,8 +4,12 @@ #include "chrome/browser/signin/signin_error_notifier_ash.h" +#include <stddef.h> + #include "ash/test/ash_test_base.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/notifications/notification.h" #include "chrome/browser/notifications/notification_ui_manager.h" diff --git a/chrome/browser/signin/signin_error_notifier_factory_ash.h b/chrome/browser/signin/signin_error_notifier_factory_ash.h index 5c50159..d9babaa 100644 --- a/chrome/browser/signin/signin_error_notifier_factory_ash.h +++ b/chrome/browser/signin/signin_error_notifier_factory_ash.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SIGNIN_SIGNIN_ERROR_NOTIFIER_FACTORY_ASH_H_ #define CHROME_BROWSER_SIGNIN_SIGNIN_ERROR_NOTIFIER_FACTORY_ASH_H_ +#include "base/macros.h" #include "base/memory/singleton.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" diff --git a/chrome/browser/signin/signin_global_error.cc b/chrome/browser/signin/signin_global_error.cc index 9369b83a..e83c3ad 100644 --- a/chrome/browser/signin/signin_global_error.cc +++ b/chrome/browser/signin/signin_global_error.cc @@ -6,6 +6,7 @@ #include "base/logging.h" #include "base/metrics/histogram_macros.h" +#include "build/build_config.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/signin_manager_factory.h" diff --git a/chrome/browser/signin/signin_global_error.h b/chrome/browser/signin/signin_global_error.h index 4d642fc..1c053e4 100644 --- a/chrome/browser/signin/signin_global_error.h +++ b/chrome/browser/signin/signin_global_error.h @@ -6,9 +6,9 @@ #define CHROME_BROWSER_SIGNIN_SIGNIN_GLOBAL_ERROR_H_ #include <set> -#include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "chrome/browser/ui/global_error/global_error.h" #include "components/keyed_service/core/keyed_service.h" #include "components/signin/core/browser/signin_error_controller.h" diff --git a/chrome/browser/signin/signin_global_error_factory.h b/chrome/browser/signin/signin_global_error_factory.h index 9ea3d55..50046c8 100644 --- a/chrome/browser/signin/signin_global_error_factory.h +++ b/chrome/browser/signin/signin_global_error_factory.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SIGNIN_SIGNIN_GLOBAL_ERROR_FACTORY_H_ #define CHROME_BROWSER_SIGNIN_SIGNIN_GLOBAL_ERROR_FACTORY_H_ +#include "base/macros.h" #include "base/memory/singleton.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" diff --git a/chrome/browser/signin/signin_global_error_unittest.cc b/chrome/browser/signin/signin_global_error_unittest.cc index 2255b16..c667d3c 100644 --- a/chrome/browser/signin/signin_global_error_unittest.cc +++ b/chrome/browser/signin/signin_global_error_unittest.cc @@ -4,6 +4,9 @@ #include "chrome/browser/signin/signin_global_error.h" +#include <stddef.h> + +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/prefs/pref_service.h" #include "base/strings/utf_string_conversions.h" diff --git a/chrome/browser/signin/signin_manager_factory.cc b/chrome/browser/signin/signin_manager_factory.cc index f8ba7fe..d76b065 100644 --- a/chrome/browser/signin/signin_manager_factory.cc +++ b/chrome/browser/signin/signin_manager_factory.cc @@ -5,6 +5,7 @@ #include "chrome/browser/signin/signin_manager_factory.h" #include "base/prefs/pref_registry_simple.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/account_fetcher_service_factory.h" diff --git a/chrome/browser/signin/signin_manager_factory.h b/chrome/browser/signin/signin_manager_factory.h index cff398b..3fbb0b2 100644 --- a/chrome/browser/signin/signin_manager_factory.h +++ b/chrome/browser/signin/signin_manager_factory.h @@ -7,6 +7,7 @@ #include "base/memory/singleton.h" #include "base/observer_list.h" +#include "build/build_config.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" class SigninManager; diff --git a/chrome/browser/signin/signin_promo.cc b/chrome/browser/signin/signin_promo.cc index b3b9a5e..0425f29 100644 --- a/chrome/browser/signin/signin_promo.cc +++ b/chrome/browser/signin/signin_promo.cc @@ -9,6 +9,7 @@ #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/signin/gaia_auth_extension_loader.h" #include "chrome/browser/first_run/first_run.h" diff --git a/chrome/browser/signin/signin_promo.h b/chrome/browser/signin/signin_promo.h index f6f7143..61e524f 100644 --- a/chrome/browser/signin/signin_promo.h +++ b/chrome/browser/signin/signin_promo.h @@ -7,7 +7,6 @@ #include <string> -#include "base/basictypes.h" #include "chrome/browser/ui/profile_chooser_constants.h" #include "components/signin/core/browser/signin_metrics.h" diff --git a/chrome/browser/signin/signin_status_metrics_provider_chromeos.h b/chrome/browser/signin/signin_status_metrics_provider_chromeos.h index c594558..e9ff719 100644 --- a/chrome/browser/signin/signin_status_metrics_provider_chromeos.h +++ b/chrome/browser/signin/signin_status_metrics_provider_chromeos.h @@ -6,6 +6,7 @@ #define CHROME_BROWSER_SIGNIN_SIGNIN_STATUS_METRICS_PROVIDER_CHROMEOS_H_ #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "components/signin/core/browser/signin_status_metrics_provider_base.h" // Record and report the browser sign-in status on ChromeOS during each UMA diff --git a/chrome/browser/signin/signin_tracker_factory.h b/chrome/browser/signin/signin_tracker_factory.h index b0f7bd5..c159e87 100644 --- a/chrome/browser/signin/signin_tracker_factory.h +++ b/chrome/browser/signin/signin_tracker_factory.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SIGNIN_SIGNIN_TRACKER_FACTORY_H_ #define CHROME_BROWSER_SIGNIN_SIGNIN_TRACKER_FACTORY_H_ +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "components/signin/core/browser/signin_tracker.h" diff --git a/chrome/browser/signin/signin_tracker_unittest.cc b/chrome/browser/signin/signin_tracker_unittest.cc index 709c3ea..0f72fb9 100644 --- a/chrome/browser/signin/signin_tracker_unittest.cc +++ b/chrome/browser/signin/signin_tracker_unittest.cc @@ -7,6 +7,7 @@ #include "base/bind.h" #include "base/bind_helpers.h" #include "base/compiler_specific.h" +#include "build/build_config.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/account_tracker_service_factory.h" diff --git a/chrome/browser/signin/signin_ui_util.cc b/chrome/browser/signin/signin_ui_util.cc index 8656309..ac945e9 100644 --- a/chrome/browser/signin/signin_ui_util.cc +++ b/chrome/browser/signin/signin_ui_util.cc @@ -7,6 +7,7 @@ #include "base/prefs/pref_service.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/account_tracker_service_factory.h" #include "chrome/browser/signin/signin_error_controller_factory.h" diff --git a/chrome/browser/site_details.h b/chrome/browser/site_details.h index 555e891..b90cb5c 100644 --- a/chrome/browser/site_details.h +++ b/chrome/browser/site_details.h @@ -5,13 +5,16 @@ #ifndef CHROME_BROWSER_SITE_DETAILS_H_ #define CHROME_BROWSER_SITE_DETAILS_H_ +#include <stdint.h> + #include "base/containers/hash_tables.h" +#include "base/macros.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/site_instance.h" #include "content/public/browser/web_contents.h" // Maps an ID representing each BrowsingInstance to a set of site URLs. -using BrowsingInstanceSiteMap = base::hash_map<int32, std::set<GURL>>; +using BrowsingInstanceSiteMap = base::hash_map<int32_t, std::set<GURL>>; // Maps a SiteInstance to a set of all SiteInstances in the same // BrowsingInstance. diff --git a/chrome/browser/site_details_browsertest.cc b/chrome/browser/site_details_browsertest.cc index c8de976..d79acb1 100644 --- a/chrome/browser/site_details_browsertest.cc +++ b/chrome/browser/site_details_browsertest.cc @@ -4,10 +4,14 @@ #include "chrome/browser/site_details.h" +#include <stddef.h> +#include <stdint.h> + #include <utility> #include "base/bind_helpers.h" #include "base/files/file_path.h" +#include "base/macros.h" #include "base/message_loop/message_loop.h" #include "base/path_service.h" #include "base/strings/stringprintf.h" diff --git a/chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc b/chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc index a9099ab..e553c34 100644 --- a/chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc +++ b/chrome/browser/speech/chrome_speech_recognition_manager_delegate.cc @@ -8,10 +8,12 @@ #include <string> #include "base/bind.h" +#include "base/macros.h" #include "base/prefs/pref_service.h" #include "base/strings/utf_string_conversions.h" #include "base/synchronization/lock.h" #include "base/threading/thread_restrictions.h" +#include "build/build_config.h" #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/tab_contents/tab_util.h" diff --git a/chrome/browser/speech/chrome_speech_recognition_manager_delegate.h b/chrome/browser/speech/chrome_speech_recognition_manager_delegate.h index b806b99..0c8973e 100644 --- a/chrome/browser/speech/chrome_speech_recognition_manager_delegate.h +++ b/chrome/browser/speech/chrome_speech_recognition_manager_delegate.h @@ -6,6 +6,7 @@ #define CHROME_BROWSER_SPEECH_CHROME_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_ #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "content/public/browser/speech_recognition_event_listener.h" #include "content/public/browser/speech_recognition_manager_delegate.h" diff --git a/chrome/browser/speech/extension_api/tts_engine_extension_api.cc b/chrome/browser/speech/extension_api/tts_engine_extension_api.cc index e7e952d..7992547 100644 --- a/chrome/browser/speech/extension_api/tts_engine_extension_api.cc +++ b/chrome/browser/speech/extension_api/tts_engine_extension_api.cc @@ -4,10 +4,13 @@ #include "chrome/browser/speech/extension_api/tts_engine_extension_api.h" +#include <stddef.h> + #include <string> #include "base/json/json_writer.h" #include "base/values.h" +#include "build/build_config.h" #include "chrome/browser/extensions/component_loader.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/profiles/profile.h" diff --git a/chrome/browser/speech/extension_api/tts_engine_extension_observer.h b/chrome/browser/speech/extension_api/tts_engine_extension_observer.h index 08d38c2..a7956a5 100644 --- a/chrome/browser/speech/extension_api/tts_engine_extension_observer.h +++ b/chrome/browser/speech/extension_api/tts_engine_extension_observer.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SPEECH_EXTENSION_API_TTS_ENGINE_EXTENSION_OBSERVER_H_ #define CHROME_BROWSER_SPEECH_EXTENSION_API_TTS_ENGINE_EXTENSION_OBSERVER_H_ +#include "base/macros.h" #include "base/scoped_observer.h" #include "components/keyed_service/core/keyed_service.h" #include "extensions/browser/event_router.h" diff --git a/chrome/browser/speech/extension_api/tts_extension_api.cc b/chrome/browser/speech/extension_api/tts_extension_api.cc index f5fbe57..26b5df2 100644 --- a/chrome/browser/speech/extension_api/tts_extension_api.cc +++ b/chrome/browser/speech/extension_api/tts_extension_api.cc @@ -4,6 +4,8 @@ #include "chrome/browser/speech/extension_api/tts_extension_api.h" +#include <stddef.h> + #include <string> #include "base/lazy_instance.h" diff --git a/chrome/browser/speech/extension_api/tts_extension_apitest.cc b/chrome/browser/speech/extension_api/tts_extension_apitest.cc index 5bd1316..f913112 100644 --- a/chrome/browser/speech/extension_api/tts_extension_apitest.cc +++ b/chrome/browser/speech/extension_api/tts_extension_apitest.cc @@ -7,6 +7,7 @@ #include "base/bind.h" #include "base/command_line.h" #include "base/location.h" +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/single_thread_task_runner.h" #include "base/thread_task_runner_handle.h" diff --git a/chrome/browser/speech/speech_recognition_browsertest.cc b/chrome/browser/speech/speech_recognition_browsertest.cc index ca242a4..d110ebd 100644 --- a/chrome/browser/speech/speech_recognition_browsertest.cc +++ b/chrome/browser/speech/speech_recognition_browsertest.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate.h" #include "chrome/browser/ui/browser.h" diff --git a/chrome/browser/speech/tts_android.h b/chrome/browser/speech/tts_android.h index 19ef66d..f7a3e20 100644 --- a/chrome/browser/speech/tts_android.h +++ b/chrome/browser/speech/tts_android.h @@ -7,6 +7,7 @@ #include "base/android/jni_android.h" #include "base/android/scoped_java_ref.h" +#include "base/macros.h" #include "chrome/browser/speech/tts_platform.h" #include "chrome/common/features.h" diff --git a/chrome/browser/speech/tts_chromeos.cc b/chrome/browser/speech/tts_chromeos.cc index a45bb3a..7d218e8 100644 --- a/chrome/browser/speech/tts_chromeos.cc +++ b/chrome/browser/speech/tts_chromeos.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "chrome/browser/speech/tts_platform.h" // Chrome OS doesn't have native TTS, instead it includes a built-in diff --git a/chrome/browser/speech/tts_controller_impl.cc b/chrome/browser/speech/tts_controller_impl.cc index 76ef045..ebe36ed63 100644 --- a/chrome/browser/speech/tts_controller_impl.cc +++ b/chrome/browser/speech/tts_controller_impl.cc @@ -4,10 +4,13 @@ #include "chrome/browser/speech/tts_controller_impl.h" +#include <stddef.h> + #include <string> #include <vector> #include "base/values.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/speech/tts_platform.h" diff --git a/chrome/browser/speech/tts_controller_impl.h b/chrome/browser/speech/tts_controller_impl.h index dc53d5e..23bb86c 100644 --- a/chrome/browser/speech/tts_controller_impl.h +++ b/chrome/browser/speech/tts_controller_impl.h @@ -10,6 +10,7 @@ #include <string> #include <vector> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" #include "chrome/browser/speech/tts_controller.h" diff --git a/chrome/browser/speech/tts_linux.cc b/chrome/browser/speech/tts_linux.cc index ba15516..93803d1 100644 --- a/chrome/browser/speech/tts_linux.cc +++ b/chrome/browser/speech/tts_linux.cc @@ -3,11 +3,13 @@ // found in the LICENSE file. #include <math.h> +#include <stddef.h> #include <map> #include "base/command_line.h" #include "base/debug/leak_annotations.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" #include "base/synchronization/lock.h" diff --git a/chrome/browser/speech/tts_mac.mm b/chrome/browser/speech/tts_mac.mm index a492dd5..facad82 100644 --- a/chrome/browser/speech/tts_mac.mm +++ b/chrome/browser/speech/tts_mac.mm @@ -5,6 +5,7 @@ #include <string> #include "base/mac/scoped_nsobject.h" +#include "base/macros.h" #include "base/memory/singleton.h" #include "base/strings/sys_string_conversions.h" #include "base/values.h" diff --git a/chrome/browser/speech/tts_message_filter.cc b/chrome/browser/speech/tts_message_filter.cc index c429bf9..3b398fc 100644 --- a/chrome/browser/speech/tts_message_filter.cc +++ b/chrome/browser/speech/tts_message_filter.cc @@ -4,6 +4,8 @@ #include "chrome/browser/speech/tts_message_filter.h" +#include <stddef.h> + #include "base/bind.h" #include "base/logging.h" #include "chrome/browser/chrome_notification_types.h" diff --git a/chrome/browser/speech/tts_message_filter.h b/chrome/browser/speech/tts_message_filter.h index 20f2985..e1b7d70 100644 --- a/chrome/browser/speech/tts_message_filter.h +++ b/chrome/browser/speech/tts_message_filter.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SPEECH_TTS_MESSAGE_FILTER_H_ #define CHROME_BROWSER_SPEECH_TTS_MESSAGE_FILTER_H_ +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/synchronization/lock.h" #include "chrome/browser/speech/tts_controller.h" diff --git a/chrome/browser/speech/tts_platform.h b/chrome/browser/speech/tts_platform.h index c4a29e7..b3690d8 100644 --- a/chrome/browser/speech/tts_platform.h +++ b/chrome/browser/speech/tts_platform.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "chrome/browser/speech/tts_controller.h" // Abstract class that defines the native platform TTS interface, diff --git a/chrome/browser/speech/tts_win.cc b/chrome/browser/speech/tts_win.cc index ac25820..055d975 100644 --- a/chrome/browser/speech/tts_win.cc +++ b/chrome/browser/speech/tts_win.cc @@ -4,7 +4,9 @@ #include <math.h> #include <sapi.h> +#include <stdint.h> +#include "base/macros.h" #include "base/memory/singleton.h" #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" @@ -87,7 +89,7 @@ bool TtsPlatformImplWin::Speak( // 0.1 -> -10 // 1.0 -> 0 // 10.0 -> 10 - speech_synthesizer_->SetRate(static_cast<int32>(10 * log10(params.rate))); + speech_synthesizer_->SetRate(static_cast<int32_t>(10 * log10(params.rate))); } if (params.pitch >= 0.0) { @@ -102,7 +104,7 @@ bool TtsPlatformImplWin::Speak( if (params.volume >= 0.0) { // The TTS api allows a range of 0 to 100 for speech volume. - speech_synthesizer_->SetVolume(static_cast<uint16>(params.volume * 100)); + speech_synthesizer_->SetVolume(static_cast<uint16_t>(params.volume * 100)); } // TODO(dmazzoni): convert SSML to SAPI xml. http://crbug.com/88072 diff --git a/chrome/browser/spellchecker/feedback.cc b/chrome/browser/spellchecker/feedback.cc index fc2c414..17bc4b7 100644 --- a/chrome/browser/spellchecker/feedback.cc +++ b/chrome/browser/spellchecker/feedback.cc @@ -3,7 +3,7 @@ // found in the LICENSE file. // // The |Feedback| object keeps track of each instance of user feedback in a map -// |misspellings_|. This is a map from uint32 hashes to |Misspelling| objects. +// |misspellings_|. This is a map from uint32_t hashes to |Misspelling| objects. // // Each misspelling should be present in only one renderer process. The // |Feedback| objects keeps track of misspelling-renderer relationship in the @@ -32,7 +32,7 @@ Feedback::Feedback(size_t max_total_text_size) Feedback::~Feedback() {} -Misspelling* Feedback::GetMisspelling(uint32 hash) { +Misspelling* Feedback::GetMisspelling(uint32_t hash) { HashMisspellingMap::iterator misspelling_it = misspellings_.find(hash); if (misspelling_it == misspellings_.end()) return NULL; @@ -41,7 +41,7 @@ Misspelling* Feedback::GetMisspelling(uint32 hash) { void Feedback::FinalizeRemovedMisspellings( int renderer_process_id, - const std::vector<uint32>& remaining_markers) { + const std::vector<uint32_t>& remaining_markers) { RendererHashesMap::iterator renderer_it = renderers_.find(renderer_process_id); if (renderer_it == renderers_.end() || renderer_it->second.empty()) @@ -49,10 +49,10 @@ void Feedback::FinalizeRemovedMisspellings( HashCollection& renderer_hashes = renderer_it->second; HashCollection remaining_hashes(remaining_markers.begin(), remaining_markers.end()); - std::vector<uint32> removed_hashes = - base::STLSetDifference<std::vector<uint32>>(renderer_hashes, - remaining_hashes); - for (std::vector<uint32>::const_iterator hash_it = removed_hashes.begin(); + std::vector<uint32_t> removed_hashes = + base::STLSetDifference<std::vector<uint32_t>>(renderer_hashes, + remaining_hashes); + for (std::vector<uint32_t>::const_iterator hash_it = removed_hashes.begin(); hash_it != removed_hashes.end(); ++hash_it) { HashMisspellingMap::iterator misspelling_it = misspellings_.find(*hash_it); if (misspelling_it != misspellings_.end() && @@ -116,7 +116,7 @@ void Feedback::EraseFinalizedMisspellings(int renderer_process_id) { renderers_.erase(renderer_it); } -bool Feedback::HasMisspelling(uint32 hash) const { +bool Feedback::HasMisspelling(uint32_t hash) const { return !!misspellings_.count(hash); } @@ -190,7 +190,7 @@ void Feedback::Clear() { renderers_.clear(); } -const std::set<uint32>& Feedback::FindMisspellings( +const std::set<uint32_t>& Feedback::FindMisspellings( const base::string16& misspelled_text) const { const TextHashesMap::const_iterator text_it = text_.find(misspelled_text); return text_it == text_.end() ? empty_hash_collection_ : text_it->second; diff --git a/chrome/browser/spellchecker/feedback.h b/chrome/browser/spellchecker/feedback.h index d98ba12..c79c0b8 100644 --- a/chrome/browser/spellchecker/feedback.h +++ b/chrome/browser/spellchecker/feedback.h @@ -12,10 +12,14 @@ #ifndef CHROME_BROWSER_SPELLCHECKER_FEEDBACK_H_ #define CHROME_BROWSER_SPELLCHECKER_FEEDBACK_H_ +#include <stddef.h> +#include <stdint.h> + #include <map> #include <set> #include <vector> +#include "base/macros.h" #include "chrome/browser/spellchecker/misspelling.h" namespace spellcheck { @@ -26,7 +30,7 @@ namespace spellcheck { // base::ASCIIToUTF16("Helllo world"), 0, 6, // std::vector<base::string16>(), GenerateRandomHash())); // feedback.FinalizeRemovedMisspellings(renderer_process_id, -// std::vector<uint32>()); +// std::vector<uint32_t>()); // ProcessFeedback(feedback.GetMisspellingsInRenderer(renderer_process_id)); // feedback.EraseFinalizedMisspellings(renderer_process_id); class Feedback { @@ -37,13 +41,13 @@ class Feedback { // Returns the misspelling identified by |hash|. Returns NULL if there's no // misspelling identified by |hash|. Retains the ownership of the result. The // caller should not modify the hash in the returned misspelling. - Misspelling* GetMisspelling(uint32 hash); + Misspelling* GetMisspelling(uint32_t hash); // Finalizes the user actions on misspellings that are removed from the // renderer process with ID |renderer_process_id|. void FinalizeRemovedMisspellings( int renderer_process_id, - const std::vector<uint32>& remaining_markers); + const std::vector<uint32_t>& remaining_markers); // Returns true if the renderer with process ID |renderer_process_id| has // misspellings. @@ -59,7 +63,7 @@ class Feedback { void EraseFinalizedMisspellings(int renderer_process_id); // Returns true if there's a misspelling with |hash| identifier. - bool HasMisspelling(uint32 hash) const; + bool HasMisspelling(uint32_t hash) const; // Adds the |misspelling| to feedback data. If the |misspelling| has a // duplicate hash, then replaces the existing misspelling with the same hash. @@ -81,12 +85,12 @@ class Feedback { void Clear(); // Returns a list of all misspelling identifiers for |misspelled_text|. - const std::set<uint32>& FindMisspellings( + const std::set<uint32_t>& FindMisspellings( const base::string16& misspelled_text) const; private: - typedef std::map<uint32, Misspelling> HashMisspellingMap; - typedef std::set<uint32> HashCollection; + typedef std::map<uint32_t, Misspelling> HashMisspellingMap; + typedef std::set<uint32_t> HashCollection; typedef std::map<int, HashCollection> RendererHashesMap; typedef std::map<base::string16, HashCollection> TextHashesMap; diff --git a/chrome/browser/spellchecker/feedback_sender.cc b/chrome/browser/spellchecker/feedback_sender.cc index 99b1baf..4bfb824 100644 --- a/chrome/browser/spellchecker/feedback_sender.cc +++ b/chrome/browser/spellchecker/feedback_sender.cc @@ -69,7 +69,7 @@ const int kMinIntervalSeconds = 5; // Returns a hash of |session_start|, the current timestamp, and // |suggestion_index|. -uint32 BuildHash(const base::Time& session_start, size_t suggestion_index) { +uint32_t BuildHash(const base::Time& session_start, size_t suggestion_index) { return base::Hash( base::StringPrintf("%" PRId64 "%" PRId64 "%" PRIuS, session_start.ToInternalValue(), @@ -185,7 +185,7 @@ FeedbackSender::FeedbackSender(net::URLRequestContextGetter* request_context, FeedbackSender::~FeedbackSender() { } -void FeedbackSender::SelectedSuggestion(uint32 hash, int suggestion_index) { +void FeedbackSender::SelectedSuggestion(uint32_t hash, int suggestion_index) { Misspelling* misspelling = feedback_.GetMisspelling(hash); // GetMisspelling() returns null for flushed feedback. Feedback is flushed // when the session expires every |kSessionHours| hours. @@ -196,7 +196,7 @@ void FeedbackSender::SelectedSuggestion(uint32 hash, int suggestion_index) { misspelling->timestamp = base::Time::Now(); } -void FeedbackSender::AddedToDictionary(uint32 hash) { +void FeedbackSender::AddedToDictionary(uint32_t hash) { Misspelling* misspelling = feedback_.GetMisspelling(hash); // GetMisspelling() returns null for flushed feedback. Feedback is flushed // when the session expires every |kSessionHours| hours. @@ -204,11 +204,10 @@ void FeedbackSender::AddedToDictionary(uint32 hash) { return; misspelling->action.set_type(SpellcheckAction::TYPE_ADD_TO_DICT); misspelling->timestamp = base::Time::Now(); - const std::set<uint32>& hashes = + const std::set<uint32_t>& hashes = feedback_.FindMisspellings(GetMisspelledString(*misspelling)); - for (std::set<uint32>::const_iterator hash_it = hashes.begin(); - hash_it != hashes.end(); - ++hash_it) { + for (std::set<uint32_t>::const_iterator hash_it = hashes.begin(); + hash_it != hashes.end(); ++hash_it) { Misspelling* duplicate_misspelling = feedback_.GetMisspelling(*hash_it); if (!duplicate_misspelling || duplicate_misspelling->action.IsFinal()) continue; @@ -217,7 +216,7 @@ void FeedbackSender::AddedToDictionary(uint32 hash) { } } -void FeedbackSender::RecordInDictionary(uint32 hash) { +void FeedbackSender::RecordInDictionary(uint32_t hash) { Misspelling* misspelling = feedback_.GetMisspelling(hash); // GetMisspelling() returns null for flushed feedback. Feedback is flushed // when the session expires every |kSessionHours| hours. @@ -226,7 +225,7 @@ void FeedbackSender::RecordInDictionary(uint32 hash) { misspelling->action.set_type(SpellcheckAction::TYPE_IN_DICTIONARY); } -void FeedbackSender::IgnoredSuggestions(uint32 hash) { +void FeedbackSender::IgnoredSuggestions(uint32_t hash) { Misspelling* misspelling = feedback_.GetMisspelling(hash); // GetMisspelling() returns null for flushed feedback. Feedback is flushed // when the session expires every |kSessionHours| hours. @@ -236,7 +235,7 @@ void FeedbackSender::IgnoredSuggestions(uint32 hash) { misspelling->timestamp = base::Time::Now(); } -void FeedbackSender::ManuallyCorrected(uint32 hash, +void FeedbackSender::ManuallyCorrected(uint32_t hash, const base::string16& correction) { Misspelling* misspelling = feedback_.GetMisspelling(hash); // GetMisspelling() returns null for flushed feedback. Feedback is flushed @@ -250,7 +249,7 @@ void FeedbackSender::ManuallyCorrected(uint32 hash, void FeedbackSender::OnReceiveDocumentMarkers( int renderer_process_id, - const std::vector<uint32>& markers) { + const std::vector<uint32_t>& markers) { if ((base::Time::Now() - session_start_).InHours() >= chrome::spellcheck_common::kSessionHours) { FlushFeedback(); @@ -279,7 +278,7 @@ void FeedbackSender::OnSpellcheckResults( // Generate a map of marker offsets to marker hashes. This map helps to // efficiently lookup feedback data based on the position of the misspelling // in text. - typedef std::map<size_t, uint32> MarkerMap; + typedef std::map<size_t, uint32_t> MarkerMap; MarkerMap marker_map; for (size_t i = 0; i < markers.size(); ++i) marker_map[markers[i].offset] = markers[i].hash; @@ -383,7 +382,7 @@ void FeedbackSender::RequestDocumentMarkers() { ++it) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(&FeedbackSender::OnReceiveDocumentMarkers, - AsWeakPtr(), *it, std::vector<uint32>())); + AsWeakPtr(), *it, std::vector<uint32_t>())); } } diff --git a/chrome/browser/spellchecker/feedback_sender.h b/chrome/browser/spellchecker/feedback_sender.h index ec97558..c98d5ba 100644 --- a/chrome/browser/spellchecker/feedback_sender.h +++ b/chrome/browser/spellchecker/feedback_sender.h @@ -5,17 +5,22 @@ // An object to record and send user feedback to spelling service. The spelling // service uses the feedback to improve its suggestions. // -// Assigns uint32 hash identifiers to spelling suggestions from spelling service -// and stores these suggestions. Records user's actions on these suggestions. -// Periodically sends batches of user feedback to the spelling service. +// Assigns uint32_t hash identifiers to spelling suggestions from spelling +// service and stores these suggestions. Records user's actions on these +// suggestions. Periodically sends batches of user feedback to the spelling +// service. #ifndef CHROME_BROWSER_SPELLCHECKER_FEEDBACK_SENDER_H_ #define CHROME_BROWSER_SPELLCHECKER_FEEDBACK_SENDER_H_ +#include <stddef.h> +#include <stdint.h> + #include <map> #include <set> #include <vector> +#include "base/macros.h" #include "base/memory/scoped_vector.h" #include "base/memory/weak_ptr.h" #include "base/timer/timer.h" @@ -61,24 +66,24 @@ class FeedbackSender : public base::SupportsWeakPtr<FeedbackSender>, // Records that user selected suggestion |suggestion_index| for the // misspelling identified by |hash|. - void SelectedSuggestion(uint32 hash, int suggestion_index); + void SelectedSuggestion(uint32_t hash, int suggestion_index); // Records that user added the misspelling identified by |hash| to the // dictionary. - void AddedToDictionary(uint32 hash); + void AddedToDictionary(uint32_t hash); // Records that user right-clicked on the misspelling identified by |hash|, // but did not select any suggestion. - void IgnoredSuggestions(uint32 hash); + void IgnoredSuggestions(uint32_t hash); // Records that user did not choose any suggestion but manually corrected the // misspelling identified by |hash| to string |correction|, which is not in // the list of suggestions. - void ManuallyCorrected(uint32 hash, const base::string16& correction); + void ManuallyCorrected(uint32_t hash, const base::string16& correction); // Records that user has the misspelling in the custom dictionary. The user // will never see the spellcheck suggestions for the misspelling. - void RecordInDictionary(uint32 hash); + void RecordInDictionary(uint32_t hash); // Receives document markers for renderer with process ID |render_process_id| // when the renderer responds to a RequestDocumentMarkers() call. Finalizes @@ -87,7 +92,7 @@ class FeedbackSender : public base::SupportsWeakPtr<FeedbackSender>, // service. If the current session has expired, then refreshes the session // start timestamp and sends out all of the feedback data. void OnReceiveDocumentMarkers(int renderer_process_id, - const std::vector<uint32>& markers); + const std::vector<uint32_t>& markers); // Generates feedback data based on spellcheck results. The new feedback data // is pending. Sets hash identifiers for |results|. Called when spelling diff --git a/chrome/browser/spellchecker/feedback_sender_unittest.cc b/chrome/browser/spellchecker/feedback_sender_unittest.cc index 47a2318..7f3bf90 100644 --- a/chrome/browser/spellchecker/feedback_sender_unittest.cc +++ b/chrome/browser/spellchecker/feedback_sender_unittest.cc @@ -6,6 +6,9 @@ #include "chrome/browser/spellchecker/feedback_sender.h" +#include <stddef.h> +#include <stdint.h> + #include "base/bind.h" #include "base/command_line.h" #include "base/json/json_reader.h" @@ -93,7 +96,7 @@ class FeedbackSenderTest : public testing::Test { feedback_->StartFeedbackCollection(); } - uint32 AddPendingFeedback() { + uint32_t AddPendingFeedback() { std::vector<SpellCheckResult> results(1, BuildSpellCheckResult()); feedback_->OnSpellcheckResults(kRendererProcessId, base::UTF8ToUTF16(kText), @@ -153,14 +156,14 @@ class FeedbackSenderTest : public testing::Test { TEST_F(FeedbackSenderTest, NoFeedback) { EXPECT_FALSE(IsUploadingData()); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_FALSE(IsUploadingData()); } // Do not send data if not aware of which markers are still in the document. TEST_F(FeedbackSenderTest, NoDocumentMarkersReceived) { EXPECT_FALSE(IsUploadingData()); - uint32 hash = AddPendingFeedback(); + uint32_t hash = AddPendingFeedback(); EXPECT_FALSE(IsUploadingData()); static const int kSuggestionIndex = 1; feedback_->SelectedSuggestion(hash, kSuggestionIndex); @@ -170,9 +173,9 @@ TEST_F(FeedbackSenderTest, NoDocumentMarkersReceived) { // Send PENDING feedback message if the marker is still in the document, and the // user has not performed any action on it. TEST_F(FeedbackSenderTest, PendingFeedback) { - uint32 hash = AddPendingFeedback(); + uint32_t hash = AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>(1, hash)); + std::vector<uint32_t>(1, hash)); EXPECT_TRUE(UploadDataContains("\"actionType\":\"PENDING\"")); } @@ -181,17 +184,17 @@ TEST_F(FeedbackSenderTest, PendingFeedback) { TEST_F(FeedbackSenderTest, NoActionFeedback) { AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"actionType\":\"NO_ACTION\"")); } // Send SELECT feedback message if the user has selected a spelling suggestion. TEST_F(FeedbackSenderTest, SelectFeedback) { - uint32 hash = AddPendingFeedback(); + uint32_t hash = AddPendingFeedback(); static const int kSuggestionIndex = 0; feedback_->SelectedSuggestion(hash, kSuggestionIndex); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"actionType\":\"SELECT\"")); EXPECT_TRUE(UploadDataContains("\"actionTargetIndex\":" + kSuggestionIndex)); } @@ -199,51 +202,51 @@ TEST_F(FeedbackSenderTest, SelectFeedback) { // Send ADD_TO_DICT feedback message if the user has added the misspelled word // to the custom dictionary. TEST_F(FeedbackSenderTest, AddToDictFeedback) { - uint32 hash = AddPendingFeedback(); + uint32_t hash = AddPendingFeedback(); feedback_->AddedToDictionary(hash); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"actionType\":\"ADD_TO_DICT\"")); } // Send IN_DICTIONARY feedback message if the user has the misspelled word in // the custom dictionary. TEST_F(FeedbackSenderTest, InDictionaryFeedback) { - uint32 hash = AddPendingFeedback(); + uint32_t hash = AddPendingFeedback(); feedback_->RecordInDictionary(hash); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"actionType\":\"IN_DICTIONARY\"")); } // Send PENDING feedback message if the user saw the spelling suggestion, but // decided to not select it, and the marker is still in the document. TEST_F(FeedbackSenderTest, IgnoreFeedbackMarkerInDocument) { - uint32 hash = AddPendingFeedback(); + uint32_t hash = AddPendingFeedback(); feedback_->IgnoredSuggestions(hash); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>(1, hash)); + std::vector<uint32_t>(1, hash)); EXPECT_TRUE(UploadDataContains("\"actionType\":\"PENDING\"")); } // Send IGNORE feedback message if the user saw the spelling suggestion, but // decided to not select it, and the marker is no longer in the document. TEST_F(FeedbackSenderTest, IgnoreFeedbackMarkerNotInDocument) { - uint32 hash = AddPendingFeedback(); + uint32_t hash = AddPendingFeedback(); feedback_->IgnoredSuggestions(hash); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"actionType\":\"IGNORE\"")); } // Send MANUALLY_CORRECTED feedback message if the user manually corrected the // misspelled word. TEST_F(FeedbackSenderTest, ManuallyCorrectedFeedback) { - uint32 hash = AddPendingFeedback(); + uint32_t hash = AddPendingFeedback(); static const std::string kManualCorrection = "Howdy"; feedback_->ManuallyCorrected(hash, base::ASCIIToUTF16(kManualCorrection)); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"actionType\":\"MANUALLY_CORRECTED\"")); EXPECT_TRUE(UploadDataContains("\"actionTargetValue\":\"" + kManualCorrection + "\"")); @@ -267,15 +270,15 @@ TEST_F(FeedbackSenderTest, BatchFeedback) { std::vector<SpellCheckMarker>(), &results); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"actionType\":\"NO_ACTION\"", 2)); } // Send a series of PENDING feedback messages and one final NO_ACTION feedback // message with the same hash identifier for a single misspelling. TEST_F(FeedbackSenderTest, SameHashFeedback) { - uint32 hash = AddPendingFeedback(); - std::vector<uint32> remaining_markers(1, hash); + uint32_t hash = AddPendingFeedback(); + std::vector<uint32_t> remaining_markers(1, hash); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, remaining_markers); EXPECT_TRUE(UploadDataContains("\"actionType\":\"PENDING\"")); @@ -289,13 +292,13 @@ TEST_F(FeedbackSenderTest, SameHashFeedback) { ClearUploadData(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"actionType\":\"NO_ACTION\"")); EXPECT_TRUE(UploadDataContains(hash_string)); ClearUploadData(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_FALSE(IsUploadingData()); } @@ -315,8 +318,8 @@ TEST_F(FeedbackSenderTest, SessionExpirationFeedback) { base::UTF8ToUTF16(kText), std::vector<SpellCheckMarker>(), &results); - uint32 original_hash = results[0].hash; - std::vector<uint32> remaining_markers(1, original_hash); + uint32_t original_hash = results[0].hash; + std::vector<uint32_t> remaining_markers(1, original_hash); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, remaining_markers); EXPECT_FALSE(UploadDataContains("\"actionType\":\"NO_ACTION\"")); @@ -350,7 +353,7 @@ TEST_F(FeedbackSenderTest, SessionExpirationFeedback) { base::ASCIIToUTF16("Hello")); feedback_->OnSpellcheckResults( kRendererProcessId, base::UTF8ToUTF16(kText), original_markers, &results); - uint32 updated_hash = results[0].hash; + uint32_t updated_hash = results[0].hash; EXPECT_NE(updated_hash, original_hash); remaining_markers[0] = updated_hash; @@ -370,13 +373,13 @@ TEST_F(FeedbackSenderTest, FirstMessageInSessionIndicator) { // Session 1, message 1 AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"isFirstInSession\":true")); // Session 1, message 2 AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"isFirstInSession\":false")); ExpireSession(); @@ -384,19 +387,19 @@ TEST_F(FeedbackSenderTest, FirstMessageInSessionIndicator) { // Session 1, message 3 (last) AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"isFirstInSession\":false")); // Session 2, message 1 AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"isFirstInSession\":true")); // Session 2, message 2 AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"isFirstInSession\":false")); } @@ -414,7 +417,7 @@ TEST_F(FeedbackSenderTest, OnLanguageCountryChange) { TEST_F(FeedbackSenderTest, FeedbackAPI) { AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); std::string actual_data = GetUploadData(); scoped_ptr<base::DictionaryValue> actual(static_cast<base::DictionaryValue*>( base::JSONReader::Read(actual_data).release())); @@ -453,7 +456,7 @@ TEST_F(FeedbackSenderTest, FeedbackAPI) { TEST_F(FeedbackSenderTest, DefaultApiVersion) { AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"apiVersion\":\"v2\"")); EXPECT_FALSE(UploadDataContains("\"apiVersion\":\"v2-internal\"")); } @@ -465,7 +468,7 @@ TEST_F(FeedbackSenderTest, FieldTrialAloneHasSameApiVersion) { AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"apiVersion\":\"v2\"")); EXPECT_FALSE(UploadDataContains("\"apiVersion\":\"v2-internal\"")); @@ -478,7 +481,7 @@ TEST_F(FeedbackSenderTest, CommandLineSwitchAloneHasSameApiVersion) { AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"apiVersion\":\"v2\"")); EXPECT_FALSE(UploadDataContains("\"apiVersion\":\"v2-internal\"")); @@ -492,7 +495,7 @@ TEST_F(FeedbackSenderTest, InternalApiVersion) { AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_FALSE(UploadDataContains("\"apiVersion\":\"v2\"")); EXPECT_TRUE(UploadDataContains("\"apiVersion\":\"v2-internal\"")); @@ -500,7 +503,7 @@ TEST_F(FeedbackSenderTest, InternalApiVersion) { // Duplicate spellcheck results should be matched to the existing markers. TEST_F(FeedbackSenderTest, MatchDupliateResultsWithExistingMarkers) { - uint32 hash = AddPendingFeedback(); + uint32_t hash = AddPendingFeedback(); std::vector<SpellCheckResult> results( 1, SpellCheckResult(SpellCheckResult::SPELLING, @@ -509,7 +512,7 @@ TEST_F(FeedbackSenderTest, MatchDupliateResultsWithExistingMarkers) { base::ASCIIToUTF16("Hello"))); std::vector<SpellCheckMarker> markers( 1, SpellCheckMarker(hash, results[0].location)); - EXPECT_EQ(static_cast<uint32>(0), results[0].hash); + EXPECT_EQ(static_cast<uint32_t>(0), results[0].hash); feedback_->OnSpellcheckResults( kRendererProcessId, base::UTF8ToUTF16(kText), markers, &results); EXPECT_EQ(hash, results[0].hash); @@ -538,7 +541,7 @@ TEST_F(FeedbackSenderTest, MultipleAddToDictFeedback) { &results); last_renderer_process_id = kRendererProcessId + i; } - std::vector<uint32> remaining_markers; + std::vector<uint32_t> remaining_markers; for (size_t i = 0; i < results.size(); ++i) remaining_markers.push_back(results[i].hash); feedback_->OnReceiveDocumentMarkers(last_renderer_process_id, @@ -557,12 +560,12 @@ TEST_F(FeedbackSenderTest, MultipleAddToDictFeedback) { // for pending feedback. TEST_F(FeedbackSenderTest, AddToDictOnlyPending) { AddPendingFeedback(); - uint32 add_to_dict_hash = AddPendingFeedback(); - uint32 select_hash = AddPendingFeedback(); + uint32_t add_to_dict_hash = AddPendingFeedback(); + uint32_t select_hash = AddPendingFeedback(); feedback_->SelectedSuggestion(select_hash, 0); feedback_->AddedToDictionary(add_to_dict_hash); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("SELECT", 1)); EXPECT_TRUE(UploadDataContains("ADD_TO_DICT", 2)); } @@ -585,7 +588,7 @@ TEST_F(FeedbackSenderTest, IgnoreOutOfBounds) { std::vector<SpellCheckMarker>(), &results); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_FALSE(IsUploadingData()); } @@ -594,7 +597,7 @@ TEST_F(FeedbackSenderTest, CanStopFeedbackCollection) { feedback_->StopFeedbackCollection(); AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_FALSE(IsUploadingData()); } @@ -605,7 +608,7 @@ TEST_F(FeedbackSenderTest, CanResumeFeedbackCollection) { feedback_->StartFeedbackCollection(); AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(IsUploadingData()); } @@ -614,10 +617,10 @@ TEST_F(FeedbackSenderTest, NoFeedbackCollectionWhenStopped) { feedback_->StopFeedbackCollection(); AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); feedback_->StartFeedbackCollection(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_FALSE(IsUploadingData()); } @@ -633,7 +636,7 @@ TEST_F(FeedbackSenderTest, TrimFeedback) { "the chance to work hard at work worth doing."), std::vector<SpellCheckMarker>(), &results); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE( UploadDataContains(",\"originalText\":\"and away teh best prize\",")); EXPECT_TRUE(UploadDataContains(",\"misspelledStart\":9,")); diff --git a/chrome/browser/spellchecker/feedback_unittest.cc b/chrome/browser/spellchecker/feedback_unittest.cc index d8c0485..cc2d1f5 100644 --- a/chrome/browser/spellchecker/feedback_unittest.cc +++ b/chrome/browser/spellchecker/feedback_unittest.cc @@ -6,6 +6,9 @@ #include "chrome/browser/spellchecker/feedback.h" +#include <stddef.h> +#include <stdint.h> + #include "base/strings/utf_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" @@ -22,7 +25,7 @@ const size_t kMaxFeedbackSize = 1024; const int kRendererProcessId = 7; // Hash identifier for a misspelling. -const uint32 kMisspellingHash = 42; +const uint32_t kMisspellingHash = 42; } // namespace @@ -33,7 +36,7 @@ class FeedbackTest : public testing::Test { ~FeedbackTest() override {} protected: - void AddMisspelling(int renderer_process_id, uint32 hash) { + void AddMisspelling(int renderer_process_id, uint32_t hash) { feedback_.AddMisspelling(renderer_process_id, Misspelling(base::string16(), 0, 0, std::vector<base::string16>(), hash)); @@ -77,7 +80,7 @@ TEST_F(FeedbackTest, LimitFeedbackSize) { std::vector<base::string16>(50, base::ASCIIToUTF16("9876543210")), 0)); feedback_.FinalizeRemovedMisspellings(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); feedback_.EraseFinalizedMisspellings(kRendererProcessId); feedback_.AddMisspelling( kRendererProcessId, @@ -103,7 +106,7 @@ TEST_F(FeedbackTest, FinalizeRemovedMisspellings) { static const int kRemainingMisspellingHash = 2; AddMisspelling(kRendererProcessId, kRemovedMisspellingHash); AddMisspelling(kRendererProcessId, kRemainingMisspellingHash); - std::vector<uint32> remaining_markers(1, kRemainingMisspellingHash); + std::vector<uint32_t> remaining_markers(1, kRemainingMisspellingHash); feedback_.FinalizeRemovedMisspellings(kRendererProcessId, remaining_markers); Misspelling* removed_misspelling = feedback_.GetMisspelling(kRemovedMisspellingHash); @@ -119,7 +122,7 @@ TEST_F(FeedbackTest, FinalizeRemovedMisspellings) { TEST_F(FeedbackTest, DuplicateMisspellingFinalization) { AddMisspelling(kRendererProcessId, kMisspellingHash); AddMisspelling(kRendererProcessId, kMisspellingHash); - std::vector<uint32> remaining_markers(1, kMisspellingHash); + std::vector<uint32_t> remaining_markers(1, kMisspellingHash); feedback_.FinalizeRemovedMisspellings(kRendererProcessId, remaining_markers); std::vector<Misspelling> misspellings = feedback_.GetAllMisspellings(); EXPECT_EQ(static_cast<size_t>(1), misspellings.size()); @@ -149,7 +152,7 @@ TEST_F(FeedbackTest, GetMisspellingsInRenderer) { TEST_F(FeedbackTest, EraseFinalizedMisspellings) { AddMisspelling(kRendererProcessId, kMisspellingHash); feedback_.FinalizeRemovedMisspellings(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(feedback_.RendererHasMisspellings(kRendererProcessId)); feedback_.EraseFinalizedMisspellings(kRendererProcessId); EXPECT_FALSE(feedback_.RendererHasMisspellings(kRendererProcessId)); @@ -238,7 +241,7 @@ TEST_F(FeedbackTest, FindMisspellingsByText) { static const int kSentenceLength = 14; static const int kNumberOfSentences = 2; static const int kNumberOfRenderers = 2; - uint32 hash = kMisspellingHash; + uint32_t hash = kMisspellingHash; for (int renderer_process_id = kRendererProcessId; renderer_process_id < kRendererProcessId + kNumberOfRenderers; ++renderer_process_id) { @@ -263,12 +266,12 @@ TEST_F(FeedbackTest, FindMisspellingsByText) { std::vector<base::string16>(1, kOtherSuggestion), hash + 1)); static const base::string16 kMisspelledWord = ASCIIToUTF16("Helllo"); - const std::set<uint32>& misspellings = + const std::set<uint32_t>& misspellings = feedback_.FindMisspellings(kMisspelledWord); EXPECT_EQ(static_cast<size_t>(kNumberOfSentences * kNumberOfRenderers), misspellings.size()); - for (std::set<uint32>::const_iterator it = misspellings.begin(); + for (std::set<uint32_t>::const_iterator it = misspellings.begin(); it != misspellings.end(); ++it) { Misspelling* misspelling = feedback_.GetMisspelling(*it); EXPECT_NE(nullptr, misspelling); diff --git a/chrome/browser/spellchecker/misspelling.cc b/chrome/browser/spellchecker/misspelling.cc index 82693f6..86deb0d 100644 --- a/chrome/browser/spellchecker/misspelling.cc +++ b/chrome/browser/spellchecker/misspelling.cc @@ -38,7 +38,7 @@ Misspelling::Misspelling(const base::string16& context, size_t location, size_t length, const std::vector<base::string16>& suggestions, - uint32 hash) + uint32_t hash) : context(context), location(location), length(length), diff --git a/chrome/browser/spellchecker/misspelling.h b/chrome/browser/spellchecker/misspelling.h index d7e4c28..44bd78a 100644 --- a/chrome/browser/spellchecker/misspelling.h +++ b/chrome/browser/spellchecker/misspelling.h @@ -4,7 +4,7 @@ // // An object to store user feedback to a single spellcheck suggestion. // -// Stores the spellcheck suggestion, its uint32 hash identifier, and user's +// Stores the spellcheck suggestion, its uint32_t hash identifier, and user's // feedback. The feedback is indirect, in the sense that we record user's // |action| instead of asking them how they feel about a spellcheck suggestion. // The object can serialize itself. @@ -12,6 +12,9 @@ #ifndef CHROME_BROWSER_SPELLCHECKER_MISSPELLING_H_ #define CHROME_BROWSER_SPELLCHECKER_MISSPELLING_H_ +#include <stddef.h> +#include <stdint.h> + #include <vector> #include "base/time/time.h" @@ -34,7 +37,7 @@ struct Misspelling { size_t location, size_t length, const std::vector<base::string16>& suggestions, - uint32 hash); + uint32_t hash); ~Misspelling(); // A several-word text snippet that immediately surrounds the misspelling. @@ -51,7 +54,7 @@ struct Misspelling { std::vector<base::string16> suggestions; // The hash that identifies the misspelling. - uint32 hash; + uint32_t hash; // User action. SpellcheckAction action; diff --git a/chrome/browser/spellchecker/spellcheck_action_unittest.cc b/chrome/browser/spellchecker/spellcheck_action_unittest.cc index c79e324..48a579f 100644 --- a/chrome/browser/spellchecker/spellcheck_action_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_action_unittest.cc @@ -2,9 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + #include <string> #include "base/json/json_reader.h" +#include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/spellchecker/spellcheck_action.h" diff --git a/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc b/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc index 84a9b52..a0df26f 100644 --- a/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc +++ b/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc @@ -4,6 +4,8 @@ #include "chrome/browser/spellchecker/spellcheck_custom_dictionary.h" +#include <stddef.h> + #include <functional> #include "base/files/file_util.h" diff --git a/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc b/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc index e40d5ec..669e9b7 100644 --- a/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc @@ -4,13 +4,17 @@ #include "chrome/browser/spellchecker/spellcheck_custom_dictionary.h" +#include <stddef.h> + #include <vector> #include "base/files/file_util.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/metrics/histogram_samples.h" #include "base/metrics/statistics_recorder.h" #include "base/strings/string_number_conversions.h" +#include "build/build_config.h" #include "chrome/browser/spellchecker/spellcheck_factory.h" #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" #include "chrome/browser/spellchecker/spellcheck_service.h" diff --git a/chrome/browser/spellchecker/spellcheck_dictionary.h b/chrome/browser/spellchecker/spellcheck_dictionary.h index e9f8b7a..ea94c98 100644 --- a/chrome/browser/spellchecker/spellcheck_dictionary.h +++ b/chrome/browser/spellchecker/spellcheck_dictionary.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_DICTIONARY_H_ #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_DICTIONARY_H_ -#include "base/basictypes.h" +#include "base/macros.h" // Defines a dictionary for use in the spellchecker system and provides access // to words within the dictionary. diff --git a/chrome/browser/spellchecker/spellcheck_factory.h b/chrome/browser/spellchecker/spellcheck_factory.h index 7cdf471..e8eb9f7 100644 --- a/chrome/browser/spellchecker/spellcheck_factory.h +++ b/chrome/browser/spellchecker/spellcheck_factory.h @@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_FACTORY_H_ #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_FACTORY_H_ -#include "base/basictypes.h" #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/memory/singleton.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" diff --git a/chrome/browser/spellchecker/spellcheck_host_metrics.cc b/chrome/browser/spellchecker/spellcheck_host_metrics.cc index 4d997f0..4899e10 100644 --- a/chrome/browser/spellchecker/spellcheck_host_metrics.cc +++ b/chrome/browser/spellchecker/spellcheck_host_metrics.cc @@ -4,6 +4,8 @@ #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" +#include <stdint.h> + #include "base/md5.h" #include "base/metrics/histogram.h" @@ -18,7 +20,7 @@ SpellCheckHostMetrics::SpellCheckHostMetrics() last_replaced_word_count_(-1), last_unique_word_count_(-1), start_time_(base::TimeTicks::Now()) { - const uint64 kHistogramTimerDurationInMinutes = 30; + const uint64_t kHistogramTimerDurationInMinutes = 30; recording_timer_.Start(FROM_HERE, base::TimeDelta::FromMinutes(kHistogramTimerDurationInMinutes), this, &SpellCheckHostMetrics::OnHistogramTimerExpired); diff --git a/chrome/browser/spellchecker/spellcheck_host_metrics.h b/chrome/browser/spellchecker/spellcheck_host_metrics.h index d28b09a..fe0df15 100644 --- a/chrome/browser/spellchecker/spellcheck_host_metrics.h +++ b/chrome/browser/spellchecker/spellcheck_host_metrics.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_HOST_METRICS_H_ #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_HOST_METRICS_H_ +#include <stddef.h> + #include <string> #include <vector> diff --git a/chrome/browser/spellchecker/spellcheck_host_metrics_unittest.cc b/chrome/browser/spellchecker/spellcheck_host_metrics_unittest.cc index f66379a..d8b8d51 100644 --- a/chrome/browser/spellchecker/spellcheck_host_metrics_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_host_metrics_unittest.cc @@ -4,13 +4,16 @@ #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" -#include "base/basictypes.h" +#include <stddef.h> + +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/metrics/histogram_samples.h" #include "base/metrics/statistics_recorder.h" #include "base/strings/utf_string_conversions.h" #include "base/test/histogram_tester.h" +#include "build/build_config.h" #include "testing/gtest/include/gtest/gtest.h" #if defined(OS_WIN) diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc index fd575c3..ea82a0c 100644 --- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc +++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc @@ -4,12 +4,15 @@ #include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h" +#include <stddef.h> + #include <utility> #include "base/files/file_util.h" #include "base/logging.h" #include "base/message_loop/message_loop.h" #include "base/path_service.h" +#include "build/build_config.h" #include "chrome/browser/spellchecker/spellcheck_platform.h" #include "chrome/browser/spellchecker/spellcheck_service.h" #include "chrome/common/chrome_paths.h" diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h index a53dc00..902d705f 100644 --- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h +++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h @@ -9,6 +9,7 @@ #include "base/files/file.h" #include "base/files/file_path.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/move.h" diff --git a/chrome/browser/spellchecker/spellcheck_message_filter.cc b/chrome/browser/spellchecker/spellcheck_message_filter.cc index 2cd28a1..0519253 100644 --- a/chrome/browser/spellchecker/spellcheck_message_filter.cc +++ b/chrome/browser/spellchecker/spellcheck_message_filter.cc @@ -96,7 +96,7 @@ void SpellCheckMessageFilter::OnNotifyChecked(const base::string16& word, } void SpellCheckMessageFilter::OnRespondDocumentMarkers( - const std::vector<uint32>& markers) { + const std::vector<uint32_t>& markers) { SpellcheckService* spellcheck = GetSpellcheckService(); // Spellcheck service may not be available for a renderer process that is // shutting down. diff --git a/chrome/browser/spellchecker/spellcheck_message_filter.h b/chrome/browser/spellchecker/spellcheck_message_filter.h index 500f22f..43671a8 100644 --- a/chrome/browser/spellchecker/spellcheck_message_filter.h +++ b/chrome/browser/spellchecker/spellcheck_message_filter.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_MESSAGE_FILTER_H_ #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_MESSAGE_FILTER_H_ +#include <stdint.h> + #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/spellchecker/spelling_service_client.h" @@ -32,7 +34,7 @@ class SpellCheckMessageFilter : public content::BrowserMessageFilter { void OnSpellCheckerRequestDictionary(); void OnNotifyChecked(const base::string16& word, bool misspelled); - void OnRespondDocumentMarkers(const std::vector<uint32>& markers); + void OnRespondDocumentMarkers(const std::vector<uint32_t>& markers); #if !defined(USE_BROWSER_SPELLCHECKER) void OnCallSpellingService(int route_id, int identifier, diff --git a/chrome/browser/spellchecker/spellcheck_message_filter_platform.h b/chrome/browser/spellchecker/spellcheck_message_filter_platform.h index 080f5631..1c2d39c 100644 --- a/chrome/browser/spellchecker/spellcheck_message_filter_platform.h +++ b/chrome/browser/spellchecker/spellcheck_message_filter_platform.h @@ -7,6 +7,8 @@ #include <map> +#include "base/macros.h" +#include "build/build_config.h" #include "chrome/browser/spellchecker/spellcheck_message_filter.h" #include "chrome/common/spellcheck_result.h" #include "content/public/browser/browser_message_filter.h" diff --git a/chrome/browser/spellchecker/spellcheck_message_filter_platform_mac_unittest.cc b/chrome/browser/spellchecker/spellcheck_message_filter_platform_mac_unittest.cc index 26897c0..07de381 100644 --- a/chrome/browser/spellchecker/spellcheck_message_filter_platform_mac_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_message_filter_platform_mac_unittest.cc @@ -4,6 +4,10 @@ #include "chrome/browser/spellchecker/spellcheck_message_filter_platform.h" +#include <stddef.h> +#include <stdint.h> + +#include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "chrome/common/spellcheck_messages.h" #include "chrome/common/spellcheck_result.h" @@ -45,8 +49,8 @@ TEST(SpellcheckMessageFilterPlatformMacTest, CombineResults) { } TEST(SpellCheckMessageFilterPlatformMacTest, TestOverrideThread) { - static const uint32 kSpellcheckMessages[] = { - SpellCheckHostMsg_RequestTextCheck::ID, + static const uint32_t kSpellcheckMessages[] = { + SpellCheckHostMsg_RequestTextCheck::ID, }; scoped_refptr<SpellCheckMessageFilterPlatform> filter( new SpellCheckMessageFilterPlatform(0)); diff --git a/chrome/browser/spellchecker/spellcheck_message_filter_unittest.cc b/chrome/browser/spellchecker/spellcheck_message_filter_unittest.cc index fb4c9fc..66a04dc 100644 --- a/chrome/browser/spellchecker/spellcheck_message_filter_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_message_filter_unittest.cc @@ -2,6 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> +#include <stdint.h> + +#include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/spellchecker/spellcheck_factory.h" #include "chrome/browser/spellchecker/spellcheck_message_filter.h" @@ -53,7 +57,7 @@ class TestingSpellCheckMessageFilter : public SpellCheckMessageFilter { }; TEST(SpellCheckMessageFilterTest, TestOverrideThread) { - static const uint32 kSpellcheckMessages[] = { + static const uint32_t kSpellcheckMessages[] = { SpellCheckHostMsg_RequestDictionary::ID, SpellCheckHostMsg_NotifyChecked::ID, SpellCheckHostMsg_RespondDocumentMarkers::ID, diff --git a/chrome/browser/spellchecker/spellcheck_platform_mac_unittest.cc b/chrome/browser/spellchecker/spellcheck_platform_mac_unittest.cc index c8dbe9d..b33262e 100644 --- a/chrome/browser/spellchecker/spellcheck_platform_mac_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_platform_mac_unittest.cc @@ -4,7 +4,10 @@ #include "chrome/browser/spellchecker/spellcheck_platform.h" +#include <stddef.h> + #include "base/bind.h" +#include "base/macros.h" #include "base/message_loop/message_loop.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc index 64083aa..7943c1d 100644 --- a/chrome/browser/spellchecker/spellcheck_service.cc +++ b/chrome/browser/spellchecker/spellcheck_service.cc @@ -10,6 +10,7 @@ #include "base/strings/string_split.h" #include "base/supports_user_data.h" #include "base/synchronization/waitable_event.h" +#include "build/build_config.h" #include "chrome/browser/spellchecker/feedback_sender.h" #include "chrome/browser/spellchecker/spellcheck_factory.h" #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" diff --git a/chrome/browser/spellchecker/spellcheck_service.h b/chrome/browser/spellchecker/spellcheck_service.h index 35e6f3c..643e3fa 100644 --- a/chrome/browser/spellchecker/spellcheck_service.h +++ b/chrome/browser/spellchecker/spellcheck_service.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_SERVICE_H_ #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_SERVICE_H_ +#include <stddef.h> + #include <string> #include <vector> @@ -14,6 +16,7 @@ #include "base/memory/scoped_vector.h" #include "base/memory/weak_ptr.h" #include "base/prefs/pref_change_registrar.h" +#include "build/build_config.h" #include "chrome/browser/spellchecker/spellcheck_custom_dictionary.h" #include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h" #include "components/keyed_service/core/keyed_service.h" diff --git a/chrome/browser/spellchecker/spellcheck_service_browsertest.cc b/chrome/browser/spellchecker/spellcheck_service_browsertest.cc index 55b87bd..506c1b0 100644 --- a/chrome/browser/spellchecker/spellcheck_service_browsertest.cc +++ b/chrome/browser/spellchecker/spellcheck_service_browsertest.cc @@ -2,7 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> +#include <stdint.h> + #include "base/command_line.h" +#include "base/macros.h" #include "base/path_service.h" #include "base/prefs/pref_service.h" #include "base/synchronization/waitable_event.h" @@ -25,16 +29,13 @@ namespace { // A corrupted BDICT data used in DeleteCorruptedBDICT. Please do not use this // BDICT data for other tests. -const uint8 kCorruptedBDICT[] = { - 0x42, 0x44, 0x69, 0x63, 0x02, 0x00, 0x01, 0x00, - 0x20, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, - 0x65, 0x72, 0xe0, 0xac, 0x27, 0xc7, 0xda, 0x66, - 0x6d, 0x1e, 0xa6, 0x35, 0xd1, 0xf6, 0xb7, 0x35, - 0x32, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, - 0x39, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, - 0x0a, 0x0a, 0x41, 0x46, 0x20, 0x30, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xe6, 0x49, 0x00, 0x68, 0x02, - 0x73, 0x06, 0x74, 0x0b, 0x77, 0x11, 0x79, 0x15, +const uint8_t kCorruptedBDICT[] = { + 0x42, 0x44, 0x69, 0x63, 0x02, 0x00, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x3b, 0x00, 0x00, 0x00, 0x65, 0x72, 0xe0, 0xac, 0x27, 0xc7, 0xda, 0x66, + 0x6d, 0x1e, 0xa6, 0x35, 0xd1, 0xf6, 0xb7, 0x35, 0x32, 0x00, 0x00, 0x00, + 0x38, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, + 0x0a, 0x0a, 0x41, 0x46, 0x20, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, + 0x49, 0x00, 0x68, 0x02, 0x73, 0x06, 0x74, 0x0b, 0x77, 0x11, 0x79, 0x15, }; } // namespace diff --git a/chrome/browser/spellchecker/spellcheck_service_unittest.cc b/chrome/browser/spellchecker/spellcheck_service_unittest.cc index ad781ef..3765989 100644 --- a/chrome/browser/spellchecker/spellcheck_service_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_service_unittest.cc @@ -4,7 +4,10 @@ #include "chrome/browser/spellchecker/spellcheck_service.h" +#include <stddef.h> + #include "base/command_line.h" +#include "base/macros.h" #include "base/message_loop/message_loop.h" #include "base/prefs/pref_registry_simple.h" #include "base/prefs/testing_pref_service.h" diff --git a/chrome/browser/spellchecker/spellchecker_session_bridge_android.cc b/chrome/browser/spellchecker/spellchecker_session_bridge_android.cc index c10fedf..03a1bb4 100644 --- a/chrome/browser/spellchecker/spellchecker_session_bridge_android.cc +++ b/chrome/browser/spellchecker/spellchecker_session_bridge_android.cc @@ -4,6 +4,8 @@ #include "chrome/browser/spellchecker/spellchecker_session_bridge_android.h" +#include <stddef.h> + #include "base/android/jni_array.h" #include "base/android/jni_string.h" #include "chrome/common/spellcheck_messages.h" diff --git a/chrome/browser/spellchecker/spellchecker_session_bridge_android.h b/chrome/browser/spellchecker/spellchecker_session_bridge_android.h index 6c56fae..d520b3b 100644 --- a/chrome/browser/spellchecker/spellchecker_session_bridge_android.h +++ b/chrome/browser/spellchecker/spellchecker_session_bridge_android.h @@ -8,6 +8,7 @@ #include <jni.h> #include "base/android/scoped_java_ref.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" diff --git a/chrome/browser/spellchecker/spelling_service_client.cc b/chrome/browser/spellchecker/spelling_service_client.cc index 888af4a..d769b27 100644 --- a/chrome/browser/spellchecker/spelling_service_client.cc +++ b/chrome/browser/spellchecker/spelling_service_client.cc @@ -4,6 +4,8 @@ #include "chrome/browser/spellchecker/spelling_service_client.h" +#include <stddef.h> + #include <algorithm> #include "base/json/json_reader.h" diff --git a/chrome/browser/spellchecker/spelling_service_client_unittest.cc b/chrome/browser/spellchecker/spelling_service_client_unittest.cc index 2e9caa9..652ecf54 100644 --- a/chrome/browser/spellchecker/spelling_service_client_unittest.cc +++ b/chrome/browser/spellchecker/spelling_service_client_unittest.cc @@ -2,11 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + #include <string> #include <vector> #include "base/bind.h" #include "base/json/json_reader.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/prefs/pref_service.h" #include "base/strings/stringprintf.h" diff --git a/chrome/browser/spellchecker/word_trimmer.h b/chrome/browser/spellchecker/word_trimmer.h index 5b108d3..fdfcc56 100644 --- a/chrome/browser/spellchecker/word_trimmer.h +++ b/chrome/browser/spellchecker/word_trimmer.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_SPELLCHECKER_WORD_TRIMMER_H_ #define CHROME_BROWSER_SPELLCHECKER_WORD_TRIMMER_H_ +#include <stddef.h> + #include "base/strings/string16.h" // Trims |text| to contain only the range from |start| to |end| and |keep| words diff --git a/chrome/browser/spellchecker/word_trimmer_unittest.cc b/chrome/browser/spellchecker/word_trimmer_unittest.cc index 35b8e6a..f35c629 100644 --- a/chrome/browser/spellchecker/word_trimmer_unittest.cc +++ b/chrome/browser/spellchecker/word_trimmer_unittest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/spellchecker/word_trimmer.h" +#include <stddef.h> + #include "base/strings/utf_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/ssl/bad_clock_blocking_page.h b/chrome/browser/ssl/bad_clock_blocking_page.h index c84079f..456df55 100644 --- a/chrome/browser/ssl/bad_clock_blocking_page.h +++ b/chrome/browser/ssl/bad_clock_blocking_page.h @@ -8,6 +8,7 @@ #include <string> #include "base/callback.h" +#include "base/macros.h" #include "base/time/time.h" #include "chrome/browser/interstitials/security_interstitial_page.h" #include "chrome/browser/ssl/ssl_cert_reporter.h" diff --git a/chrome/browser/ssl/captive_portal_blocking_page.cc b/chrome/browser/ssl/captive_portal_blocking_page.cc index adeca5bd..3c03c30 100644 --- a/chrome/browser/ssl/captive_portal_blocking_page.cc +++ b/chrome/browser/ssl/captive_portal_blocking_page.cc @@ -11,6 +11,7 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" +#include "build/build_config.h" #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ssl/cert_report_helper.h" diff --git a/chrome/browser/ssl/cert_report_helper.cc b/chrome/browser/ssl/cert_report_helper.cc index 0d277b2..ad03413 100644 --- a/chrome/browser/ssl/cert_report_helper.cc +++ b/chrome/browser/ssl/cert_report_helper.cc @@ -11,6 +11,7 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ssl/ssl_cert_reporter.h" #include "chrome/common/pref_names.h" diff --git a/chrome/browser/ssl/cert_report_helper.h b/chrome/browser/ssl/cert_report_helper.h index 3e63405..a9b15355 100644 --- a/chrome/browser/ssl/cert_report_helper.h +++ b/chrome/browser/ssl/cert_report_helper.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "chrome/browser/interstitials/security_interstitial_page.h" #include "components/certificate_reporting/error_report.h" #include "net/ssl/ssl_info.h" diff --git a/chrome/browser/ssl/certificate_reporting_test_utils.cc b/chrome/browser/ssl/certificate_reporting_test_utils.cc index 22d1700..6a4ae89 100644 --- a/chrome/browser/ssl/certificate_reporting_test_utils.cc +++ b/chrome/browser/ssl/certificate_reporting_test_utils.cc @@ -6,6 +6,7 @@ #include "base/bind.h" #include "base/bind_helpers.h" +#include "base/macros.h" #include "base/metrics/field_trial.h" #include "base/prefs/pref_service.h" #include "base/run_loop.h" diff --git a/chrome/browser/ssl/chrome_security_state_model_client.cc b/chrome/browser/ssl/chrome_security_state_model_client.cc index ec43aef..c0cbc45 100644 --- a/chrome/browser/ssl/chrome_security_state_model_client.cc +++ b/chrome/browser/ssl/chrome_security_state_model_client.cc @@ -7,6 +7,7 @@ #include "base/command_line.h" #include "base/metrics/field_trial.h" #include "base/metrics/histogram_macros.h" +#include "build/build_config.h" #include "chrome/browser/chromeos/policy/policy_cert_service.h" #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" #include "chrome/browser/profiles/profile.h" diff --git a/chrome/browser/ssl/chrome_ssl_host_state_delegate.cc b/chrome/browser/ssl/chrome_ssl_host_state_delegate.cc index 1295d3c..c4e7b44 100644 --- a/chrome/browser/ssl/chrome_ssl_host_state_delegate.cc +++ b/chrome/browser/ssl/chrome_ssl_host_state_delegate.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" +#include <stdint.h> + #include <set> #include "base/base64.h" @@ -187,7 +189,7 @@ base::DictionaryValue* ChromeSSLHostStateDelegate::GetValidCertDecisionsDict( base::Time decision_expiration; if (dict->HasKey(kSSLCertDecisionExpirationTimeKey)) { std::string decision_expiration_string; - int64 decision_expiration_int64; + int64_t decision_expiration_int64; success = dict->GetString(kSSLCertDecisionExpirationTimeKey, &decision_expiration_string); if (!base::StringToInt64(base::StringPiece(decision_expiration_string), @@ -217,7 +219,7 @@ base::DictionaryValue* ChromeSSLHostStateDelegate::GetValidCertDecisionsDict( expired = true; base::Time expiration_time = now + base::TimeDelta::FromSeconds(kDeltaDefaultExpirationInSeconds); - // Unfortunately, JSON (and thus content settings) doesn't support int64 + // Unfortunately, JSON (and thus content settings) doesn't support int64_t // values, only doubles. Since this mildly depends on precision, it is // better to store the value as a string. dict->SetString(kSSLCertDecisionExpirationTimeKey, diff --git a/chrome/browser/ssl/chrome_ssl_host_state_delegate.h b/chrome/browser/ssl/chrome_ssl_host_state_delegate.h index 3cc0ebc..374403a9 100644 --- a/chrome/browser/ssl/chrome_ssl_host_state_delegate.h +++ b/chrome/browser/ssl/chrome_ssl_host_state_delegate.h @@ -6,6 +6,7 @@ #define CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_H_ #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "content/public/browser/ssl_host_state_delegate.h" diff --git a/chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.cc b/chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.cc index 6258657..f456740 100644 --- a/chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.cc +++ b/chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.cc @@ -4,6 +4,7 @@ #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" diff --git a/chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h b/chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h index b056592..a638dd5 100644 --- a/chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h +++ b/chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_FACTORY_H_ #define CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_FACTORY_H_ +#include "base/macros.h" #include "base/memory/singleton.h" #include "base/prefs/pref_service.h" #include "base/values.h" diff --git a/chrome/browser/ssl/common_name_mismatch_handler.h b/chrome/browser/ssl/common_name_mismatch_handler.h index 5b8067f..95801d2 100644 --- a/chrome/browser/ssl/common_name_mismatch_handler.h +++ b/chrome/browser/ssl/common_name_mismatch_handler.h @@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_SSL_COMMON_NAME_MISMATCH_HANDLER_H_ #define CHROME_BROWSER_SSL_COMMON_NAME_MISMATCH_HANDLER_H_ -#include "base/basictypes.h" #include "base/callback.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/threading/non_thread_safe.h" diff --git a/chrome/browser/ssl/security_state_model.cc b/chrome/browser/ssl/security_state_model.cc index a2dad81..f0022d6 100644 --- a/chrome/browser/ssl/security_state_model.cc +++ b/chrome/browser/ssl/security_state_model.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ssl/security_state_model.h" +#include <stdint.h> + #include "base/command_line.h" #include "base/metrics/field_trial.h" #include "base/metrics/histogram_macros.h" diff --git a/chrome/browser/ssl/security_state_model_unittest.cc b/chrome/browser/ssl/security_state_model_unittest.cc index af14dfa..788106c 100644 --- a/chrome/browser/ssl/security_state_model_unittest.cc +++ b/chrome/browser/ssl/security_state_model_unittest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ssl/security_state_model.h" +#include <stdint.h> + #include "chrome/browser/ssl/security_state_model_client.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "chrome/test/base/testing_profile.h" @@ -39,7 +41,7 @@ class TestSecurityStateModelClient : public SecurityStateModelClient { void set_connection_status(int connection_status) { connection_status_ = connection_status; } - void SetCipherSuite(uint16 ciphersuite) { + void SetCipherSuite(uint16_t ciphersuite) { net::SSLConnectionStatusSetCipherSuite(ciphersuite, &connection_status_); } void AddCertStatus(net::CertStatus cert_status) { @@ -155,7 +157,7 @@ TEST_F(SecurityStateModelTest, SecureProtocolAndCiphersuite) { model.SetClient(&client); // TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 from // http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-4 - const uint16 ciphersuite = 0xc02f; + const uint16_t ciphersuite = 0xc02f; client.set_connection_status(net::SSL_CONNECTION_VERSION_TLS1_2 << net::SSL_CONNECTION_VERSION_SHIFT); client.SetCipherSuite(ciphersuite); @@ -170,7 +172,7 @@ TEST_F(SecurityStateModelTest, NonsecureProtocol) { model.SetClient(&client); // TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 from // http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-4 - const uint16 ciphersuite = 0xc02f; + const uint16_t ciphersuite = 0xc02f; client.set_connection_status(net::SSL_CONNECTION_VERSION_TLS1_1 << net::SSL_CONNECTION_VERSION_SHIFT); client.SetCipherSuite(ciphersuite); @@ -185,7 +187,7 @@ TEST_F(SecurityStateModelTest, NonsecureCiphersuite) { model.SetClient(&client); // TLS_RSA_WITH_AES_128_CCM_8 from // http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-4 - const uint16 ciphersuite = 0xc0a0; + const uint16_t ciphersuite = 0xc0a0; client.set_connection_status(net::SSL_CONNECTION_VERSION_TLS1_2 << net::SSL_CONNECTION_VERSION_SHIFT); client.SetCipherSuite(ciphersuite); diff --git a/chrome/browser/ssl/ssl_add_certificate.cc b/chrome/browser/ssl/ssl_add_certificate.cc index 7b8d51e..312b663 100644 --- a/chrome/browser/ssl/ssl_add_certificate.cc +++ b/chrome/browser/ssl/ssl_add_certificate.cc @@ -4,9 +4,10 @@ #include "chrome/browser/ssl/ssl_add_certificate.h" -#include "base/basictypes.h" +#include "base/macros.h" #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/certificate_viewer.h" #include "chrome/browser/infobars/infobar_service.h" #include "chrome/grit/generated_resources.h" diff --git a/chrome/browser/ssl/ssl_add_certificate.h b/chrome/browser/ssl/ssl_add_certificate.h index a539f01..dfb6c50 100644 --- a/chrome/browser/ssl/ssl_add_certificate.h +++ b/chrome/browser/ssl/ssl_add_certificate.h @@ -5,7 +5,8 @@ #ifndef CHROME_BROWSER_SSL_SSL_ADD_CERTIFICATE_H_ #define CHROME_BROWSER_SSL_SSL_ADD_CERTIFICATE_H_ -#include "base/basictypes.h" +#include <stddef.h> + #include "net/base/mime_util.h" namespace net { diff --git a/chrome/browser/ssl/ssl_add_certificate_android.cc b/chrome/browser/ssl/ssl_add_certificate_android.cc index 14c05e8..7564edf 100644 --- a/chrome/browser/ssl/ssl_add_certificate_android.cc +++ b/chrome/browser/ssl/ssl_add_certificate_android.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ssl/ssl_add_certificate.h" +#include <stddef.h> + #include "net/android/network_library.h" namespace chrome { diff --git a/chrome/browser/ssl/ssl_blocking_page.h b/chrome/browser/ssl/ssl_blocking_page.h index 6d7d87a..f3906ac 100644 --- a/chrome/browser/ssl/ssl_blocking_page.h +++ b/chrome/browser/ssl/ssl_blocking_page.h @@ -9,6 +9,7 @@ #include <vector> #include "base/callback.h" +#include "base/macros.h" #include "base/strings/string16.h" #include "base/task/cancelable_task_tracker.h" #include "base/time/time.h" diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc index 3efdb08..2107821 100644 --- a/chrome/browser/ssl/ssl_browser_tests.cc +++ b/chrome/browser/ssl/ssl_browser_tests.cc @@ -8,6 +8,7 @@ #include "base/callback.h" #include "base/command_line.h" #include "base/location.h" +#include "base/macros.h" #include "base/metrics/field_trial.h" #include "base/prefs/pref_service.h" #include "base/single_thread_task_runner.h" @@ -19,6 +20,7 @@ #include "base/test/simple_test_clock.h" #include "base/thread_task_runner_handle.h" #include "base/time/time.h" +#include "build/build_config.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_notification_types.h" diff --git a/chrome/browser/ssl/ssl_client_auth_observer.h b/chrome/browser/ssl/ssl_client_auth_observer.h index ee26134..e62992d 100644 --- a/chrome/browser/ssl/ssl_client_auth_observer.h +++ b/chrome/browser/ssl/ssl_client_auth_observer.h @@ -6,6 +6,7 @@ #define CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_OBSERVER_H_ #include "base/callback.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "content/public/browser/notification_observer.h" diff --git a/chrome/browser/ssl/ssl_error_handler.cc b/chrome/browser/ssl/ssl_error_handler.cc index 529e97c..5d23b01 100644 --- a/chrome/browser/ssl/ssl_error_handler.cc +++ b/chrome/browser/ssl/ssl_error_handler.cc @@ -4,7 +4,10 @@ #include "chrome/browser/ssl/ssl_error_handler.h" +#include <stdint.h> + #include "base/callback_helpers.h" +#include "base/macros.h" #include "base/metrics/field_trial.h" #include "base/metrics/histogram.h" #include "base/strings/stringprintf.h" @@ -38,7 +41,7 @@ namespace { // - If a "captive portal detected" result arrives during this time, // a captive portal interstitial is displayed. // - Otherwise, an SSL interstitial is displayed. -int64 g_interstitial_delay_in_milliseconds = 2000; +int64_t g_interstitial_delay_in_milliseconds = 2000; // Callback to call when the interstitial timer is started. Used for testing. SSLErrorHandler::TimerStartedCallback* g_timer_started_callback = nullptr; diff --git a/chrome/browser/ssl/ssl_error_handler_unittest.cc b/chrome/browser/ssl/ssl_error_handler_unittest.cc index 72be3e1..21f5830 100644 --- a/chrome/browser/ssl/ssl_error_handler_unittest.cc +++ b/chrome/browser/ssl/ssl_error_handler_unittest.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ssl/ssl_error_handler.h" #include "base/callback.h" +#include "base/macros.h" #include "base/message_loop/message_loop.h" #include "base/metrics/field_trial.h" #include "base/run_loop.h" diff --git a/chrome/browser/stack_sampling_configuration.h b/chrome/browser/stack_sampling_configuration.h index 9d18aa8..9a52b03 100644 --- a/chrome/browser/stack_sampling_configuration.h +++ b/chrome/browser/stack_sampling_configuration.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_STACK_SAMPLING_CONFIGURATION_H_ #define CHROME_BROWSER_STACK_SAMPLING_CONFIGURATION_H_ +#include "base/macros.h" #include "base/profiler/stack_sampling_profiler.h" // Chooses a configuration for the stack sampling profiler for browser process diff --git a/chrome/browser/status_icons/desktop_notification_balloon.cc b/chrome/browser/status_icons/desktop_notification_balloon.cc index fd43576..ff91fe5 100644 --- a/chrome/browser/status_icons/desktop_notification_balloon.cc +++ b/chrome/browser/status_icons/desktop_notification_balloon.cc @@ -4,6 +4,8 @@ #include "chrome/browser/status_icons/desktop_notification_balloon.h" +#include <stddef.h> + #include "base/bind.h" #include "base/location.h" #include "base/single_thread_task_runner.h" diff --git a/chrome/browser/status_icons/desktop_notification_balloon.h b/chrome/browser/status_icons/desktop_notification_balloon.h index e73508e..cd04be0 100644 --- a/chrome/browser/status_icons/desktop_notification_balloon.h +++ b/chrome/browser/status_icons/desktop_notification_balloon.h @@ -6,6 +6,7 @@ #define CHROME_BROWSER_STATUS_ICONS_DESKTOP_NOTIFICATION_BALLOON_H_ #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" diff --git a/chrome/browser/status_icons/status_icon.cc b/chrome/browser/status_icons/status_icon.cc index bc52001..3de7c37 100644 --- a/chrome/browser/status_icons/status_icon.cc +++ b/chrome/browser/status_icons/status_icon.cc @@ -4,6 +4,7 @@ #include "chrome/browser/status_icons/status_icon.h" +#include "build/build_config.h" #include "chrome/browser/status_icons/status_icon_observer.h" StatusIcon::StatusIcon() { diff --git a/chrome/browser/status_icons/status_icon.h b/chrome/browser/status_icons/status_icon.h index e49c998..13985cc 100644 --- a/chrome/browser/status_icons/status_icon.h +++ b/chrome/browser/status_icons/status_icon.h @@ -5,10 +5,11 @@ #ifndef CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_H_ #define CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "base/strings/string16.h" +#include "build/build_config.h" #include "chrome/browser/status_icons/status_icon_menu_model.h" namespace gfx { diff --git a/chrome/browser/status_icons/status_icon_menu_model.h b/chrome/browser/status_icons/status_icon_menu_model.h index 7481420..57967a5 100644 --- a/chrome/browser/status_icons/status_icon_menu_model.h +++ b/chrome/browser/status_icons/status_icon_menu_model.h @@ -7,6 +7,7 @@ #include <map> +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "ui/base/models/simple_menu_model.h" diff --git a/chrome/browser/status_icons/status_icon_observer.h b/chrome/browser/status_icons/status_icon_observer.h index 4183567..65a801e 100644 --- a/chrome/browser/status_icons/status_icon_observer.h +++ b/chrome/browser/status_icons/status_icon_observer.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_OBSERVER_H_ #define CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_OBSERVER_H_ +#include "build/build_config.h" + class StatusIconObserver { public: // Called when the user clicks on the system tray icon. Clicks that result diff --git a/chrome/browser/status_icons/status_tray.h b/chrome/browser/status_icons/status_tray.h index 9a5c9bf..a5a21dc 100644 --- a/chrome/browser/status_icons/status_tray.h +++ b/chrome/browser/status_icons/status_tray.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_STATUS_ICONS_STATUS_TRAY_H_ #define CHROME_BROWSER_STATUS_ICONS_STATUS_TRAY_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/scoped_vector.h" #include "base/strings/string16.h" diff --git a/chrome/browser/storage/durable_storage_browsertest.cc b/chrome/browser/storage/durable_storage_browsertest.cc index fa8e826..73dc079 100644 --- a/chrome/browser/storage/durable_storage_browsertest.cc +++ b/chrome/browser/storage/durable_storage_browsertest.cc @@ -5,6 +5,7 @@ #include <string> #include "base/command_line.h" +#include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" #include "chrome/browser/profiles/profile.h" diff --git a/chrome/browser/storage/durable_storage_permission_context.h b/chrome/browser/storage/durable_storage_permission_context.h index 7f30302..69ffeb8 100644 --- a/chrome/browser/storage/durable_storage_permission_context.h +++ b/chrome/browser/storage/durable_storage_permission_context.h @@ -7,6 +7,7 @@ #include <vector> +#include "base/macros.h" #include "chrome/browser/permissions/permission_context_base.h" #include "components/bookmarks/browser/bookmark_model.h" diff --git a/chrome/browser/storage/durable_storage_permission_context_factory.h b/chrome/browser/storage/durable_storage_permission_context_factory.h index 63f1a04..2440ffb 100644 --- a/chrome/browser/storage/durable_storage_permission_context_factory.h +++ b/chrome/browser/storage/durable_storage_permission_context_factory.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_STORAGE_DURABLE_STORAGE_PERMISSION_CONTEXT_FACTORY_H_ #define CHROME_BROWSER_STORAGE_DURABLE_STORAGE_PERMISSION_CONTEXT_FACTORY_H_ +#include "base/macros.h" #include "base/memory/singleton.h" #include "chrome/browser/permissions/permission_context_factory_base.h" diff --git a/chrome/browser/storage/durable_storage_permission_context_unittest.cc b/chrome/browser/storage/durable_storage_permission_context_unittest.cc index 21517e05..101df286 100644 --- a/chrome/browser/storage/durable_storage_permission_context_unittest.cc +++ b/chrome/browser/storage/durable_storage_permission_context_unittest.cc @@ -4,6 +4,7 @@ #include "chrome/browser/storage/durable_storage_permission_context.h" +#include "base/macros.h" #include "testing/gtest/include/gtest/gtest.h" using bookmarks::BookmarkModel; diff --git a/chrome/browser/supervised_user/child_accounts/child_account_service.cc b/chrome/browser/supervised_user/child_accounts/child_account_service.cc index aa74226..b6d9889 100644 --- a/chrome/browser/supervised_user/child_accounts/child_account_service.cc +++ b/chrome/browser/supervised_user/child_accounts/child_account_service.cc @@ -9,6 +9,7 @@ #include "base/metrics/field_trial.h" #include "base/prefs/pref_service.h" #include "base/values.h" +#include "build/build_config.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/account_tracker_service_factory.h" #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" diff --git a/chrome/browser/supervised_user/child_accounts/family_info_fetcher.cc b/chrome/browser/supervised_user/child_accounts/family_info_fetcher.cc index 47c6899..d545806 100644 --- a/chrome/browser/supervised_user/child_accounts/family_info_fetcher.cc +++ b/chrome/browser/supervised_user/child_accounts/family_info_fetcher.cc @@ -4,7 +4,10 @@ #include "chrome/browser/supervised_user/child_accounts/family_info_fetcher.h" +#include <stddef.h> + #include "base/json/json_reader.h" +#include "base/macros.h" #include "base/strings/stringprintf.h" #include "base/values.h" #include "net/base/load_flags.h" diff --git a/chrome/browser/supervised_user/child_accounts/family_info_fetcher_unittest.cc b/chrome/browser/supervised_user/child_accounts/family_info_fetcher_unittest.cc index 071902b..c29a8a3 100644 --- a/chrome/browser/supervised_user/child_accounts/family_info_fetcher_unittest.cc +++ b/chrome/browser/supervised_user/child_accounts/family_info_fetcher_unittest.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + #include <string> #include <vector> diff --git a/chrome/browser/supervised_user/child_accounts/permission_request_creator_apiary.h b/chrome/browser/supervised_user/child_accounts/permission_request_creator_apiary.h index 1e6cb3b..a76ec1f 100644 --- a/chrome/browser/supervised_user/child_accounts/permission_request_creator_apiary.h +++ b/chrome/browser/supervised_user/child_accounts/permission_request_creator_apiary.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "chrome/browser/supervised_user/permission_request_creator.h" diff --git a/chrome/browser/supervised_user/chromeos/manager_password_service.h b/chrome/browser/supervised_user/chromeos/manager_password_service.h index 74e7261..b2fc04a 100644 --- a/chrome/browser/supervised_user/chromeos/manager_password_service.h +++ b/chrome/browser/supervised_user/chromeos/manager_password_service.h @@ -8,6 +8,7 @@ #include <string> #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.h" diff --git a/chrome/browser/supervised_user/chromeos/supervised_user_password_service.h b/chrome/browser/supervised_user/chromeos/supervised_user_password_service.h index b3fe78a..254d055 100644 --- a/chrome/browser/supervised_user/chromeos/supervised_user_password_service.h +++ b/chrome/browser/supervised_user/chromeos/supervised_user_password_service.h @@ -8,6 +8,7 @@ #include <string> #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.h" diff --git a/chrome/browser/supervised_user/experimental/supervised_user_async_url_checker.h b/chrome/browser/supervised_user/experimental/supervised_user_async_url_checker.h index ed7af25..259ed95 100644 --- a/chrome/browser/supervised_user/experimental/supervised_user_async_url_checker.h +++ b/chrome/browser/supervised_user/experimental/supervised_user_async_url_checker.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_SUPERVISED_USER_EXPERIMENTAL_SUPERVISED_USER_ASYNC_URL_CHECKER_H_ #define CHROME_BROWSER_SUPERVISED_USER_EXPERIMENTAL_SUPERVISED_USER_ASYNC_URL_CHECKER_H_ +#include <stddef.h> + #include "base/callback_forward.h" #include "base/containers/mru_cache.h" #include "base/macros.h" diff --git a/chrome/browser/supervised_user/experimental/supervised_user_async_url_checker_unittest.cc b/chrome/browser/supervised_user/experimental/supervised_user_async_url_checker_unittest.cc index 4ffe8bd..d6a9e59 100644 --- a/chrome/browser/supervised_user/experimental/supervised_user_async_url_checker_unittest.cc +++ b/chrome/browser/supervised_user/experimental/supervised_user_async_url_checker_unittest.cc @@ -2,10 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + #include <string> #include "base/callback.h" #include "base/json/json_writer.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/thread_task_runner_handle.h" diff --git a/chrome/browser/supervised_user/experimental/supervised_user_blacklist.h b/chrome/browser/supervised_user/experimental/supervised_user_blacklist.h index 2e93d7d..44ccb36 100644 --- a/chrome/browser/supervised_user/experimental/supervised_user_blacklist.h +++ b/chrome/browser/supervised_user/experimental/supervised_user_blacklist.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_SUPERVISED_USER_EXPERIMENTAL_SUPERVISED_USER_BLACKLIST_H_ #define CHROME_BROWSER_SUPERVISED_USER_EXPERIMENTAL_SUPERVISED_USER_BLACKLIST_H_ +#include <stddef.h> + #include <string> #include <vector> diff --git a/chrome/browser/supervised_user/legacy/supervised_user_pref_mapping_service.h b/chrome/browser/supervised_user/legacy/supervised_user_pref_mapping_service.h index 31ab10a..fc89742 100644 --- a/chrome/browser/supervised_user/legacy/supervised_user_pref_mapping_service.h +++ b/chrome/browser/supervised_user/legacy/supervised_user_pref_mapping_service.h @@ -7,6 +7,7 @@ #include "base/callback.h" #include "base/callback_list.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/prefs/pref_change_registrar.h" diff --git a/chrome/browser/supervised_user/legacy/supervised_user_registration_utility.cc b/chrome/browser/supervised_user/legacy/supervised_user_registration_utility.cc index 5242fd6..d088834 100644 --- a/chrome/browser/supervised_user/legacy/supervised_user_registration_utility.cc +++ b/chrome/browser/supervised_user/legacy/supervised_user_registration_utility.cc @@ -7,10 +7,12 @@ #include "base/base64.h" #include "base/bind.h" #include "base/command_line.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/prefs/pref_service.h" #include "base/rand_util.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/chrome_signin_client_factory.h" #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" diff --git a/chrome/browser/supervised_user/legacy/supervised_user_registration_utility.h b/chrome/browser/supervised_user/legacy/supervised_user_registration_utility.h index 520a3cf..c97fb07 100644 --- a/chrome/browser/supervised_user/legacy/supervised_user_registration_utility.h +++ b/chrome/browser/supervised_user/legacy/supervised_user_registration_utility.h @@ -8,7 +8,6 @@ #include <map> #include <string> -#include "base/basictypes.h" #include "base/callback.h" #include "base/memory/weak_ptr.h" #include "base/prefs/pref_change_registrar.h" diff --git a/chrome/browser/supervised_user/legacy/supervised_user_registration_utility_stub.h b/chrome/browser/supervised_user/legacy/supervised_user_registration_utility_stub.h index f3597f6..6816e36 100644 --- a/chrome/browser/supervised_user/legacy/supervised_user_registration_utility_stub.h +++ b/chrome/browser/supervised_user/legacy/supervised_user_registration_utility_stub.h @@ -7,8 +7,8 @@ #include <string> -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/strings/string16.h" #include "chrome/browser/supervised_user/legacy/supervised_user_registration_utility.h" #include "google_apis/gaia/google_service_auth_error.h" diff --git a/chrome/browser/supervised_user/legacy/supervised_user_registration_utility_unittest.cc b/chrome/browser/supervised_user/legacy/supervised_user_registration_utility_unittest.cc index 8c6c64b..2ffea41 100644 --- a/chrome/browser/supervised_user/legacy/supervised_user_registration_utility_unittest.cc +++ b/chrome/browser/supervised_user/legacy/supervised_user_registration_utility_unittest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/supervised_user/legacy/supervised_user_registration_utility.h" +#include <stdint.h> + #include "base/bind.h" #include "base/message_loop/message_loop.h" #include "base/prefs/scoped_user_pref_update.h" @@ -133,7 +135,7 @@ class SupervisedUserRegistrationUtilityTest : public ::testing::Test { MockChangeProcessor* change_processor_; // A unique ID for creating "remote" Sync data. - int64 sync_data_id_; + int64_t sync_data_id_; // Whether OnSupervisedUserRegistered has been called. bool received_callback_; diff --git a/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service_unittest.cc b/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service_unittest.cc index ffa3940..d196105 100644 --- a/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service_unittest.cc +++ b/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service_unittest.cc @@ -6,6 +6,7 @@ #include "base/bind.h" #include "base/json/json_writer.h" +#include "base/macros.h" #include "base/prefs/pref_service.h" #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.h" #include "chrome/common/pref_names.h" diff --git a/chrome/browser/supervised_user/legacy/supervised_user_sync_service.cc b/chrome/browser/supervised_user/legacy/supervised_user_sync_service.cc index 1da90a2..7db5efe 100644 --- a/chrome/browser/supervised_user/legacy/supervised_user_sync_service.cc +++ b/chrome/browser/supervised_user/legacy/supervised_user_sync_service.cc @@ -4,6 +4,8 @@ #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service.h" +#include <stddef.h> + #include <set> #include "base/bind.h" @@ -12,6 +14,7 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" #include "base/values.h" +#include "build/build_config.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_avatar_icon_util.h" #include "chrome/browser/signin/signin_manager_factory.h" diff --git a/chrome/browser/supervised_user/legacy/supervised_user_sync_service.h b/chrome/browser/supervised_user/legacy/supervised_user_sync_service.h index 02f08de..b780e8d 100644 --- a/chrome/browser/supervised_user/legacy/supervised_user_sync_service.h +++ b/chrome/browser/supervised_user/legacy/supervised_user_sync_service.h @@ -9,6 +9,7 @@ #include <vector> #include "base/callback_forward.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service_observer.h" diff --git a/chrome/browser/supervised_user/legacy/supervised_user_sync_service_unittest.cc b/chrome/browser/supervised_user/legacy/supervised_user_sync_service_unittest.cc index c267227..09268db 100644 --- a/chrome/browser/supervised_user/legacy/supervised_user_sync_service_unittest.cc +++ b/chrome/browser/supervised_user/legacy/supervised_user_sync_service_unittest.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stdint.h> + #include <string> #include "base/bind.h" @@ -9,6 +11,7 @@ #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/threading/sequenced_worker_pool.h" +#include "build/build_config.h" #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service.h" #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service_factory.h" #include "chrome/common/pref_names.h" @@ -106,7 +109,7 @@ class SupervisedUserSyncServiceTest : public ::testing::Test { MockChangeProcessor* change_processor_; // A unique ID for creating "remote" Sync data. - int64 sync_data_id_; + int64_t sync_data_id_; }; SupervisedUserSyncServiceTest::SupervisedUserSyncServiceTest() diff --git a/chrome/browser/supervised_user/supervised_user_bookmarks_handler.cc b/chrome/browser/supervised_user/supervised_user_bookmarks_handler.cc index 2b35d14..f5a438b 100644 --- a/chrome/browser/supervised_user/supervised_user_bookmarks_handler.cc +++ b/chrome/browser/supervised_user/supervised_user_bookmarks_handler.cc @@ -4,6 +4,8 @@ #include "chrome/browser/supervised_user/supervised_user_bookmarks_handler.h" +#include <stddef.h> + #include "base/logging.h" #include "base/strings/string_number_conversions.h" #include "base/values.h" diff --git a/chrome/browser/supervised_user/supervised_user_bookmarks_handler_unittest.cc b/chrome/browser/supervised_user/supervised_user_bookmarks_handler_unittest.cc index 8de4d52..6a6a4cb 100644 --- a/chrome/browser/supervised_user/supervised_user_bookmarks_handler_unittest.cc +++ b/chrome/browser/supervised_user/supervised_user_bookmarks_handler_unittest.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + #include <iostream> #include <map> #include <string> diff --git a/chrome/browser/supervised_user/supervised_user_interstitial.cc b/chrome/browser/supervised_user/supervised_user_interstitial.cc index 510c783..1f7b606 100644 --- a/chrome/browser/supervised_user/supervised_user_interstitial.cc +++ b/chrome/browser/supervised_user/supervised_user_interstitial.cc @@ -4,6 +4,8 @@ #include "chrome/browser/supervised_user/supervised_user_interstitial.h" +#include <stddef.h> + #include "base/memory/weak_ptr.h" #include "base/metrics/histogram.h" #include "base/prefs/pref_service.h" @@ -11,6 +13,7 @@ #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/infobars/infobar_service.h" #include "chrome/browser/profiles/profile.h" diff --git a/chrome/browser/supervised_user/supervised_user_interstitial.h b/chrome/browser/supervised_user/supervised_user_interstitial.h index bf75f13..5504b1d 100644 --- a/chrome/browser/supervised_user/supervised_user_interstitial.h +++ b/chrome/browser/supervised_user/supervised_user_interstitial.h @@ -8,6 +8,7 @@ #include <string> #include "base/callback.h" +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/supervised_user/supervised_user_service_observer.h" #include "chrome/browser/supervised_user/supervised_user_url_filter.h" diff --git a/chrome/browser/supervised_user/supervised_user_navigation_observer.h b/chrome/browser/supervised_user/supervised_user_navigation_observer.h index 3400881..b52da19 100644 --- a/chrome/browser/supervised_user/supervised_user_navigation_observer.h +++ b/chrome/browser/supervised_user/supervised_user_navigation_observer.h @@ -7,6 +7,7 @@ #include <vector> +#include "base/macros.h" #include "base/memory/scoped_vector.h" #include "chrome/browser/supervised_user/supervised_user_service_observer.h" #include "chrome/browser/supervised_user/supervised_user_url_filter.h" diff --git a/chrome/browser/supervised_user/supervised_user_resource_throttle.h b/chrome/browser/supervised_user/supervised_user_resource_throttle.h index 2c81a8c..be5679e 100644 --- a/chrome/browser/supervised_user/supervised_user_resource_throttle.h +++ b/chrome/browser/supervised_user/supervised_user_resource_throttle.h @@ -6,6 +6,7 @@ #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_RESOURCE_THROTTLE_H_ #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/supervised_user/supervised_user_url_filter.h" #include "chrome/browser/supervised_user/supervised_users.h" diff --git a/chrome/browser/supervised_user/supervised_user_service.cc b/chrome/browser/supervised_user/supervised_user_service.cc index a7e61aa..8ddd5d25 100644 --- a/chrome/browser/supervised_user/supervised_user_service.cc +++ b/chrome/browser/supervised_user/supervised_user_service.cc @@ -14,6 +14,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/task_runner_util.h" #include "base/version.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/component_updater/supervised_user_whitelist_installer.h" #include "chrome/browser/net/file_downloader.h" diff --git a/chrome/browser/supervised_user/supervised_user_service.h b/chrome/browser/supervised_user/supervised_user_service.h index f001f2a..ca1d518 100644 --- a/chrome/browser/supervised_user/supervised_user_service.h +++ b/chrome/browser/supervised_user/supervised_user_service.h @@ -5,18 +5,22 @@ #ifndef CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ +#include <stddef.h> + #include <map> #include <string> #include <vector> #include "base/callback.h" #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/observer_list.h" #include "base/prefs/pref_change_registrar.h" #include "base/scoped_observer.h" #include "base/strings/string16.h" +#include "build/build_config.h" #include "chrome/browser/supervised_user/experimental/supervised_user_blacklist.h" #include "chrome/browser/supervised_user/supervised_user_url_filter.h" #include "chrome/browser/supervised_user/supervised_users.h" diff --git a/chrome/browser/supervised_user/supervised_user_service_browsertest.cc b/chrome/browser/supervised_user/supervised_user_service_browsertest.cc index 837657e..64f7256 100644 --- a/chrome/browser/supervised_user/supervised_user_service_browsertest.cc +++ b/chrome/browser/supervised_user/supervised_user_service_browsertest.cc @@ -2,10 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + #include "base/callback.h" #include "base/command_line.h" #include "base/prefs/pref_service.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_info_cache.h" diff --git a/chrome/browser/supervised_user/supervised_user_service_unittest.cc b/chrome/browser/supervised_user/supervised_user_service_unittest.cc index 716ff5a..0a5c27d 100644 --- a/chrome/browser/supervised_user/supervised_user_service_unittest.cc +++ b/chrome/browser/supervised_user/supervised_user_service_unittest.cc @@ -2,12 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "base/prefs/pref_service.h" #include "base/prefs/scoped_user_pref_update.h" #include "base/strings/utf_string_conversions.h" #include "base/thread_task_runner_handle.h" +#include "build/build_config.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h" diff --git a/chrome/browser/supervised_user/supervised_user_settings_service.cc b/chrome/browser/supervised_user/supervised_user_settings_service.cc index df2e198..166ac15 100644 --- a/chrome/browser/supervised_user/supervised_user_settings_service.cc +++ b/chrome/browser/supervised_user/supervised_user_settings_service.cc @@ -4,6 +4,8 @@ #include "chrome/browser/supervised_user/supervised_user_settings_service.h" +#include <stddef.h> + #include "base/callback.h" #include "base/json/json_reader.h" #include "base/json/json_writer.h" diff --git a/chrome/browser/supervised_user/supervised_user_settings_service.h b/chrome/browser/supervised_user/supervised_user_settings_service.h index 8b42ac2..4b8f27c 100644 --- a/chrome/browser/supervised_user/supervised_user_settings_service.h +++ b/chrome/browser/supervised_user/supervised_user_settings_service.h @@ -10,6 +10,7 @@ #include "base/callback.h" #include "base/callback_list.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/prefs/pref_store.h" diff --git a/chrome/browser/supervised_user/supervised_user_settings_service_unittest.cc b/chrome/browser/supervised_user/supervised_user_settings_service_unittest.cc index b67f7fa..a08e3d0 100644 --- a/chrome/browser/supervised_user/supervised_user_settings_service_unittest.cc +++ b/chrome/browser/supervised_user/supervised_user_settings_service_unittest.cc @@ -5,6 +5,7 @@ #include "base/bind.h" #include "base/callback.h" #include "base/json/json_reader.h" +#include "base/macros.h" #include "base/prefs/testing_pref_store.h" #include "base/strings/string_util.h" #include "chrome/browser/supervised_user/supervised_user_settings_service.h" diff --git a/chrome/browser/supervised_user/supervised_user_site_list.cc b/chrome/browser/supervised_user/supervised_user_site_list.cc index 37862e7..db18d52 100644 --- a/chrome/browser/supervised_user/supervised_user_site_list.cc +++ b/chrome/browser/supervised_user/supervised_user_site_list.cc @@ -48,7 +48,7 @@ SupervisedUserSiteList::HostnameHash::HostnameHash( } SupervisedUserSiteList::HostnameHash::HostnameHash( - const std::vector<uint8>& bytes) { + const std::vector<uint8_t>& bytes) { CHECK_GE(bytes.size(), base::kSHA1Length); std::copy(bytes.begin(), bytes.end(), bytes_.begin()); } @@ -98,7 +98,7 @@ SupervisedUserSiteList::SupervisedUserSiteList( for (const base::Value* entry : *hostname_hashes) { // |hash_str| should be a hex-encoded SHA1 hash string. std::string hash_str; - std::vector<uint8> hash_bytes; + std::vector<uint8_t> hash_bytes; if (!entry->GetAsString(&hash_str) || hash_str.size() != 2 * base::kSHA1Length || !base::HexStringToBytes(hash_str, &hash_bytes)) { diff --git a/chrome/browser/supervised_user/supervised_user_site_list.h b/chrome/browser/supervised_user/supervised_user_site_list.h index eb33e39..677ce62 100644 --- a/chrome/browser/supervised_user/supervised_user_site_list.h +++ b/chrome/browser/supervised_user/supervised_user_site_list.h @@ -5,12 +5,16 @@ #ifndef CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SITE_LIST_H_ #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SITE_LIST_H_ +#include <stddef.h> +#include <stdint.h> + #include <array> #include <string> #include <vector> #include "base/callback_forward.h" #include "base/files/file_path.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/sha1.h" @@ -40,7 +44,7 @@ class SupervisedUserSiteList public: explicit HostnameHash(const std::string& hostname); // |bytes| must have a size of at least |base::kSHA1Length|. - explicit HostnameHash(const std::vector<uint8>& bytes); + explicit HostnameHash(const std::vector<uint8_t>& bytes); bool operator==(const HostnameHash& rhs) const; @@ -48,7 +52,7 @@ class SupervisedUserSiteList size_t hash() const; private: - std::array<uint8, base::kSHA1Length> bytes_; + std::array<uint8_t, base::kSHA1Length> bytes_; // Copy and assign are allowed. }; diff --git a/chrome/browser/supervised_user/supervised_user_theme.cc b/chrome/browser/supervised_user/supervised_user_theme.cc index 055a0a7..c72bcab 100644 --- a/chrome/browser/supervised_user/supervised_user_theme.cc +++ b/chrome/browser/supervised_user/supervised_user_theme.cc @@ -4,6 +4,7 @@ #include "chrome/browser/supervised_user/supervised_user_theme.h" +#include "build/build_config.h" #include "chrome/browser/themes/theme_properties.h" #include "grit/theme_resources.h" #include "ui/base/resource/resource_bundle.h" diff --git a/chrome/browser/supervised_user/supervised_user_theme.h b/chrome/browser/supervised_user/supervised_user_theme.h index 85832fa..1209062 100644 --- a/chrome/browser/supervised_user/supervised_user_theme.h +++ b/chrome/browser/supervised_user/supervised_user_theme.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_THEME_H_ #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_THEME_H_ +#include "base/macros.h" #include "chrome/browser/supervised_user/supervised_users.h" #include "chrome/browser/themes/custom_theme_supplier.h" diff --git a/chrome/browser/supervised_user/supervised_user_url_filter.cc b/chrome/browser/supervised_user/supervised_user_url_filter.cc index e9a1a68..9956e3d 100644 --- a/chrome/browser/supervised_user/supervised_user_url_filter.cc +++ b/chrome/browser/supervised_user/supervised_user_url_filter.cc @@ -4,12 +4,16 @@ #include "chrome/browser/supervised_user/supervised_user_url_filter.h" +#include <stddef.h> +#include <stdint.h> + #include <set> #include <utility> #include "base/containers/hash_tables.h" #include "base/files/file_path.h" #include "base/json/json_file_value_serializer.h" +#include "base/macros.h" #include "base/sha1.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" @@ -102,7 +106,7 @@ FilterBuilder::~FilterBuilder() { bool FilterBuilder::AddPattern(const std::string& pattern) { std::string scheme; std::string host; - uint16 port = 0; + uint16_t port = 0; std::string path; std::string query; bool match_subdomains = true; diff --git a/chrome/browser/supervised_user/supervised_user_url_filter.h b/chrome/browser/supervised_user/supervised_user_url_filter.h index 660c970..09b5955 100644 --- a/chrome/browser/supervised_user/supervised_user_url_filter.h +++ b/chrome/browser/supervised_user/supervised_user_url_filter.h @@ -10,6 +10,7 @@ #include <vector> #include "base/callback_forward.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" diff --git a/chrome/browser/supervised_user/supervised_user_whitelist_service.cc b/chrome/browser/supervised_user/supervised_user_whitelist_service.cc index 07af6cb..2940ff8 100644 --- a/chrome/browser/supervised_user/supervised_user_whitelist_service.cc +++ b/chrome/browser/supervised_user/supervised_user_whitelist_service.cc @@ -4,6 +4,8 @@ #include "chrome/browser/supervised_user/supervised_user_whitelist_service.h" +#include <stddef.h> + #include <string> #include "base/command_line.h" diff --git a/chrome/browser/supervised_user/supervised_user_whitelist_service_unittest.cc b/chrome/browser/supervised_user/supervised_user_whitelist_service_unittest.cc index 96e6c26..fc26c1b 100644 --- a/chrome/browser/supervised_user/supervised_user_whitelist_service_unittest.cc +++ b/chrome/browser/supervised_user/supervised_user_whitelist_service_unittest.cc @@ -15,6 +15,7 @@ #include "base/run_loop.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/component_updater/supervised_user_whitelist_installer.h" #include "chrome/browser/supervised_user/supervised_user_site_list.h" #include "chrome/browser/supervised_user/supervised_user_whitelist_service.h" diff --git a/chrome/browser/sync/abstract_profile_sync_service_test.cc b/chrome/browser/sync/abstract_profile_sync_service_test.cc index d9fa08a..3089b52 100644 --- a/chrome/browser/sync/abstract_profile_sync_service_test.cc +++ b/chrome/browser/sync/abstract_profile_sync_service_test.cc @@ -20,8 +20,9 @@ using syncer::UserShare; /* static */ syncer::ImmutableChangeRecordList - ProfileSyncServiceTestHelper::MakeSingletonChangeRecordList( - int64 node_id, syncer::ChangeRecord::Action action) { +ProfileSyncServiceTestHelper::MakeSingletonChangeRecordList( + int64_t node_id, + syncer::ChangeRecord::Action action) { syncer::ChangeRecord record; record.action = action; record.id = node_id; @@ -31,8 +32,9 @@ syncer::ImmutableChangeRecordList /* static */ syncer::ImmutableChangeRecordList - ProfileSyncServiceTestHelper::MakeSingletonDeletionChangeRecordList( - int64 node_id, const sync_pb::EntitySpecifics& specifics) { +ProfileSyncServiceTestHelper::MakeSingletonDeletionChangeRecordList( + int64_t node_id, + const sync_pb::EntitySpecifics& specifics) { syncer::ChangeRecord record; record.action = syncer::ChangeRecord::ACTION_DELETE; record.id = node_id; diff --git a/chrome/browser/sync/abstract_profile_sync_service_test.h b/chrome/browser/sync/abstract_profile_sync_service_test.h index 2b11b56..d6131b7 100644 --- a/chrome/browser/sync/abstract_profile_sync_service_test.h +++ b/chrome/browser/sync/abstract_profile_sync_service_test.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ #define CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ +#include <stdint.h> + #include <string> #include "base/callback.h" @@ -27,13 +29,14 @@ struct UserShare; class ProfileSyncServiceTestHelper { public: static syncer::ImmutableChangeRecordList MakeSingletonChangeRecordList( - int64 node_id, syncer::ChangeRecord::Action action); + int64_t node_id, + syncer::ChangeRecord::Action action); // Deletions must provide an EntitySpecifics for the deleted data. static syncer::ImmutableChangeRecordList - MakeSingletonDeletionChangeRecordList( - int64 node_id, - const sync_pb::EntitySpecifics& specifics); + MakeSingletonDeletionChangeRecordList( + int64_t node_id, + const sync_pb::EntitySpecifics& specifics); }; class AbstractProfileSyncServiceTest : public testing::Test { diff --git a/chrome/browser/sync/chrome_sync_client.cc b/chrome/browser/sync/chrome_sync_client.cc index 9cf8938..17f3c40 100644 --- a/chrome/browser/sync/chrome_sync_client.cc +++ b/chrome/browser/sync/chrome_sync_client.cc @@ -6,6 +6,8 @@ #include "base/bind.h" #include "base/command_line.h" +#include "base/macros.h" +#include "build/build_config.h" #include "chrome/browser/autofill/personal_data_manager_factory.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" #include "chrome/browser/browsing_data/browsing_data_helper.h" diff --git a/chrome/browser/sync/glue/extension_data_type_controller.h b/chrome/browser/sync/glue/extension_data_type_controller.h index aca48d4..6988db3 100644 --- a/chrome/browser/sync/glue/extension_data_type_controller.h +++ b/chrome/browser/sync/glue/extension_data_type_controller.h @@ -8,6 +8,7 @@ #include <string> #include "base/compiler_specific.h" +#include "base/macros.h" #include "components/sync_driver/generic_change_processor.h" #include "components/sync_driver/ui_data_type_controller.h" diff --git a/chrome/browser/sync/glue/extension_setting_data_type_controller.h b/chrome/browser/sync/glue/extension_setting_data_type_controller.h index d72701e..84322aa 100644 --- a/chrome/browser/sync/glue/extension_setting_data_type_controller.h +++ b/chrome/browser/sync/glue/extension_setting_data_type_controller.h @@ -8,6 +8,7 @@ #include <string> #include "base/compiler_specific.h" +#include "base/macros.h" #include "components/sync_driver/non_ui_data_type_controller.h" class Profile; diff --git a/chrome/browser/sync/glue/extensions_activity_monitor_unittest.cc b/chrome/browser/sync/glue/extensions_activity_monitor_unittest.cc index decf4bb..2fb4e24 100644 --- a/chrome/browser/sync/glue/extensions_activity_monitor_unittest.cc +++ b/chrome/browser/sync/glue/extensions_activity_monitor_unittest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync/glue/extensions_activity_monitor.h" +#include <stdint.h> + #include "base/files/file_path.h" #include "base/message_loop/message_loop.h" #include "base/path_service.h" @@ -94,7 +96,7 @@ TEST_F(SyncChromeExtensionsActivityMonitorTest, DISABLED_Basic) { FireBookmarksApiEvent<extensions::BookmarksUpdateFunction>(extension1_, 2); FireBookmarksApiEvent<extensions::BookmarksCreateFunction>(extension1_, 3); FireBookmarksApiEvent<extensions::BookmarksSearchFunction>(extension1_, 5); - const uint32 writes_by_extension1 = 1 + 1 + 2 + 3; + const uint32_t writes_by_extension1 = 1 + 1 + 2 + 3; FireBookmarksApiEvent<extensions::BookmarksRemoveTreeFunction>( extension2_, 8); @@ -103,7 +105,7 @@ TEST_F(SyncChromeExtensionsActivityMonitorTest, DISABLED_Basic) { FireBookmarksApiEvent<extensions::BookmarksGetChildrenFunction>( extension2_, 21); FireBookmarksApiEvent<extensions::BookmarksGetTreeFunction>(extension2_, 33); - const uint32 writes_by_extension2 = 8; + const uint32_t writes_by_extension2 = 8; syncer::ExtensionsActivity::Records results; monitor_.GetExtensionsActivity()->GetAndClearRecords(&results); diff --git a/chrome/browser/sync/glue/session_sync_test_helper.cc b/chrome/browser/sync/glue/session_sync_test_helper.cc index 8b5d61a..e3a9f56 100644 --- a/chrome/browser/sync/glue/session_sync_test_helper.cc +++ b/chrome/browser/sync/glue/session_sync_test_helper.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync/glue/session_sync_test_helper.h" +#include <stddef.h> + #include "base/strings/utf_string_conversions.h" #include "components/sync_sessions/synced_session.h" #include "sync/protocol/session_specifics.pb.h" diff --git a/chrome/browser/sync/glue/synced_tab_delegate_android.h b/chrome/browser/sync/glue/synced_tab_delegate_android.h index 8d07ef5..e72c8f2 100644 --- a/chrome/browser/sync/glue/synced_tab_delegate_android.h +++ b/chrome/browser/sync/glue/synced_tab_delegate_android.h @@ -8,6 +8,7 @@ #include <string> #include "base/compiler_specific.h" +#include "base/macros.h" #include "components/sync_sessions/synced_tab_delegate.h" #include "content/public/browser/web_contents_user_data.h" diff --git a/chrome/browser/sync/glue/theme_data_type_controller.h b/chrome/browser/sync/glue/theme_data_type_controller.h index 091e1cd..1110ade 100644 --- a/chrome/browser/sync/glue/theme_data_type_controller.h +++ b/chrome/browser/sync/glue/theme_data_type_controller.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SYNC_GLUE_THEME_DATA_TYPE_CONTROLLER_H_ #define CHROME_BROWSER_SYNC_GLUE_THEME_DATA_TYPE_CONTROLLER_H_ +#include "base/macros.h" #include "components/sync_driver/ui_data_type_controller.h" class Profile; diff --git a/chrome/browser/sync/profile_sync_service_android.cc b/chrome/browser/sync/profile_sync_service_android.cc index c170b436..44befad 100644 --- a/chrome/browser/sync/profile_sync_service_android.cc +++ b/chrome/browser/sync/profile_sync_service_android.cc @@ -4,6 +4,9 @@ #include "chrome/browser/sync/profile_sync_service_android.h" +#include <stddef.h> +#include <stdint.h> + #include "base/android/jni_android.h" #include "base/android/jni_array.h" #include "base/android/jni_string.h" diff --git a/chrome/browser/sync/profile_sync_service_android.h b/chrome/browser/sync/profile_sync_service_android.h index d6427f6..c69e78e 100644 --- a/chrome/browser/sync/profile_sync_service_android.h +++ b/chrome/browser/sync/profile_sync_service_android.h @@ -11,6 +11,7 @@ #include "base/android/jni_weak_ref.h" #include "base/callback.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/time/time.h" #include "components/invalidation/public/invalidation_util.h" #include "components/sync_driver/sync_prefs.h" diff --git a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc index 9e0b082..706d28c 100644 --- a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> +#include <stdint.h> + #include <set> #include <string> #include <utility> @@ -14,6 +17,7 @@ #include "base/callback.h" #include "base/compiler_specific.h" #include "base/location.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/run_loop.h" @@ -580,7 +584,7 @@ class ProfileSyncServiceAutofillTest return false; } - int64 child_id = autofill_root.GetFirstChildId(); + int64_t child_id = autofill_root.GetFirstChildId(); while (child_id != syncer::kInvalidId) { syncer::ReadNode child_node(&trans); if (child_node.InitByIdLookup(child_id) != BaseNode::INIT_OK) @@ -619,7 +623,7 @@ class ProfileSyncServiceAutofillTest return false; } - int64 child_id = autofill_root.GetFirstChildId(); + int64_t child_id = autofill_root.GetFirstChildId(); while (child_id != syncer::kInvalidId) { syncer::ReadNode child_node(&trans); if (child_node.InitByIdLookup(child_id) != BaseNode::INIT_OK) diff --git a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc index e8afc4e..04a1e10 100644 --- a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc @@ -6,6 +6,9 @@ // BookmarkChangeProcessor. Write unit tests for // BookmarkModelAssociator separately. +#include <stddef.h> +#include <stdint.h> + #include <map> #include <queue> #include <stack> @@ -14,6 +17,7 @@ #include "base/command_line.h" #include "base/files/file_path.h" #include "base/location.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" #include "base/strings/string_number_conversions.h" @@ -21,6 +25,7 @@ #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/time/time.h" +#include "build/build_config.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" #include "chrome/browser/bookmarks/chrome_bookmark_client.h" #include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h" @@ -84,7 +89,7 @@ void MakeServerUpdate(syncer::WriteTransaction* trans, node->GetMutableEntryForTest()->PutIsUnappliedUpdate(true); } -void MakeServerUpdate(syncer::WriteTransaction* trans, int64 id) { +void MakeServerUpdate(syncer::WriteTransaction* trans, int64_t id) { syncer::WriteNode node(trans); EXPECT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(id)); MakeServerUpdate(trans, &node); @@ -124,12 +129,12 @@ class FakeServerChange { } // Pretend that the server told the syncer to add a bookmark object. - int64 AddWithMetaInfo(const std::string& title, - const std::string& url, - const BookmarkNode::MetaInfoMap* meta_info_map, - bool is_folder, - int64 parent_id, - int64 predecessor_id) { + int64_t AddWithMetaInfo(const std::string& title, + const std::string& url, + const BookmarkNode::MetaInfoMap* meta_info_map, + bool is_folder, + int64_t parent_id, + int64_t predecessor_id) { syncer::ReadNode parent(trans_); EXPECT_EQ(BaseNode::INIT_OK, parent.InitByIdLookup(parent_id)); syncer::WriteNode node(trans_); @@ -162,47 +167,47 @@ class FakeServerChange { return node.GetId(); } - int64 Add(const std::string& title, - const std::string& url, - bool is_folder, - int64 parent_id, - int64 predecessor_id) { + int64_t Add(const std::string& title, + const std::string& url, + bool is_folder, + int64_t parent_id, + int64_t predecessor_id) { return AddWithMetaInfo(title, url, NULL, is_folder, parent_id, predecessor_id); } // Add a bookmark folder. - int64 AddFolder(const std::string& title, - int64 parent_id, - int64 predecessor_id) { + int64_t AddFolder(const std::string& title, + int64_t parent_id, + int64_t predecessor_id) { return Add(title, std::string(), true, parent_id, predecessor_id); } - int64 AddFolderWithMetaInfo(const std::string& title, - const BookmarkNode::MetaInfoMap* meta_info_map, - int64 parent_id, - int64 predecessor_id) { + int64_t AddFolderWithMetaInfo(const std::string& title, + const BookmarkNode::MetaInfoMap* meta_info_map, + int64_t parent_id, + int64_t predecessor_id) { return AddWithMetaInfo(title, std::string(), meta_info_map, true, parent_id, predecessor_id); } // Add a bookmark. - int64 AddURL(const std::string& title, - const std::string& url, - int64 parent_id, - int64 predecessor_id) { + int64_t AddURL(const std::string& title, + const std::string& url, + int64_t parent_id, + int64_t predecessor_id) { return Add(title, url, false, parent_id, predecessor_id); } - int64 AddURLWithMetaInfo(const std::string& title, - const std::string& url, - const BookmarkNode::MetaInfoMap* meta_info_map, - int64 parent_id, - int64 predecessor_id) { + int64_t AddURLWithMetaInfo(const std::string& title, + const std::string& url, + const BookmarkNode::MetaInfoMap* meta_info_map, + int64_t parent_id, + int64_t predecessor_id) { return AddWithMetaInfo(title, url, meta_info_map, false, parent_id, predecessor_id); } // Pretend that the server told the syncer to delete an object. - void Delete(int64 id) { + void Delete(int64_t id) { { // Delete the sync node. syncer::WriteNode node(trans_); @@ -230,7 +235,7 @@ class FakeServerChange { } // Set a new title value, and return the old value. - std::string ModifyTitle(int64 id, const std::string& new_title) { + std::string ModifyTitle(int64_t id, const std::string& new_title) { syncer::WriteNode node(trans_); EXPECT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(id)); std::string old_title = node.GetTitle(); @@ -242,12 +247,14 @@ class FakeServerChange { // Set a new parent and predecessor value. Return the old parent id. // We could return the old predecessor id, but it turns out not to be // very useful for assertions. - int64 ModifyPosition(int64 id, int64 parent_id, int64 predecessor_id) { + int64_t ModifyPosition(int64_t id, + int64_t parent_id, + int64_t predecessor_id) { syncer::ReadNode parent(trans_); EXPECT_EQ(BaseNode::INIT_OK, parent.InitByIdLookup(parent_id)); syncer::WriteNode node(trans_); EXPECT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(id)); - int64 old_parent_id = node.GetParentId(); + int64_t old_parent_id = node.GetParentId(); if (predecessor_id == 0) { EXPECT_TRUE(node.SetPosition(parent, NULL)); } else { @@ -260,7 +267,7 @@ class FakeServerChange { return old_parent_id; } - void ModifyCreationTime(int64 id, int64 creation_time_us) { + void ModifyCreationTime(int64_t id, int64_t creation_time_us) { syncer::WriteNode node(trans_); ASSERT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(id)); sync_pb::BookmarkSpecifics specifics = node.GetBookmarkSpecifics(); @@ -269,7 +276,7 @@ class FakeServerChange { SetModified(id); } - void ModifyMetaInfo(int64 id, + void ModifyMetaInfo(int64_t id, const BookmarkNode::MetaInfoMap& meta_info_map) { syncer::WriteNode node(trans_); ASSERT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(id)); @@ -292,7 +299,7 @@ class FakeServerChange { private: // Helper function to push an ACTION_UPDATE record onto the back // of the changelist. - void SetModified(int64 id) { + void SetModified(int64_t id) { // Coalesce multi-property edits. if (!changes_.empty() && changes_.back().id == id && changes_.back().action == @@ -404,8 +411,8 @@ class ProfileSyncServiceBookmarkTest : public testing::Test { // change the sync model directly after ModelAssociation. This function can // be invoked prior to model association to set up first-time sync model // association scenarios. - int64 AddFolderToShare(syncer::WriteTransaction* trans, - const std::string& title) { + int64_t AddFolderToShare(syncer::WriteTransaction* trans, + const std::string& title) { EXPECT_FALSE(model_associator_); // Be sure to call CreatePermanentBookmarkNodes(), otherwise this will fail. @@ -429,10 +436,10 @@ class ProfileSyncServiceBookmarkTest : public testing::Test { // the sync model directly after ModelAssociation. This function can be // invoked prior to model association to set up first-time sync model // association scenarios. - int64 AddBookmarkToShare(syncer::WriteTransaction* trans, - int64 parent_id, - const std::string& title, - const std::string& url) { + int64_t AddBookmarkToShare(syncer::WriteTransaction* trans, + int64_t parent_id, + const std::string& title, + const std::string& url) { EXPECT_FALSE(model_associator_); syncer::ReadNode parent(trans); @@ -510,7 +517,7 @@ class ProfileSyncServiceBookmarkTest : public testing::Test { EXPECT_EQ(BaseNode::INIT_OK, root.InitTypeRoot(type)); // Loop through creating permanent nodes as necessary. - int64 last_child_id = syncer::kInvalidId; + int64_t last_child_id = syncer::kInvalidId; for (int i = 0; i < kNumPermanentNodes; ++i) { // First check if the node already exists. This is for tests that involve // persistence and set up sync more than once. @@ -694,51 +701,51 @@ class ProfileSyncServiceBookmarkTest : public testing::Test { } void ExpectBrowserNodeMatching(syncer::BaseTransaction* trans, - int64 sync_id) { + int64_t sync_id) { EXPECT_TRUE(sync_id); const BookmarkNode* bnode = model_associator_->GetChromeNodeFromSyncId(sync_id); ASSERT_TRUE(bnode); ASSERT_TRUE(CanSyncNode(bnode)); - int64 id = model_associator_->GetSyncIdFromChromeId(bnode->id()); + int64_t id = model_associator_->GetSyncIdFromChromeId(bnode->id()); EXPECT_EQ(id, sync_id); ExpectSyncerNodeMatching(trans, bnode); } - void ExpectBrowserNodeUnknown(int64 sync_id) { + void ExpectBrowserNodeUnknown(int64_t sync_id) { EXPECT_FALSE(model_associator_->GetChromeNodeFromSyncId(sync_id)); } - void ExpectBrowserNodeKnown(int64 sync_id) { + void ExpectBrowserNodeKnown(int64_t sync_id) { EXPECT_TRUE(model_associator_->GetChromeNodeFromSyncId(sync_id)); } void ExpectSyncerNodeKnown(const BookmarkNode* node) { - int64 sync_id = model_associator_->GetSyncIdFromChromeId(node->id()); + int64_t sync_id = model_associator_->GetSyncIdFromChromeId(node->id()); EXPECT_NE(sync_id, syncer::kInvalidId); } void ExpectSyncerNodeUnknown(const BookmarkNode* node) { - int64 sync_id = model_associator_->GetSyncIdFromChromeId(node->id()); + int64_t sync_id = model_associator_->GetSyncIdFromChromeId(node->id()); EXPECT_EQ(sync_id, syncer::kInvalidId); } - void ExpectBrowserNodeTitle(int64 sync_id, const std::string& title) { + void ExpectBrowserNodeTitle(int64_t sync_id, const std::string& title) { const BookmarkNode* bnode = model_associator_->GetChromeNodeFromSyncId(sync_id); ASSERT_TRUE(bnode); EXPECT_EQ(bnode->GetTitle(), base::UTF8ToUTF16(title)); } - void ExpectBrowserNodeURL(int64 sync_id, const std::string& url) { + void ExpectBrowserNodeURL(int64_t sync_id, const std::string& url) { const BookmarkNode* bnode = model_associator_->GetChromeNodeFromSyncId(sync_id); ASSERT_TRUE(bnode); EXPECT_EQ(GURL(url), bnode->url()); } - void ExpectBrowserNodeParent(int64 sync_id, int64 parent_sync_id) { + void ExpectBrowserNodeParent(int64_t sync_id, int64_t parent_sync_id) { const BookmarkNode* node = model_associator_->GetChromeNodeFromSyncId(sync_id); ASSERT_TRUE(node); @@ -760,10 +767,10 @@ class ProfileSyncServiceBookmarkTest : public testing::Test { EXPECT_EQ(root->GetIndexOf(model_->mobile_node()), 2); #endif // defined(OS_IOS) || defined(OS_ANDROID) - std::stack<int64> stack; + std::stack<int64_t> stack; stack.push(bookmark_bar_id()); while (!stack.empty()) { - int64 id = stack.top(); + int64_t id = stack.top(); stack.pop(); if (!id) continue; @@ -782,17 +789,17 @@ class ProfileSyncServiceBookmarkTest : public testing::Test { ExpectModelMatch(&trans); } - int64 mobile_bookmarks_id() { + int64_t mobile_bookmarks_id() { return model_associator_->GetSyncIdFromChromeId(model_->mobile_node()->id()); } - int64 other_bookmarks_id() { + int64_t other_bookmarks_id() { return model_associator_->GetSyncIdFromChromeId(model_->other_node()->id()); } - int64 bookmark_bar_id() { + int64_t bookmark_bar_id() { return model_associator_->GetSyncIdFromChromeId( model_->bookmark_bar_node()->id()); } @@ -843,7 +850,7 @@ TEST_F(ProfileSyncServiceBookmarkTest, InitialModelAssociate) { { syncer::WriteTransaction trans(FROM_HERE, test_user_share_.user_share()); for (int i = 0; i < kNumFolders; ++i) { - int64 folder_id = + int64_t folder_id = AddFolderToShare(&trans, base::StringPrintf("folder%05d", i)); for (int j = 0; j < kNumBookmarksPerFolder; ++j) { AddBookmarkToShare( @@ -889,7 +896,7 @@ TEST_F(ProfileSyncServiceBookmarkTest, InitialModelAssociateWithDeleteJournal) { CreatePermanentBookmarkNodes(); // Create entries matching the folder and the bookmark above. - int64 folder_id, bookmark_id; + int64_t folder_id, bookmark_id; { syncer::WriteTransaction trans(FROM_HERE, test_user_share_.user_share()); folder_id = AddFolderToShare(&trans, "foobar"); @@ -930,8 +937,8 @@ TEST_F(ProfileSyncServiceBookmarkTest, const int kFolderToIncludeBookmarks = 7; const int kBookmarkToDelete = 4; - int64 folder_ids[kNumFolders]; - int64 bookmark_ids[kNumBookmarks]; + int64_t folder_ids[kNumFolders]; + int64_t bookmark_ids[kNumBookmarks]; // Create native folders and bookmarks with identical names. Only // one of the folders contains bookmarks and others are empty. Here is the @@ -972,15 +979,15 @@ TEST_F(ProfileSyncServiceBookmarkTest, CreatePermanentBookmarkNodes(); - int64 sync_bookmark_id_to_delete = 0; + int64_t sync_bookmark_id_to_delete = 0; { // Create sync folders matching native folders above. - int64 parent_id = 0; + int64_t parent_id = 0; syncer::WriteTransaction trans(FROM_HERE, test_user_share_.user_share()); // Create in reverse order because AddFolderToShare passes NULL for // |predecessor| argument. for (int i = kNumFolders - 1; i >= 0; i--) { - int64 id = AddFolderToShare(&trans, "folder"); + int64_t id = AddFolderToShare(&trans, "folder"); // Pre-map sync folders to native folders by setting // external ID. This will verify that the association algorithm picks @@ -1065,7 +1072,7 @@ TEST_F(ProfileSyncServiceBookmarkTest, InitialModelAssociateWithInvalidUrl) { CreatePermanentBookmarkNodes(); { syncer::WriteTransaction trans(FROM_HERE, test_user_share_.user_share()); - int64 folder_id = AddFolderToShare(&trans, "folder"); + int64_t folder_id = AddFolderToShare(&trans, "folder"); // Please note that each AddBookmarkToShare inserts the node at the front // so the actual order of children in the directory will be opposite. AddBookmarkToShare(&trans, folder_id, "node2", "http://www.node2.com/"); @@ -1156,13 +1163,13 @@ TEST_F(ProfileSyncServiceBookmarkTest, ServerChangeProcessing) { syncer::WriteTransaction trans(FROM_HERE, test_user_share_.user_share()); FakeServerChange adds(&trans); - int64 f1 = adds.AddFolder("Server Folder B", bookmark_bar_id(), 0); - int64 f2 = adds.AddFolder("Server Folder A", bookmark_bar_id(), f1); - int64 u1 = adds.AddURL("Some old site", "ftp://nifty.andrew.cmu.edu/", - bookmark_bar_id(), f2); - int64 u2 = adds.AddURL("Nifty", "ftp://nifty.andrew.cmu.edu/", f1, 0); + int64_t f1 = adds.AddFolder("Server Folder B", bookmark_bar_id(), 0); + int64_t f2 = adds.AddFolder("Server Folder A", bookmark_bar_id(), f1); + int64_t u1 = adds.AddURL("Some old site", "ftp://nifty.andrew.cmu.edu/", + bookmark_bar_id(), f2); + int64_t u2 = adds.AddURL("Nifty", "ftp://nifty.andrew.cmu.edu/", f1, 0); // u3 is a duplicate URL - int64 u3 = adds.AddURL("Nifty2", "ftp://nifty.andrew.cmu.edu/", f1, u2); + int64_t u3 = adds.AddURL("Nifty2", "ftp://nifty.andrew.cmu.edu/", f1, u2); // u4 is a duplicate title, different URL. adds.AddURL("Some old site", "http://slog.thestranger.com/", bookmark_bar_id(), u1); @@ -1173,8 +1180,8 @@ TEST_F(ProfileSyncServiceBookmarkTest, ServerChangeProcessing) { "scrollbars=0,status=0,toolbar=0,width=300," \ "height=300,resizable');});"); adds.AddURL(std::string(), javascript_url, other_bookmarks_id(), 0); - int64 u6 = adds.AddURL( - "Sync1", "http://www.syncable.edu/", mobile_bookmarks_id(), 0); + int64_t u6 = adds.AddURL("Sync1", "http://www.syncable.edu/", + mobile_bookmarks_id(), 0); syncer::ChangeRecordList::const_iterator it; // The bookmark model shouldn't yet have seen any of the nodes of |adds|. @@ -1194,14 +1201,14 @@ TEST_F(ProfileSyncServiceBookmarkTest, ServerChangeProcessing) { // TODO(ncarter): Determine if we allow ModifyURL ops or not. /* std::string u2_old_url = mods.ModifyURL(u2, "http://www.google.com"); */ std::string u2_old_title = mods.ModifyTitle(u2, "The Google"); - int64 u2_old_parent = mods.ModifyPosition(u2, f2, 0); + int64_t u2_old_parent = mods.ModifyPosition(u2, f2, 0); // Now move f1 after u2. std::string f1_old_title = mods.ModifyTitle(f1, "Server Folder C"); - int64 f1_old_parent = mods.ModifyPosition(f1, f2, u2); + int64_t f1_old_parent = mods.ModifyPosition(f1, f2, u2); // Then add u3 after f1. - int64 u3_old_parent = mods.ModifyPosition(u3, f2, f1); + int64_t u3_old_parent = mods.ModifyPosition(u3, f2, f1); std::string u6_old_title = mods.ModifyTitle(u6, "Mobile Folder A"); @@ -1256,14 +1263,14 @@ TEST_F(ProfileSyncServiceBookmarkTest, ServerChangeRequiringFosterParent) { // ApplyModelChanges puts a temporary foster parent node. std::string url("http://dev.chromium.org/"); FakeServerChange adds(&trans); - int64 f0 = other_bookmarks_id(); // + other_node - int64 f1 = adds.AddFolder("f1", f0, 0); // + f1 - int64 f2 = adds.AddFolder("f2", f1, 0); // + f2 - int64 u3 = adds.AddURL( "u3", url, f2, 0); // + u3 NOLINT - int64 u4 = adds.AddURL( "u4", url, f2, u3); // + u4 NOLINT - int64 u5 = adds.AddURL( "u5", url, f1, f2); // + u5 NOLINT - int64 f6 = adds.AddFolder("f6", f1, u5); // + f6 - int64 u7 = adds.AddURL( "u7", url, f0, f1); // + u7 NOLINT + int64_t f0 = other_bookmarks_id(); // + other_node + int64_t f1 = adds.AddFolder("f1", f0, 0); // + f1 + int64_t f2 = adds.AddFolder("f2", f1, 0); // + f2 + int64_t u3 = adds.AddURL("u3", url, f2, 0); // + u3 NOLINT + int64_t u4 = adds.AddURL("u4", url, f2, u3); // + u4 NOLINT + int64_t u5 = adds.AddURL("u5", url, f1, f2); // + u5 NOLINT + int64_t f6 = adds.AddFolder("f6", f1, u5); // + f6 + int64_t u7 = adds.AddURL("u7", url, f0, f1); // + u7 NOLINT syncer::ChangeRecordList::const_iterator it; // The bookmark model shouldn't yet have seen any of the nodes of |adds|. @@ -1508,11 +1515,11 @@ TEST_F(ProfileSyncServiceBookmarkTest, ApplySyncDeletesFromJournal) { // +-- Folder 2 // +-- URL 2 LoadBookmarkModel(DELETE_EXISTING_STORAGE, SAVE_TO_STORAGE); - int64 u0 = 0; - int64 f1 = 0; - int64 u1 = 0; - int64 f2 = 0; - int64 u2 = 0; + int64_t u0 = 0; + int64_t f1 = 0; + int64_t u1 = 0; + int64_t f2 = 0; + int64_t u2 = 0; StartSync(); int fixed_sync_bk_count = GetSyncBookmarkCount(); { @@ -1591,7 +1598,7 @@ struct TestData { }; // Map from bookmark node ID to its version. -typedef std::map<int64, int64> BookmarkNodeVersionMap; +typedef std::map<int64_t, int64_t> BookmarkNodeVersionMap; // TODO(ncarter): Integrate the existing TestNode/PopulateNodeFromString code // in the bookmark model unittest, to make it simpler to set up test data @@ -2214,8 +2221,8 @@ TEST_F(ProfileSyncServiceBookmarkTestWithData, UpdateDateAdded) { // and Sync. { syncer::ReadTransaction trans(FROM_HERE, test_user_share_.user_share()); - int64 sync_version = trans.GetModelVersion(syncer::BOOKMARKS); - int64 native_version = model_->root_node()->sync_transaction_version(); + int64_t sync_version = trans.GetModelVersion(syncer::BOOKMARKS); + int64_t native_version = model_->root_node()->sync_transaction_version(); EXPECT_EQ(native_version, sync_version); } @@ -2242,8 +2249,7 @@ TEST_F(ProfileSyncServiceBookmarkTestWithData, UpdateDateAdded) { const std::string kTitle = "Some site"; const std::string kUrl = "http://www.whatwhat.yeah/"; const int kCreationTime = 30; - int64 id = adds.AddURL(kTitle, kUrl, - bookmark_bar_id(), 0); + int64_t id = adds.AddURL(kTitle, kUrl, bookmark_bar_id(), 0); adds.ApplyPendingChanges(change_processor_.get()); FakeServerChange updates(&trans); updates.ModifyCreationTime(id, kCreationTime); @@ -2283,8 +2289,8 @@ TEST_F(ProfileSyncServiceBookmarkTestWithData, // in sync with the sync version. { syncer::ReadTransaction trans(FROM_HERE, test_user_share_.user_share()); - int64 sync_version = trans.GetModelVersion(syncer::BOOKMARKS); - int64 native_version = model_->root_node()->sync_transaction_version(); + int64_t sync_version = trans.GetModelVersion(syncer::BOOKMARKS); + int64_t native_version = model_->root_node()->sync_transaction_version(); EXPECT_EQ(native_version, sync_version); } } @@ -2301,13 +2307,13 @@ TEST_F(ProfileSyncServiceBookmarkTestWithData, UpdateMetaInfoFromSync) { FakeServerChange adds(&trans); BookmarkNode::MetaInfoMap folder_meta_info; folder_meta_info["folder"] = "foldervalue"; - int64 folder_id = adds.AddFolderWithMetaInfo( + int64_t folder_id = adds.AddFolderWithMetaInfo( "folder title", &folder_meta_info, bookmark_bar_id(), 0); BookmarkNode::MetaInfoMap node_meta_info; node_meta_info["node"] = "nodevalue"; node_meta_info["other"] = "othervalue"; - int64 id = adds.AddURLWithMetaInfo("node title", "http://www.foo.com", - &node_meta_info, folder_id, 0); + int64_t id = adds.AddURLWithMetaInfo("node title", "http://www.foo.com", + &node_meta_info, folder_id, 0); adds.ApplyPendingChanges(change_processor_.get()); // Verify that the nodes are created with the correct meta info. @@ -2375,7 +2381,7 @@ TEST_F(ProfileSyncServiceBookmarkTestWithData, MetaInfoPreservedOnNonChange) { StartSync(); std::string orig_specifics; - int64 sync_id; + int64_t sync_id; const BookmarkNode* bookmark; // Create bookmark folder node containing meta info. @@ -2383,7 +2389,7 @@ TEST_F(ProfileSyncServiceBookmarkTestWithData, MetaInfoPreservedOnNonChange) { syncer::WriteTransaction trans(FROM_HERE, test_user_share_.user_share()); FakeServerChange adds(&trans); - int64 folder_id = adds.AddFolder("folder title", bookmark_bar_id(), 0); + int64_t folder_id = adds.AddFolder("folder title", bookmark_bar_id(), 0); BookmarkNode::MetaInfoMap node_meta_info; node_meta_info["one"] = "1"; @@ -2428,7 +2434,7 @@ void ProfileSyncServiceBookmarkTestWithData::GetTransactionVersions( const BookmarkNode* n = nodes.front(); nodes.pop(); - int64 version = n->sync_transaction_version(); + int64_t version = n->sync_transaction_version(); EXPECT_NE(BookmarkNode::kInvalidSyncTransactionVersion, version); (*node_versions)[n->id()] = version; @@ -2546,7 +2552,7 @@ TEST_F(ProfileSyncServiceBookmarkTestWithData, PersistenceError) { // Now shut down sync and artificially increment the native model's version. StopSync(); - int64 root_version = initial_versions[model_->root_node()->id()]; + int64_t root_version = initial_versions[model_->root_node()->id()]; model_->SetNodeSyncTransactionVersion(model_->root_node(), root_version + 1); // Upon association, bookmarks should fail to associate. @@ -2603,7 +2609,7 @@ TEST_F(ProfileSyncServiceBookmarkTest, TestUnsupportedNodes) { // Verify that these changes are ignored by Sync. EXPECT_EQ(sync_bookmark_count, GetSyncBookmarkCount()); - int64 sync_id = model_associator_->GetSyncIdFromChromeId(node->id()); + int64_t sync_id = model_associator_->GetSyncIdFromChromeId(node->id()); EXPECT_EQ(syncer::kInvalidId, sync_id); // Verify that Sync ignores deleting this node. diff --git a/chrome/browser/sync/profile_sync_service_factory.cc b/chrome/browser/sync/profile_sync_service_factory.cc index 567bf7b..1b25888 100644 --- a/chrome/browser/sync/profile_sync_service_factory.cc +++ b/chrome/browser/sync/profile_sync_service_factory.cc @@ -8,6 +8,7 @@ #include "base/memory/singleton.h" #include "base/time/time.h" +#include "build/build_config.h" #include "chrome/browser/autofill/personal_data_manager_factory.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" #include "chrome/browser/browser_process.h" diff --git a/chrome/browser/sync/profile_sync_service_factory_unittest.cc b/chrome/browser/sync/profile_sync_service_factory_unittest.cc index 84ba8e7..a7e4264 100644 --- a/chrome/browser/sync/profile_sync_service_factory_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_factory_unittest.cc @@ -2,8 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + #include "base/command_line.h" #include "base/memory/scoped_ptr.h" +#include "build/build_config.h" #include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/test/base/testing_profile.h" #include "components/browser_sync/browser/profile_sync_service.h" diff --git a/chrome/browser/sync/profile_sync_service_startup_unittest.cc b/chrome/browser/sync/profile_sync_service_startup_unittest.cc index 57bbb39..4d670c7 100644 --- a/chrome/browser/sync/profile_sync_service_startup_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_startup_unittest.cc @@ -8,6 +8,7 @@ #include "base/memory/scoped_ptr.h" #include "base/prefs/pref_service.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/signin/account_tracker_service_factory.h" #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h" #include "chrome/browser/signin/fake_signin_manager_builder.h" diff --git a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc index c21a42a..b4b086b 100644 --- a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> +#include <stdint.h> + #include <string> #include <utility> #include <vector> @@ -297,7 +300,7 @@ class ProfileSyncServiceTypedUrlTest : public AbstractProfileSyncServiceTest { syncer::BaseNode::INIT_OK) return; - int64 child_id = typed_url_root.GetFirstChildId(); + int64_t child_id = typed_url_root.GetFirstChildId(); while (child_id != syncer::kInvalidId) { syncer::ReadNode child_node(&trans); if (child_node.InitByIdLookup(child_id) != syncer::BaseNode::INIT_OK) @@ -378,7 +381,7 @@ class ProfileSyncServiceTypedUrlTest : public AbstractProfileSyncServiceTest { static history::URLRow MakeTypedUrlEntry(const char* url, const char* title, int typed_count, - int64 last_visit, + int64_t last_visit, bool hidden, history::VisitVector* visits) { // Give each URL a unique ID, to mimic the behavior of the real database. diff --git a/chrome/browser/sync/sessions/notification_service_sessions_router.h b/chrome/browser/sync/sessions/notification_service_sessions_router.h index af7f35f..8cf2db6 100644 --- a/chrome/browser/sync/sessions/notification_service_sessions_router.h +++ b/chrome/browser/sync/sessions/notification_service_sessions_router.h @@ -8,6 +8,7 @@ #include <set> #include "base/callback_list.h" +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "components/sync_sessions/sessions_sync_manager.h" #include "content/public/browser/notification_observer.h" diff --git a/chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc b/chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc index 53c8d459..10e3d64 100644 --- a/chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc +++ b/chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc @@ -4,7 +4,12 @@ #include "components/sync_sessions/sessions_sync_manager.h" +#include <stddef.h> +#include <stdint.h> + +#include "base/macros.h" #include "base/strings/string_util.h" +#include "build/build_config.h" #include "chrome/browser/sessions/session_tab_helper.h" #include "chrome/browser/sync/chrome_sync_client.h" #include "chrome/browser/sync/glue/session_sync_test_helper.h" @@ -184,10 +189,9 @@ class TestSyncProcessorStub : public syncer::SyncChangeProcessor { syncer::SyncDataList sync_data_to_return_; }; -syncer::SyncChange MakeRemoteChange( - int64 id, - const sync_pb::SessionSpecifics& specifics, - SyncChange::SyncChangeType type) { +syncer::SyncChange MakeRemoteChange(int64_t id, + const sync_pb::SessionSpecifics& specifics, + SyncChange::SyncChangeType type) { sync_pb::EntitySpecifics entity; entity.mutable_session()->CopyFrom(specifics); return syncer::SyncChange( diff --git a/chrome/browser/sync/supervised_user_signin_manager_wrapper.h b/chrome/browser/sync/supervised_user_signin_manager_wrapper.h index d5a018f..64421ea 100644 --- a/chrome/browser/sync/supervised_user_signin_manager_wrapper.h +++ b/chrome/browser/sync/supervised_user_signin_manager_wrapper.h @@ -7,7 +7,7 @@ #include <string> -#include "base/basictypes.h" +#include "base/macros.h" #include "components/sync_driver/signin_manager_wrapper.h" class Profile; diff --git a/chrome/browser/sync/sync_error_notifier_ash.cc b/chrome/browser/sync/sync_error_notifier_ash.cc index 128a33a..4e4f3e2 100644 --- a/chrome/browser/sync/sync_error_notifier_ash.cc +++ b/chrome/browser/sync/sync_error_notifier_ash.cc @@ -7,8 +7,10 @@ #include "ash/shell.h" #include "ash/shell_delegate.h" #include "ash/system/system_notifier.h" +#include "base/macros.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/notifications/notification.h" #include "chrome/browser/notifications/notification_ui_manager.h" diff --git a/chrome/browser/sync/sync_error_notifier_ash.h b/chrome/browser/sync/sync_error_notifier_ash.h index b9aa6ba..dd05ff1 100644 --- a/chrome/browser/sync/sync_error_notifier_ash.h +++ b/chrome/browser/sync/sync_error_notifier_ash.h @@ -7,8 +7,8 @@ #include <string> -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/strings/string16.h" #include "components/keyed_service/core/keyed_service.h" #include "components/sync_driver/sync_error_controller.h" diff --git a/chrome/browser/sync/sync_error_notifier_ash_unittest.cc b/chrome/browser/sync/sync_error_notifier_ash_unittest.cc index 798a2ea..90e3571 100644 --- a/chrome/browser/sync/sync_error_notifier_ash_unittest.cc +++ b/chrome/browser/sync/sync_error_notifier_ash_unittest.cc @@ -4,8 +4,12 @@ #include "chrome/browser/sync/sync_error_notifier_ash.h" +#include <stddef.h> + #include "ash/test/ash_test_base.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/notifications/notification.h" #include "chrome/browser/notifications/notification_ui_manager.h" diff --git a/chrome/browser/sync/sync_error_notifier_factory_ash.h b/chrome/browser/sync/sync_error_notifier_factory_ash.h index 86ac672..995679e 100644 --- a/chrome/browser/sync/sync_error_notifier_factory_ash.h +++ b/chrome/browser/sync/sync_error_notifier_factory_ash.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SYNC_SYNC_ERROR_NOTIFIER_FACTORY_ASH_H_ #define CHROME_BROWSER_SYNC_SYNC_ERROR_NOTIFIER_FACTORY_ASH_H_ +#include "base/macros.h" #include "base/memory/singleton.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" diff --git a/chrome/browser/sync/sync_global_error.h b/chrome/browser/sync/sync_global_error.h index 36810ce..cbdddd3 100644 --- a/chrome/browser/sync/sync_global_error.h +++ b/chrome/browser/sync/sync_global_error.h @@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_H_ #define CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_H_ -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "chrome/browser/ui/global_error/global_error.h" #include "components/keyed_service/core/keyed_service.h" #include "components/sync_driver/sync_error_controller.h" diff --git a/chrome/browser/sync/sync_global_error_factory.h b/chrome/browser/sync/sync_global_error_factory.h index 5f11ba0..19c25dd 100644 --- a/chrome/browser/sync/sync_global_error_factory.h +++ b/chrome/browser/sync/sync_global_error_factory.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_FACTORY_H_ #define CHROME_BROWSER_SYNC_SYNC_GLOBAL_ERROR_FACTORY_H_ +#include "base/macros.h" #include "base/memory/singleton.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" diff --git a/chrome/browser/sync/sync_global_error_unittest.cc b/chrome/browser/sync/sync_global_error_unittest.cc index 80836d8..ae20eaa 100644 --- a/chrome/browser/sync/sync_global_error_unittest.cc +++ b/chrome/browser/sync/sync_global_error_unittest.cc @@ -4,6 +4,7 @@ #include "chrome/browser/sync/sync_global_error.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/sync/profile_sync_test_util.h" diff --git a/chrome/browser/sync/sync_startup_tracker.h b/chrome/browser/sync/sync_startup_tracker.h index 1753282..eb73612 100644 --- a/chrome/browser/sync/sync_startup_tracker.h +++ b/chrome/browser/sync/sync_startup_tracker.h @@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_SYNC_SYNC_STARTUP_TRACKER_H_ #define CHROME_BROWSER_SYNC_SYNC_STARTUP_TRACKER_H_ -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "components/sync_driver/sync_service_observer.h" class Profile; diff --git a/chrome/browser/sync/sync_ui_util.cc b/chrome/browser/sync/sync_ui_util.cc index 76f4e41..d26bc06 100644 --- a/chrome/browser/sync/sync_ui_util.cc +++ b/chrome/browser/sync/sync_ui_util.cc @@ -4,12 +4,15 @@ #include "chrome/browser/sync/sync_ui_util.h" +#include <stdint.h> + #include "base/i18n/number_formatting.h" #include "base/i18n/time_formatting.h" #include "base/metrics/field_trial.h" #include "base/prefs/pref_service.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/signin/signin_error_controller_factory.h" @@ -392,7 +395,7 @@ MessageType GetStatus(Profile* profile, nullptr, nullptr); } -base::string16 ConstructTime(int64 time_in_int) { +base::string16 ConstructTime(int64_t time_in_int) { base::Time time = base::Time::FromInternalValue(time_in_int); // If time is null the format function returns a time in 1969. diff --git a/chrome/browser/sync/sync_ui_util.h b/chrome/browser/sync/sync_ui_util.h index 8530033..6055df5 100644 --- a/chrome/browser/sync/sync_ui_util.h +++ b/chrome/browser/sync/sync_ui_util.h @@ -6,6 +6,7 @@ #define CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_ #include "base/strings/string16.h" +#include "build/build_config.h" class Profile; class ProfileSyncService; diff --git a/chrome/browser/sync/sync_ui_util_unittest.cc b/chrome/browser/sync/sync_ui_util_unittest.cc index c42c2dd..7d4672b 100644 --- a/chrome/browser/sync/sync_ui_util_unittest.cc +++ b/chrome/browser/sync/sync_ui_util_unittest.cc @@ -2,9 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + #include <set> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/account_tracker_service_factory.h" #include "chrome/browser/signin/chrome_signin_client_factory.h" diff --git a/chrome/browser/sync/test/integration/apps_helper.cc b/chrome/browser/sync/test/integration/apps_helper.cc index 2157418..2b76b4d 100644 --- a/chrome/browser/sync/test/integration/apps_helper.cc +++ b/chrome/browser/sync/test/integration/apps_helper.cc @@ -5,6 +5,7 @@ #include "chrome/browser/sync/test/integration/apps_helper.h" #include "base/logging.h" +#include "base/macros.h" #include "base/strings/string_number_conversions.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/profiles/profile.h" diff --git a/chrome/browser/sync/test/integration/apps_helper.h b/chrome/browser/sync/test/integration/apps_helper.h index 1662b93..27567e3 100644 --- a/chrome/browser/sync/test/integration/apps_helper.h +++ b/chrome/browser/sync/test/integration/apps_helper.h @@ -5,7 +5,6 @@ #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_APPS_HELPER_H_ #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_APPS_HELPER_H_ -#include "base/basictypes.h" #include "base/compiler_specific.h" #include "chrome/browser/sync/test/integration/sync_test.h" #include "sync/api/string_ordinal.h" diff --git a/chrome/browser/sync/test/integration/autofill_helper.cc b/chrome/browser/sync/test/integration/autofill_helper.cc index 88f06ed..b02a42c 100644 --- a/chrome/browser/sync/test/integration/autofill_helper.cc +++ b/chrome/browser/sync/test/integration/autofill_helper.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync/test/integration/autofill_helper.h" +#include <stddef.h> + #include "base/guid.h" #include "chrome/browser/autofill/personal_data_manager_factory.h" #include "chrome/browser/chrome_notification_types.h" diff --git a/chrome/browser/sync/test/integration/await_match_status_change_checker.h b/chrome/browser/sync/test/integration/await_match_status_change_checker.h index 5e1cb19..d7ef744 100644 --- a/chrome/browser/sync/test/integration/await_match_status_change_checker.h +++ b/chrome/browser/sync/test/integration/await_match_status_change_checker.h @@ -7,7 +7,6 @@ #include <string> -#include "base/basictypes.h" #include "base/callback.h" #include "base/compiler_specific.h" #include "chrome/browser/sync/test/integration/multi_client_status_change_checker.h" diff --git a/chrome/browser/sync/test/integration/bookmarks_helper.cc b/chrome/browser/sync/test/integration/bookmarks_helper.cc index ccb4308..a21790c 100644 --- a/chrome/browser/sync/test/integration/bookmarks_helper.cc +++ b/chrome/browser/sync/test/integration/bookmarks_helper.cc @@ -4,12 +4,15 @@ #include "chrome/browser/sync/test/integration/bookmarks_helper.h" +#include <stddef.h> + #include <set> #include <vector> #include "base/bind.h" #include "base/compiler_specific.h" #include "base/files/file_util.h" +#include "base/macros.h" #include "base/path_service.h" #include "base/rand_util.h" #include "base/run_loop.h" diff --git a/chrome/browser/sync/test/integration/dictionary_helper.h b/chrome/browser/sync/test/integration/dictionary_helper.h index 52d0a0d..659155b 100644 --- a/chrome/browser/sync/test/integration/dictionary_helper.h +++ b/chrome/browser/sync/test/integration/dictionary_helper.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_DICTIONARY_HELPER_H_ #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_DICTIONARY_HELPER_H_ +#include <stddef.h> + #include <string> namespace dictionary_helper { diff --git a/chrome/browser/sync/test/integration/dictionary_load_observer.h b/chrome/browser/sync/test/integration/dictionary_load_observer.h index 9110c7e..d08c372 100644 --- a/chrome/browser/sync/test/integration/dictionary_load_observer.h +++ b/chrome/browser/sync/test/integration/dictionary_load_observer.h @@ -6,6 +6,7 @@ #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_DICTIONARY_LOAD_OBSERVER_H_ #include "base/callback.h" +#include "base/macros.h" #include "chrome/browser/spellchecker/spellcheck_custom_dictionary.h" // DictionaryLoadObserver is used when blocking until the diff --git a/chrome/browser/sync/test/integration/enable_disable_test.cc b/chrome/browser/sync/test/integration/enable_disable_test.cc index 5087b86..87e8f65 100644 --- a/chrome/browser/sync/test/integration/enable_disable_test.cc +++ b/chrome/browser/sync/test/integration/enable_disable_test.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" #include "chrome/browser/sync/test/integration/sync_test.h" #include "components/browser_sync/browser/profile_sync_service.h" diff --git a/chrome/browser/sync/test/integration/extensions_helper.cc b/chrome/browser/sync/test/integration/extensions_helper.cc index 4097fe6..7f9a2fb 100644 --- a/chrome/browser/sync/test/integration/extensions_helper.cc +++ b/chrome/browser/sync/test/integration/extensions_helper.cc @@ -5,6 +5,7 @@ #include "chrome/browser/sync/test/integration/extensions_helper.h" #include "base/logging.h" +#include "base/macros.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/test/integration/status_change_checker.h" diff --git a/chrome/browser/sync/test/integration/extensions_helper.h b/chrome/browser/sync/test/integration/extensions_helper.h index f789d0c..f807abf 100644 --- a/chrome/browser/sync/test/integration/extensions_helper.h +++ b/chrome/browser/sync/test/integration/extensions_helper.h @@ -8,7 +8,6 @@ #include <string> #include <vector> -#include "base/basictypes.h" #include "base/compiler_specific.h" #include "chrome/browser/sync/test/integration/sync_test.h" diff --git a/chrome/browser/sync/test/integration/fake_server_invalidation_service.h b/chrome/browser/sync/test/integration/fake_server_invalidation_service.h index 71bb558..a8c0905 100644 --- a/chrome/browser/sync/test/integration/fake_server_invalidation_service.h +++ b/chrome/browser/sync/test/integration/fake_server_invalidation_service.h @@ -8,7 +8,7 @@ #include <string> #include <utility> -#include "base/basictypes.h" +#include "base/macros.h" #include "components/invalidation/impl/invalidator_registrar.h" #include "components/invalidation/public/invalidation_service.h" #include "components/signin/core/browser/fake_profile_oauth2_token_service.h" diff --git a/chrome/browser/sync/test/integration/migration_test.cc b/chrome/browser/sync/test/integration/migration_test.cc index 77740a2..9c1d9e3 100644 --- a/chrome/browser/sync/test/integration/migration_test.cc +++ b/chrome/browser/sync/test/integration/migration_test.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/memory/scoped_vector.h" #include "base/prefs/scoped_user_pref_update.h" #include "chrome/browser/profiles/profile.h" diff --git a/chrome/browser/sync/test/integration/multiple_client_dictionary_sync_test.cc b/chrome/browser/sync/test/integration/multiple_client_dictionary_sync_test.cc index 1a8dec8..f92d4ea 100644 --- a/chrome/browser/sync/test/integration/multiple_client_dictionary_sync_test.cc +++ b/chrome/browser/sync/test/integration/multiple_client_dictionary_sync_test.cc @@ -2,7 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + +#include "base/macros.h" #include "base/strings/string_number_conversions.h" +#include "build/build_config.h" #include "chrome/browser/sync/test/integration/dictionary_helper.h" #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" #include "chrome/browser/sync/test/integration/sync_test.h" diff --git a/chrome/browser/sync/test/integration/multiple_client_passwords_sync_test.cc b/chrome/browser/sync/test/integration/multiple_client_passwords_sync_test.cc index 27e19d2..514ae36 100644 --- a/chrome/browser/sync/test/integration/multiple_client_passwords_sync_test.cc +++ b/chrome/browser/sync/test/integration/multiple_client_passwords_sync_test.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/sync/test/integration/passwords_helper.h" diff --git a/chrome/browser/sync/test/integration/p2p_invalidation_forwarder.h b/chrome/browser/sync/test/integration/p2p_invalidation_forwarder.h index b33aca0..59fe52c 100644 --- a/chrome/browser/sync/test/integration/p2p_invalidation_forwarder.h +++ b/chrome/browser/sync/test/integration/p2p_invalidation_forwarder.h @@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_INVALIDATION_FORWARDER_H_ #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_INVALIDATION_FORWARDER_H_ -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "components/sync_driver/sync_service_observer.h" class ProfileSyncService; diff --git a/chrome/browser/sync/test/integration/p2p_sync_refresher.h b/chrome/browser/sync/test/integration/p2p_sync_refresher.h index 19c0176..7a71f25 100644 --- a/chrome/browser/sync/test/integration/p2p_sync_refresher.h +++ b/chrome/browser/sync/test/integration/p2p_sync_refresher.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_SYNC_REFRESHER_H_ #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_P2P_SYNC_REFRESHER_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "components/sync_driver/sync_service_observer.h" class Profile; diff --git a/chrome/browser/sync/test/integration/passwords_helper.cc b/chrome/browser/sync/test/integration/passwords_helper.cc index 749532f..e6f8156 100644 --- a/chrome/browser/sync/test/integration/passwords_helper.cc +++ b/chrome/browser/sync/test/integration/passwords_helper.cc @@ -7,6 +7,7 @@ #include <sstream> #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/synchronization/waitable_event.h" diff --git a/chrome/browser/sync/test/integration/performance/autofill_sync_perf_test.cc b/chrome/browser/sync/test/integration/performance/autofill_sync_perf_test.cc index 5a74e7d..da288ab 100644 --- a/chrome/browser/sync/test/integration/performance/autofill_sync_perf_test.cc +++ b/chrome/browser/sync/test/integration/performance/autofill_sync_perf_test.cc @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + +#include "base/macros.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/sync/test/integration/autofill_helper.h" diff --git a/chrome/browser/sync/test/integration/performance/bookmarks_sync_perf_test.cc b/chrome/browser/sync/test/integration/performance/bookmarks_sync_perf_test.cc index a6bf1b1..e6f04cb 100644 --- a/chrome/browser/sync/test/integration/performance/bookmarks_sync_perf_test.cc +++ b/chrome/browser/sync/test/integration/performance/bookmarks_sync_perf_test.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "chrome/browser/sync/test/integration/bookmarks_helper.h" #include "chrome/browser/sync/test/integration/performance/sync_timing_helper.h" #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" diff --git a/chrome/browser/sync/test/integration/performance/dictionary_sync_perf_test.cc b/chrome/browser/sync/test/integration/performance/dictionary_sync_perf_test.cc index ac2a1b5..2d18a8b 100644 --- a/chrome/browser/sync/test/integration/performance/dictionary_sync_perf_test.cc +++ b/chrome/browser/sync/test/integration/performance/dictionary_sync_perf_test.cc @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + +#include "base/macros.h" #include "base/strings/string_number_conversions.h" #include "chrome/browser/sync/test/integration/dictionary_helper.h" #include "chrome/browser/sync/test/integration/performance/sync_timing_helper.h" diff --git a/chrome/browser/sync/test/integration/performance/extensions_sync_perf_test.cc b/chrome/browser/sync/test/integration/performance/extensions_sync_perf_test.cc index 2ca5852..0951780 100644 --- a/chrome/browser/sync/test/integration/performance/extensions_sync_perf_test.cc +++ b/chrome/browser/sync/test/integration/performance/extensions_sync_perf_test.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "base/strings/stringprintf.h" #include "chrome/browser/sync/test/integration/extensions_helper.h" #include "chrome/browser/sync/test/integration/performance/sync_timing_helper.h" diff --git a/chrome/browser/sync/test/integration/performance/passwords_sync_perf_test.cc b/chrome/browser/sync/test/integration/performance/passwords_sync_perf_test.cc index 4e536ad..634bafd 100644 --- a/chrome/browser/sync/test/integration/performance/passwords_sync_perf_test.cc +++ b/chrome/browser/sync/test/integration/performance/passwords_sync_perf_test.cc @@ -2,8 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/sync/test/integration/passwords_helper.h" #include "chrome/browser/sync/test/integration/performance/sync_timing_helper.h" #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" diff --git a/chrome/browser/sync/test/integration/performance/sessions_sync_perf_test.cc b/chrome/browser/sync/test/integration/performance/sessions_sync_perf_test.cc index 9aac0b8..21c221f 100644 --- a/chrome/browser/sync/test/integration/performance/sessions_sync_perf_test.cc +++ b/chrome/browser/sync/test/integration/performance/sessions_sync_perf_test.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "base/strings/stringprintf.h" #include "chrome/browser/sync/test/integration/performance/sync_timing_helper.h" #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" diff --git a/chrome/browser/sync/test/integration/performance/sync_timing_helper.h b/chrome/browser/sync/test/integration/performance/sync_timing_helper.h index 3130494..10cadcc 100644 --- a/chrome/browser/sync/test/integration/performance/sync_timing_helper.h +++ b/chrome/browser/sync/test/integration/performance/sync_timing_helper.h @@ -5,11 +5,11 @@ #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_PERFORMANCE_SYNC_TIMING_HELPER_H_ #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_PERFORMANCE_SYNC_TIMING_HELPER_H_ -#include "base/basictypes.h" - #include <string> #include <vector> +#include "base/macros.h" + namespace base { class TimeDelta; } diff --git a/chrome/browser/sync/test/integration/performance/typed_urls_sync_perf_test.cc b/chrome/browser/sync/test/integration/performance/typed_urls_sync_perf_test.cc index ffed1e8..8e54a8c 100644 --- a/chrome/browser/sync/test/integration/performance/typed_urls_sync_perf_test.cc +++ b/chrome/browser/sync/test/integration/performance/typed_urls_sync_perf_test.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/basictypes.h" +#include "base/macros.h" #include "base/strings/stringprintf.h" #include "chrome/browser/sync/test/integration/performance/sync_timing_helper.h" #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" diff --git a/chrome/browser/sync/test/integration/preferences_helper.cc b/chrome/browser/sync/test/integration/preferences_helper.cc index 50d1306..7cd12fb 100644 --- a/chrome/browser/sync/test/integration/preferences_helper.cc +++ b/chrome/browser/sync/test/integration/preferences_helper.cc @@ -39,7 +39,7 @@ void ChangeIntegerPref(int index, const char* pref_name, int new_value) { GetVerifierPrefs()->SetInteger(pref_name, new_value); } -void ChangeInt64Pref(int index, const char* pref_name, int64 new_value) { +void ChangeInt64Pref(int index, const char* pref_name, int64_t new_value) { GetPrefs(index)->SetInt64(pref_name, new_value); if (test()->use_verifier()) GetVerifierPrefs()->SetInt64(pref_name, new_value); @@ -126,7 +126,7 @@ bool IntegerPrefMatches(const char* pref_name) { } bool Int64PrefMatches(const char* pref_name) { - int64 reference_value; + int64_t reference_value; if (test()->use_verifier()) { reference_value = GetVerifierPrefs()->GetInt64(pref_name); } else { diff --git a/chrome/browser/sync/test/integration/preferences_helper.h b/chrome/browser/sync/test/integration/preferences_helper.h index 2ce9a17..aaa5ad8 100644 --- a/chrome/browser/sync/test/integration/preferences_helper.h +++ b/chrome/browser/sync/test/integration/preferences_helper.h @@ -8,6 +8,8 @@ #include "base/files/file_path.h" #include "base/values.h" +#include <stdint.h> + #include <string> class PrefService; @@ -30,10 +32,10 @@ void ChangeBooleanPref(int index, const char* pref_name); // |verifier| if DisableVerifier() hasn't been called. void ChangeIntegerPref(int index, const char* pref_name, int new_value); -// Changes the value of the int64 preference with name |pref_name| in the +// Changes the value of the int64_t preference with name |pref_name| in the // profile with index |index| to |new_value|. Also changes its value in // |verifier| if DisableVerifier() hasn't been called. -void ChangeInt64Pref(int index, const char* pref_name, int64 new_value); +void ChangeInt64Pref(int index, const char* pref_name, int64_t new_value); // Changes the value of the double preference with name |pref_name| in the // profile with index |index| to |new_value|. Also changes its value in @@ -71,7 +73,7 @@ bool BooleanPrefMatches(const char* pref_name) WARN_UNUSED_RESULT; // hasn't been called. bool IntegerPrefMatches(const char* pref_name) WARN_UNUSED_RESULT; -// Used to verify that the int64 preference with name |pref_name| has the +// Used to verify that the int64_t preference with name |pref_name| has the // same value across all profiles. Also checks |verifier| if DisableVerifier() // hasn't been called. bool Int64PrefMatches(const char* pref_name) WARN_UNUSED_RESULT; diff --git a/chrome/browser/sync/test/integration/profile_sync_service_harness.h b/chrome/browser/sync/test/integration/profile_sync_service_harness.h index 8a3dba4..d4958b6 100644 --- a/chrome/browser/sync/test/integration/profile_sync_service_harness.h +++ b/chrome/browser/sync/test/integration/profile_sync_service_harness.h @@ -8,8 +8,8 @@ #include <string> #include <vector> -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/internal_api/public/sessions/sync_session_snapshot.h" diff --git a/chrome/browser/sync/test/integration/quiesce_status_change_checker.cc b/chrome/browser/sync/test/integration/quiesce_status_change_checker.cc index 740f8cb..ba5be16 100644 --- a/chrome/browser/sync/test/integration/quiesce_status_change_checker.cc +++ b/chrome/browser/sync/test/integration/quiesce_status_change_checker.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync/test/integration/quiesce_status_change_checker.h" +#include <stddef.h> + #include "base/format_macros.h" #include "base/scoped_observer.h" #include "base/strings/string_number_conversions.h" diff --git a/chrome/browser/sync/test/integration/quiesce_status_change_checker.h b/chrome/browser/sync/test/integration/quiesce_status_change_checker.h index e481227..5983592 100644 --- a/chrome/browser/sync/test/integration/quiesce_status_change_checker.h +++ b/chrome/browser/sync/test/integration/quiesce_status_change_checker.h @@ -7,8 +7,8 @@ #include <vector> -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/memory/scoped_vector.h" #include "base/time/time.h" #include "chrome/browser/sync/test/integration/status_change_checker.h" diff --git a/chrome/browser/sync/test/integration/retry_verifier.cc b/chrome/browser/sync/test/integration/retry_verifier.cc index 202b1f3..7d82a23 100644 --- a/chrome/browser/sync/test/integration/retry_verifier.cc +++ b/chrome/browser/sync/test/integration/retry_verifier.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync/test/integration/retry_verifier.h" +#include <string.h> + #include <algorithm> #include "base/logging.h" @@ -13,20 +15,23 @@ namespace { // Given the current delay calculate the minimum and maximum wait times for // the next retry. -DelayInfo CalculateDelay(int64 current_delay) { - int64 backoff_s = std::max(static_cast<int64>(1), current_delay * - syncer::kBackoffRandomizationFactor); +DelayInfo CalculateDelay(int64_t current_delay) { + int64_t backoff_s = + std::max(static_cast<int64_t>(1), + current_delay * syncer::kBackoffRandomizationFactor); DelayInfo delay_info; delay_info.min_delay = backoff_s + (-1 * current_delay/ syncer::kBackoffRandomizationFactor); delay_info.max_delay = backoff_s + current_delay/2; - delay_info.min_delay = std::max(static_cast<int64>(1), - std::min(delay_info.min_delay, syncer::kMaxBackoffSeconds)); + delay_info.min_delay = + std::max(static_cast<int64_t>(1), + std::min(delay_info.min_delay, syncer::kMaxBackoffSeconds)); - delay_info.max_delay = std::max(static_cast<int64>(1), - std::min(delay_info.max_delay, syncer::kMaxBackoffSeconds)); + delay_info.max_delay = + std::max(static_cast<int64_t>(1), + std::min(delay_info.max_delay, syncer::kMaxBackoffSeconds)); return delay_info; } @@ -37,8 +42,8 @@ void FillDelayTable(DelayInfo* delay_table, int count) { DCHECK(count > 1); // We start off with the minimum value of 2 seconds. - delay_table[0].min_delay = static_cast<int64>(2); - delay_table[0].max_delay = static_cast<int64>(2); + delay_table[0].min_delay = static_cast<int64_t>(2); + delay_table[0].max_delay = static_cast<int64_t>(2); for (int i = 1 ; i < count ; ++i) { delay_table[i].min_delay = CalculateDelay(delay_table[i-1].min_delay). diff --git a/chrome/browser/sync/test/integration/retry_verifier.h b/chrome/browser/sync/test/integration/retry_verifier.h index bf7003f..e5ad086 100644 --- a/chrome/browser/sync/test/integration/retry_verifier.h +++ b/chrome/browser/sync/test/integration/retry_verifier.h @@ -5,6 +5,9 @@ #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_RETRY_VERIFIER_H_ #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_RETRY_VERIFIER_H_ +#include <stdint.h> + +#include "base/macros.h" #include "base/time/time.h" namespace syncer { @@ -17,8 +20,8 @@ class SyncSessionSnapshot; // place somewhere in this range. The algorithm that calculates the retry wait // time uses rand functions. struct DelayInfo { - int64 min_delay; - int64 max_delay; + int64_t min_delay; + int64_t max_delay; }; // Class to verify retries take place using the exponential backoff algorithm. diff --git a/chrome/browser/sync/test/integration/search_engines_helper.cc b/chrome/browser/sync/test/integration/search_engines_helper.cc index b104851..320b2a6 100644 --- a/chrome/browser/sync/test/integration/search_engines_helper.cc +++ b/chrome/browser/sync/test/integration/search_engines_helper.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync/test/integration/search_engines_helper.h" +#include <stddef.h> + #include <vector> #include "base/strings/string_util.h" diff --git a/chrome/browser/sync/test/integration/sessions_helper.cc b/chrome/browser/sync/test/integration/sessions_helper.cc index 35489a5..18cdc1b 100644 --- a/chrome/browser/sync/test/integration/sessions_helper.cc +++ b/chrome/browser/sync/test/integration/sessions_helper.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync/test/integration/sessions_helper.h" +#include <stddef.h> + #include <algorithm> #include "base/bind.h" diff --git a/chrome/browser/sync/test/integration/single_client_app_list_sync_test.cc b/chrome/browser/sync/test/integration/single_client_app_list_sync_test.cc index cd233dc..274c2a1f 100644 --- a/chrome/browser/sync/test/integration/single_client_app_list_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_app_list_sync_test.cc @@ -2,8 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/basictypes.h" +#include <stddef.h> + #include "base/command_line.h" +#include "base/macros.h" #include "chrome/browser/sync/test/integration/apps_helper.h" #include "chrome/browser/sync/test/integration/sync_app_list_helper.h" #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" diff --git a/chrome/browser/sync/test/integration/single_client_apps_sync_test.cc b/chrome/browser/sync/test/integration/single_client_apps_sync_test.cc index 92fc27e..2125f89 100644 --- a/chrome/browser/sync/test/integration/single_client_apps_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_apps_sync_test.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/basictypes.h" +#include "base/macros.h" #include "chrome/browser/sync/test/integration/apps_helper.h" #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" #include "chrome/browser/sync/test/integration/sync_test.h" diff --git a/chrome/browser/sync/test/integration/single_client_backup_rollback_test.cc b/chrome/browser/sync/test/integration/single_client_backup_rollback_test.cc index 128fa93..61c71c8 100644 --- a/chrome/browser/sync/test/integration/single_client_backup_rollback_test.cc +++ b/chrome/browser/sync/test/integration/single_client_backup_rollback_test.cc @@ -5,6 +5,7 @@ #include "base/command_line.h" #include "base/files/file_util.h" #include "base/location.h" +#include "base/macros.h" #include "base/prefs/pref_service.h" #include "base/run_loop.h" #include "base/single_thread_task_runner.h" diff --git a/chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc b/chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc index 391805d..e7519ea 100644 --- a/chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/test/integration/bookmarks_helper.h" diff --git a/chrome/browser/sync/test/integration/single_client_dictionary_sync_test.cc b/chrome/browser/sync/test/integration/single_client_dictionary_sync_test.cc index aec1c94..9ea624d 100644 --- a/chrome/browser/sync/test/integration/single_client_dictionary_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_dictionary_sync_test.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "chrome/browser/sync/test/integration/dictionary_helper.h" #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" #include "chrome/browser/sync/test/integration/sync_test.h" diff --git a/chrome/browser/sync/test/integration/single_client_directory_sync_test.cc b/chrome/browser/sync/test/integration/single_client_directory_sync_test.cc index c5c8f45..c308a88 100644 --- a/chrome/browser/sync/test/integration/single_client_directory_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_directory_sync_test.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/location.h" +#include "base/macros.h" #include "base/run_loop.h" #include "base/single_thread_task_runner.h" #include "base/strings/string_number_conversions.h" diff --git a/chrome/browser/sync/test/integration/single_client_extensions_sync_test.cc b/chrome/browser/sync/test/integration/single_client_extensions_sync_test.cc index b8c36fc..a5cda22 100644 --- a/chrome/browser/sync/test/integration/single_client_extensions_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_extensions_sync_test.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/basictypes.h" +#include "base/macros.h" #include "chrome/browser/sync/test/integration/extensions_helper.h" #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" #include "chrome/browser/sync/test/integration/sync_test.h" diff --git a/chrome/browser/sync/test/integration/single_client_password_manager_setting_migrator_service_sync_test.cc b/chrome/browser/sync/test/integration/single_client_password_manager_setting_migrator_service_sync_test.cc index e63e69a..290ce9f 100644 --- a/chrome/browser/sync/test/integration/single_client_password_manager_setting_migrator_service_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_password_manager_setting_migrator_service_sync_test.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/json/json_writer.h" +#include "base/macros.h" #include "base/prefs/pref_service.h" #include "chrome/browser/prefs/pref_service_syncable_util.h" #include "chrome/browser/sync/test/integration/password_manager_setting_migrator_helper.h" diff --git a/chrome/browser/sync/test/integration/single_client_passwords_sync_test.cc b/chrome/browser/sync/test/integration/single_client_passwords_sync_test.cc index 9be7c57..6444442 100644 --- a/chrome/browser/sync/test/integration/single_client_passwords_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_passwords_sync_test.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "chrome/browser/sync/test/integration/passwords_helper.h" #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" #include "chrome/browser/sync/test/integration/sync_test.h" diff --git a/chrome/browser/sync/test/integration/single_client_preferences_sync_test.cc b/chrome/browser/sync/test/integration/single_client_preferences_sync_test.cc index 3892ba9..c336639 100644 --- a/chrome/browser/sync/test/integration/single_client_preferences_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_preferences_sync_test.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "chrome/browser/sync/test/integration/preferences_helper.h" #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" #include "chrome/browser/sync/test/integration/sync_test.h" diff --git a/chrome/browser/sync/test/integration/single_client_search_engines_sync_test.cc b/chrome/browser/sync/test/integration/single_client_search_engines_sync_test.cc index 9f58420..225e326 100644 --- a/chrome/browser/sync/test/integration/single_client_search_engines_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_search_engines_sync_test.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "chrome/browser/sync/test/integration/search_engines_helper.h" #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" #include "chrome/browser/sync/test/integration/sync_test.h" diff --git a/chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc b/chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc index 2cda830..43666a5 100644 --- a/chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "chrome/browser/sessions/session_service.h" #include "chrome/browser/sync/test/integration/sessions_helper.h" #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" diff --git a/chrome/browser/sync/test/integration/single_client_themes_sync_test.cc b/chrome/browser/sync/test/integration/single_client_themes_sync_test.cc index 2aa0bd3..8bb0048 100644 --- a/chrome/browser/sync/test/integration/single_client_themes_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_themes_sync_test.cc @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/basictypes.h" +#include "base/macros.h" +#include "build/build_config.h" #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" #include "chrome/browser/sync/test/integration/sync_test.h" #include "chrome/browser/sync/test/integration/themes_helper.h" diff --git a/chrome/browser/sync/test/integration/single_client_typed_urls_sync_test.cc b/chrome/browser/sync/test/integration/single_client_typed_urls_sync_test.cc index 431abfe..8a4ace6 100644 --- a/chrome/browser/sync/test/integration/single_client_typed_urls_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_typed_urls_sync_test.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "chrome/browser/sessions/session_service.h" #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" #include "chrome/browser/sync/test/integration/sync_test.h" diff --git a/chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc b/chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc index 69619dd..4461ad6 100644 --- a/chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/basictypes.h" #include "base/command_line.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/prefs/pref_service.h" #include "base/strings/utf_string_conversions.h" diff --git a/chrome/browser/sync/test/integration/single_client_wifi_credentials_sync_test.cc b/chrome/browser/sync/test/integration/single_client_wifi_credentials_sync_test.cc index e11586d..4744fd1 100644 --- a/chrome/browser/sync/test/integration/single_client_wifi_credentials_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_wifi_credentials_sync_test.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + #include "base/command_line.h" #include "base/macros.h" #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" diff --git a/chrome/browser/sync/test/integration/sync_app_helper.h b/chrome/browser/sync/test/integration/sync_app_helper.h index c3bac14..71d55e8 100644 --- a/chrome/browser/sync/test/integration/sync_app_helper.h +++ b/chrome/browser/sync/test/integration/sync_app_helper.h @@ -7,7 +7,7 @@ #include <string> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/singleton.h" #include "sync/api/string_ordinal.h" diff --git a/chrome/browser/sync/test/integration/sync_app_list_helper.h b/chrome/browser/sync/test/integration/sync_app_list_helper.h index 9e4186a..cd788b25 100644 --- a/chrome/browser/sync/test/integration/sync_app_list_helper.h +++ b/chrome/browser/sync/test/integration/sync_app_list_helper.h @@ -5,9 +5,11 @@ #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_APP_LIST_HELPER_H_ #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_APP_LIST_HELPER_H_ +#include <stddef.h> + #include <string> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/singleton.h" #include "sync/api/string_ordinal.h" diff --git a/chrome/browser/sync/test/integration/sync_auth_test.cc b/chrome/browser/sync/test/integration/sync_auth_test.cc index 09f75ed..35a2117 100644 --- a/chrome/browser/sync/test/integration/sync_auth_test.cc +++ b/chrome/browser/sync/test/integration/sync_auth_test.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "base/strings/stringprintf.h" #include "base/threading/platform_thread.h" #include "base/time/time.h" diff --git a/chrome/browser/sync/test/integration/sync_datatype_helper.h b/chrome/browser/sync/test/integration/sync_datatype_helper.h index 8cbf585..770cfc3 100644 --- a/chrome/browser/sync/test/integration/sync_datatype_helper.h +++ b/chrome/browser/sync/test/integration/sync_datatype_helper.h @@ -5,7 +5,6 @@ #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_DATATYPE_HELPER_H_ #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_DATATYPE_HELPER_H_ -#include "base/basictypes.h" class SyncTest; diff --git a/chrome/browser/sync/test/integration/sync_errors_test.cc b/chrome/browser/sync/test/integration/sync_errors_test.cc index 7af22a9..704f106 100644 --- a/chrome/browser/sync/test/integration/sync_errors_test.cc +++ b/chrome/browser/sync/test/integration/sync_errors_test.cc @@ -2,9 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "base/prefs/pref_member.h" #include "base/prefs/pref_service.h" #include "base/run_loop.h" +#include "build/build_config.h" #include "chrome/browser/sync/test/integration/bookmarks_helper.h" #include "chrome/browser/sync/test/integration/passwords_helper.h" #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" diff --git a/chrome/browser/sync/test/integration/sync_exponential_backoff_test.cc b/chrome/browser/sync/test/integration/sync_exponential_backoff_test.cc index 3b98198..51a07cc 100644 --- a/chrome/browser/sync/test/integration/sync_exponential_backoff_test.cc +++ b/chrome/browser/sync/test/integration/sync_exponential_backoff_test.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/bind.h" +#include "base/macros.h" #include "base/strings/stringprintf.h" #include "chrome/browser/sync/test/integration/bookmarks_helper.h" #include "chrome/browser/sync/test/integration/retry_verifier.h" diff --git a/chrome/browser/sync/test/integration/sync_extension_helper.h b/chrome/browser/sync/test/integration/sync_extension_helper.h index 99dfa08..71b55de 100644 --- a/chrome/browser/sync/test/integration/sync_extension_helper.h +++ b/chrome/browser/sync/test/integration/sync_extension_helper.h @@ -9,8 +9,8 @@ #include <string> #include <vector> -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/singleton.h" #include "extensions/common/manifest.h" diff --git a/chrome/browser/sync/test/integration/sync_extension_installer.h b/chrome/browser/sync/test/integration/sync_extension_installer.h index 5c91cb9..22fbb66 100644 --- a/chrome/browser/sync/test/integration/sync_extension_installer.h +++ b/chrome/browser/sync/test/integration/sync_extension_installer.h @@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_EXTENSION_INSTALLER_H_ #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_EXTENSION_INSTALLER_H_ -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc index 5a9b48f..a848e12 100644 --- a/chrome/browser/sync/test/integration/sync_test.cc +++ b/chrome/browser/sync/test/integration/sync_test.cc @@ -4,6 +4,7 @@ #include "chrome/browser/sync/test/integration/sync_test.h" +#include <stddef.h> #include <stdint.h> #include <limits> @@ -26,6 +27,7 @@ #include "base/test/test_timeouts.h" #include "base/threading/platform_thread.h" #include "base/values.h" +#include "build/build_config.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/history/history_service_factory.h" diff --git a/chrome/browser/sync/test/integration/sync_test.h b/chrome/browser/sync/test/integration/sync_test.h index 5061e0b..e8aa940 100644 --- a/chrome/browser/sync/test/integration/sync_test.h +++ b/chrome/browser/sync/test/integration/sync_test.h @@ -8,8 +8,8 @@ #include <string> #include <vector> -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/process/process.h" diff --git a/chrome/browser/sync/test/integration/themes_helper.h b/chrome/browser/sync/test/integration/themes_helper.h index 9911de1..dce9cbb 100644 --- a/chrome/browser/sync/test/integration/themes_helper.h +++ b/chrome/browser/sync/test/integration/themes_helper.h @@ -7,7 +7,6 @@ #include <string> -#include "base/basictypes.h" #include "base/compiler_specific.h" #include "chrome/browser/sync/test/integration/sync_test.h" diff --git a/chrome/browser/sync/test/integration/two_client_app_list_sync_test.cc b/chrome/browser/sync/test/integration/two_client_app_list_sync_test.cc index 79cb879..2e707f0 100644 --- a/chrome/browser/sync/test/integration/two_client_app_list_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_app_list_sync_test.cc @@ -2,8 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/basictypes.h" +#include <stddef.h> + #include "base/command_line.h" +#include "base/macros.h" +#include "build/build_config.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/profiles/profile.h" diff --git a/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc b/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc index 8fa681e..650d5bf0 100644 --- a/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc @@ -2,7 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/basictypes.h" +#include <stddef.h> + +#include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/extensions/bookmark_app_helper.h" diff --git a/chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc b/chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc index 6f5064f..d8e9e6ab 100644 --- a/chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/sync/test/integration/autofill_helper.h" #include "chrome/browser/sync/test/integration/bookmarks_helper.h" diff --git a/chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc b/chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc index 5b52793a..d08e930 100644 --- a/chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc @@ -2,10 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + +#include "base/macros.h" #include "base/rand_util.h" #include "base/run_loop.h" #include "base/strings/stringprintf.h" #include "base/values.h" +#include "build/build_config.h" #include "chrome/browser/policy/profile_policy_connector_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/test/integration/bookmarks_helper.h" diff --git a/chrome/browser/sync/test/integration/two_client_dictionary_sync_test.cc b/chrome/browser/sync/test/integration/two_client_dictionary_sync_test.cc index 5f9c336..335f61e 100644 --- a/chrome/browser/sync/test/integration/two_client_dictionary_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_dictionary_sync_test.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "base/strings/string_number_conversions.h" #include "chrome/browser/sync/test/integration/dictionary_helper.h" #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" diff --git a/chrome/browser/sync/test/integration/two_client_extension_settings_and_app_settings_sync_test.cc b/chrome/browser/sync/test/integration/two_client_extension_settings_and_app_settings_sync_test.cc index 2b2767e..e6d8a98 100644 --- a/chrome/browser/sync/test/integration/two_client_extension_settings_and_app_settings_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_extension_settings_and_app_settings_sync_test.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "base/strings/stringprintf.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/test/integration/apps_helper.h" diff --git a/chrome/browser/sync/test/integration/two_client_extensions_sync_test.cc b/chrome/browser/sync/test/integration/two_client_extensions_sync_test.cc index d1b83db..5dca55b 100644 --- a/chrome/browser/sync/test/integration/two_client_extensions_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_extensions_sync_test.cc @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/basictypes.h" +#include "base/macros.h" +#include "build/build_config.h" #include "chrome/browser/sync/test/integration/extensions_helper.h" #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" diff --git a/chrome/browser/sync/test/integration/two_client_password_manager_setting_migrator_service_sync_test.cc b/chrome/browser/sync/test/integration/two_client_password_manager_setting_migrator_service_sync_test.cc index df2a33f..2ddba1d 100644 --- a/chrome/browser/sync/test/integration/two_client_password_manager_setting_migrator_service_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_password_manager_setting_migrator_service_sync_test.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "base/prefs/pref_service.h" #include "chrome/browser/sync/test/integration/password_manager_setting_migrator_helper.h" #include "chrome/browser/sync/test/integration/preferences_helper.h" diff --git a/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc b/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc index e1b6db0..d7764ba 100644 --- a/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc @@ -8,8 +8,10 @@ #include "base/guid.h" #include "base/hash.h" +#include "base/macros.h" #include "base/rand_util.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/sync/test/integration/passwords_helper.h" #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" diff --git a/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc b/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc index dd52c82..cd69ae9 100644 --- a/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc @@ -5,6 +5,7 @@ #include <string> #include "base/guid.h" +#include "base/macros.h" #include "base/prefs/pref_service.h" #include "base/strings/stringprintf.h" #include "chrome/browser/sync/test/integration/preferences_helper.h" diff --git a/chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc b/chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc index 0d6f2ff..4a44202 100644 --- a/chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/search_engines/template_url_service_factory.h" #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" diff --git a/chrome/browser/sync/test/integration/two_client_sessions_sync_test.cc b/chrome/browser/sync/test/integration/two_client_sessions_sync_test.cc index 2a48d93..54cadfd 100644 --- a/chrome/browser/sync/test/integration/two_client_sessions_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_sessions_sync_test.cc @@ -5,7 +5,9 @@ #include <string> #include "base/guid.h" +#include "base/macros.h" #include "base/strings/stringprintf.h" +#include "build/build_config.h" #include "chrome/browser/sessions/session_service.h" #include "chrome/browser/sync/test/integration/passwords_helper.h" #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" diff --git a/chrome/browser/sync/test/integration/two_client_themes_sync_test.cc b/chrome/browser/sync/test/integration/two_client_themes_sync_test.cc index 26e64a7..b0df58c 100644 --- a/chrome/browser/sync/test/integration/two_client_themes_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_themes_sync_test.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/basictypes.h" +#include "base/macros.h" #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" #include "chrome/browser/sync/test/integration/sync_test.h" diff --git a/chrome/browser/sync/test/integration/two_client_typed_urls_sync_test.cc b/chrome/browser/sync/test/integration/two_client_typed_urls_sync_test.cc index 25e2fa5..09f60cc 100644 --- a/chrome/browser/sync/test/integration/two_client_typed_urls_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_typed_urls_sync_test.cc @@ -2,10 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + #include "base/guid.h" #include "base/i18n/number_formatting.h" +#include "base/macros.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/sessions/session_service.h" #include "chrome/browser/sync/test/integration/bookmarks_helper.h" #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" diff --git a/chrome/browser/sync/test/integration/two_client_wifi_credentials_sync_test.cc b/chrome/browser/sync/test/integration/two_client_wifi_credentials_sync_test.cc index 91b8682..3a9a96a7 100644 --- a/chrome/browser/sync/test/integration/two_client_wifi_credentials_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_wifi_credentials_sync_test.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + #include "base/command_line.h" #include "base/macros.h" #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" diff --git a/chrome/browser/sync/test/integration/typed_urls_helper.cc b/chrome/browser/sync/test/integration/typed_urls_helper.cc index 2b865fb..bb7a8f9 100644 --- a/chrome/browser/sync/test/integration/typed_urls_helper.cc +++ b/chrome/browser/sync/test/integration/typed_urls_helper.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync/test/integration/typed_urls_helper.h" +#include <stddef.h> + #include "base/compiler_specific.h" #include "base/strings/utf_string_conversions.h" #include "base/synchronization/waitable_event.h" diff --git a/chrome/browser/sync/test/integration/wifi_credentials_helper.cc b/chrome/browser/sync/test/integration/wifi_credentials_helper.cc index 7472aa1..c9146cb 100644 --- a/chrome/browser/sync/test/integration/wifi_credentials_helper.cc +++ b/chrome/browser/sync/test/integration/wifi_credentials_helper.cc @@ -6,6 +6,7 @@ #include "base/logging.h" #include "base/strings/string_number_conversions.h" +#include "build/build_config.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" #include "chrome/browser/sync/test/integration/sync_test.h" diff --git a/chrome/browser/sync_file_system/drive_backend/callback_helper.h b/chrome/browser/sync_file_system/drive_backend/callback_helper.h index d976acc..80a2e44 100644 --- a/chrome/browser/sync_file_system/drive_backend/callback_helper.h +++ b/chrome/browser/sync_file_system/drive_backend/callback_helper.h @@ -10,6 +10,7 @@ #include "base/bind.h" #include "base/location.h" #include "base/logging.h" +#include "base/macros.h" #include "base/sequenced_task_runner.h" #include "base/thread_task_runner_handle.h" diff --git a/chrome/browser/sync_file_system/drive_backend/callback_tracker.h b/chrome/browser/sync_file_system/drive_backend/callback_tracker.h index f3b1172..324e438 100644 --- a/chrome/browser/sync_file_system/drive_backend/callback_tracker.h +++ b/chrome/browser/sync_file_system/drive_backend/callback_tracker.h @@ -9,6 +9,7 @@ #include "base/bind.h" #include "base/callback_forward.h" +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/sync_file_system/drive_backend/callback_tracker_internal.h" diff --git a/chrome/browser/sync_file_system/drive_backend/callback_tracker_internal.h b/chrome/browser/sync_file_system/drive_backend/callback_tracker_internal.h index 665d2c1..0fb9eb4 100644 --- a/chrome/browser/sync_file_system/drive_backend/callback_tracker_internal.h +++ b/chrome/browser/sync_file_system/drive_backend/callback_tracker_internal.h @@ -7,6 +7,7 @@ #include "base/callback.h" #include "base/callback_internal.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" diff --git a/chrome/browser/sync_file_system/drive_backend/conflict_resolver.cc b/chrome/browser/sync_file_system/drive_backend/conflict_resolver.cc index 3a9e673..91c9c48 100644 --- a/chrome/browser/sync_file_system/drive_backend/conflict_resolver.cc +++ b/chrome/browser/sync_file_system/drive_backend/conflict_resolver.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync_file_system/drive_backend/conflict_resolver.h" +#include <stdint.h> + #include "base/callback.h" #include "base/format_macros.h" #include "base/location.h" @@ -96,7 +98,7 @@ void ConflictResolver::RunExclusive(scoped_ptr<SyncTaskToken> token) { if (metadata_database()->GetConflictingTrackers(&trackers)) { target_file_id_ = PickPrimaryFile(trackers); DCHECK(!target_file_id_.empty()); - int64 primary_tracker_id = -1; + int64_t primary_tracker_id = -1; for (TrackerIDSet::const_iterator itr = trackers.begin(); itr != trackers.end(); ++itr) { FileTracker tracker; diff --git a/chrome/browser/sync_file_system/drive_backend/conflict_resolver.h b/chrome/browser/sync_file_system/drive_backend/conflict_resolver.h index e0cfef7..ae2e1f5 100644 --- a/chrome/browser/sync_file_system/drive_backend/conflict_resolver.h +++ b/chrome/browser/sync_file_system/drive_backend/conflict_resolver.h @@ -9,6 +9,7 @@ #include <utility> #include <vector> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/sync_file_system/drive_backend/sync_task.h" diff --git a/chrome/browser/sync_file_system/drive_backend/conflict_resolver_unittest.cc b/chrome/browser/sync_file_system/drive_backend/conflict_resolver_unittest.cc index 64dc3ec..dec53c9 100644 --- a/chrome/browser/sync_file_system/drive_backend/conflict_resolver_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/conflict_resolver_unittest.cc @@ -8,6 +8,7 @@ #include "base/callback.h" #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" +#include "base/macros.h" #include "base/run_loop.h" #include "base/thread_task_runner_handle.h" #include "chrome/browser/sync_file_system/drive_backend/drive_backend_constants.h" diff --git a/chrome/browser/sync_file_system/drive_backend/drive_backend_constants.cc b/chrome/browser/sync_file_system/drive_backend/drive_backend_constants.cc index 8c96289..bfcd4b0 100644 --- a/chrome/browser/sync_file_system/drive_backend/drive_backend_constants.cc +++ b/chrome/browser/sync_file_system/drive_backend/drive_backend_constants.cc @@ -14,8 +14,8 @@ const base::FilePath::CharType kDatabaseName[] = FILE_PATH_LITERAL("DriveMetadata_v2"); const char kDatabaseVersionKey[] = "VERSION"; -const int64 kCurrentDatabaseVersion = 3; -const int64 kDatabaseOnDiskVersion = 4; +const int64_t kCurrentDatabaseVersion = 3; +const int64_t kDatabaseOnDiskVersion = 4; const char kServiceMetadataKey[] = "SERVICE"; const char kFileMetadataKeyPrefix[] = "FILE: "; const char kFileTrackerKeyPrefix[] = "TRACKER: "; @@ -32,9 +32,9 @@ const char kDirtyIDKeyPrefix[] = "DIRTY: "; const char kDemotedDirtyIDKeyPrefix[] = "DEMOTED_DIRTY: "; const int kMaxRetry = 5; -const int64 kListChangesRetryDelaySeconds = 60 * 60; +const int64_t kListChangesRetryDelaySeconds = 60 * 60; -const int64 kInvalidTrackerID = 0; +const int64_t kInvalidTrackerID = 0; } // namespace drive_backend } // namespace sync_file_system diff --git a/chrome/browser/sync_file_system/drive_backend/drive_backend_constants.h b/chrome/browser/sync_file_system/drive_backend/drive_backend_constants.h index 292393e..f342e5d5 100644 --- a/chrome/browser/sync_file_system/drive_backend/drive_backend_constants.h +++ b/chrome/browser/sync_file_system/drive_backend/drive_backend_constants.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_BACKEND_CONSTANTS_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_BACKEND_CONSTANTS_H_ +#include <stdint.h> + #include "base/files/file_path.h" namespace sync_file_system { @@ -16,8 +18,8 @@ extern const char kMimeTypeOctetStream[]; extern const base::FilePath::CharType kDatabaseName[]; extern const char kDatabaseVersionKey[]; -extern const int64 kCurrentDatabaseVersion; -extern const int64 kDatabaseOnDiskVersion; +extern const int64_t kCurrentDatabaseVersion; +extern const int64_t kDatabaseOnDiskVersion; extern const char kServiceMetadataKey[]; extern const char kFileMetadataKeyPrefix[]; extern const char kFileTrackerKeyPrefix[]; @@ -34,9 +36,9 @@ extern const char kDirtyIDKeyPrefix[]; extern const char kDemotedDirtyIDKeyPrefix[]; extern const int kMaxRetry; -extern const int64 kListChangesRetryDelaySeconds; +extern const int64_t kListChangesRetryDelaySeconds; -extern const int64 kInvalidTrackerID; +extern const int64_t kInvalidTrackerID; } // namespace drive_backend } // namespace sync_file_system diff --git a/chrome/browser/sync_file_system/drive_backend/drive_backend_sync_unittest.cc b/chrome/browser/sync_file_system/drive_backend/drive_backend_sync_unittest.cc index 110a6d4..b2589ca 100644 --- a/chrome/browser/sync_file_system/drive_backend/drive_backend_sync_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/drive_backend_sync_unittest.cc @@ -2,10 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> +#include <stdint.h> + #include <algorithm> #include <stack> #include "base/files/file_util.h" +#include "base/macros.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/thread_task_runner_handle.h" @@ -156,11 +160,11 @@ class DriveBackendSyncTest : public testing::Test, RevokeSyncableFileSystem(); } - void OnRemoteChangeQueueUpdated(int64 pending_changes_hint) override { + void OnRemoteChangeQueueUpdated(int64_t pending_changes_hint) override { pending_remote_changes_ = pending_changes_hint; } - void OnLocalChangeAvailable(int64 pending_changes_hint) override { + void OnLocalChangeAvailable(int64_t pending_changes_hint) override { pending_local_changes_ = pending_changes_hint; } @@ -274,8 +278,8 @@ class DriveBackendSyncTest : public testing::Test, storage::FileSystemURL url(CreateURL(app_id, path)); ASSERT_TRUE(ContainsKey(file_systems_, app_id)); EXPECT_EQ(base::File::FILE_OK, file_systems_[app_id]->CreateFile(url)); - int64 bytes_written = file_systems_[app_id]->WriteString(url, content); - EXPECT_EQ(static_cast<int64>(content.size()), bytes_written); + int64_t bytes_written = file_systems_[app_id]->WriteString(url, content); + EXPECT_EQ(static_cast<int64_t>(content.size()), bytes_written); base::RunLoop().RunUntilIdle(); } @@ -283,9 +287,9 @@ class DriveBackendSyncTest : public testing::Test, const base::FilePath::StringType& path, const std::string& content) { ASSERT_TRUE(ContainsKey(file_systems_, app_id)); - int64 bytes_written = file_systems_[app_id]->WriteString( - CreateURL(app_id, path), content); - EXPECT_EQ(static_cast<int64>(content.size()), bytes_written); + int64_t bytes_written = + file_systems_[app_id]->WriteString(CreateURL(app_id, path), content); + EXPECT_EQ(static_cast<int64_t>(content.size()), bytes_written); base::RunLoop().RunUntilIdle(); } @@ -319,7 +323,7 @@ class DriveBackendSyncTest : public testing::Test, return status; } - int64 GetLargestChangeID() { + int64_t GetLargestChangeID() { scoped_ptr<google_apis::AboutResource> about_resource; EXPECT_EQ(google_apis::HTTP_SUCCESS, fake_drive_service_helper()->GetAboutResource(&about_resource)); @@ -374,14 +378,12 @@ class DriveBackendSyncTest : public testing::Test, continue; base::RunLoop run_loop; - int64 largest_fetched_change_id = -1; + int64_t largest_fetched_change_id = -1; PostTaskAndReplyWithResult( - worker_task_runner_.get(), - FROM_HERE, + worker_task_runner_.get(), FROM_HERE, base::Bind(&MetadataDatabase::GetLargestFetchedChangeID, base::Unretained(metadata_database())), - base::Bind(&SetValueAndCallClosure<int64>, - run_loop.QuitClosure(), + base::Bind(&SetValueAndCallClosure<int64_t>, run_loop.QuitClosure(), &largest_fetched_change_id)); run_loop.Run(); if (largest_fetched_change_id != GetLargestChangeID()) { @@ -627,8 +629,8 @@ class DriveBackendSyncTest : public testing::Test, scoped_ptr<SyncEngine> remote_sync_service_; scoped_ptr<LocalFileSyncService> local_sync_service_; - int64 pending_remote_changes_; - int64 pending_local_changes_; + int64_t pending_remote_changes_; + int64_t pending_local_changes_; scoped_ptr<FakeDriveServiceHelper> fake_drive_service_helper_; std::map<std::string, CannedSyncableFileSystem*> file_systems_; diff --git a/chrome/browser/sync_file_system/drive_backend/drive_backend_test_util.cc b/chrome/browser/sync_file_system/drive_backend/drive_backend_test_util.cc index 2904e26..4f13ff0 100644 --- a/chrome/browser/sync_file_system/drive_backend/drive_backend_test_util.cc +++ b/chrome/browser/sync_file_system/drive_backend/drive_backend_test_util.cc @@ -88,12 +88,12 @@ scoped_ptr<FileMetadata> CreateFileMetadata(const std::string& file_id, } scoped_ptr<FileTracker> CreateTracker(const FileMetadata& metadata, - int64 tracker_id, + int64_t tracker_id, const FileTracker* parent_tracker) { scoped_ptr<FileTracker> tracker(new FileTracker); tracker->set_tracker_id(tracker_id); - int64 parent_id = parent_tracker ? - parent_tracker->tracker_id() : kInvalidTrackerID; + int64_t parent_id = + parent_tracker ? parent_tracker->tracker_id() : kInvalidTrackerID; tracker->set_parent_tracker_id(parent_id); tracker->set_file_id(metadata.file_id()); if (parent_tracker) @@ -108,7 +108,7 @@ scoped_ptr<FileTracker> CreateTracker(const FileMetadata& metadata, scoped_ptr<FileTracker> CreatePlaceholderTracker( const std::string& file_id, - int64 tracker_id, + int64_t tracker_id, const FileTracker* parent_tracker) { scoped_ptr<FileTracker> tracker(new FileTracker); tracker->set_tracker_id(tracker_id); diff --git a/chrome/browser/sync_file_system/drive_backend/drive_backend_test_util.h b/chrome/browser/sync_file_system/drive_backend/drive_backend_test_util.h index d016381..e399f12 100644 --- a/chrome/browser/sync_file_system/drive_backend/drive_backend_test_util.h +++ b/chrome/browser/sync_file_system/drive_backend/drive_backend_test_util.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_BACKEND_TEST_UTIL_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_BACKEND_TEST_UTIL_H_ +#include <stdint.h> + #include "base/memory/scoped_ptr.h" #include "chrome/browser/sync_file_system/sync_status_code.h" #include "google_apis/drive/drive_api_error_codes.h" @@ -36,11 +38,11 @@ scoped_ptr<FileMetadata> CreateFileMetadata(const std::string& file_id, const std::string& title, const std::string& md5); scoped_ptr<FileTracker> CreateTracker(const FileMetadata& metadata, - int64 tracker_id, + int64_t tracker_id, const FileTracker* parent_tracker); scoped_ptr<FileTracker> CreatePlaceholderTracker( const std::string& file_id, - int64 tracker_id, + int64_t tracker_id, const FileTracker* parent_tracker); // The return value type of GetFileResourceKind(). diff --git a/chrome/browser/sync_file_system/drive_backend/drive_backend_util.cc b/chrome/browser/sync_file_system/drive_backend/drive_backend_util.cc index d41d311..40c25e3 100644 --- a/chrome/browser/sync_file_system/drive_backend/drive_backend_util.cc +++ b/chrome/browser/sync_file_system/drive_backend/drive_backend_util.cc @@ -19,7 +19,7 @@ namespace sync_file_system { namespace drive_backend { -void PutVersionToDB(int64 version, LevelDBWrapper* db) { +void PutVersionToDB(int64_t version, LevelDBWrapper* db) { DCHECK(db); db->Put(kDatabaseVersionKey, base::Int64ToString(version)); } @@ -59,7 +59,7 @@ void PutFileMetadataDeletionToDB(const std::string& file_id, db->Delete(kFileMetadataKeyPrefix + file_id); } -void PutFileTrackerDeletionToDB(int64 tracker_id, LevelDBWrapper* db) { +void PutFileTrackerDeletionToDB(int64_t tracker_id, LevelDBWrapper* db) { DCHECK(db); db->Delete(kFileTrackerKeyPrefix + base::Int64ToString(tracker_id)); } diff --git a/chrome/browser/sync_file_system/drive_backend/drive_backend_util.h b/chrome/browser/sync_file_system/drive_backend/drive_backend_util.h index 4702994..d393776 100644 --- a/chrome/browser/sync_file_system/drive_backend/drive_backend_util.h +++ b/chrome/browser/sync_file_system/drive_backend/drive_backend_util.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_BACKEND_UTIL_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_BACKEND_UTIL_H_ +#include <stdint.h> + #include <string> #include "base/bind.h" @@ -25,7 +27,7 @@ namespace drive_backend { class LevelDBWrapper; -void PutVersionToDB(int64 version, LevelDBWrapper* db); +void PutVersionToDB(int64_t version, LevelDBWrapper* db); void PutServiceMetadataToDB(const ServiceMetadata& service_metadata, LevelDBWrapper* db); @@ -34,7 +36,7 @@ void PutFileTrackerToDB(const FileTracker& tracker, LevelDBWrapper* db); void PutFileMetadataDeletionToDB(const std::string& file_id, LevelDBWrapper* db); -void PutFileTrackerDeletionToDB(int64 tracker_id, LevelDBWrapper* db); +void PutFileTrackerDeletionToDB(int64_t tracker_id, LevelDBWrapper* db); bool HasFileAsParent(const FileDetails& details, const std::string& file_id); diff --git a/chrome/browser/sync_file_system/drive_backend/drive_service_on_worker.cc b/chrome/browser/sync_file_system/drive_backend/drive_service_on_worker.cc index a7bf05b..7dc6f28 100644 --- a/chrome/browser/sync_file_system/drive_backend/drive_service_on_worker.cc +++ b/chrome/browser/sync_file_system/drive_backend/drive_service_on_worker.cc @@ -106,7 +106,7 @@ google_apis::CancelCallback DriveServiceOnWorker::GetAboutResource( } google_apis::CancelCallback DriveServiceOnWorker::GetChangeList( - int64 start_changestamp, + int64_t start_changestamp, const google_apis::ChangeListCallback& callback) { DCHECK(sequence_checker_.CalledOnValidSequencedThread()); @@ -335,7 +335,7 @@ google_apis::CancelCallback DriveServiceOnWorker::AddResourceToDirectory( google_apis::CancelCallback DriveServiceOnWorker::InitiateUploadNewFile( const std::string& content_type, - int64 content_length, + int64_t content_length, const std::string& parent_resource_id, const std::string& title, const drive::UploadNewFileOptions& options, @@ -346,7 +346,7 @@ google_apis::CancelCallback DriveServiceOnWorker::InitiateUploadNewFile( google_apis::CancelCallback DriveServiceOnWorker::InitiateUploadExistingFile( const std::string& content_type, - int64 content_length, + int64_t content_length, const std::string& resource_id, const drive::UploadExistingFileOptions& options, const google_apis::InitiateUploadCallback& callback) { @@ -356,9 +356,9 @@ google_apis::CancelCallback DriveServiceOnWorker::InitiateUploadExistingFile( google_apis::CancelCallback DriveServiceOnWorker::ResumeUpload( const GURL& upload_url, - int64 start_position, - int64 end_position, - int64 content_length, + int64_t start_position, + int64_t end_position, + int64_t content_length, const std::string& content_type, const base::FilePath& local_file_path, const google_apis::drive::UploadRangeCallback& callback, @@ -369,7 +369,7 @@ google_apis::CancelCallback DriveServiceOnWorker::ResumeUpload( google_apis::CancelCallback DriveServiceOnWorker::GetUploadStatus( const GURL& upload_url, - int64 content_length, + int64_t content_length, const google_apis::drive::UploadRangeCallback& callback) { NOTREACHED(); return google_apis::CancelCallback(); @@ -377,7 +377,7 @@ google_apis::CancelCallback DriveServiceOnWorker::GetUploadStatus( google_apis::CancelCallback DriveServiceOnWorker::MultipartUploadNewFile( const std::string& content_type, - int64 content_length, + int64_t content_length, const std::string& parent_resource_id, const std::string& title, const base::FilePath& local_file_path, @@ -390,7 +390,7 @@ google_apis::CancelCallback DriveServiceOnWorker::MultipartUploadNewFile( google_apis::CancelCallback DriveServiceOnWorker::MultipartUploadExistingFile( const std::string& content_type, - int64 content_length, + int64_t content_length, const std::string& parent_resource_id, const base::FilePath& local_file_path, const drive::UploadExistingFileOptions& options, diff --git a/chrome/browser/sync_file_system/drive_backend/drive_service_on_worker.h b/chrome/browser/sync_file_system/drive_backend/drive_service_on_worker.h index 57eafe7..12d6afc 100644 --- a/chrome/browser/sync_file_system/drive_backend/drive_service_on_worker.h +++ b/chrome/browser/sync_file_system/drive_backend/drive_service_on_worker.h @@ -5,6 +5,9 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_SERVICE_ON_WORKER_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_SERVICE_ON_WORKER_H_ +#include <stdint.h> + +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" @@ -54,7 +57,7 @@ class DriveServiceOnWorker : public drive::DriveServiceInterface { const google_apis::AboutResourceCallback& callback) override; google_apis::CancelCallback GetChangeList( - int64 start_changestamp, + int64_t start_changestamp, const google_apis::ChangeListCallback& callback) override; google_apis::CancelCallback GetRemainingChangeList( @@ -131,33 +134,33 @@ class DriveServiceOnWorker : public drive::DriveServiceInterface { const google_apis::EntryActionCallback& callback) override; google_apis::CancelCallback InitiateUploadNewFile( const std::string& content_type, - int64 content_length, + int64_t content_length, const std::string& parent_resource_id, const std::string& title, const drive::UploadNewFileOptions& options, const google_apis::InitiateUploadCallback& callback) override; google_apis::CancelCallback InitiateUploadExistingFile( const std::string& content_type, - int64 content_length, + int64_t content_length, const std::string& resource_id, const drive::UploadExistingFileOptions& options, const google_apis::InitiateUploadCallback& callback) override; google_apis::CancelCallback ResumeUpload( const GURL& upload_url, - int64 start_position, - int64 end_position, - int64 content_length, + int64_t start_position, + int64_t end_position, + int64_t content_length, const std::string& content_type, const base::FilePath& local_file_path, const google_apis::drive::UploadRangeCallback& callback, const google_apis::ProgressCallback& progress_callback) override; google_apis::CancelCallback GetUploadStatus( const GURL& upload_url, - int64 content_length, + int64_t content_length, const google_apis::drive::UploadRangeCallback& callback) override; google_apis::CancelCallback MultipartUploadNewFile( const std::string& content_type, - int64 content_length, + int64_t content_length, const std::string& parent_resource_id, const std::string& title, const base::FilePath& local_file_path, @@ -166,7 +169,7 @@ class DriveServiceOnWorker : public drive::DriveServiceInterface { const google_apis::ProgressCallback& progress_callback) override; google_apis::CancelCallback MultipartUploadExistingFile( const std::string& content_type, - int64 content_length, + int64_t content_length, const std::string& resource_id, const base::FilePath& local_file_path, const drive::UploadExistingFileOptions& options, diff --git a/chrome/browser/sync_file_system/drive_backend/drive_service_wrapper.cc b/chrome/browser/sync_file_system/drive_backend/drive_service_wrapper.cc index 534f244..e7a2984 100644 --- a/chrome/browser/sync_file_system/drive_backend/drive_service_wrapper.cc +++ b/chrome/browser/sync_file_system/drive_backend/drive_service_wrapper.cc @@ -61,7 +61,7 @@ void DriveServiceWrapper::GetAboutResource( } void DriveServiceWrapper::GetChangeList( - int64 start_changestamp, + int64_t start_changestamp, const google_apis::ChangeListCallback& callback) { DCHECK(sequece_checker_.CalledOnValidSequencedThread()); drive_service_->GetChangeList(start_changestamp, callback); diff --git a/chrome/browser/sync_file_system/drive_backend/drive_service_wrapper.h b/chrome/browser/sync_file_system/drive_backend/drive_service_wrapper.h index fa7160e..9eca838 100644 --- a/chrome/browser/sync_file_system/drive_backend/drive_service_wrapper.h +++ b/chrome/browser/sync_file_system/drive_backend/drive_service_wrapper.h @@ -5,6 +5,9 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_SERVICE_WRAPPER_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_SERVICE_WRAPPER_H_ +#include <stdint.h> + +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" #include "components/drive/service/drive_service_interface.h" @@ -40,9 +43,8 @@ class DriveServiceWrapper : public base::SupportsWeakPtr<DriveServiceWrapper> { void GetAboutResource( const google_apis::AboutResourceCallback& callback); - void GetChangeList( - int64 start_changestamp, - const google_apis::ChangeListCallback& callback); + void GetChangeList(int64_t start_changestamp, + const google_apis::ChangeListCallback& callback); void GetRemainingChangeList( const GURL& next_link, diff --git a/chrome/browser/sync_file_system/drive_backend/drive_uploader_on_worker.h b/chrome/browser/sync_file_system/drive_backend/drive_uploader_on_worker.h index cfd2c39..b7a6924 100644 --- a/chrome/browser/sync_file_system/drive_backend/drive_uploader_on_worker.h +++ b/chrome/browser/sync_file_system/drive_backend/drive_uploader_on_worker.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" diff --git a/chrome/browser/sync_file_system/drive_backend/drive_uploader_wrapper.h b/chrome/browser/sync_file_system/drive_backend/drive_uploader_wrapper.h index 4bdd548..621aafa 100644 --- a/chrome/browser/sync_file_system/drive_backend/drive_uploader_wrapper.h +++ b/chrome/browser/sync_file_system/drive_backend/drive_uploader_wrapper.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_UPLOADER_WRAPPER_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_UPLOADER_WRAPPER_H_ +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" #include "components/drive/drive_uploader.h" diff --git a/chrome/browser/sync_file_system/drive_backend/fake_drive_uploader.h b/chrome/browser/sync_file_system/drive_backend/fake_drive_uploader.h index da79223..e46373b 100644 --- a/chrome/browser/sync_file_system/drive_backend/fake_drive_uploader.h +++ b/chrome/browser/sync_file_system/drive_backend/fake_drive_uploader.h @@ -8,6 +8,7 @@ #include <string> #include "base/files/file_util.h" +#include "base/macros.h" #include "base/strings/stringprintf.h" #include "base/values.h" #include "chrome/browser/sync_file_system/drive_backend/fake_drive_service_helper.h" diff --git a/chrome/browser/sync_file_system/drive_backend/fake_sync_worker.h b/chrome/browser/sync_file_system/drive_backend/fake_sync_worker.h index 2103427..f242d43 100644 --- a/chrome/browser/sync_file_system/drive_backend/fake_sync_worker.h +++ b/chrome/browser/sync_file_system/drive_backend/fake_sync_worker.h @@ -9,6 +9,7 @@ #include <string> #include "base/callback.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "base/sequence_checker.h" diff --git a/chrome/browser/sync_file_system/drive_backend/folder_creator.cc b/chrome/browser/sync_file_system/drive_backend/folder_creator.cc index 1681184..40baec3 100644 --- a/chrome/browser/sync_file_system/drive_backend/folder_creator.cc +++ b/chrome/browser/sync_file_system/drive_backend/folder_creator.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync_file_system/drive_backend/folder_creator.h" +#include <stddef.h> + #include "chrome/browser/sync_file_system/drive_backend/drive_backend_util.h" #include "chrome/browser/sync_file_system/drive_backend/metadata_database.h" #include "components/drive/drive_api_util.h" diff --git a/chrome/browser/sync_file_system/drive_backend/folder_creator.h b/chrome/browser/sync_file_system/drive_backend/folder_creator.h index 2bce176..d00e7f2 100644 --- a/chrome/browser/sync_file_system/drive_backend/folder_creator.h +++ b/chrome/browser/sync_file_system/drive_backend/folder_creator.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/memory/weak_ptr.h" diff --git a/chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.h b/chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.h index 424db40..036e943 100644 --- a/chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.h +++ b/chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.h @@ -5,10 +5,11 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_LEVELDB_WRAPPER_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_LEVELDB_WRAPPER_H_ +#include <stdint.h> + #include <map> #include <string> -#include "base/basictypes.h" #include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "third_party/leveldatabase/src/include/leveldb/slice.h" @@ -93,8 +94,8 @@ class LevelDBWrapper { // Returns the number of pending PUT/DELETE operations. // Each counter counts operations independently, so operations on a key // may be counted more than once. - int64 num_puts() { return num_puts_; } - int64 num_deletes() { return num_deletes_; } + int64_t num_puts() { return num_puts_; } + int64_t num_deletes() { return num_deletes_; } // TODO(peria): Rename this method to GetLevelDBForTesting, after removing // usages of drive_backend::MigrateDatabaseFromVxToVy() under @@ -105,8 +106,8 @@ class LevelDBWrapper { scoped_ptr<leveldb::DB> db_; PendingOperationMap pending_; - int64 num_puts_; - int64 num_deletes_; + int64_t num_puts_; + int64_t num_deletes_; DISALLOW_COPY_AND_ASSIGN(LevelDBWrapper); }; diff --git a/chrome/browser/sync_file_system/drive_backend/leveldb_wrapper_unittest.cc b/chrome/browser/sync_file_system/drive_backend/leveldb_wrapper_unittest.cc index a8afb55..a61fc11 100644 --- a/chrome/browser/sync_file_system/drive_backend/leveldb_wrapper_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/leveldb_wrapper_unittest.cc @@ -4,10 +4,13 @@ #include "chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.h" +#include <stddef.h> + #include <string> #include "base/files/scoped_temp_dir.h" #include "base/logging.h" +#include "base/macros.h" #include "base/strings/string_number_conversions.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/leveldatabase/src/helpers/memenv/memenv.h" diff --git a/chrome/browser/sync_file_system/drive_backend/list_changes_task.cc b/chrome/browser/sync_file_system/drive_backend/list_changes_task.cc index 783ca26..de9b3cc 100644 --- a/chrome/browser/sync_file_system/drive_backend/list_changes_task.cc +++ b/chrome/browser/sync_file_system/drive_backend/list_changes_task.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync_file_system/drive_backend/list_changes_task.h" +#include <stddef.h> + #include <vector> #include "base/bind.h" @@ -108,7 +110,7 @@ void ListChangesTask::DidListChanges( change_list->largest_change_id())); } -void ListChangesTask::CheckInChangeList(int64 largest_change_id, +void ListChangesTask::CheckInChangeList(int64_t largest_change_id, scoped_ptr<SyncTaskToken> token) { token->RecordLog(base::StringPrintf( "Got %" PRIuS " changes, updating MetadataDatabase.", diff --git a/chrome/browser/sync_file_system/drive_backend/list_changes_task.h b/chrome/browser/sync_file_system/drive_backend/list_changes_task.h index d94cb7a..7e9255e 100644 --- a/chrome/browser/sync_file_system/drive_backend/list_changes_task.h +++ b/chrome/browser/sync_file_system/drive_backend/list_changes_task.h @@ -5,6 +5,9 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_LIST_CHANGES_TASK_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_LIST_CHANGES_TASK_H_ +#include <stdint.h> + +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/memory/weak_ptr.h" @@ -38,7 +41,7 @@ class ListChangesTask : public SyncTask { void DidListChanges(scoped_ptr<SyncTaskToken> token, google_apis::DriveApiErrorCode error, scoped_ptr<google_apis::ChangeList> change_list); - void CheckInChangeList(int64 largest_change_id, + void CheckInChangeList(int64_t largest_change_id, scoped_ptr<SyncTaskToken> token); bool IsContextReady(); diff --git a/chrome/browser/sync_file_system/drive_backend/list_changes_task_unittest.cc b/chrome/browser/sync_file_system/drive_backend/list_changes_task_unittest.cc index 8216c1f..0c7e1f3 100644 --- a/chrome/browser/sync_file_system/drive_backend/list_changes_task_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/list_changes_task_unittest.cc @@ -4,10 +4,13 @@ #include "chrome/browser/sync_file_system/drive_backend/list_changes_task.h" +#include <stddef.h> + #include <string> #include "base/files/scoped_temp_dir.h" #include "base/format_macros.h" +#include "base/macros.h" #include "base/run_loop.h" #include "base/thread_task_runner_handle.h" #include "chrome/browser/sync_file_system/drive_backend/drive_backend_constants.h" diff --git a/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.cc b/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.cc index 220d384..f205186 100644 --- a/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.cc +++ b/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.cc @@ -37,7 +37,7 @@ namespace drive_backend { namespace { scoped_ptr<FileTracker> FindTrackerByID(MetadataDatabase* metadata_database, - int64 tracker_id) { + int64_t tracker_id) { scoped_ptr<FileTracker> tracker(new FileTracker); if (metadata_database->FindTrackerByTrackerID(tracker_id, tracker.get())) return tracker.Pass(); @@ -46,7 +46,7 @@ scoped_ptr<FileTracker> FindTrackerByID(MetadataDatabase* metadata_database, bool GetKnownChangeID(MetadataDatabase* metadata_database, const std::string& file_id, - int64* change_id) { + int64_t* change_id) { FileMetadata remote_file_metadata; if (!metadata_database->FindFileByFileID(file_id, &remote_file_metadata)) return false; @@ -295,7 +295,7 @@ void LocalToRemoteSyncer::ContinueAsBackgroundTask( // - Others, SyncEngineInitializer and RegisterAppTask doesn't affect to // LocalToRemoteSyncer. if (remote_file_tracker_) { - int64 latest_change_id = 0; + int64_t latest_change_id = 0; if (!GetKnownChangeID(metadata_database(), remote_file_tracker_->file_id(), &latest_change_id) || diff --git a/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.h b/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.h index f0b77ed..6cec015 100644 --- a/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.h +++ b/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.h @@ -5,8 +5,11 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_LOCAL_TO_REMOTE_SYNCER_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_LOCAL_TO_REMOTE_SYNCER_H_ +#include <stdint.h> + #include <string> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/sync_file_system/drive_backend/sync_task.h" @@ -117,7 +120,7 @@ class LocalToRemoteSyncer : public SyncTask { scoped_ptr<FileTracker> remote_file_tracker_; scoped_ptr<FileTracker> remote_parent_folder_tracker_; base::FilePath target_path_; - int64 remote_file_change_id_; + int64_t remote_file_change_id_; bool retry_on_success_; bool needs_remote_change_listing_; diff --git a/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer_unittest.cc b/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer_unittest.cc index 89bd5a3..c0804d1 100644 --- a/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer_unittest.cc @@ -8,6 +8,7 @@ #include "base/callback.h" #include "base/files/scoped_temp_dir.h" #include "base/logging.h" +#include "base/macros.h" #include "base/run_loop.h" #include "base/thread_task_runner_handle.h" #include "chrome/browser/sync_file_system/drive_backend/drive_backend_constants.h" diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_database.cc b/chrome/browser/sync_file_system/drive_backend/metadata_database.cc index 52c741c..02561d0 100644 --- a/chrome/browser/sync_file_system/drive_backend/metadata_database.cc +++ b/chrome/browser/sync_file_system/drive_backend/metadata_database.cc @@ -12,6 +12,7 @@ #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/location.h" +#include "base/macros.h" #include "base/memory/scoped_vector.h" #include "base/single_thread_task_runner.h" #include "base/stl_util.h" @@ -112,7 +113,7 @@ void PopulateFileDetailsByFileResource( } scoped_ptr<FileMetadata> CreateFileMetadataFromFileResource( - int64 change_id, + int64_t change_id, const google_apis::FileResource& resource) { scoped_ptr<FileMetadata> file(new FileMetadata); file->set_file_id(resource.file_id()); @@ -146,9 +147,8 @@ scoped_ptr<FileMetadata> CreateFileMetadataFromChangeResource( return file.Pass(); } -scoped_ptr<FileMetadata> CreateDeletedFileMetadata( - int64 change_id, - const std::string& file_id) { +scoped_ptr<FileMetadata> CreateDeletedFileMetadata(int64_t change_id, + const std::string& file_id) { scoped_ptr<FileMetadata> file(new FileMetadata); file->set_file_id(file_id); @@ -159,7 +159,7 @@ scoped_ptr<FileMetadata> CreateDeletedFileMetadata( } scoped_ptr<FileTracker> CreateSyncRootTracker( - int64 tracker_id, + int64_t tracker_id, const FileMetadata& sync_root_metadata) { scoped_ptr<FileTracker> sync_root_tracker(new FileTracker); sync_root_tracker->set_tracker_id(tracker_id); @@ -174,8 +174,8 @@ scoped_ptr<FileTracker> CreateSyncRootTracker( } scoped_ptr<FileTracker> CreateInitialAppRootTracker( - int64 tracker_id, - int64 parent_tracker_id, + int64_t tracker_id, + int64_t parent_tracker_id, const FileMetadata& app_root_metadata) { scoped_ptr<FileTracker> app_root_tracker(new FileTracker); app_root_tracker->set_tracker_id(tracker_id); @@ -242,7 +242,7 @@ SyncStatusCode MigrateDatabaseIfNeeded(LevelDBWrapper* db) { DCHECK(db); std::string value; leveldb::Status status = db->Get(kDatabaseVersionKey, &value); - int64 version = 0; + int64_t version = 0; if (status.ok()) { if (!base::StringToInt64(value, &version)) return SYNC_DATABASE_ERROR_FAILED; @@ -294,7 +294,7 @@ void MarkTrackerSetDirty(const TrackerIDSet& trackers, } } -void MarkTrackersDirtyByPath(int64 parent_tracker_id, +void MarkTrackersDirtyByPath(int64_t parent_tracker_id, const std::string& title, MetadataDatabaseIndexInterface* index) { if (parent_tracker_id == kInvalidTrackerID || title.empty()) @@ -309,12 +309,12 @@ void MarkTrackersDirtyByFileID(const std::string& file_id, MarkTrackerSetDirty(index->GetFileTrackerIDsByFileID(file_id), index); } -void MarkTrackersDirtyRecursively(int64 root_tracker_id, +void MarkTrackersDirtyRecursively(int64_t root_tracker_id, MetadataDatabaseIndexInterface* index) { - std::vector<int64> stack; + std::vector<int64_t> stack; stack.push_back(root_tracker_id); while (!stack.empty()) { - int64 tracker_id = stack.back(); + int64_t tracker_id = stack.back(); stack.pop_back(); AppendContents(index->GetFileTrackerIDsByParent(tracker_id), &stack); @@ -326,17 +326,17 @@ void MarkTrackersDirtyRecursively(int64 root_tracker_id, } } -void RemoveAllDescendantTrackers(int64 root_tracker_id, +void RemoveAllDescendantTrackers(int64_t root_tracker_id, MetadataDatabaseIndexInterface* index) { - std::vector<int64> pending_trackers; + std::vector<int64_t> pending_trackers; AppendContents(index->GetFileTrackerIDsByParent(root_tracker_id), &pending_trackers); - std::vector<int64> to_be_removed; + std::vector<int64_t> to_be_removed; // List trackers to remove. while (!pending_trackers.empty()) { - int64 tracker_id = pending_trackers.back(); + int64_t tracker_id = pending_trackers.back(); pending_trackers.pop_back(); AppendContents(index->GetFileTrackerIDsByParent(tracker_id), &pending_trackers); @@ -345,7 +345,7 @@ void RemoveAllDescendantTrackers(int64 root_tracker_id, // Remove trackers in the reversed order. base::hash_set<std::string> affected_file_ids; - for (std::vector<int64>::reverse_iterator itr = to_be_removed.rbegin(); + for (std::vector<int64_t>::reverse_iterator itr = to_be_removed.rbegin(); itr != to_be_removed.rend(); ++itr) { FileTracker tracker; index->GetFileTracker(*itr, &tracker); @@ -365,11 +365,10 @@ void RemoveAllDescendantTrackers(int64 root_tracker_id, } } -bool FilterFileTrackersByParent( - const MetadataDatabaseIndexInterface* index, - const TrackerIDSet& trackers, - int64 parent_tracker_id, - FileTracker* tracker_out) { +bool FilterFileTrackersByParent(const MetadataDatabaseIndexInterface* index, + const TrackerIDSet& trackers, + int64_t parent_tracker_id, + FileTracker* tracker_out) { FileTracker tracker; for (TrackerIDSet::const_iterator itr = trackers.begin(); itr != trackers.end(); ++itr) { @@ -390,7 +389,7 @@ bool FilterFileTrackersByParent( bool FilterFileTrackersByParentAndTitle( const MetadataDatabaseIndexInterface* index, const TrackerIDSet& trackers, - int64 parent_tracker_id, + int64_t parent_tracker_id, const std::string& title, FileTracker* result) { bool found = false; @@ -452,7 +451,7 @@ enum DirtyingOption { MARK_SAME_PATH_TRACKERS_DIRTY = 1 << 2, }; -void ActivateFileTracker(int64 tracker_id, +void ActivateFileTracker(int64_t tracker_id, int dirtying_options, MetadataDatabaseIndexInterface* index) { DCHECK(dirtying_options == MARK_NOTHING_DIRTY || @@ -474,7 +473,7 @@ void ActivateFileTracker(int64 tracker_id, index->StoreFileTracker(tracker.Pass()); } -void DeactivateFileTracker(int64 tracker_id, +void DeactivateFileTracker(int64_t tracker_id, int dirtying_options, MetadataDatabaseIndexInterface* index) { RemoveAllDescendantTrackers(tracker_id, index); @@ -494,7 +493,7 @@ void DeactivateFileTracker(int64 tracker_id, index->StoreFileTracker(tracker.Pass()); } -void RemoveFileTracker(int64 tracker_id, +void RemoveFileTracker(int64_t tracker_id, int dirtying_options, MetadataDatabaseIndexInterface* index) { DCHECK(!(dirtying_options & MARK_ITSELF_DIRTY)); @@ -504,7 +503,7 @@ void RemoveFileTracker(int64 tracker_id, return; std::string file_id = tracker.file_id(); - int64 parent_tracker_id = tracker.parent_tracker_id(); + int64_t parent_tracker_id = tracker.parent_tracker_id(); std::string title = GetTrackerTitle(tracker); RemoveAllDescendantTrackers(tracker_id, index); @@ -595,20 +594,20 @@ void MetadataDatabase::ClearDatabase( base::DeleteFile(database_path, true /* recursive */); } -int64 MetadataDatabase::GetLargestFetchedChangeID() const { +int64_t MetadataDatabase::GetLargestFetchedChangeID() const { return index_->GetLargestChangeID(); } -int64 MetadataDatabase::GetSyncRootTrackerID() const { +int64_t MetadataDatabase::GetSyncRootTrackerID() const { return index_->GetSyncRootTrackerID(); } -int64 MetadataDatabase::GetLargestKnownChangeID() const { +int64_t MetadataDatabase::GetLargestKnownChangeID() const { DCHECK_LE(GetLargestFetchedChangeID(), largest_known_change_id_); return largest_known_change_id_; } -void MetadataDatabase::UpdateLargestKnownChangeID(int64 change_id) { +void MetadataDatabase::UpdateLargestKnownChangeID(int64_t change_id) { if (largest_known_change_id_ < change_id) largest_known_change_id_ = change_id; } @@ -622,7 +621,7 @@ bool MetadataDatabase::HasSyncRoot() const { } SyncStatusCode MetadataDatabase::PopulateInitialData( - int64 largest_change_id, + int64_t largest_change_id, const google_apis::FileResource& sync_root_folder, const ScopedVector<google_apis::FileResource>& app_root_folders) { index_->SetLargestChangeID(largest_change_id); @@ -641,7 +640,7 @@ SyncStatusCode MetadataDatabase::PopulateInitialData( } bool MetadataDatabase::IsAppEnabled(const std::string& app_id) const { - int64 tracker_id = index_->GetAppRootTracker(app_id); + int64_t tracker_id = index_->GetAppRootTracker(app_id); if (tracker_id == kInvalidTrackerID) return false; @@ -670,7 +669,7 @@ SyncStatusCode MetadataDatabase::RegisterApp(const std::string& app_id, return SYNC_STATUS_HAS_CONFLICT; } - int64 sync_root_tracker_id = index_->GetSyncRootTrackerID(); + int64_t sync_root_tracker_id = index_->GetSyncRootTrackerID(); if (!sync_root_tracker_id) { util::Log(logging::LOG_WARNING, FROM_HERE, "Sync-root needs to be set up before registering app-root"); @@ -694,7 +693,7 @@ SyncStatusCode MetadataDatabase::RegisterApp(const std::string& app_id, } SyncStatusCode MetadataDatabase::DisableApp(const std::string& app_id) { - int64 tracker_id = index_->GetAppRootTracker(app_id); + int64_t tracker_id = index_->GetAppRootTracker(app_id); scoped_ptr<FileTracker> tracker(new FileTracker); if (!index_->GetFileTracker(tracker_id, tracker.get())) { return SYNC_DATABASE_ERROR_NOT_FOUND; @@ -716,7 +715,7 @@ SyncStatusCode MetadataDatabase::DisableApp(const std::string& app_id) { } SyncStatusCode MetadataDatabase::EnableApp(const std::string& app_id) { - int64 tracker_id = index_->GetAppRootTracker(app_id); + int64_t tracker_id = index_->GetAppRootTracker(app_id); scoped_ptr<FileTracker> tracker(new FileTracker); if (!index_->GetFileTracker(tracker_id, tracker.get())) { return SYNC_DATABASE_ERROR_NOT_FOUND; @@ -737,7 +736,7 @@ SyncStatusCode MetadataDatabase::EnableApp(const std::string& app_id) { } SyncStatusCode MetadataDatabase::UnregisterApp(const std::string& app_id) { - int64 tracker_id = index_->GetAppRootTracker(app_id); + int64_t tracker_id = index_->GetAppRootTracker(app_id); scoped_ptr<FileTracker> tracker(new FileTracker); if (!index_->GetFileTracker(tracker_id, tracker.get()) || tracker->tracker_kind() == TRACKER_KIND_REGULAR) { @@ -757,7 +756,7 @@ SyncStatusCode MetadataDatabase::UnregisterApp(const std::string& app_id) { bool MetadataDatabase::FindAppRootTracker(const std::string& app_id, FileTracker* tracker_out) const { - int64 app_root_tracker_id = index_->GetAppRootTracker(app_id); + int64_t app_root_tracker_id = index_->GetAppRootTracker(app_id); if (!app_root_tracker_id) return false; @@ -787,7 +786,7 @@ bool MetadataDatabase::FindTrackersByFileID(const std::string& file_id, } bool MetadataDatabase::FindTrackersByParentAndTitle( - int64 parent_tracker_id, + int64_t parent_tracker_id, const std::string& title, TrackerIDSet* trackers_out) const { TrackerIDSet trackers = @@ -800,12 +799,12 @@ bool MetadataDatabase::FindTrackersByParentAndTitle( return true; } -bool MetadataDatabase::FindTrackerByTrackerID(int64 tracker_id, +bool MetadataDatabase::FindTrackerByTrackerID(int64_t tracker_id, FileTracker* tracker_out) const { return index_->GetFileTracker(tracker_id, tracker_out); } -bool MetadataDatabase::BuildPathForTracker(int64 tracker_id, +bool MetadataDatabase::BuildPathForTracker(int64_t tracker_id, base::FilePath* path) const { FileTracker current; if (!FindTrackerByTrackerID(tracker_id, ¤t) || !current.active()) @@ -890,7 +889,7 @@ bool MetadataDatabase::FindNearestActiveAncestor( } SyncStatusCode MetadataDatabase::UpdateByChangeList( - int64 largest_change_id, + int64_t largest_change_id, ScopedVector<google_apis::ChangeResource> changes) { DCHECK_LE(index_->GetLargestChangeID(), largest_change_id); @@ -954,7 +953,7 @@ SyncStatusCode MetadataDatabase::UpdateByDeletedRemoteFileList( } SyncStatusCode MetadataDatabase::ReplaceActiveTrackerWithNewResource( - int64 parent_tracker_id, + int64_t parent_tracker_id, const google_apis::FileResource& resource) { DCHECK(!index_->GetFileMetadata(resource.file_id(), nullptr)); DCHECK(index_->GetFileTracker(parent_tracker_id, nullptr)); @@ -977,7 +976,7 @@ SyncStatusCode MetadataDatabase::ReplaceActiveTrackerWithNewResource( return SYNC_STATUS_FAILED; } - int64 tracker_id = to_be_activated.tracker_id(); + int64_t tracker_id = to_be_activated.tracker_id(); if (same_path_trackers.has_active()) { DeactivateFileTracker(same_path_trackers.active_tracker(), MARK_ITSELF_DIRTY | @@ -1009,7 +1008,7 @@ SyncStatusCode MetadataDatabase::PopulateFolderByChildList( base::hash_set<std::string> children(child_file_ids.begin(), child_file_ids.end()); - std::vector<int64> known_children = + std::vector<int64_t> known_children = index_->GetFileTrackerIDsByParent(folder_tracker->tracker_id()); for (size_t i = 0; i < known_children.size(); ++i) { FileTracker tracker; @@ -1032,7 +1031,7 @@ SyncStatusCode MetadataDatabase::PopulateFolderByChildList( } SyncStatusCode MetadataDatabase::UpdateTracker( - int64 tracker_id, + int64_t tracker_id, const FileDetails& updated_details) { FileTracker tracker; if (!index_->GetFileTracker(tracker_id, &tracker)) { @@ -1127,7 +1126,7 @@ SyncStatusCode MetadataDatabase::UpdateTracker( } MetadataDatabase::ActivationStatus MetadataDatabase::TryActivateTracker( - int64 parent_tracker_id, + int64_t parent_tracker_id, const std::string& file_id, SyncStatusCode* status_out) { FileMetadata metadata; @@ -1191,7 +1190,7 @@ MetadataDatabase::ActivationStatus MetadataDatabase::TryActivateTracker( return ACTIVATION_PENDING; } -void MetadataDatabase::DemoteTracker(int64 tracker_id) { +void MetadataDatabase::DemoteTracker(int64_t tracker_id) { index_->DemoteDirtyTracker(tracker_id); WriteToDatabase(); } @@ -1202,14 +1201,14 @@ bool MetadataDatabase::PromoteDemotedTrackers() { return promoted; } -void MetadataDatabase::PromoteDemotedTracker(int64 tracker_id) { +void MetadataDatabase::PromoteDemotedTracker(int64_t tracker_id) { index_->PromoteDemotedDirtyTracker(tracker_id); WriteToDatabase(); } bool MetadataDatabase::GetDirtyTracker( FileTracker* tracker_out) const { - int64 dirty_tracker_id = index_->PickDirtyTracker(); + int64_t dirty_tracker_id = index_->PickDirtyTracker(); if (!dirty_tracker_id) return false; @@ -1287,7 +1286,7 @@ void MetadataDatabase::GetRegisteredAppIDs(std::vector<std::string>* app_ids) { SyncStatusCode MetadataDatabase::SweepDirtyTrackers( const std::vector<std::string>& file_ids) { - std::set<int64> tracker_ids; + std::set<int64_t> tracker_ids; for (size_t i = 0; i < file_ids.size(); ++i) { TrackerIDSet trackers_for_file_id = index_->GetFileTrackerIDsByFileID(file_ids[i]); @@ -1296,7 +1295,7 @@ SyncStatusCode MetadataDatabase::SweepDirtyTrackers( tracker_ids.insert(*itr); } - for (std::set<int64>::iterator itr = tracker_ids.begin(); + for (std::set<int64_t>::iterator itr = tracker_ids.begin(); itr != tracker_ids.end(); ++itr) { scoped_ptr<FileTracker> tracker(new FileTracker); if (!index_->GetFileTracker(*itr, tracker.get()) || @@ -1383,7 +1382,7 @@ void MetadataDatabase::CreateTrackerInternal(const FileTracker& parent_tracker, const std::string& file_id, const FileDetails* details, UpdateOption option) { - int64 tracker_id = IncrementTrackerID(); + int64_t tracker_id = IncrementTrackerID(); scoped_ptr<FileTracker> tracker(new FileTracker); tracker->set_tracker_id(tracker_id); tracker->set_parent_tracker_id(parent_tracker.tracker_id()); @@ -1406,7 +1405,7 @@ void MetadataDatabase::CreateTrackerInternal(const FileTracker& parent_tracker, void MetadataDatabase::MaybeAddTrackersForNewFile( const FileMetadata& metadata, UpdateOption option) { - std::set<int64> parents_to_exclude; + std::set<int64_t> parents_to_exclude; TrackerIDSet existing_trackers = index_->GetFileTrackerIDsByFileID(metadata.file_id()); for (TrackerIDSet::const_iterator itr = existing_trackers.begin(); @@ -1417,7 +1416,7 @@ void MetadataDatabase::MaybeAddTrackersForNewFile( continue; } - int64 parent_tracker_id = tracker.parent_tracker_id(); + int64_t parent_tracker_id = tracker.parent_tracker_id(); if (!parent_tracker_id) continue; @@ -1449,8 +1448,8 @@ void MetadataDatabase::MaybeAddTrackersForNewFile( } } -int64 MetadataDatabase::IncrementTrackerID() { - int64 tracker_id = index_->GetNextTrackerID(); +int64_t MetadataDatabase::IncrementTrackerID() { + int64_t tracker_id = index_->GetNextTrackerID(); index_->SetNextTrackerID(tracker_id + 1); DCHECK_GT(tracker_id, 0); return tracker_id; @@ -1512,7 +1511,7 @@ bool MetadataDatabase::ShouldKeepDirty(const FileTracker& tracker) const { } bool MetadataDatabase::HasDisabledAppRoot(const FileTracker& tracker) const { - int64 app_root_tracker_id = index_->GetAppRootTracker(tracker.app_id()); + int64_t app_root_tracker_id = index_->GetAppRootTracker(tracker.app_id()); if (app_root_tracker_id == kInvalidTrackerID) return false; @@ -1529,7 +1528,7 @@ bool MetadataDatabase::HasActiveTrackerForFileID( return index_->GetFileTrackerIDsByFileID(file_id).has_active(); } -bool MetadataDatabase::HasActiveTrackerForPath(int64 parent_tracker_id, +bool MetadataDatabase::HasActiveTrackerForPath(int64_t parent_tracker_id, const std::string& title) const { return index_->GetFileTrackerIDsByParentAndTitle(parent_tracker_id, title) .has_active(); @@ -1592,11 +1591,11 @@ scoped_ptr<base::ListValue> MetadataDatabase::DumpFiles( if (!FindAppRootTracker(app_id, &app_root_tracker)) return files.Pass(); - std::vector<int64> stack; + std::vector<int64_t> stack; AppendContents( index_->GetFileTrackerIDsByParent(app_root_tracker.tracker_id()), &stack); while (!stack.empty()) { - int64 tracker_id = stack.back(); + int64_t tracker_id = stack.back(); stack.pop_back(); AppendContents(index_->GetFileTrackerIDsByParent(tracker_id), &stack); @@ -1639,7 +1638,7 @@ scoped_ptr<base::ListValue> MetadataDatabase::DumpDatabase() { } bool MetadataDatabase::HasNewerFileMetadata(const std::string& file_id, - int64 change_id) { + int64_t change_id) { FileMetadata metadata; if (!index_->GetFileMetadata(file_id, &metadata)) return false; @@ -1666,10 +1665,10 @@ scoped_ptr<base::ListValue> MetadataDatabase::DumpTrackers() { trackers->Append(metadata); // Append tracker data. - std::vector<int64> tracker_ids(index_->GetAllTrackerIDs()); - for (std::vector<int64>::const_iterator itr = tracker_ids.begin(); + std::vector<int64_t> tracker_ids(index_->GetAllTrackerIDs()); + for (std::vector<int64_t>::const_iterator itr = tracker_ids.begin(); itr != tracker_ids.end(); ++itr) { - const int64 tracker_id = *itr; + const int64_t tracker_id = *itr; FileTracker tracker; if (!index_->GetFileTracker(tracker_id, &tracker)) { NOTREACHED(); diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_database.h b/chrome/browser/sync_file_system/drive_backend/metadata_database.h index 35deb5f..138a5fd 100644 --- a/chrome/browser/sync_file_system/drive_backend/metadata_database.h +++ b/chrome/browser/sync_file_system/drive_backend/metadata_database.h @@ -5,6 +5,9 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_H_ +#include <stddef.h> +#include <stdint.h> + #include <map> #include <set> #include <string> @@ -13,6 +16,7 @@ #include "base/containers/hash_tables.h" #include "base/containers/scoped_ptr_hash_map.h" #include "base/files/file_path.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/memory/weak_ptr.h" @@ -138,8 +142,8 @@ class MetadataDatabase { static void ClearDatabase(scoped_ptr<MetadataDatabase> metadata_database); - int64 GetLargestFetchedChangeID() const; - int64 GetSyncRootTrackerID() const; + int64_t GetLargestFetchedChangeID() const; + int64_t GetSyncRootTrackerID() const; // Returns true if the client should check if the sync root is still valid. bool NeedsSyncRootRevalidation() const; @@ -166,8 +170,8 @@ class MetadataDatabase { // FileMetadata from overwritten by ChangeList. // Also if other tasks try to update a remote resource whose change is not yet // retrieved the task should fail due to etag check, so we should be fine. - int64 GetLargestKnownChangeID() const; - void UpdateLargestKnownChangeID(int64 change_id); + int64_t GetLargestKnownChangeID() const; + void UpdateLargestKnownChangeID(int64_t change_id); // Populates empty database with initial data. // Adds a file metadata and a file tracker for |sync_root_folder|, and adds @@ -177,7 +181,7 @@ class MetadataDatabase { // Trackers for |app_root_folders| are not yet registered as app-roots, but // are ready to register. SyncStatusCode PopulateInitialData( - int64 largest_change_id, + int64_t largest_change_id, const google_apis::FileResource& sync_root_folder, const ScopedVector<google_apis::FileResource>& app_root_folders); @@ -218,7 +222,7 @@ class MetadataDatabase { // is found. // Copies the tracker identified by |tracker_id| into |tracker| if exists and // |tracker| is non-NULL. - bool FindTrackerByTrackerID(int64 tracker_id, FileTracker* tracker) const; + bool FindTrackerByTrackerID(int64_t tracker_id, FileTracker* tracker) const; // Finds the trackers tracking |file_id|. Returns true if the trackers are // found. @@ -229,15 +233,14 @@ class MetadataDatabase { // and who has |title| as its title in the synced_details. // Copies the tracker set to |trackers| if it is non-NULL. // Returns true if the trackers are found. - bool FindTrackersByParentAndTitle( - int64 parent_tracker_id, - const std::string& title, - TrackerIDSet* trackers) const; + bool FindTrackersByParentAndTitle(int64_t parent_tracker_id, + const std::string& title, + TrackerIDSet* trackers) const; // Builds the file path for the given tracker. Returns true on success. // |path| can be NULL. // The file path is relative to app-root and have a leading path separator. - bool BuildPathForTracker(int64 tracker_id, base::FilePath* path) const; + bool BuildPathForTracker(int64_t tracker_id, base::FilePath* path) const; // Builds the file path for the given tracker for display purpose. // This may return a path ending with '<unknown>' if the given tracker does @@ -257,7 +260,7 @@ class MetadataDatabase { // Marks each tracker for modified file as dirty and adds new trackers if // needed. SyncStatusCode UpdateByChangeList( - int64 largest_change_id, + int64_t largest_change_id, ScopedVector<google_apis::ChangeResource> changes); // Updates database by |resource|. @@ -277,7 +280,7 @@ class MetadataDatabase { // Deactivates existing active tracker if exists that has the same title and // parent_tracker to the newly added tracker. SyncStatusCode ReplaceActiveTrackerWithNewResource( - int64 parent_tracker_id, + int64_t parent_tracker_id, const google_apis::FileResource& resource); // Adds |child_file_ids| to |folder_id| as its children. @@ -287,7 +290,7 @@ class MetadataDatabase { const FileIDList& child_file_ids); // Updates |synced_details| of the tracker with |updated_details|. - SyncStatusCode UpdateTracker(int64 tracker_id, + SyncStatusCode UpdateTracker(int64_t tracker_id, const FileDetails& updated_details); // Activates a tracker identified by |parent_tracker_id| and |file_id| if the @@ -303,14 +306,14 @@ class MetadataDatabase { // The tracker to be activated must: // - have a tracked metadata in the database, // - have |synced_details| with valid |title|. - ActivationStatus TryActivateTracker(int64 parent_tracker_id, + ActivationStatus TryActivateTracker(int64_t parent_tracker_id, const std::string& file_id, SyncStatusCode* status); // Changes the priority of the tracker to low. - void DemoteTracker(int64 tracker_id); + void DemoteTracker(int64_t tracker_id); bool PromoteDemotedTrackers(); - void PromoteDemotedTracker(int64 tracker_id); + void PromoteDemotedTracker(int64_t tracker_id); // Returns true if there is a normal priority dirty tracker. // Assigns the dirty tracker if exists and |tracker| is non-NULL. @@ -344,8 +347,7 @@ class MetadataDatabase { SyncStatusCode Initialize(); // Database manipulation methods. - void RegisterTrackerAsAppRoot(const std::string& app_id, - int64 tracker_id); + void RegisterTrackerAsAppRoot(const std::string& app_id, int64_t tracker_id); void CreateTrackerForParentAndFileID(const FileTracker& parent_tracker, const std::string& file_id); @@ -360,14 +362,14 @@ class MetadataDatabase { void MaybeAddTrackersForNewFile(const FileMetadata& file, UpdateOption option); - int64 IncrementTrackerID(); + int64_t IncrementTrackerID(); bool CanActivateTracker(const FileTracker& tracker); bool ShouldKeepDirty(const FileTracker& tracker) const; bool HasDisabledAppRoot(const FileTracker& tracker) const; bool HasActiveTrackerForFileID(const std::string& file_id) const; - bool HasActiveTrackerForPath(int64 parent_tracker, + bool HasActiveTrackerForPath(int64_t parent_tracker, const std::string& title) const; void RemoveUnneededTrackersForMissingFile(const std::string& file_id); @@ -377,7 +379,7 @@ class MetadataDatabase { SyncStatusCode WriteToDatabase(); - bool HasNewerFileMetadata(const std::string& file_id, int64 change_id); + bool HasNewerFileMetadata(const std::string& file_id, int64_t change_id); scoped_ptr<base::ListValue> DumpTrackers(); scoped_ptr<base::ListValue> DumpMetadata(); @@ -385,7 +387,7 @@ class MetadataDatabase { void AttachSyncRoot(const google_apis::FileResource& sync_root_folder); void AttachInitialAppRoot(const google_apis::FileResource& app_root_folder); - void ForceActivateTrackerByPath(int64 parent_tracker_id, + void ForceActivateTrackerByPath(int64_t parent_tracker_id, const std::string& title, const std::string& file_id); @@ -397,7 +399,7 @@ class MetadataDatabase { bool enable_on_disk_index_; - int64 largest_known_change_id_; + int64_t largest_known_change_id_; scoped_ptr<MetadataDatabaseIndexInterface> index_; diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_database_index.cc b/chrome/browser/sync_file_system/drive_backend/metadata_database_index.cc index d33e191..df4dcf6 100644 --- a/chrome/browser/sync_file_system/drive_backend/metadata_database_index.cc +++ b/chrome/browser/sync_file_system/drive_backend/metadata_database_index.cc @@ -24,7 +24,7 @@ // // NOTE // - Entries are sorted by keys. -// - int64 value is serialized as a string by base::Int64ToString(). +// - int64_t value is serialized as a string by base::Int64ToString(). // - ServiceMetadata, FileMetadata, and FileTracker values are serialized // as a string by SerializeToString() of protocol buffers. // @@ -42,15 +42,14 @@ // value: <FileMetadata 'metadata'> // // # Trackers of local file updates -// key: "TRACKER: " + <int64 'tracker_id'> +// key: "TRACKER: " + <int64_t 'tracker_id'> // value: <FileTracker 'tracker'> namespace sync_file_system { namespace drive_backend { ParentIDAndTitle::ParentIDAndTitle() : parent_id(0) {} -ParentIDAndTitle::ParentIDAndTitle(int64 parent_id, - const std::string& title) +ParentIDAndTitle::ParentIDAndTitle(int64_t parent_id, const std::string& title) : parent_id(parent_id), title(title) {} bool operator==(const ParentIDAndTitle& left, const ParentIDAndTitle& right) { @@ -102,7 +101,7 @@ void ReadDatabaseContents(LevelDBWrapper* db, DatabaseContents* contents) { std::string tracker_id_str; if (RemovePrefix(key, kFileTrackerKeyPrefix, &tracker_id_str)) { - int64 tracker_id = 0; + int64_t tracker_id = 0; if (!base::StringToInt64(tracker_id_str, &tracker_id)) { util::Log(logging::LOG_WARNING, FROM_HERE, "Failed to parse TrackerID"); @@ -122,16 +121,16 @@ void ReadDatabaseContents(LevelDBWrapper* db, DatabaseContents* contents) { } void RemoveUnreachableItemsFromDB(DatabaseContents* contents, - int64 sync_root_tracker_id, + int64_t sync_root_tracker_id, LevelDBWrapper* db) { - typedef std::map<int64, std::set<int64> > ChildTrackersByParent; + typedef std::map<int64_t, std::set<int64_t>> ChildTrackersByParent; ChildTrackersByParent trackers_by_parent; // Set up links from parent tracker to child trackers. for (size_t i = 0; i < contents->file_trackers.size(); ++i) { const FileTracker& tracker = *contents->file_trackers[i]; - int64 parent_tracker_id = tracker.parent_tracker_id(); - int64 tracker_id = tracker.tracker_id(); + int64_t parent_tracker_id = tracker.parent_tracker_id(); + int64_t tracker_id = tracker.tracker_id(); trackers_by_parent[parent_tracker_id].insert(tracker_id); } @@ -144,14 +143,14 @@ void RemoveUnreachableItemsFromDB(DatabaseContents* contents, trackers_by_parent.erase(tracker.tracker_id()); } - std::vector<int64> pending; + std::vector<int64_t> pending; if (sync_root_tracker_id != kInvalidTrackerID) pending.push_back(sync_root_tracker_id); // Traverse tracker tree from sync-root. - std::set<int64> visited_trackers; + std::set<int64_t> visited_trackers; while (!pending.empty()) { - int64 tracker_id = pending.back(); + int64_t tracker_id = pending.back(); DCHECK_NE(kInvalidTrackerID, tracker_id); pending.pop_back(); @@ -161,7 +160,7 @@ void RemoveUnreachableItemsFromDB(DatabaseContents* contents, } AppendContents( - LookUpMap(trackers_by_parent, tracker_id, std::set<int64>()), + LookUpMap(trackers_by_parent, tracker_id, std::set<int64_t>()), &pending); } @@ -267,8 +266,8 @@ bool MetadataDatabaseIndex::GetFileMetadata( return true; } -bool MetadataDatabaseIndex::GetFileTracker( - int64 tracker_id, FileTracker* tracker) const { +bool MetadataDatabaseIndex::GetFileTracker(int64_t tracker_id, + FileTracker* tracker) const { FileTracker* identified = tracker_by_id_.get(tracker_id); if (!identified) return false; @@ -297,7 +296,7 @@ void MetadataDatabaseIndex::StoreFileTracker( return; } - int64 tracker_id = tracker->tracker_id(); + int64_t tracker_id = tracker->tracker_id(); FileTracker* old_tracker = tracker_by_id_.get(tracker_id); if (!old_tracker) { @@ -326,7 +325,7 @@ void MetadataDatabaseIndex::RemoveFileMetadata(const std::string& file_id) { metadata_by_id_.erase(file_id); } -void MetadataDatabaseIndex::RemoveFileTracker(int64 tracker_id) { +void MetadataDatabaseIndex::RemoveFileTracker(int64_t tracker_id) { PutFileTrackerDeletionToDB(tracker_id, db_); FileTracker* tracker = tracker_by_id_.get(tracker_id); @@ -351,13 +350,13 @@ TrackerIDSet MetadataDatabaseIndex::GetFileTrackerIDsByFileID( return FindItem(trackers_by_file_id_, file_id); } -int64 MetadataDatabaseIndex::GetAppRootTracker( +int64_t MetadataDatabaseIndex::GetAppRootTracker( const std::string& app_id) const { return FindItem(app_root_by_app_id_, app_id); } TrackerIDSet MetadataDatabaseIndex::GetFileTrackerIDsByParentAndTitle( - int64 parent_tracker_id, + int64_t parent_tracker_id, const std::string& title) const { TrackerIDsByParentAndTitle::const_iterator found = trackers_by_parent_and_title_.find(parent_tracker_id); @@ -366,9 +365,9 @@ TrackerIDSet MetadataDatabaseIndex::GetFileTrackerIDsByParentAndTitle( return FindItem(found->second, title); } -std::vector<int64> MetadataDatabaseIndex::GetFileTrackerIDsByParent( - int64 parent_tracker_id) const { - std::vector<int64> result; +std::vector<int64_t> MetadataDatabaseIndex::GetFileTrackerIDsByParent( + int64_t parent_tracker_id) const { + std::vector<int64_t> result; TrackerIDsByParentAndTitle::const_iterator found = trackers_by_parent_and_title_.find(parent_tracker_id); if (found == trackers_by_parent_and_title_.end()) @@ -394,13 +393,13 @@ ParentIDAndTitle MetadataDatabaseIndex::PickMultiBackingFilePath() const { return *multi_backing_file_paths_.begin(); } -int64 MetadataDatabaseIndex::PickDirtyTracker() const { +int64_t MetadataDatabaseIndex::PickDirtyTracker() const { if (dirty_trackers_.empty()) return kInvalidTrackerID; return *dirty_trackers_.begin(); } -void MetadataDatabaseIndex::DemoteDirtyTracker(int64 tracker_id) { +void MetadataDatabaseIndex::DemoteDirtyTracker(int64_t tracker_id) { if (dirty_trackers_.erase(tracker_id)) demoted_dirty_trackers_.insert(tracker_id); } @@ -409,12 +408,12 @@ bool MetadataDatabaseIndex::HasDemotedDirtyTracker() const { return !demoted_dirty_trackers_.empty(); } -bool MetadataDatabaseIndex::IsDemotedDirtyTracker(int64 tracker_id) const { +bool MetadataDatabaseIndex::IsDemotedDirtyTracker(int64_t tracker_id) const { return demoted_dirty_trackers_.find(tracker_id) != demoted_dirty_trackers_.end(); } -void MetadataDatabaseIndex::PromoteDemotedDirtyTracker(int64 tracker_id) { +void MetadataDatabaseIndex::PromoteDemotedDirtyTracker(int64_t tracker_id) { if (demoted_dirty_trackers_.erase(tracker_id) == 1) dirty_trackers_.insert(tracker_id); } @@ -444,20 +443,18 @@ void MetadataDatabaseIndex::SetSyncRootRevalidated() const { PutServiceMetadataToDB(*service_metadata_, db_); } -void MetadataDatabaseIndex::SetSyncRootTrackerID( - int64 sync_root_id) const { +void MetadataDatabaseIndex::SetSyncRootTrackerID(int64_t sync_root_id) const { service_metadata_->set_sync_root_tracker_id(sync_root_id); PutServiceMetadataToDB(*service_metadata_, db_); } void MetadataDatabaseIndex::SetLargestChangeID( - int64 largest_change_id) const { + int64_t largest_change_id) const { service_metadata_->set_largest_change_id(largest_change_id); PutServiceMetadataToDB(*service_metadata_, db_); } -void MetadataDatabaseIndex::SetNextTrackerID( - int64 next_tracker_id) const { +void MetadataDatabaseIndex::SetNextTrackerID(int64_t next_tracker_id) const { service_metadata_->set_next_tracker_id(next_tracker_id); PutServiceMetadataToDB(*service_metadata_, db_); } @@ -467,19 +464,19 @@ bool MetadataDatabaseIndex::IsSyncRootRevalidated() const { service_metadata_->sync_root_revalidated(); } -int64 MetadataDatabaseIndex::GetSyncRootTrackerID() const { +int64_t MetadataDatabaseIndex::GetSyncRootTrackerID() const { if (!service_metadata_->has_sync_root_tracker_id()) return kInvalidTrackerID; return service_metadata_->sync_root_tracker_id(); } -int64 MetadataDatabaseIndex::GetLargestChangeID() const { +int64_t MetadataDatabaseIndex::GetLargestChangeID() const { if (!service_metadata_->has_largest_change_id()) return kInvalidTrackerID; return service_metadata_->largest_change_id(); } -int64 MetadataDatabaseIndex::GetNextTrackerID() const { +int64_t MetadataDatabaseIndex::GetNextTrackerID() const { if (!service_metadata_->has_next_tracker_id()) { NOTREACHED(); return kInvalidTrackerID; @@ -496,8 +493,8 @@ std::vector<std::string> MetadataDatabaseIndex::GetRegisteredAppIDs() const { return result; } -std::vector<int64> MetadataDatabaseIndex::GetAllTrackerIDs() const { - std::vector<int64> result; +std::vector<int64_t> MetadataDatabaseIndex::GetAllTrackerIDs() const { + std::vector<int64_t> result; for (TrackerByID::const_iterator itr = tracker_by_id_.begin(); itr != tracker_by_id_.end(); ++itr) { result.push_back(itr->first); @@ -615,7 +612,7 @@ void MetadataDatabaseIndex::RemoveFromFileIDIndexes( void MetadataDatabaseIndex::AddToPathIndexes( const FileTracker& new_tracker) { - int64 parent = new_tracker.parent_tracker_id(); + int64_t parent = new_tracker.parent_tracker_id(); std::string title = GetTrackerTitle(new_tracker); DVLOG(3) << " Add to trackers_by_parent_and_title_: " @@ -640,8 +637,8 @@ void MetadataDatabaseIndex::UpdateInPathIndexes( DCHECK(GetTrackerTitle(old_tracker) == GetTrackerTitle(new_tracker) || !old_tracker.has_synced_details()); - int64 tracker_id = new_tracker.tracker_id(); - int64 parent = new_tracker.parent_tracker_id(); + int64_t tracker_id = new_tracker.tracker_id(); + int64_t parent = new_tracker.parent_tracker_id(); std::string old_title = GetTrackerTitle(old_tracker); std::string title = GetTrackerTitle(new_tracker); @@ -693,8 +690,8 @@ void MetadataDatabaseIndex::UpdateInPathIndexes( void MetadataDatabaseIndex::RemoveFromPathIndexes( const FileTracker& tracker) { - int64 tracker_id = tracker.tracker_id(); - int64 parent = tracker.parent_tracker_id(); + int64_t tracker_id = tracker.tracker_id(); + int64_t parent = tracker.parent_tracker_id(); std::string title = GetTrackerTitle(tracker); DCHECK(ContainsKey(trackers_by_parent_and_title_, parent)); @@ -737,7 +734,7 @@ void MetadataDatabaseIndex::UpdateInDirtyTrackerIndexes( const FileTracker& new_tracker) { DCHECK_EQ(old_tracker.tracker_id(), new_tracker.tracker_id()); - int64 tracker_id = new_tracker.tracker_id(); + int64_t tracker_id = new_tracker.tracker_id(); if (old_tracker.dirty() && !new_tracker.dirty()) { DCHECK(ContainsKey(dirty_trackers_, tracker_id) || ContainsKey(demoted_dirty_trackers_, tracker_id)); @@ -759,7 +756,7 @@ void MetadataDatabaseIndex::UpdateInDirtyTrackerIndexes( void MetadataDatabaseIndex::RemoveFromDirtyTrackerIndexes( const FileTracker& tracker) { if (tracker.dirty()) { - int64 tracker_id = tracker.tracker_id(); + int64_t tracker_id = tracker.tracker_id(); DCHECK(ContainsKey(dirty_trackers_, tracker_id) || ContainsKey(demoted_dirty_trackers_, tracker_id)); diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_database_index.h b/chrome/browser/sync_file_system/drive_backend/metadata_database_index.h index c907e6d..a6f4510 100644 --- a/chrome/browser/sync_file_system/drive_backend/metadata_database_index.h +++ b/chrome/browser/sync_file_system/drive_backend/metadata_database_index.h @@ -5,6 +5,9 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX_H_ +#include <stddef.h> +#include <stdint.h> + #include <map> #include <set> #include <string> @@ -12,6 +15,7 @@ #include "base/containers/hash_tables.h" #include "base/containers/scoped_ptr_hash_map.h" +#include "base/macros.h" #include "base/memory/scoped_vector.h" #include "chrome/browser/sync_file_system/drive_backend/metadata_database_index_interface.h" #include "chrome/browser/sync_file_system/drive_backend/tracker_id_set.h" @@ -61,53 +65,53 @@ class MetadataDatabaseIndex : public MetadataDatabaseIndexInterface { void RemoveUnreachableItems() override; bool GetFileMetadata(const std::string& file_id, FileMetadata* metadata) const override; - bool GetFileTracker(int64 tracker_id, FileTracker* tracker) const override; + bool GetFileTracker(int64_t tracker_id, FileTracker* tracker) const override; void StoreFileMetadata(scoped_ptr<FileMetadata> metadata) override; void StoreFileTracker(scoped_ptr<FileTracker> tracker) override; void RemoveFileMetadata(const std::string& file_id) override; - void RemoveFileTracker(int64 tracker_id) override; + void RemoveFileTracker(int64_t tracker_id) override; TrackerIDSet GetFileTrackerIDsByFileID( const std::string& file_id) const override; - int64 GetAppRootTracker(const std::string& app_id) const override; + int64_t GetAppRootTracker(const std::string& app_id) const override; TrackerIDSet GetFileTrackerIDsByParentAndTitle( - int64 parent_tracker_id, + int64_t parent_tracker_id, const std::string& title) const override; - std::vector<int64> GetFileTrackerIDsByParent( - int64 parent_tracker_id) const override; + std::vector<int64_t> GetFileTrackerIDsByParent( + int64_t parent_tracker_id) const override; std::string PickMultiTrackerFileID() const override; ParentIDAndTitle PickMultiBackingFilePath() const override; - int64 PickDirtyTracker() const override; - void DemoteDirtyTracker(int64 tracker_id) override; + int64_t PickDirtyTracker() const override; + void DemoteDirtyTracker(int64_t tracker_id) override; bool HasDemotedDirtyTracker() const override; - bool IsDemotedDirtyTracker(int64 tracker_id) const override; - void PromoteDemotedDirtyTracker(int64 tracker_id) override; + bool IsDemotedDirtyTracker(int64_t tracker_id) const override; + void PromoteDemotedDirtyTracker(int64_t tracker_id) override; bool PromoteDemotedDirtyTrackers() override; size_t CountDirtyTracker() const override; size_t CountFileMetadata() const override; size_t CountFileTracker() const override; void SetSyncRootRevalidated() const override; - void SetSyncRootTrackerID(int64 sync_root_id) const override; - void SetLargestChangeID(int64 largest_change_id) const override; - void SetNextTrackerID(int64 next_tracker_id) const override; + void SetSyncRootTrackerID(int64_t sync_root_id) const override; + void SetLargestChangeID(int64_t largest_change_id) const override; + void SetNextTrackerID(int64_t next_tracker_id) const override; bool IsSyncRootRevalidated() const override; - int64 GetSyncRootTrackerID() const override; - int64 GetLargestChangeID() const override; - int64 GetNextTrackerID() const override; + int64_t GetSyncRootTrackerID() const override; + int64_t GetLargestChangeID() const override; + int64_t GetNextTrackerID() const override; std::vector<std::string> GetRegisteredAppIDs() const override; - std::vector<int64> GetAllTrackerIDs() const override; + std::vector<int64_t> GetAllTrackerIDs() const override; std::vector<std::string> GetAllMetadataIDs() const override; private: typedef base::ScopedPtrHashMap<std::string, scoped_ptr<FileMetadata>> MetadataByID; - typedef base::ScopedPtrHashMap<int64, scoped_ptr<FileTracker>> TrackerByID; + typedef base::ScopedPtrHashMap<int64_t, scoped_ptr<FileTracker>> TrackerByID; typedef base::hash_map<std::string, TrackerIDSet> TrackerIDsByFileID; typedef base::hash_map<std::string, TrackerIDSet> TrackerIDsByTitle; - typedef std::map<int64, TrackerIDsByTitle> TrackerIDsByParentAndTitle; - typedef base::hash_map<std::string, int64> TrackerIDByAppID; + typedef std::map<int64_t, TrackerIDsByTitle> TrackerIDsByParentAndTitle; + typedef base::hash_map<std::string, int64_t> TrackerIDByAppID; typedef base::hash_set<std::string> FileIDSet; typedef base::hash_set<ParentIDAndTitle> PathSet; - typedef std::set<int64> DirtyTrackers; + typedef std::set<int64_t> DirtyTrackers; friend class MetadataDatabaseTest; diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_database_index_interface.h b/chrome/browser/sync_file_system/drive_backend/metadata_database_index_interface.h index 0c06301..622c35c 100644 --- a/chrome/browser/sync_file_system/drive_backend/metadata_database_index_interface.h +++ b/chrome/browser/sync_file_system/drive_backend/metadata_database_index_interface.h @@ -5,10 +5,13 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX_INTERFACE_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX_INTERFACE_H_ +#include <stddef.h> +#include <stdint.h> + #include <string> #include <vector> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" namespace sync_file_system { @@ -19,11 +22,11 @@ class FileTracker; class TrackerIDSet; struct ParentIDAndTitle { - int64 parent_id; + int64_t parent_id; std::string title; ParentIDAndTitle(); - ParentIDAndTitle(int64 parent_id, const std::string& title); + ParentIDAndTitle(int64_t parent_id, const std::string& title); }; bool operator==(const ParentIDAndTitle& left, const ParentIDAndTitle& right); @@ -45,8 +48,8 @@ class MetadataDatabaseIndexInterface { // Returns true if FileTracker identified by |tracker_id| exists. // If |tracker| is not NULL, the FileTracker is copied to it. - virtual bool GetFileTracker( - int64 tracker_id, FileTracker* tracker) const = 0; + virtual bool GetFileTracker(int64_t tracker_id, + FileTracker* tracker) const = 0; // Stores |metadata| and updates indexes. // This overwrites existing FileMetadata for the same |file_id|. @@ -60,7 +63,7 @@ class MetadataDatabaseIndexInterface { virtual void RemoveFileMetadata(const std::string& file_id) = 0; // Removes FileTracker identified by |tracker_id| from indexes. - virtual void RemoveFileTracker(int64 tracker_id) = 0; + virtual void RemoveFileTracker(int64_t tracker_id) = 0; // Returns a set of FileTracker that have |file_id| as its own. virtual TrackerIDSet GetFileTrackerIDsByFileID( @@ -68,15 +71,15 @@ class MetadataDatabaseIndexInterface { // Returns an app-root tracker identified by |app_id|. Returns 0 if not // found. - virtual int64 GetAppRootTracker(const std::string& app_id) const = 0; + virtual int64_t GetAppRootTracker(const std::string& app_id) const = 0; // Returns a set of FileTracker that have |parent_tracker_id| and |title|. virtual TrackerIDSet GetFileTrackerIDsByParentAndTitle( - int64 parent_tracker_id, + int64_t parent_tracker_id, const std::string& title) const = 0; - virtual std::vector<int64> GetFileTrackerIDsByParent( - int64 parent_tracker_id) const = 0; + virtual std::vector<int64_t> GetFileTrackerIDsByParent( + int64_t parent_tracker_id) const = 0; // Returns the |file_id| of a file that has multiple trackers. virtual std::string PickMultiTrackerFileID() const = 0; @@ -87,16 +90,16 @@ class MetadataDatabaseIndexInterface { // Returns a FileTracker whose |dirty| is set and which isn't demoted. // Returns 0 if not found. - virtual int64 PickDirtyTracker() const = 0; + virtual int64_t PickDirtyTracker() const = 0; // Demotes a dirty tracker. - virtual void DemoteDirtyTracker(int64 tracker_id) = 0; + virtual void DemoteDirtyTracker(int64_t tracker_id) = 0; virtual bool HasDemotedDirtyTracker() const = 0; - virtual bool IsDemotedDirtyTracker(int64 tracker_id) const = 0; + virtual bool IsDemotedDirtyTracker(int64_t tracker_id) const = 0; // Promotes single demoted dirty tracker to a normal dirty tracker. - virtual void PromoteDemotedDirtyTracker(int64 tracker_id) = 0; + virtual void PromoteDemotedDirtyTracker(int64_t tracker_id) = 0; // Promotes all demoted dirty trackers to normal dirty trackers. // Returns true if any tracker was promoted. @@ -107,15 +110,15 @@ class MetadataDatabaseIndexInterface { virtual size_t CountFileTracker() const = 0; virtual void SetSyncRootRevalidated() const = 0; - virtual void SetSyncRootTrackerID(int64 sync_root_id) const = 0; - virtual void SetLargestChangeID(int64 largest_change_id) const = 0; - virtual void SetNextTrackerID(int64 next_tracker_id) const = 0; + virtual void SetSyncRootTrackerID(int64_t sync_root_id) const = 0; + virtual void SetLargestChangeID(int64_t largest_change_id) const = 0; + virtual void SetNextTrackerID(int64_t next_tracker_id) const = 0; virtual bool IsSyncRootRevalidated() const = 0; - virtual int64 GetSyncRootTrackerID() const = 0; - virtual int64 GetLargestChangeID() const = 0; - virtual int64 GetNextTrackerID() const = 0; + virtual int64_t GetSyncRootTrackerID() const = 0; + virtual int64_t GetLargestChangeID() const = 0; + virtual int64_t GetNextTrackerID() const = 0; virtual std::vector<std::string> GetRegisteredAppIDs() const = 0; - virtual std::vector<int64> GetAllTrackerIDs() const = 0; + virtual std::vector<int64_t> GetAllTrackerIDs() const = 0; virtual std::vector<std::string> GetAllMetadataIDs() const = 0; private: diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.cc b/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.cc index 4956f48..2587acb 100644 --- a/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.cc +++ b/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.cc @@ -6,6 +6,7 @@ #include "base/format_macros.h" #include "base/logging.h" +#include "base/macros.h" #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" @@ -21,7 +22,7 @@ // // NOTE // - Entries are sorted by keys. -// - int64 value is serialized as a string by base::Int64ToString(). +// - int64_t value is serialized as a string by base::Int64ToString(). // - ServiceMetadata, FileMetadata, and FileTracker values are serialized // as a string by SerializeToString() of protocol buffers. // @@ -39,45 +40,46 @@ // value: <FileMetadata 'metadata'> // // # Trackers of remote file updates (compatible with version 3) -// key: "TRACKER: " + <int64 'tracker_id'> +// key: "TRACKER: " + <int64_t 'tracker_id'> // value: <FileTracker 'tracker'> // // # Index from App ID to the tracker ID // key: "APP_ROOT: " + <string 'app_id'> -// value: <int64 'app_root_tracker_id'> +// value: <int64_t 'app_root_tracker_id'> // // # Index from file ID to the active tracker ID // key: "ACTIVE_FILE: " + <string 'file_id'> -// value: <int64 'active_tracker_id'> +// value: <int64_t 'active_tracker_id'> // // # Index from file ID to a tracker ID -// key: "TRACKER_FILE: " + <string 'file_id'> + '\x00' + <int64 'tracker_id'> +// key: "TRACKER_FILE: " + <string 'file_id'> + '\x00' + +// <int64_t'tracker_id'> // value: <empty> // // # Tracker IDs; a file metadata linked to multiple tracker IDs. -// key: "MULTI_FILE: " + <int64 'tracker_id'> +// key: "MULTI_FILE: " + <int64_t 'tracker_id'> // value: <empty> // // # Index from the parent tracker ID and the title to the active tracker ID -// key: "ACTIVE_PATH: " + <int64 'parent_tracker_id'> + +// key: "ACTIVE_PATH: " + <int64_t 'parent_tracker_id'> + // '\x00' + <string 'title'> -// value: <int64 'active_tracker_id'> +// value: <int64_t 'active_tracker_id'> // // # Index from the parent tracker ID and the title to a tracker ID -// key: "TRACKER_PATH: " + <int64 'parent_tracker_id'> + -// '\x00' + <string 'title'> + '\x00' + <int64 'tracker_id'> +// key: "TRACKER_PATH: " + <int64_t 'parent_tracker_id'> + +// '\x00' + <string 'title'> + '\x00' + <int64_t 'tracker_id'> // value: <empty> // // # Tracker IDs; a parent tracker ID and a title figure multiple tracker IDs -// key: "MULTI_PATH: " + <int64 'tracker_id'> +// key: "MULTI_PATH: " + <int64_t 'tracker_id'> // value: <empty> // // # Dirty tracker IDs -// key: "DIRTY: " + <int64 'dirty_tracker_id'> +// key: "DIRTY: " + <int64_t 'dirty_tracker_id'> // value: <empty> // // # Demoted dirty tracker IDs -// key: "DEMOTED_DIRTY: " + <int64 'demoted_dirty_tracker_id'> +// key: "DEMOTED_DIRTY: " + <int64_t 'demoted_dirty_tracker_id'> // value: <empty> // // # Timestamp when the last validation ran @@ -108,7 +110,8 @@ std::string GenerateMultiTrackerKey(const std::string& file_id) { } std::string GenerateActiveTrackerIDByParentAndTitleKey( - int64 parent_id, const std::string& title) { + int64_t parent_id, + const std::string& title) { std::ostringstream oss; oss << kActiveTrackerIDByParentAndTitleKeyPrefix << parent_id << '\0' << title; @@ -116,44 +119,45 @@ std::string GenerateActiveTrackerIDByParentAndTitleKey( } std::string GenerateTrackerIDByParentAndTitleKeyPrefix( - int64 parent_id, const std::string& title) { + int64_t parent_id, + const std::string& title) { std::ostringstream oss; oss << kTrackerIDByParentAndTitleKeyPrefix << parent_id << '\0' << title << '\0'; return oss.str(); } -std::string GenerateTrackerIDsByParentIDKeyPrefix(int64 parent_id) { +std::string GenerateTrackerIDsByParentIDKeyPrefix(int64_t parent_id) { std::ostringstream oss; oss << kTrackerIDByParentAndTitleKeyPrefix << parent_id << '\0'; return oss.str(); } -std::string GenerateMultiBackingParentAndTitleKey( - int64 parent_id, const std::string& title) { +std::string GenerateMultiBackingParentAndTitleKey(int64_t parent_id, + const std::string& title) { std::ostringstream oss; oss << kMultiBackingParentAndTitleKeyPrefix << parent_id << '\0' << title; return oss.str(); } -std::string GenerateDirtyIDKey(int64 tracker_id) { +std::string GenerateDirtyIDKey(int64_t tracker_id) { return kDirtyIDKeyPrefix + base::Int64ToString(tracker_id); } -std::string GenerateDemotedDirtyIDKey(int64 tracker_id) { +std::string GenerateDemotedDirtyIDKey(int64_t tracker_id) { return kDemotedDirtyIDKeyPrefix + base::Int64ToString(tracker_id); } void RemoveUnreachableItemsFromDB(LevelDBWrapper* db, - int64 sync_root_tracker_id) { + int64_t sync_root_tracker_id) { DCHECK(db); - typedef std::map<int64, std::set<int64> > ChildTrackersByParent; + typedef std::map<int64_t, std::set<int64_t>> ChildTrackersByParent; ChildTrackersByParent trackers_by_parent; { // Set up links from parent tracker to child trackers. - std::set<int64> inactive_trackers; + std::set<int64_t> inactive_trackers; scoped_ptr<LevelDBWrapper::Iterator> itr = db->NewIterator(); for (itr->Seek(kFileTrackerKeyPrefix); itr->Valid(); itr->Next()) { if (!RemovePrefix(itr->key().ToString(), kFileTrackerKeyPrefix, nullptr)) @@ -166,29 +170,29 @@ void RemoveUnreachableItemsFromDB(LevelDBWrapper* db, continue; } - int64 parent_tracker_id = tracker->parent_tracker_id(); - int64 tracker_id = tracker->tracker_id(); + int64_t parent_tracker_id = tracker->parent_tracker_id(); + int64_t tracker_id = tracker->tracker_id(); trackers_by_parent[parent_tracker_id].insert(tracker_id); if (!tracker->active()) inactive_trackers.insert(tracker_id); } // Drop links from inactive trackers. - for (std::set<int64>::iterator iter = inactive_trackers.begin(); + for (std::set<int64_t>::iterator iter = inactive_trackers.begin(); iter != inactive_trackers.end(); ++iter) { trackers_by_parent.erase(*iter); } } // Traverse tracker tree from sync-root. - std::set<int64> visited_trackers; + std::set<int64_t> visited_trackers; { - std::vector<int64> pending; + std::vector<int64_t> pending; if (sync_root_tracker_id != kInvalidTrackerID) pending.push_back(sync_root_tracker_id); while (!pending.empty()) { - int64 tracker_id = pending.back(); + int64_t tracker_id = pending.back(); DCHECK_NE(kInvalidTrackerID, tracker_id); pending.pop_back(); @@ -198,7 +202,7 @@ void RemoveUnreachableItemsFromDB(LevelDBWrapper* db, } AppendContents( - LookUpMap(trackers_by_parent, tracker_id, std::set<int64>()), + LookUpMap(trackers_by_parent, tracker_id, std::set<int64_t>()), &pending); } } @@ -305,8 +309,8 @@ bool MetadataDatabaseIndexOnDisk::GetFileMetadata( return true; } -bool MetadataDatabaseIndexOnDisk::GetFileTracker( - int64 tracker_id, FileTracker* tracker) const { +bool MetadataDatabaseIndexOnDisk::GetFileTracker(int64_t tracker_id, + FileTracker* tracker) const { const std::string key = kFileTrackerKeyPrefix + base::Int64ToString(tracker_id); std::string value; @@ -346,7 +350,7 @@ void MetadataDatabaseIndexOnDisk::StoreFileTracker( scoped_ptr<FileTracker> tracker) { DCHECK(tracker); - int64 tracker_id = tracker->tracker_id(); + int64_t tracker_id = tracker->tracker_id(); FileTracker old_tracker; if (!GetFileTracker(tracker_id, &old_tracker)) { DVLOG(3) << "Adding new tracker: " << tracker->tracker_id() @@ -372,7 +376,7 @@ void MetadataDatabaseIndexOnDisk::RemoveFileMetadata( PutFileMetadataDeletionToDB(file_id, db_); } -void MetadataDatabaseIndexOnDisk::RemoveFileTracker(int64 tracker_id) { +void MetadataDatabaseIndexOnDisk::RemoveFileTracker(int64_t tracker_id) { FileTracker tracker; if (!GetFileTracker(tracker_id, &tracker)) { NOTREACHED(); @@ -396,7 +400,7 @@ TrackerIDSet MetadataDatabaseIndexOnDisk::GetFileTrackerIDsByFileID( GenerateTrackerIDByFileIDKeyPrefix(file_id)); } -int64 MetadataDatabaseIndexOnDisk::GetAppRootTracker( +int64_t MetadataDatabaseIndexOnDisk::GetAppRootTracker( const std::string& app_id) const { const std::string key = GenerateAppRootIDByAppIDKey(app_id); std::string value; @@ -413,7 +417,7 @@ int64 MetadataDatabaseIndexOnDisk::GetAppRootTracker( return kInvalidTrackerID; } - int64 root_id; + int64_t root_id; if (!base::StringToInt64(value, &root_id)) { util::Log(logging::LOG_WARNING, FROM_HERE, "Failed to parse a root ID (%s) for an App ID: %s", @@ -426,15 +430,16 @@ int64 MetadataDatabaseIndexOnDisk::GetAppRootTracker( } TrackerIDSet MetadataDatabaseIndexOnDisk::GetFileTrackerIDsByParentAndTitle( - int64 parent_tracker_id, const std::string& title) const { + int64_t parent_tracker_id, + const std::string& title) const { return GetTrackerIDSetByPrefix( GenerateActiveTrackerIDByParentAndTitleKey(parent_tracker_id, title), GenerateTrackerIDByParentAndTitleKeyPrefix(parent_tracker_id, title)); } -std::vector<int64> MetadataDatabaseIndexOnDisk::GetFileTrackerIDsByParent( - int64 parent_id) const { - std::vector<int64> result; +std::vector<int64_t> MetadataDatabaseIndexOnDisk::GetFileTrackerIDsByParent( + int64_t parent_id) const { + std::vector<int64_t> result; const std::string prefix = GenerateTrackerIDsByParentIDKeyPrefix(parent_id); scoped_ptr<LevelDBWrapper::Iterator> itr(db_->NewIterator()); @@ -447,7 +452,7 @@ std::vector<int64> MetadataDatabaseIndexOnDisk::GetFileTrackerIDsByParent( size_t pos = title_and_id.rfind('\0'); DCHECK(pos != std::string::npos); - int64 tracker_id; + int64_t tracker_id; if (!base::StringToInt64(title_and_id.substr(pos + 1), &tracker_id)) continue; result.push_back(tracker_id); @@ -484,12 +489,12 @@ ParentIDAndTitle MetadataDatabaseIndexOnDisk::PickMultiBackingFilePath() const { if (pos == std::string::npos) return ParentIDAndTitle(); - int64 parent_id; + int64_t parent_id; return base::StringToInt64(value.substr(0, pos), &parent_id) ? ParentIDAndTitle(parent_id, value.substr(pos + 1)) : ParentIDAndTitle(); } -int64 MetadataDatabaseIndexOnDisk::PickDirtyTracker() const { +int64_t MetadataDatabaseIndexOnDisk::PickDirtyTracker() const { scoped_ptr<LevelDBWrapper::Iterator> itr(db_->NewIterator()); itr->Seek(kDirtyIDKeyPrefix); if (!itr->Valid()) @@ -499,14 +504,14 @@ int64 MetadataDatabaseIndexOnDisk::PickDirtyTracker() const { if (!RemovePrefix(itr->key().ToString(), kDirtyIDKeyPrefix, &id_str)) return kInvalidTrackerID; - int64 tracker_id; + int64_t tracker_id; if (!base::StringToInt64(id_str, &tracker_id)) return kInvalidTrackerID; return tracker_id; } -void MetadataDatabaseIndexOnDisk::DemoteDirtyTracker(int64 tracker_id) { +void MetadataDatabaseIndexOnDisk::DemoteDirtyTracker(int64_t tracker_id) { const std::string key = GenerateDirtyIDKey(tracker_id); std::string value; @@ -536,11 +541,12 @@ bool MetadataDatabaseIndexOnDisk::HasDemotedDirtyTracker() const { } bool MetadataDatabaseIndexOnDisk::IsDemotedDirtyTracker( - int64 tracker_id) const { + int64_t tracker_id) const { return DBHasKey(GenerateDemotedDirtyIDKey(tracker_id)); } -void MetadataDatabaseIndexOnDisk::PromoteDemotedDirtyTracker(int64 tracker_id) { +void MetadataDatabaseIndexOnDisk::PromoteDemotedDirtyTracker( + int64_t tracker_id) { std::string demoted_key = GenerateDemotedDirtyIDKey(tracker_id); std::string empty; @@ -559,7 +565,7 @@ bool MetadataDatabaseIndexOnDisk::PromoteDemotedDirtyTrackers() { if (!RemovePrefix(itr->key().ToString(), kDemotedDirtyIDKeyPrefix, &id_str)) break; - int64 tracker_id; + int64_t tracker_id; if (!base::StringToInt64(id_str, &tracker_id)) continue; @@ -607,19 +613,19 @@ void MetadataDatabaseIndexOnDisk::SetSyncRootRevalidated() const { } void MetadataDatabaseIndexOnDisk::SetSyncRootTrackerID( - int64 sync_root_id) const { + int64_t sync_root_id) const { service_metadata_->set_sync_root_tracker_id(sync_root_id); PutServiceMetadataToDB(*service_metadata_, db_); } void MetadataDatabaseIndexOnDisk::SetLargestChangeID( - int64 largest_change_id) const { + int64_t largest_change_id) const { service_metadata_->set_largest_change_id(largest_change_id); PutServiceMetadataToDB(*service_metadata_, db_); } void MetadataDatabaseIndexOnDisk::SetNextTrackerID( - int64 next_tracker_id) const { + int64_t next_tracker_id) const { service_metadata_->set_next_tracker_id(next_tracker_id); PutServiceMetadataToDB(*service_metadata_, db_); } @@ -629,19 +635,19 @@ bool MetadataDatabaseIndexOnDisk::IsSyncRootRevalidated() const { service_metadata_->sync_root_revalidated(); } -int64 MetadataDatabaseIndexOnDisk::GetSyncRootTrackerID() const { +int64_t MetadataDatabaseIndexOnDisk::GetSyncRootTrackerID() const { if (!service_metadata_->has_sync_root_tracker_id()) return kInvalidTrackerID; return service_metadata_->sync_root_tracker_id(); } -int64 MetadataDatabaseIndexOnDisk::GetLargestChangeID() const { +int64_t MetadataDatabaseIndexOnDisk::GetLargestChangeID() const { if (!service_metadata_->has_largest_change_id()) return kInvalidTrackerID; return service_metadata_->largest_change_id(); } -int64 MetadataDatabaseIndexOnDisk::GetNextTrackerID() const { +int64_t MetadataDatabaseIndexOnDisk::GetNextTrackerID() const { if (!service_metadata_->has_next_tracker_id()) return kInvalidTrackerID; return service_metadata_->next_tracker_id(); @@ -660,15 +666,15 @@ MetadataDatabaseIndexOnDisk::GetRegisteredAppIDs() const { return result; } -std::vector<int64> MetadataDatabaseIndexOnDisk::GetAllTrackerIDs() const { - std::vector<int64> tracker_ids; +std::vector<int64_t> MetadataDatabaseIndexOnDisk::GetAllTrackerIDs() const { + std::vector<int64_t> tracker_ids; scoped_ptr<LevelDBWrapper::Iterator> itr(db_->NewIterator()); for (itr->Seek(kFileTrackerKeyPrefix); itr->Valid(); itr->Next()) { std::string id_str; if (!RemovePrefix(itr->key().ToString(), kFileTrackerKeyPrefix, &id_str)) break; - int64 tracker_id; + int64_t tracker_id; if (!base::StringToInt64(id_str, &tracker_id)) continue; tracker_ids.push_back(tracker_id); @@ -689,8 +695,8 @@ MetadataDatabaseIndexOnDisk::GetAllMetadataIDs() const { return file_ids; } -int64 MetadataDatabaseIndexOnDisk::BuildTrackerIndexes() { - int64 num_puts_before = db_->num_puts(); +int64_t MetadataDatabaseIndexOnDisk::BuildTrackerIndexes() { + int64_t num_puts_before = db_->num_puts(); scoped_ptr<LevelDBWrapper::Iterator> itr(db_->NewIterator()); for (itr->Seek(kFileTrackerKeyPrefix); itr->Valid(); itr->Next()) { @@ -713,7 +719,7 @@ int64 MetadataDatabaseIndexOnDisk::BuildTrackerIndexes() { return db_->num_puts() - num_puts_before; } -int64 MetadataDatabaseIndexOnDisk::DeleteTrackerIndexes() { +int64_t MetadataDatabaseIndexOnDisk::DeleteTrackerIndexes() { const char* kIndexPrefixes[] = { kAppRootIDByAppIDKeyPrefix, kActiveTrackerIDByFileIDKeyPrefix, kTrackerIDByFileIDKeyPrefix, kMultiTrackerByFileIDKeyPrefix, @@ -722,7 +728,7 @@ int64 MetadataDatabaseIndexOnDisk::DeleteTrackerIndexes() { kDirtyIDKeyPrefix, kDemotedDirtyIDKeyPrefix }; - int64 num_deletes_before = db_->num_deletes(); + int64_t num_deletes_before = db_->num_deletes(); for (size_t i = 0; i < arraysize(kIndexPrefixes); ++i) DeleteKeyStartsWith(kIndexPrefixes[i]); num_dirty_trackers_ = 0; @@ -741,15 +747,15 @@ MetadataDatabaseIndexOnDisk::MetadataDatabaseIndexOnDisk(LevelDBWrapper* db) service_metadata_ = InitializeServiceMetadata(db_); // Check if index is valid, if no validations run in 7 days. - const int64 kThresholdToValidateInDays = 7; + const int64_t kThresholdToValidateInDays = 7; - int64 last_check_time = 0; + int64_t last_check_time = 0; std::string value; if (db_->Get(kLastValidationTimeKey, &value).ok()) base::StringToInt64(value, &last_check_time); base::TimeDelta since_last_check = base::Time::Now() - base::Time::FromInternalValue(last_check_time); - int64 since_last_check_in_days = since_last_check.InDays(); + int64_t since_last_check_in_days = since_last_check.InDays(); if (since_last_check_in_days >= kThresholdToValidateInDays || since_last_check_in_days < 0) { // TODO(peria): Add UMA to check if the number of deleted entries and the @@ -877,7 +883,7 @@ void MetadataDatabaseIndexOnDisk::RemoveFromFileIDIndexes( void MetadataDatabaseIndexOnDisk::AddToPathIndexes( const FileTracker& new_tracker) { - int64 parent_id = new_tracker.parent_tracker_id(); + int64_t parent_id = new_tracker.parent_tracker_id(); std::string title = GetTrackerTitle(new_tracker); DVLOG(1) << " Add to trackers by parent and title: " @@ -892,7 +898,7 @@ void MetadataDatabaseIndexOnDisk::AddToPathIndexes( if (!RemovePrefix(itr->key().ToString(), prefix, &id_str)) break; - int64 tracker_id; + int64_t tracker_id; if (!base::StringToInt64(id_str, &tracker_id)) continue; if (tracker_id == new_tracker.tracker_id()) { @@ -922,8 +928,8 @@ void MetadataDatabaseIndexOnDisk::UpdateInPathIndexes( DCHECK(GetTrackerTitle(old_tracker) == GetTrackerTitle(new_tracker) || !old_tracker.has_synced_details()); - int64 tracker_id = new_tracker.tracker_id(); - int64 parent_id = new_tracker.parent_tracker_id(); + int64_t tracker_id = new_tracker.tracker_id(); + int64_t parent_id = new_tracker.parent_tracker_id(); const std::string old_title = GetTrackerTitle(old_tracker); const std::string title = GetTrackerTitle(new_tracker); @@ -980,8 +986,8 @@ void MetadataDatabaseIndexOnDisk::UpdateInPathIndexes( void MetadataDatabaseIndexOnDisk::RemoveFromPathIndexes( const FileTracker& tracker) { - int64 tracker_id = tracker.tracker_id(); - int64 parent_id = tracker.parent_tracker_id(); + int64_t tracker_id = tracker.tracker_id(); + int64_t parent_id = tracker.parent_tracker_id(); std::string title = GetTrackerTitle(tracker); DVLOG(1) << " Remove from trackers by parent and title: " @@ -1023,7 +1029,7 @@ void MetadataDatabaseIndexOnDisk::UpdateInDirtyTrackerIndexes( const FileTracker& new_tracker) { DCHECK_EQ(old_tracker.tracker_id(), new_tracker.tracker_id()); - int64 tracker_id = new_tracker.tracker_id(); + int64_t tracker_id = new_tracker.tracker_id(); const std::string dirty_key = GenerateDirtyIDKey(tracker_id); const std::string demoted_key = GenerateDemotedDirtyIDKey(tracker_id); if (old_tracker.dirty() && !new_tracker.dirty()) { @@ -1049,7 +1055,7 @@ void MetadataDatabaseIndexOnDisk::UpdateInDirtyTrackerIndexes( void MetadataDatabaseIndexOnDisk::RemoveFromDirtyTrackerIndexes( const FileTracker& tracker) { if (tracker.dirty()) { - int64 tracker_id = tracker.tracker_id(); + int64_t tracker_id = tracker.tracker_id(); const std::string dirty_key = GenerateDirtyIDKey(tracker_id); const std::string demoted_key = GenerateDemotedDirtyIDKey(tracker_id); DCHECK(DBHasKey(dirty_key) || DBHasKey(demoted_key)); @@ -1075,7 +1081,7 @@ TrackerIDSet MetadataDatabaseIndexOnDisk::GetTrackerIDSetByPrefix( if (!RemovePrefix(key, ids_prefix, &id_str)) break; - int64 tracker_id; + int64_t tracker_id; if (!base::StringToInt64(id_str, &tracker_id)) continue; trackers.InsertInactiveTracker(tracker_id); @@ -1084,7 +1090,7 @@ TrackerIDSet MetadataDatabaseIndexOnDisk::GetTrackerIDSetByPrefix( // Set an active tracker ID, if available. std::string value; leveldb::Status status = db_->Get(active_tracker_key, &value); - int64 active_tracker; + int64_t active_tracker; if (status.ok() && base::StringToInt64(value, &active_tracker)) { DCHECK_NE(kInvalidTrackerID, active_tracker); trackers.Activate(active_tracker); @@ -1105,8 +1111,9 @@ void MetadataDatabaseIndexOnDisk::AddToTrackerIDSetWithPrefix( } bool MetadataDatabaseIndexOnDisk::EraseInTrackerIDSetWithPrefix( - const std::string& active_tracker_key, const std::string& key_prefix, - int64 tracker_id) { + const std::string& active_tracker_key, + const std::string& key_prefix, + int64_t tracker_id) { std::string value; const std::string del_key = key_prefix + base::Int64ToString(tracker_id); leveldb::Status status = db_->Get(del_key, &value); @@ -1116,7 +1123,7 @@ bool MetadataDatabaseIndexOnDisk::EraseInTrackerIDSetWithPrefix( db_->Delete(del_key); status = db_->Get(active_tracker_key, &value); - int64 active_tracker_id; + int64_t active_tracker_id; if (status.ok() && base::StringToInt64(value, &active_tracker_id) && active_tracker_id == tracker_id) { db_->Delete(active_tracker_key); @@ -1126,13 +1133,14 @@ bool MetadataDatabaseIndexOnDisk::EraseInTrackerIDSetWithPrefix( } void MetadataDatabaseIndexOnDisk::ActivateInTrackerIDSetWithPrefix( - const std::string& active_tracker_key, const std::string& key_prefix, - int64 tracker_id) { + const std::string& active_tracker_key, + const std::string& key_prefix, + int64_t tracker_id) { DCHECK(DBHasKey(key_prefix + base::Int64ToString(tracker_id))); std::string value; leveldb::Status status = db_->Get(active_tracker_key, &value); - int64 active_tracker_id = kInvalidTrackerID; + int64_t active_tracker_id = kInvalidTrackerID; if (status.IsNotFound() || (status.ok() && base::StringToInt64(value, &active_tracker_id))) { DCHECK(active_tracker_id != tracker_id); @@ -1141,13 +1149,14 @@ void MetadataDatabaseIndexOnDisk::ActivateInTrackerIDSetWithPrefix( } void MetadataDatabaseIndexOnDisk::DeactivateInTrackerIDSetWithPrefix( - const std::string& active_tracker_key, const std::string& key_prefix, - int64 tracker_id) { + const std::string& active_tracker_key, + const std::string& key_prefix, + int64_t tracker_id) { DCHECK(DBHasKey(key_prefix + base::Int64ToString(tracker_id))); std::string value; leveldb::Status status = db_->Get(active_tracker_key, &value); - int64 active_tracker_id; + int64_t active_tracker_id; if (status.ok() && base::StringToInt64(value, &active_tracker_id)) { DCHECK(active_tracker_id == tracker_id); db_->Delete(active_tracker_key); @@ -1175,8 +1184,8 @@ size_t MetadataDatabaseIndexOnDisk::CountDirtyTrackerInternal() const { } MetadataDatabaseIndexOnDisk::NumEntries -MetadataDatabaseIndexOnDisk::CountWithPrefix( - const std::string& prefix, int64 ignored_id) { +MetadataDatabaseIndexOnDisk::CountWithPrefix(const std::string& prefix, + int64_t ignored_id) { const std::string ignored = base::Int64ToString(ignored_id); size_t count = 0; diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.h b/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.h index 5e50572..c06adb9 100644 --- a/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.h +++ b/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.h @@ -5,11 +5,15 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX_ON_DISK_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_METADATA_DATABASE_INDEX_ON_DISK_H_ +#include <stddef.h> +#include <stdint.h> + #include <map> #include <set> #include <string> #include <vector> +#include "base/macros.h" #include "chrome/browser/sync_file_system/drive_backend/metadata_database_index_interface.h" #include "chrome/browser/sync_file_system/drive_backend/tracker_id_set.h" @@ -36,49 +40,49 @@ class MetadataDatabaseIndexOnDisk : public MetadataDatabaseIndexInterface { void RemoveUnreachableItems() override; bool GetFileMetadata(const std::string& file_id, FileMetadata* metadata) const override; - bool GetFileTracker(int64 tracker_id, FileTracker* tracker) const override; + bool GetFileTracker(int64_t tracker_id, FileTracker* tracker) const override; void StoreFileMetadata(scoped_ptr<FileMetadata> metadata) override; void StoreFileTracker(scoped_ptr<FileTracker> tracker) override; void RemoveFileMetadata(const std::string& file_id) override; - void RemoveFileTracker(int64 tracker_id) override; + void RemoveFileTracker(int64_t tracker_id) override; TrackerIDSet GetFileTrackerIDsByFileID( const std::string& file_id) const override; - int64 GetAppRootTracker(const std::string& app_id) const override; + int64_t GetAppRootTracker(const std::string& app_id) const override; TrackerIDSet GetFileTrackerIDsByParentAndTitle( - int64 parent_tracker_id, + int64_t parent_tracker_id, const std::string& title) const override; - std::vector<int64> GetFileTrackerIDsByParent( - int64 parent_tracker_id) const override; + std::vector<int64_t> GetFileTrackerIDsByParent( + int64_t parent_tracker_id) const override; std::string PickMultiTrackerFileID() const override; ParentIDAndTitle PickMultiBackingFilePath() const override; - int64 PickDirtyTracker() const override; - void DemoteDirtyTracker(int64 tracker_id) override; + int64_t PickDirtyTracker() const override; + void DemoteDirtyTracker(int64_t tracker_id) override; bool HasDemotedDirtyTracker() const override; - bool IsDemotedDirtyTracker(int64 tracker_id) const override; - void PromoteDemotedDirtyTracker(int64 tracker_id) override; + bool IsDemotedDirtyTracker(int64_t tracker_id) const override; + void PromoteDemotedDirtyTracker(int64_t tracker_id) override; bool PromoteDemotedDirtyTrackers() override; size_t CountDirtyTracker() const override; size_t CountFileMetadata() const override; size_t CountFileTracker() const override; void SetSyncRootRevalidated() const override; - void SetSyncRootTrackerID(int64 sync_root_id) const override; - void SetLargestChangeID(int64 largest_change_id) const override; - void SetNextTrackerID(int64 next_tracker_id) const override; + void SetSyncRootTrackerID(int64_t sync_root_id) const override; + void SetLargestChangeID(int64_t largest_change_id) const override; + void SetNextTrackerID(int64_t next_tracker_id) const override; bool IsSyncRootRevalidated() const override; - int64 GetSyncRootTrackerID() const override; - int64 GetLargestChangeID() const override; - int64 GetNextTrackerID() const override; + int64_t GetSyncRootTrackerID() const override; + int64_t GetLargestChangeID() const override; + int64_t GetNextTrackerID() const override; std::vector<std::string> GetRegisteredAppIDs() const override; - std::vector<int64> GetAllTrackerIDs() const override; + std::vector<int64_t> GetAllTrackerIDs() const override; std::vector<std::string> GetAllMetadataIDs() const override; // Builds on-disk indexes from FileTracker entries on disk. // Returns the number of newly added entries for indexing. - int64 BuildTrackerIndexes(); + int64_t BuildTrackerIndexes(); // Deletes entries used for indexes on on-disk database. // Returns the number of the deleted entries. - int64 DeleteTrackerIndexes(); + int64_t DeleteTrackerIndexes(); LevelDBWrapper* GetDBForTesting(); @@ -133,24 +137,21 @@ class MetadataDatabaseIndexOnDisk : public MetadataDatabaseIndexInterface { // Returns true if |tracker_id| is removed successfully. If no other entries // are stored with |key_prefix|, the entry for |active_key| is also removed. - bool EraseInTrackerIDSetWithPrefix( - const std::string& active_tracker_key, - const std::string& key_prefix, - int64 tracker_id); + bool EraseInTrackerIDSetWithPrefix(const std::string& active_tracker_key, + const std::string& key_prefix, + int64_t tracker_id); // Adds an entry for |active_key| on DB, if |tracker_id| has an entry with // |key_prefix|. - void ActivateInTrackerIDSetWithPrefix( - const std::string& active_tracker_key, - const std::string& key_prefix, - int64 tracker_id); + void ActivateInTrackerIDSetWithPrefix(const std::string& active_tracker_key, + const std::string& key_prefix, + int64_t tracker_id); // Removes an entry for |active_key| on DB, if the value of |active_key| key // is |tracker_id|. - void DeactivateInTrackerIDSetWithPrefix( - const std::string& active_tracker_key, - const std::string& key_prefix, - int64 tracker_id); + void DeactivateInTrackerIDSetWithPrefix(const std::string& active_tracker_key, + const std::string& key_prefix, + int64_t tracker_id); // Checks if |db_| has an entry whose key is |key|. bool DBHasKey(const std::string& key) const; @@ -160,7 +161,7 @@ class MetadataDatabaseIndexOnDisk : public MetadataDatabaseIndexInterface { // Returns the number of entries starting with |prefix| in NumEntries format. // Entries for |ignored_id| are not counted in. - NumEntries CountWithPrefix(const std::string& prefix, int64 ignored_id); + NumEntries CountWithPrefix(const std::string& prefix, int64_t ignored_id); // Deletes entries whose keys start from |prefix|. void DeleteKeyStartsWith(const std::string& prefix); diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk_unittest.cc b/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk_unittest.cc index 1ec85c5..55442a0 100644 --- a/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk_unittest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.h" +#include <stdint.h> + #include <algorithm> #include "base/files/scoped_temp_dir.h" @@ -24,10 +26,10 @@ namespace drive_backend { namespace { -const int64 kSyncRootTrackerID = 1; -const int64 kAppRootTrackerID = 2; -const int64 kFileTrackerID = 3; -const int64 kPlaceholderTrackerID = 4; +const int64_t kSyncRootTrackerID = 1; +const int64_t kAppRootTrackerID = 2; +const int64_t kFileTrackerID = 3; +const int64_t kPlaceholderTrackerID = 4; } // namespace @@ -154,7 +156,7 @@ TEST_F(MetadataDatabaseIndexOnDiskTest, GetEntryTest) { TEST_F(MetadataDatabaseIndexOnDiskTest, SetEntryTest) { CreateTestDatabase(false, nullptr); - const int64 tracker_id = 10; + const int64_t tracker_id = 10; scoped_ptr<FileMetadata> metadata = test_util::CreateFileMetadata("test_file_id", "test_title", "test_md5"); FileTracker root_tracker; @@ -230,7 +232,7 @@ TEST_F(MetadataDatabaseIndexOnDiskTest, SyncRootInvalidation) { CreateTestDatabase(true, nullptr); EXPECT_NE(kInvalidTrackerID, index()->GetAppRootTracker("app_id")); - const int64 kNewSyncRootTrackerID = 10; + const int64_t kNewSyncRootTrackerID = 10; scoped_ptr<FileMetadata> new_sync_root_metadata = test_util::CreateFolderMetadata("new_sync_root_folder_id", kSyncRootFolderTitle); @@ -280,7 +282,7 @@ TEST_F(MetadataDatabaseIndexOnDiskTest, BuildIndexTest) { TEST_F(MetadataDatabaseIndexOnDiskTest, BuildAndDeleteIndexTest) { CreateTestDatabase(false, nullptr); - int64 answer = index()->BuildTrackerIndexes(); + int64_t answer = index()->BuildTrackerIndexes(); WriteToDB(); ASSERT_EQ(16, answer); EXPECT_EQ(answer, index()->DeleteTrackerIndexes()); @@ -301,7 +303,7 @@ TEST_F(MetadataDatabaseIndexOnDiskTest, AllEntriesTest) { EXPECT_EQ("sync_root_folder_id", file_ids[2]); EXPECT_EQ(4U, index()->CountFileTracker()); - std::vector<int64> tracker_ids = index()->GetAllTrackerIDs(); + std::vector<int64_t> tracker_ids = index()->GetAllTrackerIDs(); ASSERT_EQ(4U, tracker_ids.size()); std::sort(tracker_ids.begin(), tracker_ids.end()); EXPECT_EQ(kSyncRootTrackerID, tracker_ids[0]); @@ -320,7 +322,7 @@ TEST_F(MetadataDatabaseIndexOnDiskTest, IndexAppRootIDByAppIDTest) { EXPECT_EQ(kInvalidTrackerID, index()->GetAppRootTracker("")); EXPECT_EQ(kAppRootTrackerID, index()->GetAppRootTracker("app_id")); - const int64 kAppRootTrackerID2 = 12; + const int64_t kAppRootTrackerID2 = 12; FileTracker sync_root_tracker; index()->GetFileTracker(kSyncRootTrackerID, &sync_root_tracker); scoped_ptr<FileMetadata> app_root_metadata = @@ -383,7 +385,7 @@ TEST_F(MetadataDatabaseIndexOnDiskTest, TrackerIDSetByFileIDTest) { EXPECT_EQ(1U, tracker_ids.size()); EXPECT_EQ(kFileTrackerID, tracker_ids.active_tracker()); - const int64 tracker_id = 21; + const int64_t tracker_id = 21; // Testing AddToFileIDIndexes scoped_ptr<FileTracker> file_tracker = test_util::CreateTracker(metadata, tracker_id, &app_root_tracker); @@ -452,7 +454,7 @@ TEST_F(MetadataDatabaseIndexOnDiskTest, TrackerIDSetByParentIDAndTitleTest) { kAppRootTrackerID, "file2"); EXPECT_TRUE(tracker_ids.empty()); - const int64 tracker_id = 72; + const int64_t tracker_id = 72; // Testing AddToFileIDIndexes scoped_ptr<FileTracker> file_tracker = test_util::CreateTracker(metadata, tracker_id, &app_root_tracker); @@ -515,8 +517,8 @@ TEST_F(MetadataDatabaseIndexOnDiskTest, TrackerIDSetByParentIDAndTitleTest_EmptyTitle) { CreateTestDatabase(true, nullptr); - const int64 kFolderTrackerID = 23; - const int64 kNewFileTrackerID = 42; + const int64_t kFolderTrackerID = 23; + const int64_t kNewFileTrackerID = 42; { FileTracker app_root_tracker; EXPECT_TRUE(index()->GetFileTracker(kAppRootTrackerID, &app_root_tracker)); @@ -575,8 +577,8 @@ TEST_F(MetadataDatabaseIndexOnDiskTest, TrackerIDSetDetailsTest) { FileTracker app_root; EXPECT_TRUE(index()->GetFileTracker(kAppRootTrackerID, &app_root)); - const int64 kFileTrackerID2 = 123; - const int64 kFileTrackerID3 = 124; + const int64_t kFileTrackerID2 = 123; + const int64_t kFileTrackerID3 = 124; scoped_ptr<FileMetadata> file_metadata = test_util::CreateFileMetadata("file_id2", "file_2", "file_md5_2"); scoped_ptr<FileTracker> file_tracker = @@ -619,7 +621,7 @@ TEST_F(MetadataDatabaseIndexOnDiskTest, DirtyTrackersTest) { EXPECT_TRUE(index()->HasDemotedDirtyTracker()); EXPECT_EQ(0U, index()->CountDirtyTracker()); - const int64 tracker_id = 13; + const int64_t tracker_id = 13; scoped_ptr<FileTracker> app_root_tracker(new FileTracker); index()->GetFileTracker(kAppRootTrackerID, app_root_tracker.get()); diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_database_index_unittest.cc b/chrome/browser/sync_file_system/drive_backend/metadata_database_index_unittest.cc index 482c0dd..dc0e596 100644 --- a/chrome/browser/sync_file_system/drive_backend/metadata_database_index_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/metadata_database_index_unittest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync_file_system/drive_backend/metadata_database_index.h" +#include <stdint.h> + #include "chrome/browser/sync_file_system/drive_backend/drive_backend_constants.h" #include "chrome/browser/sync_file_system/drive_backend/drive_backend_test_util.h" #include "chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.h" @@ -19,10 +21,10 @@ namespace drive_backend { namespace { -const int64 kSyncRootTrackerID = 1; -const int64 kAppRootTrackerID = 2; -const int64 kFileTrackerID = 3; -const int64 kPlaceholderTrackerID = 4; +const int64_t kSyncRootTrackerID = 1; +const int64_t kAppRootTrackerID = 2; +const int64_t kFileTrackerID = 3; +const int64_t kPlaceholderTrackerID = 4; scoped_ptr<DatabaseContents> CreateTestDatabaseContents() { scoped_ptr<DatabaseContents> contents(new DatabaseContents); @@ -117,7 +119,7 @@ TEST_F(MetadataDatabaseIndexTest, IndexLookUpTest) { EXPECT_TRUE(trackers.has_active()); EXPECT_EQ(kFileTrackerID, trackers.active_tracker()); - int64 app_root_tracker_id = index()->GetAppRootTracker("app_id"); + int64_t app_root_tracker_id = index()->GetAppRootTracker("app_id"); EXPECT_EQ(kAppRootTrackerID, app_root_tracker_id); trackers = index()->GetFileTrackerIDsByParentAndTitle( @@ -145,7 +147,7 @@ TEST_F(MetadataDatabaseIndexTest, UpdateTest) { FileTracker app_root_tracker; ASSERT_TRUE(index()->GetFileTracker(kAppRootTrackerID, &app_root_tracker)); - int64 new_tracker_id = 100; + int64_t new_tracker_id = 100; scoped_ptr<FileTracker> new_tracker = test_util::CreateTracker(metadata, new_tracker_id, &app_root_tracker); new_tracker->set_active(false); diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_database_unittest.cc b/chrome/browser/sync_file_system/drive_backend/metadata_database_unittest.cc index 90f43f5..cd7af78 100644 --- a/chrome/browser/sync_file_system/drive_backend/metadata_database_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/metadata_database_unittest.cc @@ -4,8 +4,11 @@ #include "chrome/browser/sync_file_system/drive_backend/metadata_database.h" +#include <stdint.h> + #include "base/bind.h" #include "base/files/scoped_temp_dir.h" +#include "base/macros.h" #include "base/message_loop/message_loop.h" #include "base/strings/string_number_conversions.h" #include "base/thread_task_runner_handle.h" @@ -34,8 +37,8 @@ namespace { typedef MetadataDatabase::FileIDList FileIDList; -const int64 kInitialChangeID = 1234; -const int64 kSyncRootTrackerID = 100; +const int64_t kInitialChangeID = 1234; +const int64_t kSyncRootTrackerID = 100; const char kSyncRootFolderID[] = "sync_root_folder_id"; // This struct is used to setup initial state of the database in the test and @@ -82,7 +85,7 @@ void ExpectEquivalent(const FileTracker* left, const FileTracker* right) { test_util::ExpectEquivalentTrackers(*left, *right); } -void ExpectEquivalent(int64 left, int64 right) { +void ExpectEquivalent(int64_t left, int64_t right) { EXPECT_EQ(left, right); } @@ -192,7 +195,7 @@ class MetadataDatabaseTest : public testing::TestWithParam<bool> { return "file_id_" + base::Int64ToString(next_file_id_number_++); } - int64 GetTrackerIDByFileID(const std::string& file_id) { + int64_t GetTrackerIDByFileID(const std::string& file_id) { TrackerIDSet trackers; if (metadata_database_->FindTrackersByFileID(file_id, &trackers)) { EXPECT_FALSE(trackers.empty()); @@ -587,7 +590,7 @@ class MetadataDatabaseTest : public testing::TestWithParam<bool> { } SyncStatusCode PopulateInitialData( - int64 largest_change_id, + int64_t largest_change_id, const google_apis::FileResource& sync_root_folder, const ScopedVector<google_apis::FileResource>& app_root_folders) { return metadata_database_->PopulateInitialData( @@ -598,9 +601,7 @@ class MetadataDatabaseTest : public testing::TestWithParam<bool> { tracker->set_tracker_id(GetTrackerIDByFileID(tracker->file_id())); } - int64 current_change_id() const { - return current_change_id_; - } + int64_t current_change_id() const { return current_change_id_; } private: base::ScopedTempDir database_dir_; @@ -609,10 +610,10 @@ class MetadataDatabaseTest : public testing::TestWithParam<bool> { scoped_ptr<leveldb::Env> in_memory_env_; scoped_ptr<MetadataDatabase> metadata_database_; - int64 current_change_id_; - int64 next_tracker_id_; - int64 next_file_id_number_; - int64 next_md5_sequence_number_; + int64_t current_change_id_; + int64_t next_tracker_id_; + int64_t next_file_id_number_; + int64_t next_md5_sequence_number_; DISALLOW_COPY_AND_ASSIGN(MetadataDatabaseTest); }; diff --git a/chrome/browser/sync_file_system/drive_backend/register_app_task.cc b/chrome/browser/sync_file_system/drive_backend/register_app_task.cc index cc2249b..594df14 100644 --- a/chrome/browser/sync_file_system/drive_backend/register_app_task.cc +++ b/chrome/browser/sync_file_system/drive_backend/register_app_task.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync_file_system/drive_backend/register_app_task.h" +#include <stdint.h> + #include "base/bind.h" #include "base/location.h" #include "chrome/browser/sync_file_system/drive_backend/drive_backend_constants.h" @@ -57,7 +59,7 @@ void RegisterAppTask::RunExclusive(const SyncStatusCallback& callback) { return; } - int64 sync_root = metadata_database()->GetSyncRootTrackerID(); + int64_t sync_root = metadata_database()->GetSyncRootTrackerID(); TrackerIDSet trackers; if (!metadata_database()->FindTrackersByParentAndTitle( sync_root, app_id_, &trackers)) { @@ -82,7 +84,7 @@ void RegisterAppTask::RunExclusive(const SyncStatusCallback& callback) { } void RegisterAppTask::CreateAppRootFolder(const SyncStatusCallback& callback) { - int64 sync_root_tracker_id = metadata_database()->GetSyncRootTrackerID(); + int64_t sync_root_tracker_id = metadata_database()->GetSyncRootTrackerID(); FileTracker sync_root_tracker; bool should_success = metadata_database()->FindTrackerByTrackerID( sync_root_tracker_id, diff --git a/chrome/browser/sync_file_system/drive_backend/register_app_task.h b/chrome/browser/sync_file_system/drive_backend/register_app_task.h index dda99c6..d6b7e94 100644 --- a/chrome/browser/sync_file_system/drive_backend/register_app_task.h +++ b/chrome/browser/sync_file_system/drive_backend/register_app_task.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/sync_file_system/drive_backend/sync_task.h" diff --git a/chrome/browser/sync_file_system/drive_backend/register_app_task_unittest.cc b/chrome/browser/sync_file_system/drive_backend/register_app_task_unittest.cc index 6145984..c6efe8d 100644 --- a/chrome/browser/sync_file_system/drive_backend/register_app_task_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/register_app_task_unittest.cc @@ -4,10 +4,14 @@ #include "chrome/browser/sync_file_system/drive_backend/register_app_task.h" +#include <stddef.h> +#include <stdint.h> + #include <vector> #include "base/files/scoped_temp_dir.h" #include "base/format_macros.h" +#include "base/macros.h" #include "base/run_loop.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" @@ -33,7 +37,7 @@ namespace sync_file_system { namespace drive_backend { namespace { -const int64 kSyncRootTrackerID = 100; +const int64_t kSyncRootTrackerID = 100; } // namespace class RegisterAppTaskTest : public testing::Test { @@ -261,8 +265,8 @@ class RegisterAppTaskTest : public testing::Test { std::string sync_root_folder_id_; - int64 next_file_id_; - int64 next_tracker_id_; + int64_t next_file_id_; + int64_t next_tracker_id_; content::TestBrowserThreadBundle browser_threads_; base::ScopedTempDir database_dir_; diff --git a/chrome/browser/sync_file_system/drive_backend/remote_change_processor_on_worker.h b/chrome/browser/sync_file_system/drive_backend/remote_change_processor_on_worker.h index 2e68c09..78e5d4f 100644 --- a/chrome/browser/sync_file_system/drive_backend/remote_change_processor_on_worker.h +++ b/chrome/browser/sync_file_system/drive_backend/remote_change_processor_on_worker.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_REMOTE_CHANGE_PROCESSOR_ON_WORKER_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_REMOTE_CHANGE_PROCESSOR_ON_WORKER_H_ +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" diff --git a/chrome/browser/sync_file_system/drive_backend/remote_change_processor_wrapper.h b/chrome/browser/sync_file_system/drive_backend/remote_change_processor_wrapper.h index 714dfba..bf277cc 100644 --- a/chrome/browser/sync_file_system/drive_backend/remote_change_processor_wrapper.h +++ b/chrome/browser/sync_file_system/drive_backend/remote_change_processor_wrapper.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_REMOTE_CHANGE_PROCESSOR_WRAPPER_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_REMOTE_CHANGE_PROCESSOR_WRAPPER_H_ +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" #include "chrome/browser/sync_file_system/remote_change_processor.h" diff --git a/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer.h b/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer.h index 5609c17..0e5332d 100644 --- a/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer.h +++ b/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer.h @@ -8,6 +8,7 @@ #include <string> #include <vector> +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/sync_file_system/drive_backend/metadata_database.pb.h" #include "chrome/browser/sync_file_system/drive_backend/sync_task.h" diff --git a/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer_unittest.cc b/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer_unittest.cc index 3cd033e0..4d1d0da 100644 --- a/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer_unittest.cc @@ -10,6 +10,7 @@ #include "base/callback.h" #include "base/files/scoped_temp_dir.h" #include "base/logging.h" +#include "base/macros.h" #include "base/run_loop.h" #include "base/thread_task_runner_handle.h" #include "chrome/browser/sync_file_system/drive_backend/drive_backend_constants.h" diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc index 6fbd594..0e496cd 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc +++ b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc @@ -7,6 +7,7 @@ #include <vector> #include "base/bind.h" +#include "base/macros.h" #include "base/metrics/histogram.h" #include "base/thread_task_runner_handle.h" #include "base/threading/sequenced_worker_pool.h" diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine.h b/chrome/browser/sync_file_system/drive_backend/sync_engine.h index 720993e..0d9a874 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_engine.h +++ b/chrome/browser/sync_file_system/drive_backend/sync_engine.h @@ -8,6 +8,7 @@ #include <set> #include <string> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine_context.cc b/chrome/browser/sync_file_system/drive_backend/sync_engine_context.cc index 16f2c01..e26a0eb 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_engine_context.cc +++ b/chrome/browser/sync_file_system/drive_backend/sync_engine_context.cc @@ -4,7 +4,6 @@ #include "chrome/browser/sync_file_system/drive_backend/sync_engine_context.h" -#include "base/basictypes.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/sequenced_task_runner.h" diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine_context.h b/chrome/browser/sync_file_system/drive_backend/sync_engine_context.h index 8aaaf15..982ea36 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_engine_context.h +++ b/chrome/browser/sync_file_system/drive_backend/sync_engine_context.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_CONTEXT_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_CONTEXT_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine_initializer.cc b/chrome/browser/sync_file_system/drive_backend/sync_engine_initializer.cc index 5680e35..26dfd07 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_engine_initializer.cc +++ b/chrome/browser/sync_file_system/drive_backend/sync_engine_initializer.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync_file_system/drive_backend/sync_engine_initializer.h" +#include <stddef.h> + #include "base/bind.h" #include "base/callback.h" #include "base/logging.h" diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine_initializer.h b/chrome/browser/sync_file_system/drive_backend/sync_engine_initializer.h index ee7df71..d540690 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_engine_initializer.h +++ b/chrome/browser/sync_file_system/drive_backend/sync_engine_initializer.h @@ -5,8 +5,11 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_INITIALIZER_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_INITIALIZER_H_ +#include <stdint.h> + #include <string> +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" @@ -110,7 +113,7 @@ class SyncEngineInitializer : public SyncTask { scoped_ptr<MetadataDatabase> metadata_database_; ScopedVector<google_apis::FileResource> app_root_folders_; - int64 largest_change_id_; + int64_t largest_change_id_; std::string root_folder_id_; scoped_ptr<google_apis::FileResource> sync_root_folder_; diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine_initializer_unittest.cc b/chrome/browser/sync_file_system/drive_backend/sync_engine_initializer_unittest.cc index 079dc88..aac13d8 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_engine_initializer_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/sync_engine_initializer_unittest.cc @@ -4,8 +4,12 @@ #include "chrome/browser/sync_file_system/drive_backend/sync_engine_initializer.h" +#include <stddef.h> +#include <stdint.h> + #include "base/bind.h" #include "base/files/scoped_temp_dir.h" +#include "base/macros.h" #include "base/run_loop.h" #include "base/thread_task_runner_handle.h" #include "chrome/browser/sync_file_system/drive_backend/drive_backend_constants.h" @@ -29,7 +33,7 @@ namespace drive_backend { namespace { -const int64 kInitialLargestChangeID = 1234; +const int64_t kInitialLargestChangeID = 1234; } // namespace @@ -163,7 +167,7 @@ class SyncEngineInitializerTest : public testing::Test { } std::string GetSyncRootFolderID() { - int64 sync_root_tracker_id = metadata_database_->GetSyncRootTrackerID(); + int64_t sync_root_tracker_id = metadata_database_->GetSyncRootTrackerID(); FileTracker sync_root_tracker; EXPECT_TRUE(metadata_database_->FindTrackerByTrackerID( sync_root_tracker_id, &sync_root_tracker)); diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine_unittest.cc b/chrome/browser/sync_file_system/drive_backend/sync_engine_unittest.cc index c2cd8ca..84b47b7 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_engine_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/sync_engine_unittest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync_file_system/drive_backend/sync_engine.h" +#include <stddef.h> + #include "base/files/scoped_temp_dir.h" #include "base/macros.h" #include "base/run_loop.h" diff --git a/chrome/browser/sync_file_system/drive_backend/sync_task.h b/chrome/browser/sync_file_system/drive_backend/sync_task.h index d701684..670c214 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_task.h +++ b/chrome/browser/sync_file_system/drive_backend/sync_task.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_H_ +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/sync_file_system/sync_callbacks.h" diff --git a/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc b/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc index 16e1f9b..a576262 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc +++ b/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc @@ -6,6 +6,7 @@ #include "base/bind.h" #include "base/location.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/sequenced_task_runner.h" #include "chrome/browser/sync_file_system/drive_backend/sync_task.h" @@ -189,7 +190,7 @@ void SyncTaskManager::UpdateTaskBlocker( continuation); } -bool SyncTaskManager::IsRunningTask(int64 token_id) const { +bool SyncTaskManager::IsRunningTask(int64_t token_id) const { DCHECK(sequence_checker_.CalledOnValidSequencedThread()); // If the client is gone, all task should be aborted. diff --git a/chrome/browser/sync_file_system/drive_backend/sync_task_manager.h b/chrome/browser/sync_file_system/drive_backend/sync_task_manager.h index 6be0e7b..688c3d9 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_task_manager.h +++ b/chrome/browser/sync_file_system/drive_backend/sync_task_manager.h @@ -5,11 +5,15 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_MANAGER_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_MANAGER_H_ +#include <stddef.h> +#include <stdint.h> + #include <queue> #include <vector> #include "base/callback.h" #include "base/containers/scoped_ptr_hash_map.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" @@ -119,7 +123,7 @@ class SyncTaskManager { scoped_ptr<TaskBlocker> task_blocker, const Continuation& continuation); - bool IsRunningTask(int64 task_token_id) const; + bool IsRunningTask(int64_t task_token_id) const; void DetachFromSequence(); bool ShouldTrackTaskToken() const; @@ -128,7 +132,7 @@ class SyncTaskManager { struct PendingTask { base::Closure task; Priority priority; - int64 seq; + int64_t seq; PendingTask(); PendingTask(const base::Closure& task, Priority pri, int seq); @@ -176,7 +180,8 @@ class SyncTaskManager { // Owns running backgrounded SyncTask to cancel the task on SyncTaskManager // deletion. - base::ScopedPtrHashMap<int64, scoped_ptr<SyncTask>> running_background_tasks_; + base::ScopedPtrHashMap<int64_t, scoped_ptr<SyncTask>> + running_background_tasks_; size_t maximum_background_task_; @@ -185,8 +190,8 @@ class SyncTaskManager { std::priority_queue<PendingTask, std::vector<PendingTask>, PendingTaskComparator> pending_tasks_; - int64 pending_task_seq_; - int64 task_token_seq_; + int64_t pending_task_seq_; + int64_t task_token_seq_; // Absence of |token_| implies a task is running. Incoming tasks should // wait for the task to finish in |pending_tasks_| if |token_| is null. diff --git a/chrome/browser/sync_file_system/drive_backend/sync_task_manager_unittest.cc b/chrome/browser/sync_file_system/drive_backend/sync_task_manager_unittest.cc index 9bb3ee0..c7ee44e 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_task_manager_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/sync_task_manager_unittest.cc @@ -2,12 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stdint.h> + #include <deque> #include <string> -#include "base/basictypes.h" #include "base/bind.h" #include "base/location.h" +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" @@ -57,7 +59,7 @@ class TaskManagerClient : public SyncTaskManager::Client, public base::SupportsWeakPtr<TaskManagerClient> { public: - explicit TaskManagerClient(int64 maximum_background_task) + explicit TaskManagerClient(int64_t maximum_background_task) : maybe_schedule_next_task_count_(0), task_scheduled_count_(0), idle_task_scheduled_count_(0), @@ -169,9 +171,9 @@ class MultihopSyncTask : public ExclusiveTask { class BackgroundTask : public SyncTask { public: struct Stats { - int64 running_background_task; - int64 finished_task; - int64 max_parallel_task; + int64_t running_background_task; + int64_t finished_task; + int64_t max_parallel_task; Stats() : running_background_task(0), diff --git a/chrome/browser/sync_file_system/drive_backend/sync_task_token.cc b/chrome/browser/sync_file_system/drive_backend/sync_task_token.cc index b4d58bf..32cb4e4 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_task_token.cc +++ b/chrome/browser/sync_file_system/drive_backend/sync_task_token.cc @@ -13,9 +13,9 @@ namespace sync_file_system { namespace drive_backend { -const int64 SyncTaskToken::kTestingTaskTokenID = -1; -const int64 SyncTaskToken::kForegroundTaskTokenID = 0; -const int64 SyncTaskToken::kMinimumBackgroundTaskTokenID = 1; +const int64_t SyncTaskToken::kTestingTaskTokenID = -1; +const int64_t SyncTaskToken::kForegroundTaskTokenID = 0; +const int64_t SyncTaskToken::kMinimumBackgroundTaskTokenID = 1; // static scoped_ptr<SyncTaskToken> SyncTaskToken::CreateForTesting( @@ -44,7 +44,7 @@ scoped_ptr<SyncTaskToken> SyncTaskToken::CreateForForegroundTask( scoped_ptr<SyncTaskToken> SyncTaskToken::CreateForBackgroundTask( const base::WeakPtr<SyncTaskManager>& manager, base::SequencedTaskRunner* task_runner, - int64 token_id, + int64_t token_id, scoped_ptr<TaskBlocker> task_blocker) { return make_scoped_ptr(new SyncTaskToken( manager, @@ -144,15 +144,14 @@ scoped_ptr<TaskLogger::TaskLog> SyncTaskToken::PassTaskLog() { SyncTaskToken::SyncTaskToken( const base::WeakPtr<SyncTaskManager>& manager, const scoped_refptr<base::SequencedTaskRunner>& task_runner, - int64 token_id, + int64_t token_id, scoped_ptr<TaskBlocker> task_blocker, const SyncStatusCallback& callback) : manager_(manager), task_runner_(task_runner), token_id_(token_id), callback_(callback), - task_blocker_(task_blocker.Pass()) { -} + task_blocker_(task_blocker.Pass()) {} } // namespace drive_backend } // namespace sync_file_system diff --git a/chrome/browser/sync_file_system/drive_backend/sync_task_token.h b/chrome/browser/sync_file_system/drive_backend/sync_task_token.h index a32fd47..1304ed6 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_task_token.h +++ b/chrome/browser/sync_file_system/drive_backend/sync_task_token.h @@ -5,8 +5,11 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_TOKEN_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_TASK_TOKEN_H_ +#include <stdint.h> + #include "base/callback.h" #include "base/location.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/sync_file_system/sync_callbacks.h" @@ -22,9 +25,9 @@ struct TaskBlocker; // should run exclusively, and held by SyncTaskManager when no task is running. class SyncTaskToken { public: - static const int64 kTestingTaskTokenID; - static const int64 kForegroundTaskTokenID; - static const int64 kMinimumBackgroundTaskTokenID; + static const int64_t kTestingTaskTokenID; + static const int64_t kForegroundTaskTokenID; + static const int64_t kMinimumBackgroundTaskTokenID; static scoped_ptr<SyncTaskToken> CreateForTesting( const SyncStatusCallback& callback); @@ -34,7 +37,7 @@ class SyncTaskToken { static scoped_ptr<SyncTaskToken> CreateForBackgroundTask( const base::WeakPtr<SyncTaskManager>& manager, base::SequencedTaskRunner* task_runner, - int64 token_id, + int64_t token_id, scoped_ptr<TaskBlocker> task_blocker); void UpdateTask(const tracked_objects::Location& location, @@ -54,7 +57,7 @@ class SyncTaskToken { const TaskBlocker* task_blocker() const; void clear_task_blocker(); - int64 token_id() const { return token_id_; } + int64_t token_id() const { return token_id_; } void InitializeTaskLog(const std::string& task_description); void FinalizeTaskLog(const std::string& result_description); @@ -67,14 +70,14 @@ class SyncTaskToken { private: SyncTaskToken(const base::WeakPtr<SyncTaskManager>& manager, const scoped_refptr<base::SequencedTaskRunner>& task_runner, - int64 token_id, + int64_t token_id, scoped_ptr<TaskBlocker> task_blocker, const SyncStatusCallback& callback); base::WeakPtr<SyncTaskManager> manager_; scoped_refptr<base::SequencedTaskRunner> task_runner_; tracked_objects::Location location_; - int64 token_id_; + int64_t token_id_; SyncStatusCallback callback_; scoped_ptr<TaskLogger::TaskLog> task_log_; diff --git a/chrome/browser/sync_file_system/drive_backend/sync_worker.h b/chrome/browser/sync_file_system/drive_backend/sync_worker.h index 7ae7606..45167b6 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_worker.h +++ b/chrome/browser/sync_file_system/drive_backend/sync_worker.h @@ -8,6 +8,7 @@ #include <string> #include "base/files/file_path.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" diff --git a/chrome/browser/sync_file_system/drive_backend/sync_worker_interface.h b/chrome/browser/sync_file_system/drive_backend/sync_worker_interface.h index b053974..4590a4b 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_worker_interface.h +++ b/chrome/browser/sync_file_system/drive_backend/sync_worker_interface.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/sync_file_system/remote_file_sync_service.h" #include "chrome/browser/sync_file_system/sync_action.h" diff --git a/chrome/browser/sync_file_system/drive_backend/sync_worker_unittest.cc b/chrome/browser/sync_file_system/drive_backend/sync_worker_unittest.cc index 6bed5bf..a8754d2 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_worker_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/sync_worker_unittest.cc @@ -6,6 +6,7 @@ #include "base/files/scoped_temp_dir.h" #include "base/location.h" +#include "base/macros.h" #include "base/run_loop.h" #include "base/single_thread_task_runner.h" #include "base/strings/stringprintf.h" diff --git a/chrome/browser/sync_file_system/drive_backend/task_dependency_manager.h b/chrome/browser/sync_file_system/drive_backend/task_dependency_manager.h index f856748..8641106 100644 --- a/chrome/browser/sync_file_system/drive_backend/task_dependency_manager.h +++ b/chrome/browser/sync_file_system/drive_backend/task_dependency_manager.h @@ -5,12 +5,15 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_TASK_DEPENDENCY_MANAGER_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_TASK_DEPENDENCY_MANAGER_H_ +#include <stdint.h> + #include <map> #include <set> #include <string> #include <vector> #include "base/files/file_path.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/sync_file_system/subtree_set.h" @@ -22,7 +25,7 @@ struct TaskBlocker { std::string app_id; std::vector<base::FilePath> paths; std::vector<std::string> file_ids; - std::vector<int64> tracker_ids; + std::vector<int64_t> tracker_ids; TaskBlocker(); ~TaskBlocker(); @@ -53,7 +56,7 @@ class TaskDependencyManager { bool running_exclusive_task_; std::map<std::string, SubtreeSet> paths_by_app_id_; std::set<std::string> file_ids_; - std::set<int64> tracker_ids_; + std::set<int64_t> tracker_ids_; DISALLOW_COPY_AND_ASSIGN(TaskDependencyManager); }; diff --git a/chrome/browser/sync_file_system/drive_backend/tracker_id_set.cc b/chrome/browser/sync_file_system/drive_backend/tracker_id_set.cc index 9fc4bba..0bb272d 100644 --- a/chrome/browser/sync_file_system/drive_backend/tracker_id_set.cc +++ b/chrome/browser/sync_file_system/drive_backend/tracker_id_set.cc @@ -22,7 +22,7 @@ void TrackerIDSet::Insert(const FileTracker& tracker) { InsertInactiveTracker(tracker.tracker_id()); } -void TrackerIDSet::InsertActiveTracker(int64 tracker_id) { +void TrackerIDSet::InsertActiveTracker(int64_t tracker_id) { DCHECK(tracker_id); DCHECK(!active_tracker_); @@ -30,14 +30,14 @@ void TrackerIDSet::InsertActiveTracker(int64 tracker_id) { tracker_ids_.insert(tracker_id); } -void TrackerIDSet::InsertInactiveTracker(int64 tracker_id) { +void TrackerIDSet::InsertInactiveTracker(int64_t tracker_id) { DCHECK(tracker_id); DCHECK_NE(active_tracker_, tracker_id); tracker_ids_.insert(tracker_id); } -void TrackerIDSet::Erase(int64 tracker_id) { +void TrackerIDSet::Erase(int64_t tracker_id) { DCHECK(ContainsKey(tracker_ids_, tracker_id)); if (active_tracker_ == tracker_id) @@ -45,13 +45,13 @@ void TrackerIDSet::Erase(int64 tracker_id) { tracker_ids_.erase(tracker_id); } -void TrackerIDSet::Activate(int64 tracker_id) { +void TrackerIDSet::Activate(int64_t tracker_id) { DCHECK(!active_tracker_); DCHECK(ContainsKey(tracker_ids_, tracker_id)); active_tracker_ = tracker_id; } -void TrackerIDSet::Deactivate(int64 tracker_id) { +void TrackerIDSet::Deactivate(int64_t tracker_id) { DCHECK_EQ(active_tracker_, tracker_id); DCHECK(ContainsKey(tracker_ids_, tracker_id)); active_tracker_ = 0; diff --git a/chrome/browser/sync_file_system/drive_backend/tracker_id_set.h b/chrome/browser/sync_file_system/drive_backend/tracker_id_set.h index 15f4470..15217d2 100644 --- a/chrome/browser/sync_file_system/drive_backend/tracker_id_set.h +++ b/chrome/browser/sync_file_system/drive_backend/tracker_id_set.h @@ -5,9 +5,11 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_TRACKER_ID_SET_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_TRACKER_ID_SET_H_ +#include <stddef.h> +#include <stdint.h> + #include <set> -#include "base/basictypes.h" namespace sync_file_system { namespace drive_backend { @@ -16,7 +18,7 @@ class FileTracker; class TrackerIDSet { public: - typedef std::set<int64> RawTrackerIDSet; + typedef std::set<int64_t> RawTrackerIDSet; typedef RawTrackerIDSet::iterator iterator; typedef RawTrackerIDSet::const_iterator const_iterator; @@ -25,13 +27,13 @@ class TrackerIDSet { bool has_active() const { return !!active_tracker_; } void Insert(const FileTracker& tracker); - void InsertActiveTracker(int64 tracker_id); - void InsertInactiveTracker(int64 tracker_id); - void Erase(int64 tracker_id); - void Activate(int64 tracker_id); - void Deactivate(int64 tracker_id); + void InsertActiveTracker(int64_t tracker_id); + void InsertInactiveTracker(int64_t tracker_id); + void Erase(int64_t tracker_id); + void Activate(int64_t tracker_id); + void Deactivate(int64_t tracker_id); - int64 active_tracker() const { return active_tracker_; } + int64_t active_tracker() const { return active_tracker_; } const RawTrackerIDSet& tracker_set() const { return tracker_ids_; } iterator begin() { return tracker_ids_.begin(); } @@ -42,7 +44,7 @@ class TrackerIDSet { size_t size() const { return tracker_ids_.size(); } private: - int64 active_tracker_; + int64_t active_tracker_; RawTrackerIDSet tracker_ids_; }; diff --git a/chrome/browser/sync_file_system/drive_backend/uninstall_app_task.cc b/chrome/browser/sync_file_system/drive_backend/uninstall_app_task.cc index 1a5bf6f..a6351aa 100644 --- a/chrome/browser/sync_file_system/drive_backend/uninstall_app_task.cc +++ b/chrome/browser/sync_file_system/drive_backend/uninstall_app_task.cc @@ -46,7 +46,7 @@ void UninstallAppTask::RunExclusive(const SyncStatusCallback& callback) { } DCHECK_EQ(RemoteFileSyncService::UNINSTALL_AND_PURGE_REMOTE, uninstall_flag_); - int64 sync_root_tracker_id = metadata_database()->GetSyncRootTrackerID(); + int64_t sync_root_tracker_id = metadata_database()->GetSyncRootTrackerID(); TrackerIDSet trackers; if (!metadata_database()->FindTrackersByParentAndTitle( sync_root_tracker_id, app_id_, &trackers) || @@ -75,7 +75,7 @@ void UninstallAppTask::RunExclusive(const SyncStatusCallback& callback) { } void UninstallAppTask::DidDeleteAppRoot(const SyncStatusCallback& callback, - int64 change_id, + int64_t change_id, google_apis::DriveApiErrorCode error) { SyncStatusCode status = DriveApiErrorCodeToSyncStatusCode(error); if (status != SYNC_STATUS_OK && diff --git a/chrome/browser/sync_file_system/drive_backend/uninstall_app_task.h b/chrome/browser/sync_file_system/drive_backend/uninstall_app_task.h index 2b9e0d7..0f2813d 100644 --- a/chrome/browser/sync_file_system/drive_backend/uninstall_app_task.h +++ b/chrome/browser/sync_file_system/drive_backend/uninstall_app_task.h @@ -5,8 +5,11 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_UNINSTALL_APP_TASK_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_UNINSTALL_APP_TASK_H_ +#include <stdint.h> + #include <string> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/sync_file_system/drive_backend/sync_task.h" @@ -38,7 +41,7 @@ class UninstallAppTask : public ExclusiveTask { private: void DidDeleteAppRoot(const SyncStatusCallback& callback, - int64 change_id, + int64_t change_id, google_apis::DriveApiErrorCode error); bool IsContextReady(); @@ -49,7 +52,7 @@ class UninstallAppTask : public ExclusiveTask { std::string app_id_; UninstallFlag uninstall_flag_; - int64 app_root_tracker_id_; + int64_t app_root_tracker_id_; base::WeakPtrFactory<UninstallAppTask> weak_ptr_factory_; diff --git a/chrome/browser/sync_file_system/fake_remote_change_processor.cc b/chrome/browser/sync_file_system/fake_remote_change_processor.cc index 59f71cf..6401f0e 100644 --- a/chrome/browser/sync_file_system/fake_remote_change_processor.cc +++ b/chrome/browser/sync_file_system/fake_remote_change_processor.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync_file_system/fake_remote_change_processor.h" +#include <stddef.h> + #include "base/bind.h" #include "base/files/file_path.h" #include "base/location.h" diff --git a/chrome/browser/sync_file_system/fake_remote_change_processor.h b/chrome/browser/sync_file_system/fake_remote_change_processor.h index 48bfa8d..08c42ae 100644 --- a/chrome/browser/sync_file_system/fake_remote_change_processor.h +++ b/chrome/browser/sync_file_system/fake_remote_change_processor.h @@ -10,6 +10,7 @@ #include <vector> #include "base/callback.h" +#include "base/macros.h" #include "chrome/browser/sync_file_system/remote_change_processor.h" #include "chrome/browser/sync_file_system/sync_callbacks.h" diff --git a/chrome/browser/sync_file_system/file_change.h b/chrome/browser/sync_file_system/file_change.h index e06db90..826cf2e 100644 --- a/chrome/browser/sync_file_system/file_change.h +++ b/chrome/browser/sync_file_system/file_change.h @@ -5,10 +5,11 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_FILE_CHANGE_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_FILE_CHANGE_H_ +#include <stddef.h> + #include <deque> #include <string> -#include "base/basictypes.h" #include "base/files/file_path.h" #include "chrome/browser/sync_file_system/sync_file_type.h" #include "storage/browser/fileapi/file_system_url.h" diff --git a/chrome/browser/sync_file_system/file_change_unittest.cc b/chrome/browser/sync_file_system/file_change_unittest.cc index 6a3df50..2195caa 100644 --- a/chrome/browser/sync_file_system/file_change_unittest.cc +++ b/chrome/browser/sync_file_system/file_change_unittest.cc @@ -4,7 +4,8 @@ #include "chrome/browser/sync_file_system/file_change.h" -#include "base/basictypes.h" +#include <stddef.h> + #include "base/logging.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/sync_file_system/file_status_observer.h b/chrome/browser/sync_file_system/file_status_observer.h index 352a5ce..bbc5239 100644 --- a/chrome/browser/sync_file_system/file_status_observer.h +++ b/chrome/browser/sync_file_system/file_status_observer.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_FILE_STATUS_OBSERVER_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_FILE_STATUS_OBSERVER_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "chrome/browser/sync_file_system/sync_action.h" #include "chrome/browser/sync_file_system/sync_direction.h" #include "chrome/browser/sync_file_system/sync_file_status.h" diff --git a/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc b/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc index ab18150f..efe1107 100644 --- a/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc +++ b/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync_file_system/local/canned_syncable_file_system.h" +#include <stddef.h> + #include <algorithm> #include <iterator> @@ -12,6 +14,7 @@ #include "base/files/file.h" #include "base/files/file_util.h" #include "base/guid.h" +#include "base/macros.h" #include "base/run_loop.h" #include "base/single_thread_task_runner.h" #include "base/task_runner_util.h" @@ -168,19 +171,22 @@ class WriteHelper { ScopedTextBlob* scoped_text_blob() const { return blob_data_.get(); } - void DidWrite(const base::Callback<void(int64 result)>& completion_callback, - File::Error error, int64 bytes, bool complete) { + void DidWrite(const base::Callback<void(int64_t result)>& completion_callback, + File::Error error, + int64_t bytes, + bool complete) { if (error == base::File::FILE_OK) { bytes_written_ += bytes; if (!complete) return; } - completion_callback.Run(error == base::File::FILE_OK ? - bytes_written_ : static_cast<int64>(error)); + completion_callback.Run(error == base::File::FILE_OK + ? bytes_written_ + : static_cast<int64_t>(error)); } private: - int64 bytes_written_; + int64_t bytes_written_; scoped_ptr<MockBlobURLRequestContext> request_context_; scoped_ptr<ScopedTextBlob> blob_data_; @@ -188,11 +194,11 @@ class WriteHelper { }; void DidGetUsageAndQuota(const storage::StatusCallback& callback, - int64* usage_out, - int64* quota_out, + int64_t* usage_out, + int64_t* quota_out, storage::QuotaStatusCode status, - int64 usage, - int64 quota) { + int64_t usage, + int64_t quota) { *usage_out = usage; *quota_out = quota; callback.Run(status); @@ -373,8 +379,8 @@ File::Error CannedSyncableFileSystem::Move( dest_url)); } -File::Error CannedSyncableFileSystem::TruncateFile( - const FileSystemURL& url, int64 size) { +File::Error CannedSyncableFileSystem::TruncateFile(const FileSystemURL& url, + int64_t size) { return RunOnThread<File::Error>( io_task_runner_.get(), FROM_HERE, @@ -467,27 +473,22 @@ File::Error CannedSyncableFileSystem::ReadDirectory( entries)); } -int64 CannedSyncableFileSystem::Write( +int64_t CannedSyncableFileSystem::Write( net::URLRequestContext* url_request_context, const FileSystemURL& url, scoped_ptr<storage::BlobDataHandle> blob_data_handle) { - return RunOnThread<int64>(io_task_runner_.get(), - FROM_HERE, - base::Bind(&CannedSyncableFileSystem::DoWrite, - base::Unretained(this), - url_request_context, - url, - base::Passed(&blob_data_handle))); + return RunOnThread<int64_t>( + io_task_runner_.get(), FROM_HERE, + base::Bind(&CannedSyncableFileSystem::DoWrite, base::Unretained(this), + url_request_context, url, base::Passed(&blob_data_handle))); } -int64 CannedSyncableFileSystem::WriteString( - const FileSystemURL& url, const std::string& data) { - return RunOnThread<int64>(io_task_runner_.get(), - FROM_HERE, - base::Bind(&CannedSyncableFileSystem::DoWriteString, - base::Unretained(this), - url, - data)); +int64_t CannedSyncableFileSystem::WriteString(const FileSystemURL& url, + const std::string& data) { + return RunOnThread<int64_t>( + io_task_runner_.get(), FROM_HERE, + base::Bind(&CannedSyncableFileSystem::DoWriteString, + base::Unretained(this), url, data)); } File::Error CannedSyncableFileSystem::DeleteFileSystem() { @@ -502,8 +503,8 @@ File::Error CannedSyncableFileSystem::DeleteFileSystem() { } storage::QuotaStatusCode CannedSyncableFileSystem::GetUsageAndQuota( - int64* usage, - int64* quota) { + int64_t* usage, + int64_t* quota) { return RunOnThread<storage::QuotaStatusCode>( io_task_runner_.get(), FROM_HERE, @@ -610,9 +611,9 @@ void CannedSyncableFileSystem::DoMove( src_url, dest_url, storage::FileSystemOperation::OPTION_NONE, callback); } -void CannedSyncableFileSystem::DoTruncateFile( - const FileSystemURL& url, int64 size, - const StatusCallback& callback) { +void CannedSyncableFileSystem::DoTruncateFile(const FileSystemURL& url, + int64_t size, + const StatusCallback& callback) { EXPECT_TRUE(io_task_runner_->RunsTasksOnCurrentThread()); EXPECT_TRUE(is_filesystem_opened_); operation_runner()->Truncate(url, size, callback); @@ -713,8 +714,8 @@ void CannedSyncableFileSystem::DoWriteString( } void CannedSyncableFileSystem::DoGetUsageAndQuota( - int64* usage, - int64* quota, + int64_t* usage, + int64_t* quota, const storage::StatusCallback& callback) { // crbug.com/349708 TRACE_EVENT0("io", "CannedSyncableFileSystem::DoGetUsageAndQuota"); diff --git a/chrome/browser/sync_file_system/local/canned_syncable_file_system.h b/chrome/browser/sync_file_system/local/canned_syncable_file_system.h index cb95f7a..57bfa47 100644 --- a/chrome/browser/sync_file_system/local/canned_syncable_file_system.h +++ b/chrome/browser/sync_file_system/local/canned_syncable_file_system.h @@ -5,12 +5,15 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_CANNED_SYNCABLE_FILE_SYSTEM_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_CANNED_SYNCABLE_FILE_SYSTEM_H_ +#include <stdint.h> + #include <string> #include <vector> #include "base/callback_forward.h" #include "base/files/file.h" #include "base/files/scoped_temp_dir.h" +#include "base/macros.h" #include "base/observer_list_threadsafe.h" #include "chrome/browser/sync_file_system/local/local_file_sync_status.h" #include "chrome/browser/sync_file_system/sync_status_code.h" @@ -62,7 +65,7 @@ class CannedSyncableFileSystem base::File::Error result)> OpenFileSystemCallback; typedef base::Callback<void(base::File::Error)> StatusCallback; - typedef base::Callback<void(int64)> WriteCallback; + typedef base::Callback<void(int64_t)> WriteCallback; typedef storage::FileSystemOperation::FileEntryList FileEntryList; enum QuotaMode { @@ -121,7 +124,8 @@ class CannedSyncableFileSystem const storage::FileSystemURL& dest_url); base::File::Error Move(const storage::FileSystemURL& src_url, const storage::FileSystemURL& dest_url); - base::File::Error TruncateFile(const storage::FileSystemURL& url, int64 size); + base::File::Error TruncateFile(const storage::FileSystemURL& url, + int64_t size); base::File::Error TouchFile(const storage::FileSystemURL& url, const base::Time& last_access_time, const base::Time& last_modified_time); @@ -138,16 +142,17 @@ class CannedSyncableFileSystem FileEntryList* entries); // Returns the # of bytes written (>=0) or an error code (<0). - int64 Write(net::URLRequestContext* url_request_context, - const storage::FileSystemURL& url, - scoped_ptr<storage::BlobDataHandle> blob_data_handle); - int64 WriteString(const storage::FileSystemURL& url, const std::string& data); + int64_t Write(net::URLRequestContext* url_request_context, + const storage::FileSystemURL& url, + scoped_ptr<storage::BlobDataHandle> blob_data_handle); + int64_t WriteString(const storage::FileSystemURL& url, + const std::string& data); // Purges the file system local storage. base::File::Error DeleteFileSystem(); // Retrieves the quota and usage. - storage::QuotaStatusCode GetUsageAndQuota(int64* usage, int64* quota); + storage::QuotaStatusCode GetUsageAndQuota(int64_t* usage, int64_t* quota); // ChangeTracker related methods. They run on file task runner. void GetChangedURLsInTracker(storage::FileSystemURLSet* urls); @@ -176,7 +181,7 @@ class CannedSyncableFileSystem const storage::FileSystemURL& dest_url, const StatusCallback& callback); void DoTruncateFile(const storage::FileSystemURL& url, - int64 size, + int64_t size, const StatusCallback& callback); void DoTouchFile(const storage::FileSystemURL& url, const base::Time& last_access_time, @@ -206,8 +211,8 @@ class CannedSyncableFileSystem void DoWriteString(const storage::FileSystemURL& url, const std::string& data, const WriteCallback& callback); - void DoGetUsageAndQuota(int64* usage, - int64* quota, + void DoGetUsageAndQuota(int64_t* usage, + int64_t* quota, const storage::StatusCallback& callback); private: diff --git a/chrome/browser/sync_file_system/local/local_file_change_tracker.cc b/chrome/browser/sync_file_system/local/local_file_change_tracker.cc index 6558bce..e67d97b 100644 --- a/chrome/browser/sync_file_system/local/local_file_change_tracker.cc +++ b/chrome/browser/sync_file_system/local/local_file_change_tracker.cc @@ -4,10 +4,13 @@ #include "chrome/browser/sync_file_system/local/local_file_change_tracker.h" +#include <stddef.h> + #include <queue> #include "base/location.h" #include "base/logging.h" +#include "base/macros.h" #include "base/sequenced_task_runner.h" #include "base/stl_util.h" #include "chrome/browser/sync_file_system/local/local_file_sync_status.h" @@ -305,7 +308,7 @@ void LocalFileChangeTracker::ResetForFileSystem(const GURL& origin, void LocalFileChangeTracker::UpdateNumChanges() { base::AutoLock lock(num_changes_lock_); - num_changes_ = static_cast<int64>(change_seqs_.size()); + num_changes_ = static_cast<int64_t>(change_seqs_.size()); } void LocalFileChangeTracker::GetAllChangedURLs(FileSystemURLSet* urls) { diff --git a/chrome/browser/sync_file_system/local/local_file_change_tracker.h b/chrome/browser/sync_file_system/local/local_file_change_tracker.h index d38c8fc..d907eb2 100644 --- a/chrome/browser/sync_file_system/local/local_file_change_tracker.h +++ b/chrome/browser/sync_file_system/local/local_file_change_tracker.h @@ -5,13 +5,15 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_CHANGE_TRACKER_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_CHANGE_TRACKER_H_ +#include <stdint.h> + #include <deque> #include <map> #include <string> -#include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/files/file_path.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/synchronization/lock.h" @@ -52,7 +54,7 @@ class LocalFileChangeTracker : public storage::FileUpdateObserver, // FileUpdateObserver overrides. void OnStartUpdate(const storage::FileSystemURL& url) override; - void OnUpdate(const storage::FileSystemURL& url, int64 delta) override {} + void OnUpdate(const storage::FileSystemURL& url, int64_t delta) override {} void OnEndUpdate(const storage::FileSystemURL& url) override; // FileChangeObserver overrides. @@ -113,7 +115,7 @@ class LocalFileChangeTracker : public storage::FileUpdateObserver, void ResetForFileSystem(const GURL& origin, storage::FileSystemType type); // This method is (exceptionally) thread-safe. - int64 num_changes() const { + int64_t num_changes() const { base::AutoLock lock(num_changes_lock_); return num_changes_; } @@ -130,13 +132,13 @@ class LocalFileChangeTracker : public storage::FileUpdateObserver, ChangeInfo(); ~ChangeInfo(); FileChangeList change_list; - int64 change_seq; + int64_t change_seq; }; typedef std::map<storage::FileSystemURL, ChangeInfo, storage::FileSystemURL::Comparator> FileChangeMap; - typedef std::map<int64, storage::FileSystemURL> ChangeSeqMap; + typedef std::map<int64_t, storage::FileSystemURL> ChangeSeqMap; void UpdateNumChanges(); @@ -182,10 +184,10 @@ class LocalFileChangeTracker : public storage::FileUpdateObserver, // Change sequence number. Briefly gives a hint about the order of changes, // but they are updated when a new change comes on the same file (as // well as Drive's changestamps). - int64 current_change_seq_number_; + int64_t current_change_seq_number_; // This can be accessed on any threads (with num_changes_lock_). - int64 num_changes_; + int64_t num_changes_; mutable base::Lock num_changes_lock_; DISALLOW_COPY_AND_ASSIGN(LocalFileChangeTracker); diff --git a/chrome/browser/sync_file_system/local/local_file_change_tracker_unittest.cc b/chrome/browser/sync_file_system/local/local_file_change_tracker_unittest.cc index 8c91a3a..4a0e4e3 100644 --- a/chrome/browser/sync_file_system/local/local_file_change_tracker_unittest.cc +++ b/chrome/browser/sync_file_system/local/local_file_change_tracker_unittest.cc @@ -4,11 +4,13 @@ #include "chrome/browser/sync_file_system/local/local_file_change_tracker.h" +#include <stdint.h> + #include <deque> #include <set> -#include "base/basictypes.h" #include "base/files/scoped_temp_dir.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/stl_util.h" @@ -294,9 +296,9 @@ TEST_F(LocalFileChangeTrackerTest, RestoreCreateAndModifyChanges) { file_system_.TruncateFile(URL(kPath3), 1)); // Modifies the file. EXPECT_EQ(base::File::FILE_OK, file_system_.CreateFile(URL(kPath4))); // Creates another file. - EXPECT_EQ(static_cast<int64>(kData.size()), // Modifies the file. - file_system_.Write(&url_request_context, - URL(kPath4), blob.GetBlobDataHandle())); + EXPECT_EQ(static_cast<int64_t>(kData.size()), // Modifies the file. + file_system_.Write(&url_request_context, URL(kPath4), + blob.GetBlobDataHandle())); // Verify the changes. file_system_.GetChangedURLsInTracker(&urls); @@ -445,8 +447,8 @@ TEST_F(LocalFileChangeTrackerTest, RestoreCopyChanges) { file_system_.TruncateFile(URL(kPath3), 1)); // Modifies the file. EXPECT_EQ(base::File::FILE_OK, file_system_.CreateFile(URL(kPath4))); // Creates another file. - EXPECT_EQ(static_cast<int64>(kData.size()), - file_system_.Write(&url_request_context, // Modifies the file. + EXPECT_EQ(static_cast<int64_t>(kData.size()), + file_system_.Write(&url_request_context, // Modifies the file. URL(kPath4), blob.GetBlobDataHandle())); // Verify we have 5 changes for preparation. diff --git a/chrome/browser/sync_file_system/local/local_file_sync_context.h b/chrome/browser/sync_file_system/local/local_file_sync_context.h index 1cfc04d..f0dc383 100644 --- a/chrome/browser/sync_file_system/local/local_file_sync_context.h +++ b/chrome/browser/sync_file_system/local/local_file_sync_context.h @@ -11,11 +11,11 @@ #include <string> #include <vector> -#include "base/basictypes.h" #include "base/callback.h" #include "base/files/file.h" #include "base/files/file_path.h" #include "base/logging.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" diff --git a/chrome/browser/sync_file_system/local/local_file_sync_context_unittest.cc b/chrome/browser/sync_file_system/local/local_file_sync_context_unittest.cc index 82b4989..bcca037 100644 --- a/chrome/browser/sync_file_system/local/local_file_sync_context_unittest.cc +++ b/chrome/browser/sync_file_system/local/local_file_sync_context_unittest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync_file_system/local/local_file_sync_context.h" +#include <stdint.h> + #include <vector> #include "base/bind.h" @@ -11,6 +13,7 @@ #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/location.h" +#include "base/macros.h" #include "base/message_loop/message_loop.h" #include "base/single_thread_task_runner.h" #include "base/stl_util.h" @@ -610,8 +613,8 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForDeletion) { ASSERT_EQ(base::File::FILE_OK, file_system.OpenFileSystem()); // Record the initial usage (likely 0). - int64 initial_usage = -1; - int64 quota = -1; + int64_t initial_usage = -1; + int64_t quota = -1; EXPECT_EQ(storage::kQuotaStatusOk, file_system.GetUsageAndQuota(&initial_usage, "a)); @@ -637,7 +640,7 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForDeletion) { } // At this point the usage must be greater than the initial usage. - int64 new_usage = -1; + int64_t new_usage = -1; EXPECT_EQ(storage::kQuotaStatusOk, file_system.GetUsageAndQuota(&new_usage, "a)); EXPECT_GT(new_usage, initial_usage); @@ -698,8 +701,8 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForDeletion_ForRoot) { ASSERT_EQ(base::File::FILE_OK, file_system.OpenFileSystem()); // Record the initial usage (likely 0). - int64 initial_usage = -1; - int64 quota = -1; + int64_t initial_usage = -1; + int64_t quota = -1; EXPECT_EQ(storage::kQuotaStatusOk, file_system.GetUsageAndQuota(&initial_usage, "a)); @@ -713,7 +716,7 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForDeletion_ForRoot) { EXPECT_EQ(base::File::FILE_OK, file_system.CreateFile(kChild)); // At this point the usage must be greater than the initial usage. - int64 new_usage = -1; + int64_t new_usage = -1; EXPECT_EQ(storage::kQuotaStatusOk, file_system.GetUsageAndQuota(&new_usage, "a)); EXPECT_GT(new_usage, initial_usage); @@ -777,7 +780,7 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForAddOrUpdate) { // Create kFile1 and populate it with kTestFileData0. EXPECT_EQ(base::File::FILE_OK, file_system.CreateFile(kFile1)); - EXPECT_EQ(static_cast<int64>(arraysize(kTestFileData0) - 1), + EXPECT_EQ(static_cast<int64_t>(arraysize(kTestFileData0) - 1), file_system.WriteString(kFile1, kTestFileData0)); // kFile2 and kDir are not there yet. @@ -805,8 +808,8 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForAddOrUpdate) { arraysize(kTestFileData2) - 1)); // Record the usage. - int64 usage = -1, new_usage = -1; - int64 quota = -1; + int64_t usage = -1, new_usage = -1; + int64_t quota = -1; EXPECT_EQ(storage::kQuotaStatusOk, file_system.GetUsageAndQuota(&usage, "a)); @@ -884,7 +887,7 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForAddOrUpdate) { EXPECT_EQ(storage::kQuotaStatusOk, file_system.GetUsageAndQuota(&new_usage, "a)); EXPECT_GT(new_usage, - static_cast<int64>(usage + arraysize(kTestFileData2) - 1)); + static_cast<int64_t>(usage + arraysize(kTestFileData2) - 1)); // The changes applied by ApplyRemoteChange should not be recorded in // the change tracker. diff --git a/chrome/browser/sync_file_system/local/local_file_sync_service.cc b/chrome/browser/sync_file_system/local/local_file_sync_service.cc index b9c76f7..d28c141 100644 --- a/chrome/browser/sync_file_system/local/local_file_sync_service.cc +++ b/chrome/browser/sync_file_system/local/local_file_sync_service.cc @@ -70,8 +70,8 @@ bool LocalFileSyncService::OriginChangeMap::NextOriginToProcess(GURL* origin) { return false; } -int64 LocalFileSyncService::OriginChangeMap::GetTotalChangeCount() const { - int64 num_changes = 0; +int64_t LocalFileSyncService::OriginChangeMap::GetTotalChangeCount() const { + int64_t num_changes = 0; for (Map::const_iterator iter = change_count_map_.begin(); iter != change_count_map_.end(); ++iter) { if (ContainsKey(disabled_origins_, iter->first)) @@ -82,7 +82,8 @@ int64 LocalFileSyncService::OriginChangeMap::GetTotalChangeCount() const { } void LocalFileSyncService::OriginChangeMap::SetOriginChangeCount( - const GURL& origin, int64 changes) { + const GURL& origin, + int64_t changes) { if (changes != 0) { change_count_map_[origin] = changes; return; @@ -329,7 +330,7 @@ void LocalFileSyncService::OnChangesAvailableInOrigins( } if (!need_notification) return; - int64 num_changes = origin_change_map_.GetTotalChangeCount(); + int64_t num_changes = origin_change_map_.GetTotalChangeCount(); FOR_EACH_OBSERVER(Observer, change_observers_, OnLocalChangeAvailable(num_changes)); } @@ -376,7 +377,7 @@ void LocalFileSyncService::DidInitializeFileSystemContext( DCHECK(backend->change_tracker()); origin_change_map_.SetOriginChangeCount( app_origin, backend->change_tracker()->num_changes()); - int64 num_changes = origin_change_map_.GetTotalChangeCount(); + int64_t num_changes = origin_change_map_.GetTotalChangeCount(); FOR_EACH_OBSERVER(Observer, change_observers_, OnLocalChangeAvailable(num_changes)); } diff --git a/chrome/browser/sync_file_system/local/local_file_sync_service.h b/chrome/browser/sync_file_system/local/local_file_sync_service.h index 26c5949..3c6a531 100644 --- a/chrome/browser/sync_file_system/local/local_file_sync_service.h +++ b/chrome/browser/sync_file_system/local/local_file_sync_service.h @@ -5,12 +5,14 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_SYNC_SERVICE_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_SYNC_SERVICE_H_ +#include <stdint.h> + #include <map> #include <set> #include <string> -#include "base/basictypes.h" #include "base/callback.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" @@ -60,7 +62,7 @@ class LocalFileSyncService // |pending_changes_hint| indicates the pending queue length to help sync // scheduling but the value may not be accurately reflect the real-time // value. - virtual void OnLocalChangeAvailable(int64 pending_changes_hint) = 0; + virtual void OnLocalChangeAvailable(int64_t pending_changes_hint) = 0; private: DISALLOW_COPY_AND_ASSIGN(Observer); @@ -157,7 +159,7 @@ class LocalFileSyncService class OriginChangeMap { public: - typedef std::map<GURL, int64> Map; + typedef std::map<GURL, int64_t> Map; OriginChangeMap(); ~OriginChangeMap(); @@ -167,10 +169,10 @@ class LocalFileSyncService // Returns false if no origins to process. bool NextOriginToProcess(GURL* origin); - int64 GetTotalChangeCount() const; + int64_t GetTotalChangeCount() const; // Update change_count_map_ for |origin|. - void SetOriginChangeCount(const GURL& origin, int64 changes); + void SetOriginChangeCount(const GURL& origin, int64_t changes); void SetOriginEnabled(const GURL& origin, bool enabled); diff --git a/chrome/browser/sync_file_system/local/local_file_sync_service_unittest.cc b/chrome/browser/sync_file_system/local/local_file_sync_service_unittest.cc index 67c7088..d18d4d1 100644 --- a/chrome/browser/sync_file_system/local/local_file_sync_service_unittest.cc +++ b/chrome/browser/sync_file_system/local/local_file_sync_service_unittest.cc @@ -2,16 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stdint.h> + #include <vector> -#include "base/basictypes.h" #include "base/bind.h" #include "base/files/file_util.h" #include "base/location.h" +#include "base/macros.h" #include "base/run_loop.h" #include "base/stl_util.h" #include "base/thread_task_runner_handle.h" #include "base/threading/thread.h" +#include "build/build_config.h" #include "chrome/browser/sync_file_system/file_change.h" #include "chrome/browser/sync_file_system/local/canned_syncable_file_system.h" #include "chrome/browser/sync_file_system/local/local_file_change_tracker.h" @@ -148,7 +151,7 @@ class LocalFileSyncServiceTest } // LocalChangeObserver overrides. - void OnLocalChangeAvailable(int64 num_changes) override { + void OnLocalChangeAvailable(int64_t num_changes) override { num_changes_ = num_changes; } @@ -190,7 +193,7 @@ class LocalFileSyncServiceTest return sync_status; } - int64 GetNumChangesInTracker() const { + int64_t GetNumChangesInTracker() const { return file_system_->backend()->change_tracker()->num_changes(); } @@ -203,7 +206,7 @@ class LocalFileSyncServiceTest scoped_ptr<CannedSyncableFileSystem> file_system_; scoped_ptr<LocalFileSyncService> local_service_; - int64 num_changes_; + int64_t num_changes_; }; // More complete tests for PrepareForProcessRemoteChange and ApplyRemoteChange @@ -597,11 +600,9 @@ class OriginChangeMapTest : public testing::Test { return map_.NextOriginToProcess(origin); } - int64 GetTotalChangeCount() const { - return map_.GetTotalChangeCount(); - } + int64_t GetTotalChangeCount() const { return map_.GetTotalChangeCount(); } - void SetOriginChangeCount(const GURL& origin, int64 changes) { + void SetOriginChangeCount(const GURL& origin, int64_t changes) { map_.SetOriginChangeCount(origin, changes); } diff --git a/chrome/browser/sync_file_system/local/local_file_sync_status.h b/chrome/browser/sync_file_system/local/local_file_sync_status.h index 1556d97..acd27e1 100644 --- a/chrome/browser/sync_file_system/local/local_file_sync_status.h +++ b/chrome/browser/sync_file_system/local/local_file_sync_status.h @@ -5,12 +5,14 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_SYNC_STATUS_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_LOCAL_FILE_SYNC_STATUS_H_ +#include <stdint.h> + #include <map> #include <set> -#include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/observer_list.h" #include "base/threading/non_thread_safe.h" #include "storage/browser/fileapi/file_system_url.h" @@ -83,7 +85,7 @@ class LocalFileSyncStatus typedef std::set<base::FilePath> PathSet; typedef std::map<OriginAndType, PathSet> URLSet; - typedef std::map<base::FilePath, int64> PathBucket; + typedef std::map<base::FilePath, int64_t> PathBucket; typedef std::map<OriginAndType, PathBucket> URLBucket; bool IsChildOrParentWriting(const storage::FileSystemURL& url) const; diff --git a/chrome/browser/sync_file_system/local/local_file_sync_status_unittest.cc b/chrome/browser/sync_file_system/local/local_file_sync_status_unittest.cc index 5e29098..8b1d453 100644 --- a/chrome/browser/sync_file_system/local/local_file_sync_status_unittest.cc +++ b/chrome/browser/sync_file_system/local/local_file_sync_status_unittest.cc @@ -4,7 +4,6 @@ #include "chrome/browser/sync_file_system/local/local_file_sync_status.h" -#include "base/basictypes.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" diff --git a/chrome/browser/sync_file_system/local/local_origin_change_observer.h b/chrome/browser/sync_file_system/local/local_origin_change_observer.h index 8d42347..3213114 100644 --- a/chrome/browser/sync_file_system/local/local_origin_change_observer.h +++ b/chrome/browser/sync_file_system/local/local_origin_change_observer.h @@ -7,7 +7,7 @@ #include <set> -#include "base/basictypes.h" +#include "base/macros.h" #include "url/gurl.h" namespace sync_file_system { diff --git a/chrome/browser/sync_file_system/local/mock_sync_status_observer.h b/chrome/browser/sync_file_system/local/mock_sync_status_observer.h index 353c312..193462f 100644 --- a/chrome/browser/sync_file_system/local/mock_sync_status_observer.h +++ b/chrome/browser/sync_file_system/local/mock_sync_status_observer.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_MOCK_SYNC_STATUS_OBSERVER_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_MOCK_SYNC_STATUS_OBSERVER_H_ +#include "base/macros.h" #include "chrome/browser/sync_file_system/local/local_file_sync_status.h" #include "testing/gmock/include/gmock/gmock.h" diff --git a/chrome/browser/sync_file_system/local/root_delete_helper.h b/chrome/browser/sync_file_system/local/root_delete_helper.h index a3bfa9d..1c8a383 100644 --- a/chrome/browser/sync_file_system/local/root_delete_helper.h +++ b/chrome/browser/sync_file_system/local/root_delete_helper.h @@ -5,9 +5,9 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_ROOT_DELETE_HELPER_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_ROOT_DELETE_HELPER_H_ -#include "base/basictypes.h" #include "base/callback.h" #include "base/files/file.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "storage/browser/fileapi/file_system_url.h" diff --git a/chrome/browser/sync_file_system/local/sync_file_system_backend.cc b/chrome/browser/sync_file_system/local/sync_file_system_backend.cc index b57995d..fbb9444 100644 --- a/chrome/browser/sync_file_system/local/sync_file_system_backend.cc +++ b/chrome/browser/sync_file_system/local/sync_file_system_backend.cc @@ -189,8 +189,8 @@ bool SyncFileSystemBackend::HasInplaceCopyImplementation( scoped_ptr<storage::FileStreamReader> SyncFileSystemBackend::CreateFileStreamReader( const storage::FileSystemURL& url, - int64 offset, - int64 max_bytes_to_read, + int64_t offset, + int64_t max_bytes_to_read, const base::Time& expected_modification_time, storage::FileSystemContext* context) const { DCHECK(CanHandleType(url.type())); @@ -201,7 +201,7 @@ SyncFileSystemBackend::CreateFileStreamReader( scoped_ptr<storage::FileStreamWriter> SyncFileSystemBackend::CreateFileStreamWriter( const storage::FileSystemURL& url, - int64 offset, + int64_t offset, storage::FileSystemContext* context) const { DCHECK(CanHandleType(url.type())); return GetDelegate()->CreateFileStreamWriter( diff --git a/chrome/browser/sync_file_system/local/sync_file_system_backend.h b/chrome/browser/sync_file_system/local/sync_file_system_backend.h index 4b47e28..043f995 100644 --- a/chrome/browser/sync_file_system/local/sync_file_system_backend.h +++ b/chrome/browser/sync_file_system/local/sync_file_system_backend.h @@ -5,6 +5,9 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNC_FILE_SYSTEM_BACKEND_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNC_FILE_SYSTEM_BACKEND_H_ +#include <stdint.h> + +#include "base/macros.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync_file_system/sync_callbacks.h" #include "chrome/browser/sync_file_system/sync_status_code.h" @@ -49,13 +52,13 @@ class SyncFileSystemBackend : public storage::FileSystemBackend { storage::FileSystemType type) const override; scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( const storage::FileSystemURL& url, - int64 offset, - int64 max_bytes_to_read, + int64_t offset, + int64_t max_bytes_to_read, const base::Time& expected_modification_time, storage::FileSystemContext* context) const override; scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter( const storage::FileSystemURL& url, - int64 offset, + int64_t offset, storage::FileSystemContext* context) const override; storage::FileSystemQuotaUtil* GetQuotaUtil() override; const storage::UpdateObserverList* GetUpdateObservers( diff --git a/chrome/browser/sync_file_system/local/syncable_file_operation_runner.cc b/chrome/browser/sync_file_system/local/syncable_file_operation_runner.cc index 11053a2..de4e316 100644 --- a/chrome/browser/sync_file_system/local/syncable_file_operation_runner.cc +++ b/chrome/browser/sync_file_system/local/syncable_file_operation_runner.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync_file_system/local/syncable_file_operation_runner.h" +#include <stddef.h> + #include <algorithm> #include <functional> @@ -43,7 +45,7 @@ void SyncableFileOperationRunner::Task::Start(LocalFileSyncStatus* status) { // SyncableFileOperationRunner ------------------------------------------------- SyncableFileOperationRunner::SyncableFileOperationRunner( - int64 max_inflight_tasks, + int64_t max_inflight_tasks, LocalFileSyncStatus* sync_status) : sync_status_(sync_status), max_inflight_tasks_(max_inflight_tasks), diff --git a/chrome/browser/sync_file_system/local/syncable_file_operation_runner.h b/chrome/browser/sync_file_system/local/syncable_file_operation_runner.h index 0005ab2..e54e702 100644 --- a/chrome/browser/sync_file_system/local/syncable_file_operation_runner.h +++ b/chrome/browser/sync_file_system/local/syncable_file_operation_runner.h @@ -5,11 +5,13 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNCABLE_FILE_OPERATION_RUNNER_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNCABLE_FILE_OPERATION_RUNNER_H_ +#include <stdint.h> + #include <list> #include <vector> -#include "base/basictypes.h" #include "base/callback.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/threading/non_thread_safe.h" @@ -52,7 +54,7 @@ class SyncableFileOperationRunner DISALLOW_COPY_AND_ASSIGN(Task); }; - SyncableFileOperationRunner(int64 max_inflight_tasks, + SyncableFileOperationRunner(int64_t max_inflight_tasks, LocalFileSyncStatus* sync_status); ~SyncableFileOperationRunner() override; @@ -78,11 +80,11 @@ class SyncableFileOperationRunner LocalFileSyncStatus* sync_status() const { return sync_status_; } - int64 num_pending_tasks() const { - return static_cast<int64>(pending_tasks_.size()); + int64_t num_pending_tasks() const { + return static_cast<int64_t>(pending_tasks_.size()); } - int64 num_inflight_tasks() const { return num_inflight_tasks_; } + int64_t num_inflight_tasks() const { return num_inflight_tasks_; } private: // Returns true if we should start more tasks. @@ -93,8 +95,8 @@ class SyncableFileOperationRunner std::list<Task*> pending_tasks_; - const int64 max_inflight_tasks_; - int64 num_inflight_tasks_; + const int64_t max_inflight_tasks_; + int64_t num_inflight_tasks_; DISALLOW_COPY_AND_ASSIGN(SyncableFileOperationRunner); }; diff --git a/chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc b/chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc index 2391dcc..8ccf44d 100644 --- a/chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc +++ b/chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc @@ -2,12 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> +#include <stdint.h> + #include <string> -#include "base/basictypes.h" #include "base/files/file.h" #include "base/files/file_util.h" #include "base/location.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" @@ -119,7 +122,9 @@ class SyncableFileOperationRunnerTest : public testing::Test { } void DidWrite(const tracked_objects::Location& location, - File::Error status, int64 bytes, bool complete) { + File::Error status, + int64_t bytes, + bool complete) { SCOPED_TRACE(testing::Message() << location.ToString()); write_status_ = status; write_bytes_ += bytes; diff --git a/chrome/browser/sync_file_system/local/syncable_file_system_operation.cc b/chrome/browser/sync_file_system/local/syncable_file_system_operation.cc index 1c19b9c..56243ee 100644 --- a/chrome/browser/sync_file_system/local/syncable_file_system_operation.cc +++ b/chrome/browser/sync_file_system/local/syncable_file_system_operation.cc @@ -5,6 +5,7 @@ #include "chrome/browser/sync_file_system/local/syncable_file_system_operation.h" #include "base/logging.h" +#include "base/macros.h" #include "chrome/browser/sync_file_system/local/local_file_sync_context.h" #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" #include "chrome/browser/sync_file_system/local/syncable_file_operation_runner.h" @@ -237,9 +238,9 @@ void SyncableFileSystemOperation::Write( operation_runner_->PostOperationTask(task.Pass()); } -void SyncableFileSystemOperation::Truncate( - const FileSystemURL& url, int64 length, - const StatusCallback& callback) { +void SyncableFileSystemOperation::Truncate(const FileSystemURL& url, + int64_t length, + const StatusCallback& callback) { DCHECK(CalledOnValidThread()); if (!operation_runner_.get()) { callback.Run(base::File::FILE_ERROR_NOT_FOUND); @@ -374,11 +375,10 @@ void SyncableFileSystemOperation::DidFinish(base::File::Error status) { completion_callback_.Run(status); } -void SyncableFileSystemOperation::DidWrite( - const WriteCallback& callback, - base::File::Error result, - int64 bytes, - bool complete) { +void SyncableFileSystemOperation::DidWrite(const WriteCallback& callback, + base::File::Error result, + int64_t bytes, + bool complete) { DCHECK(CalledOnValidThread()); if (!complete) { callback.Run(result, bytes, complete); diff --git a/chrome/browser/sync_file_system/local/syncable_file_system_operation.h b/chrome/browser/sync_file_system/local/syncable_file_system_operation.h index b93ded8..71491dc 100644 --- a/chrome/browser/sync_file_system/local/syncable_file_system_operation.h +++ b/chrome/browser/sync_file_system/local/syncable_file_system_operation.h @@ -5,9 +5,12 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNCABLE_FILE_SYSTEM_OPERATION_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNCABLE_FILE_SYSTEM_OPERATION_H_ +#include <stdint.h> + #include <vector> #include "base/callback.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" @@ -66,7 +69,7 @@ class SyncableFileSystemOperation scoped_ptr<net::URLRequest> blob_request, const WriteCallback& callback) override; void Truncate(const storage::FileSystemURL& url, - int64 length, + int64_t length, const StatusCallback& callback) override; void TouchFile(const storage::FileSystemURL& url, const base::Time& last_access_time, @@ -112,7 +115,7 @@ class SyncableFileSystemOperation void DidFinish(base::File::Error status); void DidWrite(const WriteCallback& callback, base::File::Error result, - int64 bytes, + int64_t bytes, bool complete); void OnCancelled(); diff --git a/chrome/browser/sync_file_system/local/syncable_file_system_unittest.cc b/chrome/browser/sync_file_system/local/syncable_file_system_unittest.cc index 4e1d784..9234744 100644 --- a/chrome/browser/sync_file_system/local/syncable_file_system_unittest.cc +++ b/chrome/browser/sync_file_system/local/syncable_file_system_unittest.cc @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stdint.h> + +#include "base/macros.h" #include "base/stl_util.h" #include "base/thread_task_runner_handle.h" #include "chrome/browser/sync_file_system/local/canned_syncable_file_system.h" @@ -123,11 +126,11 @@ TEST_F(SyncableFileSystemTest, SyncableLocalSandboxCombined) { EXPECT_EQ(base::File::FILE_OK, file_system_.CreateFile(URL("dir/foo"))); - const int64 kOriginalQuota = QuotaManager::kSyncableStorageDefaultHostQuota; + const int64_t kOriginalQuota = QuotaManager::kSyncableStorageDefaultHostQuota; - const int64 kQuota = 12345 * 1024; + const int64_t kQuota = 12345 * 1024; QuotaManager::kSyncableStorageDefaultHostQuota = kQuota; - int64 usage, quota; + int64_t usage, quota; EXPECT_EQ(storage::kQuotaStatusOk, file_system_.GetUsageAndQuota(&usage, "a)); @@ -137,14 +140,14 @@ TEST_F(SyncableFileSystemTest, SyncableLocalSandboxCombined) { EXPECT_GT(usage, 0); // Truncate to extend an existing file and see if the usage reflects it. - const int64 kFileSizeToExtend = 333; + const int64_t kFileSizeToExtend = 333; EXPECT_EQ(base::File::FILE_OK, file_system_.CreateFile(URL("dir/foo"))); EXPECT_EQ(base::File::FILE_OK, file_system_.TruncateFile(URL("dir/foo"), kFileSizeToExtend)); - int64 new_usage; + int64_t new_usage; EXPECT_EQ(storage::kQuotaStatusOk, file_system_.GetUsageAndQuota(&new_usage, "a)); EXPECT_EQ(kFileSizeToExtend, new_usage - usage); diff --git a/chrome/browser/sync_file_system/local_change_processor.h b/chrome/browser/sync_file_system/local_change_processor.h index 75f8ba0..7405956 100644 --- a/chrome/browser/sync_file_system/local_change_processor.h +++ b/chrome/browser/sync_file_system/local_change_processor.h @@ -6,6 +6,7 @@ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_CHANGE_PROCESSOR_H_ #include "base/callback_forward.h" +#include "base/macros.h" #include "chrome/browser/sync_file_system/sync_callbacks.h" namespace storage { diff --git a/chrome/browser/sync_file_system/logger_unittest.cc b/chrome/browser/sync_file_system/logger_unittest.cc index 78df071..4167582 100644 --- a/chrome/browser/sync_file_system/logger_unittest.cc +++ b/chrome/browser/sync_file_system/logger_unittest.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "chrome/browser/sync_file_system/logger.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/sync_file_system/mock_local_change_processor.h b/chrome/browser/sync_file_system/mock_local_change_processor.h index 79976ed..a67bb38 100644 --- a/chrome/browser/sync_file_system/mock_local_change_processor.h +++ b/chrome/browser/sync_file_system/mock_local_change_processor.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_MOCK_LOCAL_CHANGE_PROCESSOR_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_MOCK_LOCAL_CHANGE_PROCESSOR_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "chrome/browser/sync_file_system/local_change_processor.h" #include "testing/gmock/include/gmock/gmock.h" diff --git a/chrome/browser/sync_file_system/mock_remote_change_processor.h b/chrome/browser/sync_file_system/mock_remote_change_processor.h index 1740d77..99faaa2 100644 --- a/chrome/browser/sync_file_system/mock_remote_change_processor.h +++ b/chrome/browser/sync_file_system/mock_remote_change_processor.h @@ -6,6 +6,7 @@ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_MOCK_REMOTE_CHANGE_PROCESSOR_H_ #include "base/callback.h" +#include "base/macros.h" #include "chrome/browser/sync_file_system/file_change.h" #include "chrome/browser/sync_file_system/remote_change_processor.h" #include "chrome/browser/sync_file_system/sync_callbacks.h" diff --git a/chrome/browser/sync_file_system/mock_remote_file_sync_service.cc b/chrome/browser/sync_file_system/mock_remote_file_sync_service.cc index 25d9d2d..432c38f 100644 --- a/chrome/browser/sync_file_system/mock_remote_file_sync_service.cc +++ b/chrome/browser/sync_file_system/mock_remote_file_sync_service.cc @@ -56,7 +56,7 @@ void MockRemoteFileSyncService::SetServiceState(RemoteServiceState state) { } void MockRemoteFileSyncService::NotifyRemoteChangeQueueUpdated( - int64 pending_changes) { + int64_t pending_changes) { FOR_EACH_OBSERVER(Observer, service_observers_, OnRemoteChangeQueueUpdated(pending_changes)); } diff --git a/chrome/browser/sync_file_system/mock_remote_file_sync_service.h b/chrome/browser/sync_file_system/mock_remote_file_sync_service.h index 456c6f7..5fc04b6 100644 --- a/chrome/browser/sync_file_system/mock_remote_file_sync_service.h +++ b/chrome/browser/sync_file_system/mock_remote_file_sync_service.h @@ -5,8 +5,11 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_MOCK_REMOTE_FILE_SYNC_SERVICE_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_MOCK_REMOTE_FILE_SYNC_SERVICE_H_ +#include <stdint.h> + #include <string> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "base/values.h" @@ -61,7 +64,7 @@ class MockRemoteFileSyncService : public RemoteFileSyncService { // Send notifications to the observers. // Can be used in the mock implementation. - void NotifyRemoteChangeQueueUpdated(int64 pending_changes); + void NotifyRemoteChangeQueueUpdated(int64_t pending_changes); void NotifyRemoteServiceStateUpdated( RemoteServiceState state, const std::string& description); diff --git a/chrome/browser/sync_file_system/remote_change_processor.h b/chrome/browser/sync_file_system/remote_change_processor.h index 4f98786..a4464a5 100644 --- a/chrome/browser/sync_file_system/remote_change_processor.h +++ b/chrome/browser/sync_file_system/remote_change_processor.h @@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_CHANGE_PROCESSOR_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_CHANGE_PROCESSOR_H_ -#include "base/basictypes.h" #include "base/callback_forward.h" +#include "base/macros.h" #include "chrome/browser/sync_file_system/sync_callbacks.h" #include "chrome/browser/sync_file_system/sync_status_code.h" diff --git a/chrome/browser/sync_file_system/remote_file_sync_service.h b/chrome/browser/sync_file_system/remote_file_sync_service.h index edb729a..042d524 100644 --- a/chrome/browser/sync_file_system/remote_file_sync_service.h +++ b/chrome/browser/sync_file_system/remote_file_sync_service.h @@ -5,12 +5,14 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_ +#include <stdint.h> + #include <map> #include <set> #include <string> #include <vector> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/sync_file_system/conflict_resolution_policy.h" #include "chrome/browser/sync_file_system/sync_callbacks.h" @@ -92,7 +94,7 @@ class RemoteFileSyncService { // |pending_changes_hint| indicates the pending queue length to help sync // scheduling but the value may not be accurately reflect the real-time // value. - virtual void OnRemoteChangeQueueUpdated(int64 pending_changes_hint) = 0; + virtual void OnRemoteChangeQueueUpdated(int64_t pending_changes_hint) = 0; // This is called when RemoteFileSyncService updates its state. virtual void OnRemoteServiceStateUpdated( diff --git a/chrome/browser/sync_file_system/subtree_set.h b/chrome/browser/sync_file_system/subtree_set.h index bf28602..9bd2961 100644 --- a/chrome/browser/sync_file_system/subtree_set.h +++ b/chrome/browser/sync_file_system/subtree_set.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_SUBTREE_SET_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SUBTREE_SET_H_ +#include <stddef.h> + #include "base/containers/hash_tables.h" #include "base/files/file_path.h" diff --git a/chrome/browser/sync_file_system/sync_event_observer.h b/chrome/browser/sync_file_system/sync_event_observer.h index b6e8010..965d26b 100644 --- a/chrome/browser/sync_file_system/sync_event_observer.h +++ b/chrome/browser/sync_file_system/sync_event_observer.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "chrome/browser/sync_file_system/file_status_observer.h" #include "chrome/browser/sync_file_system/sync_service_state.h" diff --git a/chrome/browser/sync_file_system/sync_file_metadata.cc b/chrome/browser/sync_file_system/sync_file_metadata.cc index 42b5735..c5b267d 100644 --- a/chrome/browser/sync_file_system/sync_file_metadata.cc +++ b/chrome/browser/sync_file_system/sync_file_metadata.cc @@ -13,14 +13,10 @@ SyncFileMetadata::SyncFileMetadata() size(-1) { } -SyncFileMetadata::SyncFileMetadata( - SyncFileType file_type, - int64 size, - const base::Time& last_modified) - : file_type(file_type), - size(size), - last_modified(last_modified) { -} +SyncFileMetadata::SyncFileMetadata(SyncFileType file_type, + int64_t size, + const base::Time& last_modified) + : file_type(file_type), size(size), last_modified(last_modified) {} SyncFileMetadata::~SyncFileMetadata() {} diff --git a/chrome/browser/sync_file_system/sync_file_metadata.h b/chrome/browser/sync_file_system/sync_file_metadata.h index 7e3e631..d382183c 100644 --- a/chrome/browser/sync_file_system/sync_file_metadata.h +++ b/chrome/browser/sync_file_system/sync_file_metadata.h @@ -5,7 +5,8 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_METADATA_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_METADATA_H_ -#include "base/basictypes.h" +#include <stdint.h> + #include "base/time/time.h" #include "chrome/browser/sync_file_system/file_change.h" #include "storage/browser/fileapi/file_system_url.h" @@ -16,12 +17,12 @@ class SyncFileMetadata { public: SyncFileMetadata(); SyncFileMetadata(SyncFileType file_type, - int64 size, + int64_t size, const base::Time& last_modified); ~SyncFileMetadata(); SyncFileType file_type; - int64 size; + int64_t size; base::Time last_modified; bool operator==(const SyncFileMetadata& that) const; diff --git a/chrome/browser/sync_file_system/sync_file_system_service.cc b/chrome/browser/sync_file_system/sync_file_system_service.cc index 804eccf..8a74b0a 100644 --- a/chrome/browser/sync_file_system/sync_file_system_service.cc +++ b/chrome/browser/sync_file_system/sync_file_system_service.cc @@ -4,11 +4,15 @@ #include "chrome/browser/sync_file_system/sync_file_system_service.h" +#include <stddef.h> +#include <stdint.h> + #include <string> #include "base/bind.h" #include "base/format_macros.h" #include "base/logging.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/metrics/histogram.h" #include "base/single_thread_task_runner.h" @@ -157,7 +161,7 @@ class LocalSyncRunner : public SyncProcessRunner, } // LocalFileSyncService::Observer overrides. - void OnLocalChangeAvailable(int64 pending_changes) override { + void OnLocalChangeAvailable(int64_t pending_changes) override { DCHECK_CURRENTLY_ON(BrowserThread::UI); OnChangesUpdated(pending_changes); @@ -207,7 +211,7 @@ class RemoteSyncRunner : public SyncProcessRunner, } // RemoteFileSyncService::Observer overrides. - void OnRemoteChangeQueueUpdated(int64 pending_changes) override { + void OnRemoteChangeQueueUpdated(int64_t pending_changes) override { DCHECK_CURRENTLY_ON(BrowserThread::UI); OnChangesUpdated(pending_changes); @@ -365,7 +369,7 @@ void SyncFileSystemService::OnSyncIdle() { base::Bind(&SyncFileSystemService::OnPromotionCompleted, AsWeakPtr(), base::Owned(job_count)); - int64 remote_changes = 0; + int64_t remote_changes = 0; for (size_t i = 0; i < remote_sync_runners_.size(); ++i) remote_changes += remote_sync_runners_[i]->pending_changes(); if (remote_changes == 0) { @@ -373,7 +377,7 @@ void SyncFileSystemService::OnSyncIdle() { local_service_->PromoteDemotedChanges(promote_completion_callback); } - int64 local_changes = 0; + int64_t local_changes = 0; for (size_t i = 0; i < local_sync_runners_.size(); ++i) local_changes += local_sync_runners_[i]->pending_changes(); if (local_changes == 0) { diff --git a/chrome/browser/sync_file_system/sync_file_system_service.h b/chrome/browser/sync_file_system/sync_file_system_service.h index 7bbea9d..c81a253 100644 --- a/chrome/browser/sync_file_system/sync_file_system_service.h +++ b/chrome/browser/sync_file_system/sync_file_system_service.h @@ -9,8 +9,8 @@ #include <memory> #include <string> -#include "base/basictypes.h" #include "base/callback_forward.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/memory/weak_ptr.h" diff --git a/chrome/browser/sync_file_system/sync_file_system_service_factory.h b/chrome/browser/sync_file_system/sync_file_system_service_factory.h index 88de867..fa7341c 100644 --- a/chrome/browser/sync_file_system/sync_file_system_service_factory.h +++ b/chrome/browser/sync_file_system/sync_file_system_service_factory.h @@ -5,7 +5,6 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_FACTORY_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_FACTORY_H_ -#include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" diff --git a/chrome/browser/sync_file_system/sync_file_system_service_unittest.cc b/chrome/browser/sync_file_system/sync_file_system_service_unittest.cc index ddf32d0..5c61fe1 100644 --- a/chrome/browser/sync_file_system/sync_file_system_service_unittest.cc +++ b/chrome/browser/sync_file_system/sync_file_system_service_unittest.cc @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + #include <vector> -#include "base/basictypes.h" #include "base/bind.h" #include "base/run_loop.h" #include "base/single_thread_task_runner.h" diff --git a/chrome/browser/sync_file_system/sync_process_runner.cc b/chrome/browser/sync_file_system/sync_process_runner.cc index 619a6bd..42078fd 100644 --- a/chrome/browser/sync_file_system/sync_process_runner.cc +++ b/chrome/browser/sync_file_system/sync_process_runner.cc @@ -5,19 +5,20 @@ #include "chrome/browser/sync_file_system/sync_process_runner.h" #include "base/format_macros.h" +#include "base/macros.h" #include "chrome/browser/sync_file_system/logger.h" namespace sync_file_system { -const int64 SyncProcessRunner::kSyncDelayInMilliseconds = - 1 * base::Time::kMillisecondsPerSecond; // 1 sec -const int64 SyncProcessRunner::kSyncDelayWithSyncError = - 3 * base::Time::kMillisecondsPerSecond; // 3 sec -const int64 SyncProcessRunner::kSyncDelayFastInMilliseconds = 100; // 100 ms +const int64_t SyncProcessRunner::kSyncDelayInMilliseconds = + 1 * base::Time::kMillisecondsPerSecond; // 1 sec +const int64_t SyncProcessRunner::kSyncDelayWithSyncError = + 3 * base::Time::kMillisecondsPerSecond; // 3 sec +const int64_t SyncProcessRunner::kSyncDelayFastInMilliseconds = 100; // 100 ms const int SyncProcessRunner::kPendingChangeThresholdForFastSync = 10; -const int64 SyncProcessRunner::kSyncDelaySlowInMilliseconds = +const int64_t SyncProcessRunner::kSyncDelaySlowInMilliseconds = 30 * base::Time::kMillisecondsPerSecond; // 30 sec -const int64 SyncProcessRunner::kSyncDelayMaxInMilliseconds = +const int64_t SyncProcessRunner::kSyncDelayMaxInMilliseconds = 30 * 60 * base::Time::kMillisecondsPerSecond; // 30 min namespace { @@ -111,7 +112,7 @@ void SyncProcessRunner::Schedule() { ScheduleInternal(kSyncDelayMaxInMilliseconds); } -void SyncProcessRunner::ThrottleSync(int64 base_delay) { +void SyncProcessRunner::ThrottleSync(int64_t base_delay) { base::TimeTicks now = timer_helper_->Now(); base::TimeDelta elapsed = std::min(now, throttle_until_) - throttle_from_; DCHECK(base::TimeDelta() <= elapsed); @@ -145,10 +146,9 @@ SyncServiceState SyncProcessRunner::GetServiceState() { return client_->GetSyncServiceState(); } -void SyncProcessRunner::OnChangesUpdated( - int64 pending_changes) { +void SyncProcessRunner::OnChangesUpdated(int64_t pending_changes) { DCHECK_GE(pending_changes, 0); - int64 old_pending_changes = pending_changes_; + int64_t old_pending_changes = pending_changes_; pending_changes_ = pending_changes; if (old_pending_changes != pending_changes) { CheckIfIdle(); @@ -203,7 +203,7 @@ void SyncProcessRunner::Run() { Schedule(); } -void SyncProcessRunner::ScheduleInternal(int64 delay) { +void SyncProcessRunner::ScheduleInternal(int64_t delay) { base::TimeTicks now = timer_helper_->Now(); base::TimeTicks next_scheduled; diff --git a/chrome/browser/sync_file_system/sync_process_runner.h b/chrome/browser/sync_file_system/sync_process_runner.h index 118ca70..80be8d5 100644 --- a/chrome/browser/sync_file_system/sync_process_runner.h +++ b/chrome/browser/sync_file_system/sync_process_runner.h @@ -5,9 +5,12 @@ #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_PROCESS_RUNNER_H_ #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_PROCESS_RUNNER_H_ +#include <stddef.h> +#include <stdint.h> + #include <string> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/timer/timer.h" #include "chrome/browser/sync_file_system/sync_callbacks.h" @@ -26,22 +29,22 @@ class SyncFileSystemService; class SyncProcessRunner { public: // Default delay when more changes are available. - static const int64 kSyncDelayInMilliseconds; + static const int64_t kSyncDelayInMilliseconds; // Default delay when the previous change has had an error (but remote service // is running). - static const int64 kSyncDelayWithSyncError; + static const int64_t kSyncDelayWithSyncError; // Default delay when there're more than 10 pending changes. - static const int64 kSyncDelayFastInMilliseconds; + static const int64_t kSyncDelayFastInMilliseconds; static const int kPendingChangeThresholdForFastSync; // Default delay when remote service is temporarily unavailable. // The delay backs off exponentially from initial value on repeated failure. - static const int64 kSyncDelaySlowInMilliseconds; + static const int64_t kSyncDelaySlowInMilliseconds; // Default delay when there're no changes. - static const int64 kSyncDelayMaxInMilliseconds; + static const int64_t kSyncDelayMaxInMilliseconds; class Client { public: @@ -76,24 +79,24 @@ class SyncProcessRunner { // Schedules a new sync. void Schedule(); - int64 pending_changes() const { return pending_changes_; } + int64_t pending_changes() const { return pending_changes_; } // Returns the current service state. Default implementation returns // sync_service()->GetSyncServiceState(). virtual SyncServiceState GetServiceState(); protected: - void OnChangesUpdated(int64 pending_changes); + void OnChangesUpdated(int64_t pending_changes); SyncFileSystemService* GetSyncService(); private: void Finished(const base::TimeTicks& start_time, SyncStatusCode status); void Run(); - void ScheduleInternal(int64 delay); + void ScheduleInternal(int64_t delay); // Throttles new sync for |base_delay| milliseconds for an error case. // If new sync is already throttled, back off the duration. - void ThrottleSync(int64 base_delay); + void ThrottleSync(int64_t base_delay); // Clears old throttling setting that is already over. void ResetOldThrottling(); @@ -113,7 +116,7 @@ class SyncProcessRunner { base::TimeTicks throttle_from_; base::TimeTicks throttle_until_; - int64 pending_changes_; + int64_t pending_changes_; base::WeakPtrFactory<SyncProcessRunner> factory_; DISALLOW_COPY_AND_ASSIGN(SyncProcessRunner); diff --git a/chrome/browser/sync_file_system/sync_process_runner_unittest.cc b/chrome/browser/sync_file_system/sync_process_runner_unittest.cc index a1bd4b7..d123142 100644 --- a/chrome/browser/sync_file_system/sync_process_runner_unittest.cc +++ b/chrome/browser/sync_file_system/sync_process_runner_unittest.cc @@ -4,8 +4,12 @@ #include "chrome/browser/sync_file_system/sync_process_runner.h" +#include <stddef.h> +#include <stdint.h> + #include <queue> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "testing/gtest/include/gtest/gtest.h" @@ -62,7 +66,7 @@ class FakeTimerHelper : public SyncProcessRunner::TimerHelper { SetCurrentTime(scheduled_time_); } - int64 GetCurrentDelay() { + int64_t GetCurrentDelay() { EXPECT_FALSE(timer_task_.is_null()); return (scheduled_time_ - current_time_).InMilliseconds(); } diff --git a/chrome/browser/sync_file_system/task_logger.cc b/chrome/browser/sync_file_system/task_logger.cc index 8d8c585..437a689 100644 --- a/chrome/browser/sync_file_system/task_logger.cc +++ b/chrome/browser/sync_file_system/task_logger.cc @@ -4,6 +4,8 @@ #include "chrome/browser/sync_file_system/task_logger.h" +#include <stddef.h> + #include "base/lazy_instance.h" #include "base/stl_util.h" #include "base/synchronization/lock.h" diff --git a/chrome/browser/sync_file_system/task_logger.h b/chrome/browser/sync_file_system/task_logger.h index 089bd65..1021c3a 100644 --- a/chrome/browser/sync_file_system/task_logger.h +++ b/chrome/browser/sync_file_system/task_logger.h @@ -9,6 +9,7 @@ #include <string> #include <vector> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" diff --git a/chrome/browser/tab_contents/navigation_metrics_recorder.cc b/chrome/browser/tab_contents/navigation_metrics_recorder.cc index 63ca224..81fac73 100644 --- a/chrome/browser/tab_contents/navigation_metrics_recorder.cc +++ b/chrome/browser/tab_contents/navigation_metrics_recorder.cc @@ -5,6 +5,7 @@ #include "chrome/browser/tab_contents/navigation_metrics_recorder.h" #include "base/metrics/histogram_macros.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "components/navigation_metrics/navigation_metrics.h" #include "components/rappor/rappor_utils.h" diff --git a/chrome/browser/tab_contents/navigation_metrics_recorder.h b/chrome/browser/tab_contents/navigation_metrics_recorder.h index aaf96a3..c5c8890 100644 --- a/chrome/browser/tab_contents/navigation_metrics_recorder.h +++ b/chrome/browser/tab_contents/navigation_metrics_recorder.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_METRICS_RECORDER_H_ #define CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_METRICS_RECORDER_H_ +#include "base/macros.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_user_data.h" diff --git a/chrome/browser/tab_contents/retargeting_details.h b/chrome/browser/tab_contents/retargeting_details.h index c80a1ca..53728f9 100644 --- a/chrome/browser/tab_contents/retargeting_details.h +++ b/chrome/browser/tab_contents/retargeting_details.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_TAB_CONTENTS_RETARGETING_DETAILS_H_ #define CHROME_BROWSER_TAB_CONTENTS_RETARGETING_DETAILS_H_ +#include <stdint.h> + #include "url/gurl.h" namespace content { @@ -18,7 +20,7 @@ struct RetargetingDetails { // The routing id of the source render frame from which the retargeting was // triggered. - int64 source_render_frame_id; + int64_t source_render_frame_id; // The target URL. GURL target_url; diff --git a/chrome/browser/task_management/providers/arc/arc_process_task_provider.cc b/chrome/browser/task_management/providers/arc/arc_process_task_provider.cc index 10d689e..53a52d5 100644 --- a/chrome/browser/task_management/providers/arc/arc_process_task_provider.cc +++ b/chrome/browser/task_management/providers/arc/arc_process_task_provider.cc @@ -4,6 +4,8 @@ #include "chrome/browser/task_management/providers/arc/arc_process_task_provider.h" +#include <stddef.h> + #include <queue> #include <set> #include <utility> diff --git a/chrome/browser/task_management/providers/browser_process_task.cc b/chrome/browser/task_management/providers/browser_process_task.cc index 0f246ba..854e850 100644 --- a/chrome/browser/task_management/providers/browser_process_task.cc +++ b/chrome/browser/task_management/providers/browser_process_task.cc @@ -56,18 +56,18 @@ BrowserProcessTask::~BrowserProcessTask() { } void BrowserProcessTask::Refresh(const base::TimeDelta& update_interval, - int64 refresh_flags) { + int64_t refresh_flags) { Task::Refresh(update_interval, refresh_flags); if (reports_v8_stats_ && (refresh_flags & REFRESH_TYPE_V8_MEMORY) != 0) { allocated_v8_memory_ = - static_cast<int64>(net::ProxyResolverV8::GetTotalHeapSize()); + static_cast<int64_t>(net::ProxyResolverV8::GetTotalHeapSize()); used_v8_memory_ = - static_cast<int64>(net::ProxyResolverV8::GetUsedHeapSize()); + static_cast<int64_t>(net::ProxyResolverV8::GetUsedHeapSize()); } if ((refresh_flags & REFRESH_TYPE_SQLITE_MEMORY) != 0) - used_sqlite_memory_ = static_cast<int64>(sqlite3_memory_used()); + used_sqlite_memory_ = static_cast<int64_t>(sqlite3_memory_used()); } Task::Type BrowserProcessTask::GetType() const { @@ -78,15 +78,15 @@ int BrowserProcessTask::GetChildProcessUniqueID() const { return 0; } -int64 BrowserProcessTask::GetSqliteMemoryUsed() const { +int64_t BrowserProcessTask::GetSqliteMemoryUsed() const { return used_sqlite_memory_; } -int64 BrowserProcessTask::GetV8MemoryAllocated() const { +int64_t BrowserProcessTask::GetV8MemoryAllocated() const { return allocated_v8_memory_; } -int64 BrowserProcessTask::GetV8MemoryUsed() const { +int64_t BrowserProcessTask::GetV8MemoryUsed() const { return used_v8_memory_; } diff --git a/chrome/browser/task_management/providers/browser_process_task.h b/chrome/browser/task_management/providers/browser_process_task.h index 23492f4..fad5783 100644 --- a/chrome/browser/task_management/providers/browser_process_task.h +++ b/chrome/browser/task_management/providers/browser_process_task.h @@ -5,6 +5,9 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_BROWSER_PROCESS_TASK_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_BROWSER_PROCESS_TASK_H_ +#include <stdint.h> + +#include "base/macros.h" #include "chrome/browser/task_management/providers/task.h" namespace task_management { @@ -17,17 +20,17 @@ class BrowserProcessTask : public Task { // task_management::Task: void Refresh(const base::TimeDelta& update_interval, - int64 refresh_flags) override; + int64_t refresh_flags) override; Type GetType() const override; int GetChildProcessUniqueID() const override; - int64 GetSqliteMemoryUsed() const override; - int64 GetV8MemoryAllocated() const override; - int64 GetV8MemoryUsed() const override; + int64_t GetSqliteMemoryUsed() const override; + int64_t GetV8MemoryAllocated() const override; + int64_t GetV8MemoryUsed() const override; private: - int64 allocated_v8_memory_; - int64 used_v8_memory_; - int64 used_sqlite_memory_; + int64_t allocated_v8_memory_; + int64_t used_v8_memory_; + int64_t used_sqlite_memory_; bool reports_v8_stats_; DISALLOW_COPY_AND_ASSIGN(BrowserProcessTask); diff --git a/chrome/browser/task_management/providers/browser_process_task_provider.h b/chrome/browser/task_management/providers/browser_process_task_provider.h index f49f50f..da36224 100644 --- a/chrome/browser/task_management/providers/browser_process_task_provider.h +++ b/chrome/browser/task_management/providers/browser_process_task_provider.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_BROWSER_PROCESS_TASK_PROVIDER_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_BROWSER_PROCESS_TASK_PROVIDER_H_ +#include "base/macros.h" #include "chrome/browser/task_management/providers/browser_process_task.h" #include "chrome/browser/task_management/providers/task_provider.h" diff --git a/chrome/browser/task_management/providers/browser_process_task_unittest.cc b/chrome/browser/task_management/providers/browser_process_task_unittest.cc index ac9cb4a..00b9b75 100644 --- a/chrome/browser/task_management/providers/browser_process_task_unittest.cc +++ b/chrome/browser/task_management/providers/browser_process_task_unittest.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "chrome/browser/task_management/providers/browser_process_task_provider.h" #include "chrome/browser/task_management/task_manager_observer.h" #include "chrome/grit/generated_resources.h" diff --git a/chrome/browser/task_management/providers/child_process_task.cc b/chrome/browser/task_management/providers/child_process_task.cc index de5b4e3..f3795c9 100644 --- a/chrome/browser/task_management/providers/child_process_task.cc +++ b/chrome/browser/task_management/providers/child_process_task.cc @@ -180,7 +180,7 @@ ChildProcessTask::~ChildProcessTask() { } void ChildProcessTask::Refresh(const base::TimeDelta& update_interval, - int64 refresh_flags) { + int64_t refresh_flags) { Task::Refresh(update_interval, refresh_flags); if ((refresh_flags & REFRESH_TYPE_V8_MEMORY) == 0) @@ -195,9 +195,9 @@ void ChildProcessTask::Refresh(const base::TimeDelta& update_interval, // potentially having valid values). process_resources_sampler_->Refresh(base::Closure()); - v8_memory_allocated_ = base::saturated_cast<int64>( + v8_memory_allocated_ = base::saturated_cast<int64_t>( process_resources_sampler_->GetV8MemoryAllocated()); - v8_memory_used_ = base::saturated_cast<int64>( + v8_memory_used_ = base::saturated_cast<int64_t>( process_resources_sampler_->GetV8MemoryUsed()); } @@ -232,11 +232,11 @@ bool ChildProcessTask::ReportsV8Memory() const { return uses_v8_memory_ && process_resources_sampler_->ReportsV8MemoryStats(); } -int64 ChildProcessTask::GetV8MemoryAllocated() const { +int64_t ChildProcessTask::GetV8MemoryAllocated() const { return v8_memory_allocated_; } -int64 ChildProcessTask::GetV8MemoryUsed() const { +int64_t ChildProcessTask::GetV8MemoryUsed() const { return v8_memory_used_; } diff --git a/chrome/browser/task_management/providers/child_process_task.h b/chrome/browser/task_management/providers/child_process_task.h index 9160ec5..db84321 100644 --- a/chrome/browser/task_management/providers/child_process_task.h +++ b/chrome/browser/task_management/providers/child_process_task.h @@ -5,6 +5,9 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_CHILD_PROCESS_TASK_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_CHILD_PROCESS_TASK_H_ +#include <stdint.h> + +#include "base/macros.h" #include "chrome/browser/task_management/providers/task.h" class ProcessResourceUsage; @@ -27,12 +30,12 @@ class ChildProcessTask : public Task { // task_management::Task: void Refresh(const base::TimeDelta& update_interval, - int64 refresh_flags) override; + int64_t refresh_flags) override; Type GetType() const override; int GetChildProcessUniqueID() const override; bool ReportsV8Memory() const; - int64 GetV8MemoryAllocated() const override; - int64 GetV8MemoryUsed() const override; + int64_t GetV8MemoryAllocated() const override; + int64_t GetV8MemoryUsed() const override; private: // The Mojo service wrapper that will provide us with the V8 memory usage of @@ -40,8 +43,8 @@ class ChildProcessTask : public Task { scoped_ptr<ProcessResourceUsage> process_resources_sampler_; // The allocated and used V8 memory (in bytes). - int64 v8_memory_allocated_; - int64 v8_memory_used_; + int64_t v8_memory_allocated_; + int64_t v8_memory_used_; // The unique ID of the child process. It is not the PID of the process. // See |content::ChildProcessData::id|. diff --git a/chrome/browser/task_management/providers/child_process_task_provider.h b/chrome/browser/task_management/providers/child_process_task_provider.h index 321a540..7d69f86 100644 --- a/chrome/browser/task_management/providers/child_process_task_provider.h +++ b/chrome/browser/task_management/providers/child_process_task_provider.h @@ -8,6 +8,7 @@ #include <map> #include <vector> +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/task_management/providers/task_provider.h" #include "content/public/browser/browser_child_process_observer.h" diff --git a/chrome/browser/task_management/providers/child_process_task_unittest.cc b/chrome/browser/task_management/providers/child_process_task_unittest.cc index f85508f..066cf59 100644 --- a/chrome/browser/task_management/providers/child_process_task_unittest.cc +++ b/chrome/browser/task_management/providers/child_process_task_unittest.cc @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stdint.h> + +#include "base/macros.h" #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/task_management/providers/child_process_task.h" @@ -139,7 +142,7 @@ TEST_F(ChildProcessTaskTest, TestAll) { Task* found_task = provider.GetTaskOfUrlRequest(base::GetCurrentProcId(), 0, 0); ASSERT_EQ(task, found_task); - const int64 bytes_read = 1024; + const int64_t bytes_read = 1024; found_task->OnNetworkBytesRead(bytes_read); found_task->Refresh(base::TimeDelta::FromSeconds(1), REFRESH_TYPE_NETWORK_USAGE); diff --git a/chrome/browser/task_management/providers/task.cc b/chrome/browser/task_management/providers/task.cc index 7d861c9..1912721 100644 --- a/chrome/browser/task_management/providers/task.cc +++ b/chrome/browser/task_management/providers/task.cc @@ -4,6 +4,8 @@ #include "chrome/browser/task_management/providers/task.h" +#include <stddef.h> + #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_info_cache.h" @@ -15,7 +17,7 @@ namespace task_management { namespace { // The last ID given to the previously created task. -int64 g_last_id = 0; +int64_t g_last_id = 0; } // namespace @@ -54,7 +56,7 @@ void Task::Activate() { } void Task::Refresh(const base::TimeDelta& update_interval, - int64 refresh_flags) { + int64_t refresh_flags) { if ((refresh_flags & REFRESH_TYPE_NETWORK_USAGE) == 0) return; @@ -68,7 +70,7 @@ void Task::Refresh(const base::TimeDelta& update_interval, current_byte_count_ = 0; } -void Task::OnNetworkBytesRead(int64 bytes_read) { +void Task::OnNetworkBytesRead(int64_t bytes_read) { if (current_byte_count_ == -1) current_byte_count_ = 0; @@ -83,7 +85,7 @@ bool Task::ReportsSqliteMemory() const { return GetSqliteMemoryUsed() != -1; } -int64 Task::GetSqliteMemoryUsed() const { +int64_t Task::GetSqliteMemoryUsed() const { return -1; } @@ -91,11 +93,11 @@ bool Task::ReportsV8Memory() const { return GetV8MemoryAllocated() != -1; } -int64 Task::GetV8MemoryAllocated() const { +int64_t Task::GetV8MemoryAllocated() const { return -1; } -int64 Task::GetV8MemoryUsed() const { +int64_t Task::GetV8MemoryUsed() const { return -1; } diff --git a/chrome/browser/task_management/providers/task.h b/chrome/browser/task_management/providers/task.h index 441d7b1..86dc3c6 100644 --- a/chrome/browser/task_management/providers/task.h +++ b/chrome/browser/task_management/providers/task.h @@ -5,7 +5,9 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_TASK_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_TASK_H_ -#include "base/basictypes.h" +#include <stdint.h> + +#include "base/macros.h" #include "base/process/process_handle.h" #include "base/strings/string16.h" #include "base/time/time.h" @@ -61,12 +63,12 @@ class Task { // the |refresh_flags| indicate which resources should be calculated on each // refresh. virtual void Refresh(const base::TimeDelta& update_interval, - int64 refresh_flags); + int64_t refresh_flags); // Will receive this notification through the task manager from // |ChromeNetworkDelegate::OnNetworkBytesReceived()|. The task will add to the // |current_byte_count_| in this refresh cycle. - void OnNetworkBytesRead(int64 bytes_read); + void OnNetworkBytesRead(int64_t bytes_read); // Returns the task type. virtual Type GetType() const = 0; @@ -85,14 +87,14 @@ class Task { // memory, in this case a default invalid value of -1 will be returned. // Check for whether the task reports it or not first. bool ReportsSqliteMemory() const; - virtual int64 GetSqliteMemoryUsed() const; + virtual int64_t GetSqliteMemoryUsed() const; // Getting the allocated and used V8 memory (in bytes). Not all tasks reports // V8 memory, in this case a default invalid value of -1 will be returned. // Check for whether the task reports it or not first. bool ReportsV8Memory() const; - virtual int64 GetV8MemoryAllocated() const; - virtual int64 GetV8MemoryUsed() const; + virtual int64_t GetV8MemoryAllocated() const; + virtual int64_t GetV8MemoryUsed() const; // Checking if the task reports Webkit resource cache statistics and getting // them if it does. @@ -102,8 +104,8 @@ class Task { // Checking whether the task reports network usage. bool ReportsNetworkUsage() const; - int64 task_id() const { return task_id_; } - int64 network_usage() const { return network_usage_; } + int64_t task_id() const { return task_id_; } + int64_t network_usage() const { return network_usage_; } const base::string16& title() const { return title_; } const std::string& rappor_sample_name() const { return rappor_sample_name_; } const gfx::ImageSkia& icon() const { return icon_; } @@ -119,16 +121,16 @@ class Task { private: // The unique ID of this task. - const int64 task_id_; + const int64_t task_id_; // The task's network usage in the current refresh cycle measured in bytes per // second. A value of -1 means this task doesn't report network usage data. - int64 network_usage_; + int64_t network_usage_; // The current network bytes received by this task during the current refresh // cycle. A value of -1 means this task has never been notified of any network // usage. - int64 current_byte_count_; + int64_t current_byte_count_; // The title of the task. base::string16 title_; diff --git a/chrome/browser/task_management/providers/task_provider.h b/chrome/browser/task_management/providers/task_provider.h index 91f71c1..e4387cf 100644 --- a/chrome/browser/task_management/providers/task_provider.h +++ b/chrome/browser/task_management/providers/task_provider.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_TASK_PROVIDER_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_TASK_PROVIDER_H_ +#include "base/macros.h" #include "chrome/browser/task_management/providers/task_provider_observer.h" namespace task_management { diff --git a/chrome/browser/task_management/providers/task_provider_observer.h b/chrome/browser/task_management/providers/task_provider_observer.h index 74f2de5..72f8696 100644 --- a/chrome/browser/task_management/providers/task_provider_observer.h +++ b/chrome/browser/task_management/providers/task_provider_observer.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_TASK_PROVIDER_OBSERVER_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_TASK_PROVIDER_OBSERVER_H_ +#include "base/macros.h" #include "chrome/browser/task_management/providers/task.h" namespace task_management { diff --git a/chrome/browser/task_management/providers/web_contents/background_contents_tag.h b/chrome/browser/task_management/providers/web_contents/background_contents_tag.h index 01720b5..60b0437 100644 --- a/chrome/browser/task_management/providers/web_contents/background_contents_tag.h +++ b/chrome/browser/task_management/providers/web_contents/background_contents_tag.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_BACKGROUND_CONTENTS_TAG_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_BACKGROUND_CONTENTS_TAG_H_ +#include "base/macros.h" #include "chrome/browser/task_management/providers/web_contents/background_contents_task.h" #include "chrome/browser/task_management/providers/web_contents/web_contents_tag.h" diff --git a/chrome/browser/task_management/providers/web_contents/background_contents_tag_browsertest.cc b/chrome/browser/task_management/providers/web_contents/background_contents_tag_browsertest.cc index 95564c0..ee59a53 100644 --- a/chrome/browser/task_management/providers/web_contents/background_contents_tag_browsertest.cc +++ b/chrome/browser/task_management/providers/web_contents/background_contents_tag_browsertest.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/extensions/extension_browsertest.h" #include "chrome/browser/task_management/providers/web_contents/web_contents_tags_manager.h" diff --git a/chrome/browser/task_management/providers/web_contents/background_contents_task.h b/chrome/browser/task_management/providers/web_contents/background_contents_task.h index af76deb..0607604 100644 --- a/chrome/browser/task_management/providers/web_contents/background_contents_task.h +++ b/chrome/browser/task_management/providers/web_contents/background_contents_task.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_BACKGROUND_CONTENTS_TASK_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_BACKGROUND_CONTENTS_TASK_H_ +#include "base/macros.h" #include "chrome/browser/background/background_contents.h" #include "chrome/browser/task_management/providers/web_contents/renderer_task.h" diff --git a/chrome/browser/task_management/providers/web_contents/devtools_tag.h b/chrome/browser/task_management/providers/web_contents/devtools_tag.h index a33e057..f6c4cae 100644 --- a/chrome/browser/task_management/providers/web_contents/devtools_tag.h +++ b/chrome/browser/task_management/providers/web_contents/devtools_tag.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_DEVTOOLS_TAG_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_DEVTOOLS_TAG_H_ +#include "base/macros.h" #include "chrome/browser/task_management/providers/web_contents/devtools_task.h" #include "chrome/browser/task_management/providers/web_contents/web_contents_tag.h" diff --git a/chrome/browser/task_management/providers/web_contents/devtools_tag_browsertest.cc b/chrome/browser/task_management/providers/web_contents/devtools_tag_browsertest.cc index 0a26496..c1b0458 100644 --- a/chrome/browser/task_management/providers/web_contents/devtools_tag_browsertest.cc +++ b/chrome/browser/task_management/providers/web_contents/devtools_tag_browsertest.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "chrome/browser/devtools/devtools_window_testing.h" #include "chrome/browser/task_management/providers/web_contents/web_contents_tags_manager.h" #include "chrome/browser/task_management/task_management_browsertest_util.h" diff --git a/chrome/browser/task_management/providers/web_contents/devtools_task.h b/chrome/browser/task_management/providers/web_contents/devtools_task.h index 4fc27f5..08cd582 100644 --- a/chrome/browser/task_management/providers/web_contents/devtools_task.h +++ b/chrome/browser/task_management/providers/web_contents/devtools_task.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_DEVTOOLS_TASK_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_DEVTOOLS_TASK_H_ +#include "base/macros.h" #include "chrome/browser/task_management/providers/web_contents/renderer_task.h" namespace task_management { diff --git a/chrome/browser/task_management/providers/web_contents/extension_tag.h b/chrome/browser/task_management/providers/web_contents/extension_tag.h index 6936812..0b521e9 100644 --- a/chrome/browser/task_management/providers/web_contents/extension_tag.h +++ b/chrome/browser/task_management/providers/web_contents/extension_tag.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_EXTENSION_TAG_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_EXTENSION_TAG_H_ +#include "base/macros.h" #include "chrome/browser/task_management/providers/web_contents/extension_task.h" #include "chrome/browser/task_management/providers/web_contents/web_contents_tag.h" diff --git a/chrome/browser/task_management/providers/web_contents/extension_tag_browsertest.cc b/chrome/browser/task_management/providers/web_contents/extension_tag_browsertest.cc index dfcfdcf..b79325d 100644 --- a/chrome/browser/task_management/providers/web_contents/extension_tag_browsertest.cc +++ b/chrome/browser/task_management/providers/web_contents/extension_tag_browsertest.cc @@ -2,7 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/extensions/extension_browsertest.h" #include "chrome/browser/task_management/task_management_browsertest_util.h" #include "chrome/common/chrome_switches.h" diff --git a/chrome/browser/task_management/providers/web_contents/extension_task.h b/chrome/browser/task_management/providers/web_contents/extension_task.h index a33ea40..c7c8633 100644 --- a/chrome/browser/task_management/providers/web_contents/extension_task.h +++ b/chrome/browser/task_management/providers/web_contents/extension_task.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_EXTENSION_TASK_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_EXTENSION_TASK_H_ +#include "base/macros.h" #include "chrome/browser/task_management/providers/web_contents/renderer_task.h" #include "extensions/browser/extension_icon_image.h" #include "extensions/common/view_type.h" diff --git a/chrome/browser/task_management/providers/web_contents/guest_tag.h b/chrome/browser/task_management/providers/web_contents/guest_tag.h index fed0fe0..bcdd8bf 100644 --- a/chrome/browser/task_management/providers/web_contents/guest_tag.h +++ b/chrome/browser/task_management/providers/web_contents/guest_tag.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_GUEST_TAG_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_GUEST_TAG_H_ +#include "base/macros.h" #include "chrome/browser/task_management/providers/web_contents/guest_task.h" #include "chrome/browser/task_management/providers/web_contents/web_contents_tag.h" diff --git a/chrome/browser/task_management/providers/web_contents/guest_task.h b/chrome/browser/task_management/providers/web_contents/guest_task.h index 77ee9f6..a114b11 100644 --- a/chrome/browser/task_management/providers/web_contents/guest_task.h +++ b/chrome/browser/task_management/providers/web_contents/guest_task.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_GUEST_TASK_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_GUEST_TASK_H_ +#include "base/macros.h" #include "chrome/browser/task_management/providers/web_contents/renderer_task.h" namespace task_management { diff --git a/chrome/browser/task_management/providers/web_contents/panel_tag.h b/chrome/browser/task_management/providers/web_contents/panel_tag.h index c09e137..8bd0155 100644 --- a/chrome/browser/task_management/providers/web_contents/panel_tag.h +++ b/chrome/browser/task_management/providers/web_contents/panel_tag.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_PANEL_TAG_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_PANEL_TAG_H_ +#include "base/macros.h" #include "chrome/browser/task_management/providers/web_contents/panel_task.h" #include "chrome/browser/task_management/providers/web_contents/web_contents_tag.h" diff --git a/chrome/browser/task_management/providers/web_contents/panel_task.h b/chrome/browser/task_management/providers/web_contents/panel_task.h index 3073068..8c5100a 100644 --- a/chrome/browser/task_management/providers/web_contents/panel_task.h +++ b/chrome/browser/task_management/providers/web_contents/panel_task.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_PANEL_TASK_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_PANEL_TASK_H_ +#include "base/macros.h" #include "chrome/browser/task_management/providers/web_contents/renderer_task.h" class Panel; diff --git a/chrome/browser/task_management/providers/web_contents/prerender_tag.h b/chrome/browser/task_management/providers/web_contents/prerender_tag.h index 6c6f959..48d0243 100644 --- a/chrome/browser/task_management/providers/web_contents/prerender_tag.h +++ b/chrome/browser/task_management/providers/web_contents/prerender_tag.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_PRERENDER_TAG_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_PRERENDER_TAG_H_ +#include "base/macros.h" #include "chrome/browser/task_management/providers/web_contents/prerender_task.h" #include "chrome/browser/task_management/providers/web_contents/web_contents_tag.h" diff --git a/chrome/browser/task_management/providers/web_contents/prerender_task.h b/chrome/browser/task_management/providers/web_contents/prerender_task.h index 0b6fd93..3a27521 100644 --- a/chrome/browser/task_management/providers/web_contents/prerender_task.h +++ b/chrome/browser/task_management/providers/web_contents/prerender_task.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_PRERENDER_TASK_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_PRERENDER_TASK_H_ +#include "base/macros.h" #include "chrome/browser/task_management/providers/web_contents/renderer_task.h" namespace task_management { diff --git a/chrome/browser/task_management/providers/web_contents/printing_tag.h b/chrome/browser/task_management/providers/web_contents/printing_tag.h index a9f74e2..1574028 100644 --- a/chrome/browser/task_management/providers/web_contents/printing_tag.h +++ b/chrome/browser/task_management/providers/web_contents/printing_tag.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_PRINTING_TAG_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_PRINTING_TAG_H_ +#include "base/macros.h" #include "chrome/browser/task_management/providers/web_contents/printing_task.h" #include "chrome/browser/task_management/providers/web_contents/web_contents_tag.h" diff --git a/chrome/browser/task_management/providers/web_contents/printing_task.h b/chrome/browser/task_management/providers/web_contents/printing_task.h index 24ae3c2..d8d6299 100644 --- a/chrome/browser/task_management/providers/web_contents/printing_task.h +++ b/chrome/browser/task_management/providers/web_contents/printing_task.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_PRINTING_TASK_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_PRINTING_TASK_H_ +#include "base/macros.h" #include "chrome/browser/task_management/providers/web_contents/renderer_task.h" namespace task_management { diff --git a/chrome/browser/task_management/providers/web_contents/renderer_task.cc b/chrome/browser/task_management/providers/web_contents/renderer_task.cc index 9a8ec77..ce966f6 100644 --- a/chrome/browser/task_management/providers/web_contents/renderer_task.cc +++ b/chrome/browser/task_management/providers/web_contents/renderer_task.cc @@ -45,7 +45,7 @@ base::string16 GetRendererProfileName( return Task::GetProfileNameFromProfile(profile); } -inline bool IsRendererResourceSamplingDisabled(int64 flags) { +inline bool IsRendererResourceSamplingDisabled(int64_t flags) { return (flags & (REFRESH_TYPE_V8_MEMORY | REFRESH_TYPE_WEBCACHE_STATS)) == 0; } @@ -100,7 +100,7 @@ void RendererTask::Activate() { } void RendererTask::Refresh(const base::TimeDelta& update_interval, - int64 refresh_flags) { + int64_t refresh_flags) { Task::Refresh(update_interval, refresh_flags); if (IsRendererResourceSamplingDisabled(refresh_flags)) @@ -112,9 +112,9 @@ void RendererTask::Refresh(const base::TimeDelta& update_interval, // having valid values). renderer_resources_sampler_->Refresh(base::Closure()); - v8_memory_allocated_ = base::saturated_cast<int64>( + v8_memory_allocated_ = base::saturated_cast<int64_t>( renderer_resources_sampler_->GetV8MemoryAllocated()); - v8_memory_used_ = base::saturated_cast<int64>( + v8_memory_used_ = base::saturated_cast<int64_t>( renderer_resources_sampler_->GetV8MemoryUsed()); webcache_stats_ = renderer_resources_sampler_->GetWebCoreCacheStats(); } @@ -131,11 +131,11 @@ base::string16 RendererTask::GetProfileName() const { return profile_name_; } -int64 RendererTask::GetV8MemoryAllocated() const { +int64_t RendererTask::GetV8MemoryAllocated() const { return v8_memory_allocated_; } -int64 RendererTask::GetV8MemoryUsed() const { +int64_t RendererTask::GetV8MemoryUsed() const { return v8_memory_used_; } diff --git a/chrome/browser/task_management/providers/web_contents/renderer_task.h b/chrome/browser/task_management/providers/web_contents/renderer_task.h index 9baed10..0a9bdeb 100644 --- a/chrome/browser/task_management/providers/web_contents/renderer_task.h +++ b/chrome/browser/task_management/providers/web_contents/renderer_task.h @@ -5,6 +5,9 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_RENDERER_TASK_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_RENDERER_TASK_H_ +#include <stdint.h> + +#include "base/macros.h" #include "chrome/browser/task_management/providers/task.h" #include "components/favicon/core/favicon_driver_observer.h" #include "content/public/browser/navigation_entry.h" @@ -48,12 +51,12 @@ class RendererTask : public Task, // task_management::Task: void Activate() override; void Refresh(const base::TimeDelta& update_interval, - int64 refresh_flags) override; + int64_t refresh_flags) override; Type GetType() const override; int GetChildProcessUniqueID() const override; base::string16 GetProfileName() const override; - int64 GetV8MemoryAllocated() const override; - int64 GetV8MemoryUsed() const override; + int64_t GetV8MemoryAllocated() const override; + int64_t GetV8MemoryUsed() const override; bool ReportsWebCacheStats() const override; blink::WebCache::ResourceTypeStats GetWebCacheStats() const override; @@ -101,8 +104,8 @@ class RendererTask : public Task, const int render_process_id_; // The allocated and used V8 memory (in bytes). - int64 v8_memory_allocated_; - int64 v8_memory_used_; + int64_t v8_memory_allocated_; + int64_t v8_memory_used_; // The WebKit resource cache statistics for this renderer. blink::WebCache::ResourceTypeStats webcache_stats_; diff --git a/chrome/browser/task_management/providers/web_contents/subframe_task.h b/chrome/browser/task_management/providers/web_contents/subframe_task.h index a251906..61d3219 100644 --- a/chrome/browser/task_management/providers/web_contents/subframe_task.h +++ b/chrome/browser/task_management/providers/web_contents/subframe_task.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_SUBFRAME_TASK_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_SUBFRAME_TASK_H_ +#include "base/macros.h" #include "chrome/browser/task_management/providers/web_contents/renderer_task.h" namespace content { diff --git a/chrome/browser/task_management/providers/web_contents/subframe_task_browsertest.cc b/chrome/browser/task_management/providers/web_contents/subframe_task_browsertest.cc index e99a3f9..6163883 100644 --- a/chrome/browser/task_management/providers/web_contents/subframe_task_browsertest.cc +++ b/chrome/browser/task_management/providers/web_contents/subframe_task_browsertest.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/task_management/task_management_browsertest_util.h" #include "chrome/grit/generated_resources.h" diff --git a/chrome/browser/task_management/providers/web_contents/tab_contents_tag.h b/chrome/browser/task_management/providers/web_contents/tab_contents_tag.h index 777a62f..8af93d3 100644 --- a/chrome/browser/task_management/providers/web_contents/tab_contents_tag.h +++ b/chrome/browser/task_management/providers/web_contents/tab_contents_tag.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_TAB_CONTENTS_TAG_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_TAB_CONTENTS_TAG_H_ +#include "base/macros.h" #include "chrome/browser/task_management/providers/web_contents/tab_contents_task.h" #include "chrome/browser/task_management/providers/web_contents/web_contents_tag.h" diff --git a/chrome/browser/task_management/providers/web_contents/tab_contents_tag_browsertest.cc b/chrome/browser/task_management/providers/web_contents/tab_contents_tag_browsertest.cc index 7dfa845..b0853a9 100644 --- a/chrome/browser/task_management/providers/web_contents/tab_contents_tag_browsertest.cc +++ b/chrome/browser/task_management/providers/web_contents/tab_contents_tag_browsertest.cc @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + +#include "base/macros.h" #include "base/path_service.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/task_management/providers/web_contents/web_contents_tags_manager.h" diff --git a/chrome/browser/task_management/providers/web_contents/tab_contents_task.h b/chrome/browser/task_management/providers/web_contents/tab_contents_task.h index 4ed6bda..6ad1d88 100644 --- a/chrome/browser/task_management/providers/web_contents/tab_contents_task.h +++ b/chrome/browser/task_management/providers/web_contents/tab_contents_task.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_TAB_CONTENTS_TASK_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_TAB_CONTENTS_TASK_H_ +#include "base/macros.h" #include "chrome/browser/task_management/providers/web_contents/renderer_task.h" namespace task_management { diff --git a/chrome/browser/task_management/providers/web_contents/web_contents_tag.h b/chrome/browser/task_management/providers/web_contents/web_contents_tag.h index 2b45783..300a20a 100644 --- a/chrome/browser/task_management/providers/web_contents/web_contents_tag.h +++ b/chrome/browser/task_management/providers/web_contents/web_contents_tag.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_WEB_CONTENTS_TAG_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_PROVIDERS_WEB_CONTENTS_WEB_CONTENTS_TAG_H_ +#include "base/macros.h" #include "base/supports_user_data.h" namespace content { diff --git a/chrome/browser/task_management/providers/web_contents/web_contents_tags_manager.h b/chrome/browser/task_management/providers/web_contents/web_contents_tags_manager.h index ad06501..89276d1 100644 --- a/chrome/browser/task_management/providers/web_contents/web_contents_tags_manager.h +++ b/chrome/browser/task_management/providers/web_contents/web_contents_tags_manager.h @@ -7,6 +7,7 @@ #include <vector> +#include "base/macros.h" #include "chrome/browser/task_management/providers/web_contents/web_contents_tag.h" namespace base { diff --git a/chrome/browser/task_management/providers/web_contents/web_contents_task_provider.cc b/chrome/browser/task_management/providers/web_contents/web_contents_task_provider.cc index 9a3ef6b..a80a9e5 100644 --- a/chrome/browser/task_management/providers/web_contents/web_contents_task_provider.cc +++ b/chrome/browser/task_management/providers/web_contents/web_contents_task_provider.cc @@ -5,6 +5,7 @@ #include "chrome/browser/task_management/providers/web_contents/web_contents_task_provider.h" #include "base/bind.h" +#include "base/macros.h" #include "base/stl_util.h" #include "chrome/browser/task_management/providers/web_contents/subframe_task.h" #include "chrome/browser/task_management/providers/web_contents/web_contents_tags_manager.h" diff --git a/chrome/browser/task_management/providers/web_contents/web_contents_task_provider.h b/chrome/browser/task_management/providers/web_contents/web_contents_task_provider.h index aeff7cc..3be0022 100644 --- a/chrome/browser/task_management/providers/web_contents/web_contents_task_provider.h +++ b/chrome/browser/task_management/providers/web_contents/web_contents_task_provider.h @@ -7,6 +7,7 @@ #include <map> +#include "base/macros.h" #include "chrome/browser/task_management/providers/task_provider.h" namespace content { diff --git a/chrome/browser/task_management/sampling/task_group.cc b/chrome/browser/task_management/sampling/task_group.cc index deab8f5..c8d9bf1 100644 --- a/chrome/browser/task_management/sampling/task_group.cc +++ b/chrome/browser/task_management/sampling/task_group.cc @@ -7,6 +7,7 @@ #include "base/bind.h" #include "base/callback.h" #include "base/stl_util.h" +#include "build/build_config.h" #include "chrome/browser/task_management/task_manager_observer.h" #include "components/nacl/browser/nacl_browser.h" #include "content/public/browser/browser_thread.h" @@ -23,10 +24,10 @@ inline bool IsResourceRefreshEnabled(RefreshType refresh_type, #if defined(OS_WIN) // Gets the GDI and USER Handles on Windows at one shot. void GetWindowsHandles(base::ProcessHandle handle, - int64* out_gdi_current, - int64* out_gdi_peak, - int64* out_user_current, - int64* out_user_peak) { + int64_t* out_gdi_current, + int64_t* out_gdi_peak, + int64_t* out_user_current, + int64_t* out_user_peak) { *out_gdi_current = 0; *out_gdi_peak = 0; *out_user_current = 0; @@ -37,13 +38,13 @@ void GetWindowsHandles(base::ProcessHandle handle, if (DuplicateHandle(current_process, handle, current_process, &process_with_query_rights, PROCESS_QUERY_INFORMATION, false, 0)) { - *out_gdi_current = static_cast<int64>( + *out_gdi_current = static_cast<int64_t>( GetGuiResources(process_with_query_rights, GR_GDIOBJECTS)); - *out_gdi_peak = static_cast<int64>( + *out_gdi_peak = static_cast<int64_t>( GetGuiResources(process_with_query_rights, GR_GDIOBJECTS_PEAK)); - *out_user_current = static_cast<int64>( + *out_user_current = static_cast<int64_t>( GetGuiResources(process_with_query_rights, GR_USEROBJECTS)); - *out_user_peak = static_cast<int64>( + *out_user_peak = static_cast<int64_t>( GetGuiResources(process_with_query_rights, GR_USEROBJECTS_PEAK)); CloseHandle(process_with_query_rights); } @@ -119,7 +120,7 @@ void TaskGroup::RemoveTask(Task* task) { void TaskGroup::Refresh( const content::GPUVideoMemoryUsageStats& gpu_memory_stats, base::TimeDelta update_interval, - int64 refresh_flags) { + int64_t refresh_flags) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); // First refresh the enabled non-expensive resources usages on the UI thread. @@ -187,7 +188,7 @@ void TaskGroup::RefreshGpuMemory( return; } - gpu_memory_ = static_cast<int64>(itr->second.video_memory); + gpu_memory_ = static_cast<int64_t>(itr->second.video_memory); gpu_memory_has_duplicates_ = itr->second.has_duplicates; } diff --git a/chrome/browser/task_management/sampling/task_group.h b/chrome/browser/task_management/sampling/task_group.h index 2ac45b6..02459fd 100644 --- a/chrome/browser/task_management/sampling/task_group.h +++ b/chrome/browser/task_management/sampling/task_group.h @@ -5,11 +5,16 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_SAMPLING_TASK_GROUP_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_SAMPLING_TASK_GROUP_H_ +#include <stddef.h> +#include <stdint.h> + #include <map> +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/process/process_handle.h" #include "base/process/process_metrics.h" +#include "build/build_config.h" #include "chrome/browser/task_management/providers/task.h" #include "chrome/browser/task_management/sampling/task_group_sampler.h" #include "chrome/browser/task_management/task_manager_observer.h" @@ -34,7 +39,7 @@ class TaskGroup { void Refresh(const content::GPUVideoMemoryUsageStats& gpu_memory_stats, base::TimeDelta update_interval, - int64 refresh_flags); + int64_t refresh_flags); // Appends the sorted IDs of the tasks that belong to this group to // |out_list|. @@ -49,19 +54,21 @@ class TaskGroup { bool empty() const { return tasks_.empty(); } double cpu_usage() const { return cpu_usage_; } - int64 private_bytes() const { return memory_usage_.private_bytes; } - int64 shared_bytes() const { return memory_usage_.shared_bytes; } - int64 physical_bytes() const { return memory_usage_.physical_bytes; } - int64 gpu_memory() const { return gpu_memory_; } + int64_t private_bytes() const { return memory_usage_.private_bytes; } + int64_t shared_bytes() const { return memory_usage_.shared_bytes; } + int64_t physical_bytes() const { return memory_usage_.physical_bytes; } + int64_t gpu_memory() const { return gpu_memory_; } bool gpu_memory_has_duplicates() const { return gpu_memory_has_duplicates_; } - int64 per_process_network_usage() const { return per_process_network_usage_; } + int64_t per_process_network_usage() const { + return per_process_network_usage_; + } bool is_backgrounded() const { return is_backgrounded_; } #if defined(OS_WIN) - int64 gdi_current_handles() const { return gdi_current_handles_; } - int64 gdi_peak_handles() const { return gdi_peak_handles_; } - int64 user_current_handles() const { return user_current_handles_; } - int64 user_peak_handles() const { return user_peak_handles_; } + int64_t gdi_current_handles() const { return gdi_current_handles_; } + int64_t gdi_peak_handles() const { return gdi_peak_handles_; } + int64_t user_current_handles() const { return user_current_handles_; } + int64_t user_peak_handles() const { return user_peak_handles_; } #endif // defined(OS_WIN) #if !defined(DISABLE_NACL) @@ -108,16 +115,16 @@ class TaskGroup { // The per process resources usages. double cpu_usage_; MemoryUsageStats memory_usage_; - int64 gpu_memory_; + int64_t gpu_memory_; // The network usage in bytes per second as the sum of all network usages of // the individual tasks sharing the same process. - int64 per_process_network_usage_; + int64_t per_process_network_usage_; #if defined(OS_WIN) // Windows GDI and USER Handles. - int64 gdi_current_handles_; - int64 gdi_peak_handles_; - int64 user_current_handles_; - int64 user_peak_handles_; + int64_t gdi_current_handles_; + int64_t gdi_peak_handles_; + int64_t user_current_handles_; + int64_t user_peak_handles_; #endif // defined(OS_WIN) #if !defined(DISABLE_NACL) int nacl_debug_stub_port_; diff --git a/chrome/browser/task_management/sampling/task_group_sampler.cc b/chrome/browser/task_management/sampling/task_group_sampler.cc index e3aaf72..896cbd3 100644 --- a/chrome/browser/task_management/sampling/task_group_sampler.cc +++ b/chrome/browser/task_management/sampling/task_group_sampler.cc @@ -6,6 +6,7 @@ #include "base/bind.h" #include "base/callback.h" +#include "build/build_config.h" #include "chrome/browser/task_management/task_manager_observer.h" #include "content/public/browser/browser_child_process_host.h" #include "content/public/browser/browser_thread.h" @@ -59,7 +60,7 @@ TaskGroupSampler::TaskGroupSampler( worker_pool_sequenced_checker_.DetachFromSequence(); } -void TaskGroupSampler::Refresh(int64 refresh_flags) { +void TaskGroupSampler::Refresh(int64_t refresh_flags) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (IsResourceRefreshEnabled(REFRESH_TYPE_CPU, refresh_flags)) { @@ -126,8 +127,8 @@ MemoryUsageStats TaskGroupSampler::RefreshMemoryUsage() { // Refreshing the physical/private/shared memory at one shot. base::WorkingSetKBytes ws_usage; if (process_metrics_->GetWorkingSetKBytes(&ws_usage)) { - memory_usage.private_bytes = static_cast<int64>(ws_usage.priv * 1024); - memory_usage.shared_bytes = static_cast<int64>(ws_usage.shared * 1024); + memory_usage.private_bytes = static_cast<int64_t>(ws_usage.priv * 1024); + memory_usage.shared_bytes = static_cast<int64_t>(ws_usage.shared * 1024); #if defined(OS_LINUX) // On Linux private memory is also resident. Just use it. memory_usage.physical_bytes = memory_usage.private_bytes; @@ -138,9 +139,9 @@ MemoryUsageStats TaskGroupSampler::RefreshMemoryUsage() { // not counted when two or more are open) and it is much more efficient to // calculate on Windows. memory_usage.physical_bytes = - static_cast<int64>(process_metrics_->GetWorkingSetSize()); + static_cast<int64_t>(process_metrics_->GetWorkingSetSize()); memory_usage.physical_bytes -= - static_cast<int64>(ws_usage.shareable * 1024); + static_cast<int64_t>(ws_usage.shareable * 1024); #endif } diff --git a/chrome/browser/task_management/sampling/task_group_sampler.h b/chrome/browser/task_management/sampling/task_group_sampler.h index 1d2c613..b70b6eb 100644 --- a/chrome/browser/task_management/sampling/task_group_sampler.h +++ b/chrome/browser/task_management/sampling/task_group_sampler.h @@ -5,22 +5,26 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_SAMPLING_TASK_GROUP_SAMPLER_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_SAMPLING_TASK_GROUP_SAMPLER_H_ +#include <stdint.h> + #include "base/callback.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/process/process.h" #include "base/process/process_handle.h" #include "base/process/process_metrics.h" #include "base/sequence_checker.h" #include "base/sequenced_task_runner.h" +#include "build/build_config.h" namespace task_management { // Wraps the memory usage stats values together so that it can be sent between // the UI and the worker threads. struct MemoryUsageStats { - int64 private_bytes; - int64 shared_bytes; - int64 physical_bytes; + int64_t private_bytes; + int64_t shared_bytes; + int64_t physical_bytes; MemoryUsageStats() : private_bytes(-1), @@ -58,7 +62,7 @@ class TaskGroupSampler : public base::RefCountedThreadSafe<TaskGroupSampler> { // Refreshes the expensive process' stats (CPU usage, memory usage, and idle // wakeups per second) on the worker thread. - void Refresh(int64 refresh_flags); + void Refresh(int64_t refresh_flags); private: friend class base::RefCountedThreadSafe<TaskGroupSampler>; diff --git a/chrome/browser/task_management/sampling/task_manager_impl.cc b/chrome/browser/task_management/sampling/task_manager_impl.cc index e44a0da..9f6e87b 100644 --- a/chrome/browser/task_management/sampling/task_manager_impl.cc +++ b/chrome/browser/task_management/sampling/task_manager_impl.cc @@ -6,6 +6,7 @@ #include "base/command_line.h" #include "base/stl_util.h" +#include "build/build_config.h" #include "chrome/browser/task_management/providers/browser_process_task_provider.h" #include "chrome/browser/task_management/providers/child_process_task_provider.h" #include "chrome/browser/task_management/providers/web_contents/web_contents_task_provider.h" @@ -75,20 +76,20 @@ double TaskManagerImpl::GetCpuUsage(TaskId task_id) const { return GetTaskGroupByTaskId(task_id)->cpu_usage(); } -int64 TaskManagerImpl::GetPhysicalMemoryUsage(TaskId task_id) const { +int64_t TaskManagerImpl::GetPhysicalMemoryUsage(TaskId task_id) const { return GetTaskGroupByTaskId(task_id)->physical_bytes(); } -int64 TaskManagerImpl::GetPrivateMemoryUsage(TaskId task_id) const { +int64_t TaskManagerImpl::GetPrivateMemoryUsage(TaskId task_id) const { return GetTaskGroupByTaskId(task_id)->private_bytes(); } -int64 TaskManagerImpl::GetSharedMemoryUsage(TaskId task_id) const { +int64_t TaskManagerImpl::GetSharedMemoryUsage(TaskId task_id) const { return GetTaskGroupByTaskId(task_id)->shared_bytes(); } -int64 TaskManagerImpl::GetGpuMemoryUsage(TaskId task_id, - bool* has_duplicates) const { +int64_t TaskManagerImpl::GetGpuMemoryUsage(TaskId task_id, + bool* has_duplicates) const { const TaskGroup* task_group = GetTaskGroupByTaskId(task_id); if (has_duplicates) *has_duplicates = task_group->gpu_memory_has_duplicates(); @@ -108,8 +109,8 @@ int TaskManagerImpl::GetNaClDebugStubPort(TaskId task_id) const { } void TaskManagerImpl::GetGDIHandles(TaskId task_id, - int64* current, - int64* peak) const { + int64_t* current, + int64_t* peak) const { #if defined(OS_WIN) const TaskGroup* task_group = GetTaskGroupByTaskId(task_id); *current = task_group->gdi_current_handles(); @@ -121,8 +122,8 @@ void TaskManagerImpl::GetGDIHandles(TaskId task_id, } void TaskManagerImpl::GetUSERHandles(TaskId task_id, - int64* current, - int64* peak) const { + int64_t* current, + int64_t* peak) const { #if defined(OS_WIN) const TaskGroup* task_group = GetTaskGroupByTaskId(task_id); *current = task_group->user_current_handles(); @@ -174,21 +175,21 @@ Task::Type TaskManagerImpl::GetType(TaskId task_id) const { return GetTaskByTaskId(task_id)->GetType(); } -int64 TaskManagerImpl::GetNetworkUsage(TaskId task_id) const { +int64_t TaskManagerImpl::GetNetworkUsage(TaskId task_id) const { return GetTaskByTaskId(task_id)->network_usage(); } -int64 TaskManagerImpl::GetProcessTotalNetworkUsage(TaskId task_id) const { +int64_t TaskManagerImpl::GetProcessTotalNetworkUsage(TaskId task_id) const { return GetTaskGroupByTaskId(task_id)->per_process_network_usage(); } -int64 TaskManagerImpl::GetSqliteMemoryUsed(TaskId task_id) const { +int64_t TaskManagerImpl::GetSqliteMemoryUsed(TaskId task_id) const { return GetTaskByTaskId(task_id)->GetSqliteMemoryUsed(); } bool TaskManagerImpl::GetV8Memory(TaskId task_id, - int64* allocated, - int64* used) const { + int64_t* allocated, + int64_t* used) const { const Task* task = GetTaskByTaskId(task_id); if (!task->ReportsV8Memory()) return false; diff --git a/chrome/browser/task_management/sampling/task_manager_impl.h b/chrome/browser/task_management/sampling/task_manager_impl.h index 4207eb6..eef0410 100644 --- a/chrome/browser/task_management/sampling/task_manager_impl.h +++ b/chrome/browser/task_management/sampling/task_manager_impl.h @@ -5,9 +5,13 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_SAMPLING_TASK_MANAGER_IMPL_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_SAMPLING_TASK_MANAGER_IMPL_H_ +#include <stddef.h> +#include <stdint.h> + #include <map> #include "base/lazy_instance.h" +#include "base/macros.h" #include "base/memory/scoped_vector.h" #include "base/sequenced_task_runner.h" #include "chrome/browser/task_management/providers/task_provider.h" @@ -32,18 +36,19 @@ class TaskManagerImpl : // task_management::TaskManagerInterface: void ActivateTask(TaskId task_id) override; double GetCpuUsage(TaskId task_id) const override; - int64 GetPhysicalMemoryUsage(TaskId task_id) const override; - int64 GetPrivateMemoryUsage(TaskId task_id) const override; - int64 GetSharedMemoryUsage(TaskId task_id) const override; - int64 GetGpuMemoryUsage(TaskId task_id, bool* has_duplicates) const override; + int64_t GetPhysicalMemoryUsage(TaskId task_id) const override; + int64_t GetPrivateMemoryUsage(TaskId task_id) const override; + int64_t GetSharedMemoryUsage(TaskId task_id) const override; + int64_t GetGpuMemoryUsage(TaskId task_id, + bool* has_duplicates) const override; int GetIdleWakeupsPerSecond(TaskId task_id) const override; int GetNaClDebugStubPort(TaskId task_id) const override; void GetGDIHandles(TaskId task_id, - int64* current, - int64* peak) const override; + int64_t* current, + int64_t* peak) const override; void GetUSERHandles(TaskId task_id, - int64* current, - int64* peak) const override; + int64_t* current, + int64_t* peak) const override; int GetOpenFdCount(TaskId task_id) const override; bool IsTaskOnBackgroundedProcess(TaskId task_id) const override; const base::string16& GetTitle(TaskId task_id) const override; @@ -53,12 +58,12 @@ class TaskManagerImpl : const base::ProcessHandle& GetProcessHandle(TaskId task_id) const override; const base::ProcessId& GetProcessId(TaskId task_id) const override; Task::Type GetType(TaskId task_id) const override; - int64 GetNetworkUsage(TaskId task_id) const override; - int64 GetProcessTotalNetworkUsage(TaskId task_id) const override; - int64 GetSqliteMemoryUsed(TaskId task_id) const override; + int64_t GetNetworkUsage(TaskId task_id) const override; + int64_t GetProcessTotalNetworkUsage(TaskId task_id) const override; + int64_t GetSqliteMemoryUsed(TaskId task_id) const override; bool GetV8Memory(TaskId task_id, - int64* allocated, - int64* used) const override; + int64_t* allocated, + int64_t* used) const override; bool GetWebCacheStats( TaskId task_id, blink::WebCache::ResourceTypeStats* stats) const override; diff --git a/chrome/browser/task_management/task_management_browsertest_util.cc b/chrome/browser/task_management/task_management_browsertest_util.cc index 3fb1810..6c51d48 100644 --- a/chrome/browser/task_management/task_management_browsertest_util.cc +++ b/chrome/browser/task_management/task_management_browsertest_util.cc @@ -5,6 +5,7 @@ #include "chrome/browser/task_management/task_management_browsertest_util.h" #include "base/stl_util.h" +#include "build/build_config.h" #if defined(OS_CHROMEOS) #include "chrome/browser/chromeos/resource_reporter/resource_reporter.h" diff --git a/chrome/browser/task_management/task_management_browsertest_util.h b/chrome/browser/task_management/task_management_browsertest_util.h index 6ba4855..51eb8d9 100644 --- a/chrome/browser/task_management/task_management_browsertest_util.h +++ b/chrome/browser/task_management/task_management_browsertest_util.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_TASK_MANAGEMENT_BROWSERTEST_UTIL_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_TASK_MANAGEMENT_BROWSERTEST_UTIL_H_ +#include "base/macros.h" #include "chrome/browser/task_management/providers/task_provider_observer.h" #include "chrome/browser/task_management/providers/web_contents/web_contents_tags_manager.h" #include "chrome/browser/task_management/providers/web_contents/web_contents_task_provider.h" diff --git a/chrome/browser/task_management/task_manager_interface.cc b/chrome/browser/task_management/task_manager_interface.cc index 13c4ecc..790cbd0 100644 --- a/chrome/browser/task_management/task_manager_interface.cc +++ b/chrome/browser/task_management/task_manager_interface.cc @@ -57,7 +57,7 @@ void TaskManagerInterface::RemoveObserver(TaskManagerObserver* observer) { observer->observed_task_manager_ = nullptr; // Recalculate the minimum refresh rate and the enabled resource flags. - int64 flags = 0; + int64_t flags = 0; base::TimeDelta min_time = base::TimeDelta::Max(); base::ObserverList<TaskManagerObserver>::Iterator itr(&observers_); while (TaskManagerObserver* obs = itr.GetNext()) { @@ -79,7 +79,7 @@ void TaskManagerInterface::RemoveObserver(TaskManagerObserver* observer) { } void TaskManagerInterface::RecalculateRefreshFlags() { - int64 flags = 0; + int64_t flags = 0; base::ObserverList<TaskManagerObserver>::Iterator itr(&observers_); while (TaskManagerObserver* obs = itr.GetNext()) flags |= obs->desired_resources_flags(); @@ -120,11 +120,11 @@ base::TimeDelta TaskManagerInterface::GetCurrentRefreshTime() const { : base::TimeDelta::Max(); } -void TaskManagerInterface::ResourceFlagsAdded(int64 flags) { +void TaskManagerInterface::ResourceFlagsAdded(int64_t flags) { enabled_resources_flags_ |= flags; } -void TaskManagerInterface::SetEnabledResourceFlags(int64 flags) { +void TaskManagerInterface::SetEnabledResourceFlags(int64_t flags) { enabled_resources_flags_ = flags; } diff --git a/chrome/browser/task_management/task_manager_interface.h b/chrome/browser/task_management/task_manager_interface.h index 0a78f79..dd310ee 100644 --- a/chrome/browser/task_management/task_manager_interface.h +++ b/chrome/browser/task_management/task_manager_interface.h @@ -5,8 +5,10 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_TASK_MANAGER_INTERFACE_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_TASK_MANAGER_INTERFACE_H_ +#include <stddef.h> #include <stdint.h> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "base/process/process_handle.h" @@ -51,16 +53,16 @@ class TaskManagerInterface { // Returns the current physical/private/shared memory usage of the task with // |task_id| in bytes. A value of -1 means no valid value is currently // available. - virtual int64 GetPhysicalMemoryUsage(TaskId task_id) const = 0; - virtual int64 GetPrivateMemoryUsage(TaskId task_id) const = 0; - virtual int64 GetSharedMemoryUsage(TaskId task_id) const = 0; + virtual int64_t GetPhysicalMemoryUsage(TaskId task_id) const = 0; + virtual int64_t GetPrivateMemoryUsage(TaskId task_id) const = 0; + virtual int64_t GetSharedMemoryUsage(TaskId task_id) const = 0; // Returns the GPU memory usage of the task with |task_id| in bytes. A value // of -1 means no valid value is currently available. // |has_duplicates| will be set to true if this process' GPU resource count is // inflated because it is counting other processes' resources. - virtual int64 GetGpuMemoryUsage(TaskId task_id, - bool* has_duplicates) const = 0; + virtual int64_t GetGpuMemoryUsage(TaskId task_id, + bool* has_duplicates) const = 0; // Returns the number of average idle CPU wakeups per second since the last // refresh cycle. A value of -1 means no valid value is currently available. @@ -74,11 +76,11 @@ class TaskManagerInterface { // On Windows, gets the current and peak number of GDI and USER handles in // use. A value of -1 means no valid value is currently available. virtual void GetGDIHandles(TaskId task_id, - int64* current, - int64* peak) const = 0; + int64_t* current, + int64_t* peak) const = 0; virtual void GetUSERHandles(TaskId task_id, - int64* current, - int64* peak) const = 0; + int64_t* current, + int64_t* peak) const = 0; // On Linux and ChromeOS, gets the number of file descriptors currently open // by the process on which the task with |task_id| is running, or -1 if no @@ -116,25 +118,25 @@ class TaskManagerInterface { // cycle for the task with |task_id|. A value of -1 means no valid value is // currently available or that task has never been notified of any network // usage. - virtual int64 GetNetworkUsage(TaskId task_id) const = 0; + virtual int64_t GetNetworkUsage(TaskId task_id) const = 0; // Returns the total network usage (in bytes per second) during the current // refresh cycle for the process on which the task with |task_id| is running. // This is the sum of all the network usage of the individual tasks (that // can be gotten by the above GetNetworkUsage()). A value of -1 means network // usage calculation refresh is currently not available. - virtual int64 GetProcessTotalNetworkUsage(TaskId task_id) const = 0; + virtual int64_t GetProcessTotalNetworkUsage(TaskId task_id) const = 0; // Returns the Sqlite used memory (in bytes) for the task with |task_id|. // A value of -1 means no valid value is currently available. - virtual int64 GetSqliteMemoryUsed(TaskId task_id) const = 0; + virtual int64_t GetSqliteMemoryUsed(TaskId task_id) const = 0; // Returns the allocated and used V8 memory (in bytes) for the task with // |task_id|. A return value of false means no valid value is currently // available. virtual bool GetV8Memory(TaskId task_id, - int64* allocated, - int64* used) const = 0; + int64_t* allocated, + int64_t* used) const = 0; // Gets the Webkit resource cache stats for the task with |task_id|. // A return value of false means that task does NOT report WebCache stats. @@ -178,7 +180,7 @@ class TaskManagerInterface { // will return base::TimeDelta::Max() if the task manager is not running. base::TimeDelta GetCurrentRefreshTime() const; - int64 enabled_resources_flags() const { return enabled_resources_flags_; } + int64_t enabled_resources_flags() const { return enabled_resources_flags_; } void set_timer_for_testing(scoped_ptr<base::Timer> timer) { refresh_timer_ = timer.Pass(); @@ -192,10 +194,10 @@ class TaskManagerInterface { void RecalculateRefreshFlags(); // Appends |flags| to the |enabled_resources_flags_|. - void ResourceFlagsAdded(int64 flags); + void ResourceFlagsAdded(int64_t flags); // Sets |enabled_resources_flags_| to |flags|. - void SetEnabledResourceFlags(int64 flags); + void SetEnabledResourceFlags(int64_t flags); // Schedules the task manager refresh cycles using the given |refresh_time|. // It stops any existing refresh schedule. @@ -208,7 +210,7 @@ class TaskManagerInterface { scoped_ptr<base::Timer> refresh_timer_; // The flags containing the enabled resources types calculations. - int64 enabled_resources_flags_; + int64_t enabled_resources_flags_; DISALLOW_COPY_AND_ASSIGN(TaskManagerInterface); }; diff --git a/chrome/browser/task_management/task_manager_observer.cc b/chrome/browser/task_management/task_manager_observer.cc index cda0067..a0a1a65 100644 --- a/chrome/browser/task_management/task_manager_observer.cc +++ b/chrome/browser/task_management/task_manager_observer.cc @@ -9,13 +9,12 @@ namespace task_management { TaskManagerObserver::TaskManagerObserver(base::TimeDelta refresh_time, - int64 resources_flags) + int64_t resources_flags) : observed_task_manager_(nullptr), - desired_refresh_time_( - refresh_time < base::TimeDelta::FromSeconds(1) ? - base::TimeDelta::FromSeconds(1) : refresh_time), - desired_resources_flags_(resources_flags) { -} + desired_refresh_time_(refresh_time < base::TimeDelta::FromSeconds(1) + ? base::TimeDelta::FromSeconds(1) + : refresh_time), + desired_resources_flags_(resources_flags) {} TaskManagerObserver::~TaskManagerObserver() { } diff --git a/chrome/browser/task_management/task_manager_observer.h b/chrome/browser/task_management/task_manager_observer.h index 7163cb4..408d2a8 100644 --- a/chrome/browser/task_management/task_manager_observer.h +++ b/chrome/browser/task_management/task_manager_observer.h @@ -5,15 +5,19 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_TASK_MANAGER_OBSERVER_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_TASK_MANAGER_OBSERVER_H_ +#include <stdint.h> + #include <vector> +#include "base/macros.h" #include "base/time/time.h" +#include "build/build_config.h" namespace task_management { class TaskManagerInterface; -typedef int64 TaskId; +typedef int64_t TaskId; typedef std::vector<TaskId> TaskIdList; // Defines a list of types of resources that an observer needs to be refreshed @@ -60,7 +64,7 @@ class TaskManagerObserver { // 4- Upon the removal of the observer from the task manager, the task manager // will update its refresh time and the calculated resources to be the minimum // required value of all the remaining observers. - TaskManagerObserver(base::TimeDelta refresh_time, int64 resources_flags); + TaskManagerObserver(base::TimeDelta refresh_time, int64_t resources_flags); virtual ~TaskManagerObserver(); // Notifies the observer that a chrome task with |id| has started and the task @@ -86,7 +90,7 @@ class TaskManagerObserver { return desired_refresh_time_; } - int64 desired_resources_flags() const { return desired_resources_flags_; } + int64_t desired_resources_flags() const { return desired_resources_flags_; } protected: TaskManagerInterface* observed_task_manager() const { @@ -109,7 +113,7 @@ class TaskManagerObserver { // The flags that contain the resources that this observer needs to be // calculated on each refresh. - int64 desired_resources_flags_; + int64_t desired_resources_flags_; DISALLOW_COPY_AND_ASSIGN(TaskManagerObserver); }; diff --git a/chrome/browser/task_management/task_manager_observer_unittest.cc b/chrome/browser/task_management/task_manager_observer_unittest.cc index aedd2a0..6595fa2 100644 --- a/chrome/browser/task_management/task_manager_observer_unittest.cc +++ b/chrome/browser/task_management/task_manager_observer_unittest.cc @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stdint.h> + +#include "base/macros.h" #include "chrome/browser/task_management/test_task_manager.h" #include "testing/gtest/include/gtest/gtest.h" @@ -12,9 +15,8 @@ namespace { // Defines a concrete observer that will be used for testing. class TestObserver : public TaskManagerObserver { public: - TestObserver(base::TimeDelta refresh_time, int64 resources_flags) - : TaskManagerObserver(refresh_time, resources_flags) { - } + TestObserver(base::TimeDelta refresh_time, int64_t resources_flags) + : TaskManagerObserver(refresh_time, resources_flags) {} ~TestObserver() override {} @@ -49,11 +51,11 @@ class TaskManagerObserverTest : public testing::Test { TEST_F(TaskManagerObserverTest, Basic) { base::TimeDelta refresh_time1 = base::TimeDelta::FromSeconds(2); base::TimeDelta refresh_time2 = base::TimeDelta::FromMilliseconds(999); - int64 flags1 = RefreshType::REFRESH_TYPE_CPU | - RefreshType::REFRESH_TYPE_WEBCACHE_STATS | - RefreshType::REFRESH_TYPE_HANDLES; - int64 flags2 = RefreshType::REFRESH_TYPE_MEMORY | - RefreshType::REFRESH_TYPE_NACL; + int64_t flags1 = RefreshType::REFRESH_TYPE_CPU | + RefreshType::REFRESH_TYPE_WEBCACHE_STATS | + RefreshType::REFRESH_TYPE_HANDLES; + int64_t flags2 = + RefreshType::REFRESH_TYPE_MEMORY | RefreshType::REFRESH_TYPE_NACL; TestObserver observer1(refresh_time1, flags1); TestObserver observer2(refresh_time2, flags2); @@ -75,14 +77,14 @@ TEST_F(TaskManagerObserverTest, TaskManagerResponseToObservers) { base::TimeDelta refresh_time2 = base::TimeDelta::FromSeconds(10); base::TimeDelta refresh_time3 = base::TimeDelta::FromSeconds(3); base::TimeDelta refresh_time4 = base::TimeDelta::FromSeconds(2); - int64 flags1 = RefreshType::REFRESH_TYPE_CPU | - RefreshType::REFRESH_TYPE_WEBCACHE_STATS | - RefreshType::REFRESH_TYPE_HANDLES; - int64 flags2 = RefreshType::REFRESH_TYPE_MEMORY | - RefreshType::REFRESH_TYPE_NACL; - int64 flags3 = RefreshType::REFRESH_TYPE_MEMORY | - RefreshType::REFRESH_TYPE_CPU; - int64 flags4 = RefreshType::REFRESH_TYPE_GPU_MEMORY; + int64_t flags1 = RefreshType::REFRESH_TYPE_CPU | + RefreshType::REFRESH_TYPE_WEBCACHE_STATS | + RefreshType::REFRESH_TYPE_HANDLES; + int64_t flags2 = + RefreshType::REFRESH_TYPE_MEMORY | RefreshType::REFRESH_TYPE_NACL; + int64_t flags3 = + RefreshType::REFRESH_TYPE_MEMORY | RefreshType::REFRESH_TYPE_CPU; + int64_t flags4 = RefreshType::REFRESH_TYPE_GPU_MEMORY; TestObserver observer1(refresh_time1, flags1); TestObserver observer2(refresh_time2, flags2); diff --git a/chrome/browser/task_management/test_task_manager.cc b/chrome/browser/task_management/test_task_manager.cc index ffd7202..c76c5b1 100644 --- a/chrome/browser/task_management/test_task_manager.cc +++ b/chrome/browser/task_management/test_task_manager.cc @@ -24,20 +24,20 @@ double TestTaskManager::GetCpuUsage(TaskId task_id) const { return 0.0; } -int64 TestTaskManager::GetPhysicalMemoryUsage(TaskId task_id) const { +int64_t TestTaskManager::GetPhysicalMemoryUsage(TaskId task_id) const { return -1; } -int64 TestTaskManager::GetPrivateMemoryUsage(TaskId task_id) const { +int64_t TestTaskManager::GetPrivateMemoryUsage(TaskId task_id) const { return -1; } -int64 TestTaskManager::GetSharedMemoryUsage(TaskId task_id) const { +int64_t TestTaskManager::GetSharedMemoryUsage(TaskId task_id) const { return -1; } -int64 TestTaskManager::GetGpuMemoryUsage(TaskId task_id, - bool* has_duplicates) const { +int64_t TestTaskManager::GetGpuMemoryUsage(TaskId task_id, + bool* has_duplicates) const { return -1; } @@ -50,14 +50,12 @@ int TestTaskManager::GetNaClDebugStubPort(TaskId task_id) const { } void TestTaskManager::GetGDIHandles(TaskId task_id, - int64* current, - int64* peak) const { -} + int64_t* current, + int64_t* peak) const {} void TestTaskManager::GetUSERHandles(TaskId task_id, - int64* current, - int64* peak) const { -} + int64_t* current, + int64_t* peak) const {} int TestTaskManager::GetOpenFdCount(TaskId task_id) const { return -1; @@ -96,21 +94,21 @@ Task::Type TestTaskManager::GetType(TaskId task_id) const { return Task::UNKNOWN; } -int64 TestTaskManager::GetNetworkUsage(TaskId task_id) const { +int64_t TestTaskManager::GetNetworkUsage(TaskId task_id) const { return -1; } -int64 TestTaskManager::GetProcessTotalNetworkUsage(TaskId task_id) const { +int64_t TestTaskManager::GetProcessTotalNetworkUsage(TaskId task_id) const { return -1; } -int64 TestTaskManager::GetSqliteMemoryUsed(TaskId task_id) const { +int64_t TestTaskManager::GetSqliteMemoryUsed(TaskId task_id) const { return -1; } bool TestTaskManager::GetV8Memory(TaskId task_id, - int64* allocated, - int64* used) const { + int64_t* allocated, + int64_t* used) const { return false; } @@ -132,7 +130,7 @@ base::TimeDelta TestTaskManager::GetRefreshTime() { return GetCurrentRefreshTime(); } -int64 TestTaskManager::GetEnabledFlags() { +int64_t TestTaskManager::GetEnabledFlags() { return enabled_resources_flags(); } diff --git a/chrome/browser/task_management/test_task_manager.h b/chrome/browser/task_management/test_task_manager.h index 36f2847..156df2e 100644 --- a/chrome/browser/task_management/test_task_manager.h +++ b/chrome/browser/task_management/test_task_manager.h @@ -5,6 +5,9 @@ #ifndef CHROME_BROWSER_TASK_MANAGEMENT_TEST_TASK_MANAGER_H_ #define CHROME_BROWSER_TASK_MANAGEMENT_TEST_TASK_MANAGER_H_ +#include <stddef.h> +#include <stdint.h> + #include "base/macros.h" #include "base/timer/mock_timer.h" #include "chrome/browser/task_management/task_manager_interface.h" @@ -21,18 +24,19 @@ class TestTaskManager : public TaskManagerInterface { // task_management::TaskManagerInterface: void ActivateTask(TaskId task_id) override; double GetCpuUsage(TaskId task_id) const override; - int64 GetPhysicalMemoryUsage(TaskId task_id) const override; - int64 GetPrivateMemoryUsage(TaskId task_id) const override; - int64 GetSharedMemoryUsage(TaskId task_id) const override; - int64 GetGpuMemoryUsage(TaskId task_id, bool* has_duplicates) const override; + int64_t GetPhysicalMemoryUsage(TaskId task_id) const override; + int64_t GetPrivateMemoryUsage(TaskId task_id) const override; + int64_t GetSharedMemoryUsage(TaskId task_id) const override; + int64_t GetGpuMemoryUsage(TaskId task_id, + bool* has_duplicates) const override; int GetIdleWakeupsPerSecond(TaskId task_id) const override; int GetNaClDebugStubPort(TaskId task_id) const override; void GetGDIHandles(TaskId task_id, - int64* current, - int64* peak) const override; + int64_t* current, + int64_t* peak) const override; void GetUSERHandles(TaskId task_id, - int64* current, - int64* peak) const override; + int64_t* current, + int64_t* peak) const override; int GetOpenFdCount(TaskId task_id) const override; bool IsTaskOnBackgroundedProcess(TaskId task_id) const override; const base::string16& GetTitle(TaskId task_id) const override; @@ -42,12 +46,12 @@ class TestTaskManager : public TaskManagerInterface { const base::ProcessHandle& GetProcessHandle(TaskId task_id) const override; const base::ProcessId& GetProcessId(TaskId task_id) const override; Task::Type GetType(TaskId task_id) const override; - int64 GetNetworkUsage(TaskId task_id) const override; - int64 GetProcessTotalNetworkUsage(TaskId task_id) const override; - int64 GetSqliteMemoryUsed(TaskId task_id) const override; + int64_t GetNetworkUsage(TaskId task_id) const override; + int64_t GetProcessTotalNetworkUsage(TaskId task_id) const override; + int64_t GetSqliteMemoryUsed(TaskId task_id) const override; bool GetV8Memory(TaskId task_id, - int64* allocated, - int64* used) const override; + int64_t* allocated, + int64_t* used) const override; bool GetWebCacheStats( TaskId task_id, blink::WebCache::ResourceTypeStats* stats) const override; @@ -55,7 +59,7 @@ class TestTaskManager : public TaskManagerInterface { size_t GetNumberOfTasksOnSameProcess(TaskId task_id) const override; base::TimeDelta GetRefreshTime(); - int64 GetEnabledFlags(); + int64_t GetEnabledFlags(); protected: // task_management::TaskManager: diff --git a/chrome/browser/task_manager/background_information.cc b/chrome/browser/task_manager/background_information.cc index adc88a2..a1b5d86 100644 --- a/chrome/browser/task_manager/background_information.cc +++ b/chrome/browser/task_manager/background_information.cc @@ -4,7 +4,10 @@ #include "chrome/browser/task_manager/background_information.h" +#include <stddef.h> + #include "base/i18n/rtl.h" +#include "base/macros.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/background/background_contents.h" diff --git a/chrome/browser/task_manager/background_information.h b/chrome/browser/task_manager/background_information.h index 4e2d8a5..929eb7d 100644 --- a/chrome/browser/task_manager/background_information.h +++ b/chrome/browser/task_manager/background_information.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGER_BACKGROUND_INFORMATION_H_ #define CHROME_BROWSER_TASK_MANAGER_BACKGROUND_INFORMATION_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "chrome/browser/task_manager/web_contents_information.h" namespace task_manager { diff --git a/chrome/browser/task_manager/browser_process_resource_provider.h b/chrome/browser/task_manager/browser_process_resource_provider.h index 6d9a0db..fb158e0 100644 --- a/chrome/browser/task_manager/browser_process_resource_provider.h +++ b/chrome/browser/task_manager/browser_process_resource_provider.h @@ -5,8 +5,10 @@ #ifndef CHROME_BROWSER_TASK_MANAGER_BROWSER_PROCESS_RESOURCE_PROVIDER_H_ #define CHROME_BROWSER_TASK_MANAGER_BROWSER_PROCESS_RESOURCE_PROVIDER_H_ -#include "base/basictypes.h" +#include <stddef.h> + #include "base/compiler_specific.h" +#include "base/macros.h" #include "chrome/browser/task_manager/resource_provider.h" #include "content/public/browser/browser_child_process_observer.h" #include "content/public/browser/child_process_data.h" diff --git a/chrome/browser/task_manager/child_process_resource_provider.cc b/chrome/browser/task_manager/child_process_resource_provider.cc index 8bfa922..c89cc0e 100644 --- a/chrome/browser/task_manager/child_process_resource_provider.cc +++ b/chrome/browser/task_manager/child_process_resource_provider.cc @@ -4,9 +4,12 @@ #include "chrome/browser/task_manager/child_process_resource_provider.h" +#include <stddef.h> + #include <vector> #include "base/i18n/rtl.h" +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/strings/string16.h" #include "chrome/browser/process_resource_usage.h" diff --git a/chrome/browser/task_manager/child_process_resource_provider.h b/chrome/browser/task_manager/child_process_resource_provider.h index 6063e53..ffb3635 100644 --- a/chrome/browser/task_manager/child_process_resource_provider.h +++ b/chrome/browser/task_manager/child_process_resource_provider.h @@ -8,7 +8,7 @@ #include <map> #include <vector> -#include "base/basictypes.h" +#include "base/macros.h" #include "chrome/browser/task_manager/resource_provider.h" #include "content/public/browser/browser_child_process_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/task_manager/extension_information.cc b/chrome/browser/task_manager/extension_information.cc index 527b7c2..66e39d0 100644 --- a/chrome/browser/task_manager/extension_information.cc +++ b/chrome/browser/task_manager/extension_information.cc @@ -4,6 +4,9 @@ #include "chrome/browser/task_manager/extension_information.h" +#include <stddef.h> + +#include "base/macros.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/browser_process.h" diff --git a/chrome/browser/task_manager/extension_information.h b/chrome/browser/task_manager/extension_information.h index 879d3ef..fc2e768 100644 --- a/chrome/browser/task_manager/extension_information.h +++ b/chrome/browser/task_manager/extension_information.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGER_EXTENSION_INFORMATION_H_ #define CHROME_BROWSER_TASK_MANAGER_EXTENSION_INFORMATION_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "chrome/browser/task_manager/web_contents_information.h" namespace task_manager { diff --git a/chrome/browser/task_manager/guest_information.cc b/chrome/browser/task_manager/guest_information.cc index 63f1f7b..6299c66 100644 --- a/chrome/browser/task_manager/guest_information.cc +++ b/chrome/browser/task_manager/guest_information.cc @@ -4,6 +4,7 @@ #include "chrome/browser/task_manager/guest_information.h" +#include "base/macros.h" #include "base/strings/string16.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/profiles/profile.h" diff --git a/chrome/browser/task_manager/guest_information.h b/chrome/browser/task_manager/guest_information.h index 6333978..0d47cdf 100644 --- a/chrome/browser/task_manager/guest_information.h +++ b/chrome/browser/task_manager/guest_information.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGER_GUEST_INFORMATION_H_ #define CHROME_BROWSER_TASK_MANAGER_GUEST_INFORMATION_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "chrome/browser/task_manager/web_contents_information.h" namespace task_manager { diff --git a/chrome/browser/task_manager/os_resource_win.h b/chrome/browser/task_manager/os_resource_win.h index f04e59b..8e56bac 100644 --- a/chrome/browser/task_manager/os_resource_win.h +++ b/chrome/browser/task_manager/os_resource_win.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_TASK_MANAGER_OS_RESOURCE_WIN_H_ #define CHROME_BROWSER_TASK_MANAGER_OS_RESOURCE_WIN_H_ +#include <stddef.h> + #include "base/process/process_handle.h" namespace task_manager { diff --git a/chrome/browser/task_manager/panel_information.cc b/chrome/browser/task_manager/panel_information.cc index 189b9a6..262c842 100644 --- a/chrome/browser/task_manager/panel_information.cc +++ b/chrome/browser/task_manager/panel_information.cc @@ -4,7 +4,10 @@ #include "chrome/browser/task_manager/panel_information.h" +#include <stddef.h> + #include "base/i18n/rtl.h" +#include "base/macros.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/task_manager/renderer_resource.h" diff --git a/chrome/browser/task_manager/panel_information.h b/chrome/browser/task_manager/panel_information.h index c5b5324..38b4f26 100644 --- a/chrome/browser/task_manager/panel_information.h +++ b/chrome/browser/task_manager/panel_information.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGER_PANEL_INFORMATION_H_ #define CHROME_BROWSER_TASK_MANAGER_PANEL_INFORMATION_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "chrome/browser/task_manager/web_contents_information.h" namespace task_manager { diff --git a/chrome/browser/task_manager/printing_information.cc b/chrome/browser/task_manager/printing_information.cc index ac0d904..01fb7f9 100644 --- a/chrome/browser/task_manager/printing_information.cc +++ b/chrome/browser/task_manager/printing_information.cc @@ -4,6 +4,7 @@ #include "chrome/browser/task_manager/printing_information.h" +#include "base/macros.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/browser_process.h" diff --git a/chrome/browser/task_manager/printing_information.h b/chrome/browser/task_manager/printing_information.h index 8bc8c4d..41b58fe 100644 --- a/chrome/browser/task_manager/printing_information.h +++ b/chrome/browser/task_manager/printing_information.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGER_PRINTING_INFORMATION_H_ #define CHROME_BROWSER_TASK_MANAGER_PRINTING_INFORMATION_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "chrome/browser/task_manager/web_contents_information.h" namespace task_manager { diff --git a/chrome/browser/task_manager/renderer_resource.cc b/chrome/browser/task_manager/renderer_resource.cc index 51f0dc1..e7a3528 100644 --- a/chrome/browser/task_manager/renderer_resource.cc +++ b/chrome/browser/task_manager/renderer_resource.cc @@ -4,7 +4,6 @@ #include "chrome/browser/task_manager/renderer_resource.h" -#include "base/basictypes.h" #include "chrome/browser/devtools/devtools_window.h" #include "chrome/browser/process_resource_usage.h" #include "chrome/browser/profiles/profile.h" diff --git a/chrome/browser/task_manager/renderer_resource.h b/chrome/browser/task_manager/renderer_resource.h index c83ed3c..8c3ee00 100644 --- a/chrome/browser/task_manager/renderer_resource.h +++ b/chrome/browser/task_manager/renderer_resource.h @@ -5,7 +5,9 @@ #ifndef CHROME_BROWSER_TASK_MANAGER_RENDERER_RESOURCE_H_ #define CHROME_BROWSER_TASK_MANAGER_RENDERER_RESOURCE_H_ -#include "base/basictypes.h" +#include <stddef.h> + +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/task_manager/resource_provider.h" diff --git a/chrome/browser/task_manager/resource_provider.h b/chrome/browser/task_manager/resource_provider.h index 5186483..8677a17 100644 --- a/chrome/browser/task_manager/resource_provider.h +++ b/chrome/browser/task_manager/resource_provider.h @@ -5,7 +5,9 @@ #ifndef CHROME_BROWSER_TASK_MANAGER_RESOURCE_PROVIDER_H_ #define CHROME_BROWSER_TASK_MANAGER_RESOURCE_PROVIDER_H_ -#include "base/basictypes.h" +#include <stddef.h> + +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/process/process_handle.h" #include "base/strings/string16.h" diff --git a/chrome/browser/task_manager/tab_contents_information.cc b/chrome/browser/task_manager/tab_contents_information.cc index 05ce45b..c566491 100644 --- a/chrome/browser/task_manager/tab_contents_information.cc +++ b/chrome/browser/task_manager/tab_contents_information.cc @@ -4,7 +4,10 @@ #include "chrome/browser/task_manager/tab_contents_information.h" +#include <stddef.h> + #include "base/callback.h" +#include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/devtools/devtools_window.h" diff --git a/chrome/browser/task_manager/tab_contents_information.h b/chrome/browser/task_manager/tab_contents_information.h index 5bd6380..fefc8ad 100644 --- a/chrome/browser/task_manager/tab_contents_information.h +++ b/chrome/browser/task_manager/tab_contents_information.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_TASK_MANAGER_TAB_CONTENTS_INFORMATION_H_ #define CHROME_BROWSER_TASK_MANAGER_TAB_CONTENTS_INFORMATION_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "chrome/browser/task_manager/web_contents_information.h" namespace task_manager { diff --git a/chrome/browser/task_manager/task_manager.cc b/chrome/browser/task_manager/task_manager.cc index 59f179e..80eb9e6 100644 --- a/chrome/browser/task_manager/task_manager.cc +++ b/chrome/browser/task_manager/task_manager.cc @@ -18,6 +18,7 @@ #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/thread_task_runner_handle.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/private_working_set_snapshot.h" #include "chrome/browser/profiles/profile_manager.h" @@ -308,7 +309,7 @@ int TaskManagerModel::GetNaClDebugStubPort(int index) const { return values.nacl_debug_stub_port; } -int64 TaskManagerModel::GetNetworkUsage(int index) const { +int64_t TaskManagerModel::GetNetworkUsage(int index) const { return GetNetworkUsage(GetResource(index)); } @@ -432,7 +433,7 @@ base::string16 TaskManagerModel::GetResourceNaClDebugStubPort(int index) const { } base::string16 TaskManagerModel::GetResourceNetworkUsage(int index) const { - int64 net_usage = GetNetworkUsage(index); + int64_t net_usage = GetNetworkUsage(index); if (net_usage == -1) return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT); if (net_usage == 0) @@ -1331,7 +1332,7 @@ void TaskManagerModel::RefreshVideoMemoryUsageStats() { content::GpuDataManager::GetInstance()->RequestVideoMemoryUsageStatsUpdate(); } -int64 TaskManagerModel::GetNetworkUsageForResource(Resource* resource) const { +int64_t TaskManagerModel::GetNetworkUsageForResource(Resource* resource) const { // Returns default of 0 if no network usage. return per_resource_cache_[resource].network_usage; } @@ -1407,8 +1408,8 @@ void TaskManagerModel::SetUpdatingByteCount(bool is_updating) { is_updating_byte_count_ = is_updating; } -int64 TaskManagerModel::GetNetworkUsage(Resource* resource) const { - int64 net_usage = GetNetworkUsageForResource(resource); +int64_t TaskManagerModel::GetNetworkUsage(Resource* resource) const { + int64_t net_usage = GetNetworkUsageForResource(resource); if (net_usage == 0 && !resource->SupportNetworkUsage()) return -1; return net_usage; @@ -1426,7 +1427,7 @@ int TaskManagerModel::GetIdleWakeupsPerSecond(Resource* resource) const { return values.idle_wakeups; } -base::string16 TaskManagerModel::GetMemCellText(int64 number) const { +base::string16 TaskManagerModel::GetMemCellText(int64_t number) const { #if !defined(OS_MACOSX) base::string16 str = base::FormatNumber(number / 1024); diff --git a/chrome/browser/task_manager/task_manager.h b/chrome/browser/task_manager/task_manager.h index 4ed4f0c..a015843 100644 --- a/chrome/browser/task_manager/task_manager.h +++ b/chrome/browser/task_manager/task_manager.h @@ -5,18 +5,20 @@ #ifndef CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ #define CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ +#include <stddef.h> #include <stdint.h> #include <map> #include <vector> -#include "base/basictypes.h" #include "base/callback_forward.h" #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/singleton.h" #include "base/observer_list.h" #include "base/strings/string16.h" +#include "build/build_config.h" #include "chrome/browser/task_manager/resource_provider.h" #include "chrome/browser/ui/host_desktop.h" #include "content/public/common/gpu_memory_stats.h" @@ -159,7 +161,7 @@ class TaskManagerModel : public base::RefCountedThreadSafe<TaskManagerModel> { // Methods to return raw resource information. int GetNaClDebugStubPort(int index) const; - int64 GetNetworkUsage(int index) const; + int64_t GetNetworkUsage(int index) const; double GetCPUUsage(int index) const; int GetIdleWakeupsPerSecond(int index) const; base::ProcessId GetProcessId(int index) const; @@ -339,7 +341,7 @@ class TaskManagerModel : public base::RefCountedThreadSafe<TaskManagerModel> { base::string16 profile_name; // No is_network_usage since default (0) is fine. - int64 network_usage; + int64_t network_usage; bool is_process_id_valid; base::ProcessId process_id; @@ -395,7 +397,7 @@ class TaskManagerModel : public base::RefCountedThreadSafe<TaskManagerModel> { ResourceProviderList; typedef std::map<base::ProcessHandle, ResourceList> GroupMap; typedef std::map<base::ProcessHandle, base::ProcessMetrics*> MetricsMap; - typedef std::map<task_manager::Resource*, int64> ResourceValueMap; + typedef std::map<task_manager::Resource*, int64_t> ResourceValueMap; typedef std::map<task_manager::Resource*, PerResourceValues> PerResourceCache; typedef std::map<base::ProcessHandle, PerProcessValues> PerProcessCache; @@ -431,7 +433,7 @@ class TaskManagerModel : public base::RefCountedThreadSafe<TaskManagerModel> { // Returns the network usage (in bytes per seconds) for the specified // resource. That's the value retrieved at the last timer's tick. - int64 GetNetworkUsageForResource(task_manager::Resource* resource) const; + int64_t GetNetworkUsageForResource(task_manager::Resource* resource) const; // Called on the UI thread when some bytes are read. void BytesRead(BytesReadParam param); @@ -450,7 +452,7 @@ class TaskManagerModel : public base::RefCountedThreadSafe<TaskManagerModel> { // Returns the network usage (in byte per second) that should be displayed for // the passed |resource|. -1 means the information is not available for that // resource. - int64 GetNetworkUsage(task_manager::Resource* resource) const; + int64_t GetNetworkUsage(task_manager::Resource* resource) const; // Returns the CPU usage (in %) that should be displayed for the passed // |resource|. @@ -462,7 +464,7 @@ class TaskManagerModel : public base::RefCountedThreadSafe<TaskManagerModel> { // Given a number, this function returns the formatted string that should be // displayed in the task manager's memory cell. - base::string16 GetMemCellText(int64 number) const; + base::string16 GetMemCellText(int64_t number) const; // Verifies the private and shared memory for |handle| is valid in // |per_process_cache_|. Returns true if the data in |per_process_cache_| is diff --git a/chrome/browser/task_manager/task_manager_browsertest.cc b/chrome/browser/task_manager/task_manager_browsertest.cc index 4057f28..822c5ff 100644 --- a/chrome/browser/task_manager/task_manager_browsertest.cc +++ b/chrome/browser/task_manager/task_manager_browsertest.cc @@ -4,9 +4,13 @@ #include "chrome/browser/task_manager/task_manager.h" +#include <stddef.h> + #include "base/files/file_path.h" +#include "base/macros.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/devtools/devtools_window_testing.h" diff --git a/chrome/browser/task_manager/task_manager_browsertest_util.h b/chrome/browser/task_manager/task_manager_browsertest_util.h index 4165dce..7f9902a 100644 --- a/chrome/browser/task_manager/task_manager_browsertest_util.h +++ b/chrome/browser/task_manager/task_manager_browsertest_util.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_BROWSERTEST_UTIL_H_ #define CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_BROWSERTEST_UTIL_H_ +#include <stddef.h> + #include "base/strings/string16.h" namespace task_manager { diff --git a/chrome/browser/task_manager/task_manager_unittest.cc b/chrome/browser/task_manager/task_manager_unittest.cc index 09c7bf1..8e37c19 100644 --- a/chrome/browser/task_manager/task_manager_unittest.cc +++ b/chrome/browser/task_manager/task_manager_unittest.cc @@ -8,6 +8,7 @@ #include "base/message_loop/message_loop.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/task_manager/resource_provider.h" #include "chrome/grit/generated_resources.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/task_manager/task_manager_util.cc b/chrome/browser/task_manager/task_manager_util.cc index 9b217c6..95c5630 100644 --- a/chrome/browser/task_manager/task_manager_util.cc +++ b/chrome/browser/task_manager/task_manager_util.cc @@ -4,7 +4,8 @@ #include "chrome/browser/task_manager/task_manager_util.h" -#include "base/basictypes.h" +#include <stddef.h> + #include "base/i18n/rtl.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" diff --git a/chrome/browser/task_manager/task_manager_util.h b/chrome/browser/task_manager/task_manager_util.h index ca64dba..7a9c611 100644 --- a/chrome/browser/task_manager/task_manager_util.h +++ b/chrome/browser/task_manager/task_manager_util.h @@ -5,7 +5,6 @@ #ifndef CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_UTIL_H_ #define CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_UTIL_H_ -#include "base/basictypes.h" #include "base/strings/string16.h" class Profile; diff --git a/chrome/browser/task_manager/task_manager_util_unittest.cc b/chrome/browser/task_manager/task_manager_util_unittest.cc index b25bfc11..7919054 100644 --- a/chrome/browser/task_manager/task_manager_util_unittest.cc +++ b/chrome/browser/task_manager/task_manager_util_unittest.cc @@ -4,7 +4,9 @@ #include "chrome/browser/task_manager/task_manager_util.h" -#include "base/basictypes.h" +#include <stddef.h> + +#include "base/macros.h" #include "chrome/grit/generated_resources.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/task_manager/web_contents_information.h b/chrome/browser/task_manager/web_contents_information.h index 4cf1938..a1fcdc1 100644 --- a/chrome/browser/task_manager/web_contents_information.h +++ b/chrome/browser/task_manager/web_contents_information.h @@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_TASK_MANAGER_WEB_CONTENTS_INFORMATION_H_ #define CHROME_BROWSER_TASK_MANAGER_WEB_CONTENTS_INFORMATION_H_ -#include "base/basictypes.h" #include "base/callback.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/task_manager/web_contents_resource_provider.cc b/chrome/browser/task_manager/web_contents_resource_provider.cc index 3e2c1ac..5c7f68d 100644 --- a/chrome/browser/task_manager/web_contents_resource_provider.cc +++ b/chrome/browser/task_manager/web_contents_resource_provider.cc @@ -6,6 +6,7 @@ #include "base/bind.h" #include "base/bind_helpers.h" +#include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/prerender/prerender_manager.h" diff --git a/chrome/browser/task_manager/web_contents_resource_provider.h b/chrome/browser/task_manager/web_contents_resource_provider.h index 4d3d365..ea0e262 100644 --- a/chrome/browser/task_manager/web_contents_resource_provider.h +++ b/chrome/browser/task_manager/web_contents_resource_provider.h @@ -7,7 +7,7 @@ #include <map> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/task_manager/renderer_resource.h" #include "chrome/browser/task_manager/resource_provider.h" diff --git a/chrome/browser/task_profiler/task_profiler_data_serializer.h b/chrome/browser/task_profiler/task_profiler_data_serializer.h index 196bd0b..7444cb4 100644 --- a/chrome/browser/task_profiler/task_profiler_data_serializer.h +++ b/chrome/browser/task_profiler/task_profiler_data_serializer.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_TASK_PROFILER_TASK_PROFILER_DATA_SERIALIZER_H_ #define CHROME_BROWSER_TASK_PROFILER_TASK_PROFILER_DATA_SERIALIZER_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "base/process/process_handle.h" #include "components/metrics/proto/profiler_event.pb.h" diff --git a/chrome/browser/task_profiler/task_profiler_data_serializer_unittest.cc b/chrome/browser/task_profiler/task_profiler_data_serializer_unittest.cc index 71b1b1eaa..2548762 100644 --- a/chrome/browser/task_profiler/task_profiler_data_serializer_unittest.cc +++ b/chrome/browser/task_profiler/task_profiler_data_serializer_unittest.cc @@ -4,7 +4,6 @@ #include <string> -#include "base/basictypes.h" #include "base/json/json_writer.h" #include "base/process/process_handle.h" #include "base/strings/string_number_conversions.h" diff --git a/chrome/browser/themes/browser_theme_pack.cc b/chrome/browser/themes/browser_theme_pack.cc index 3b7ef08..9d225c3 100644 --- a/chrome/browser/themes/browser_theme_pack.cc +++ b/chrome/browser/themes/browser_theme_pack.cc @@ -4,9 +4,12 @@ #include "chrome/browser/themes/browser_theme_pack.h" +#include <stddef.h> + #include <limits> #include "base/files/file.h" +#include "base/macros.h" #include "base/memory/ref_counted_memory.h" #include "base/memory/scoped_ptr.h" #include "base/stl_util.h" @@ -16,6 +19,7 @@ #include "base/threading/sequenced_worker_pool.h" #include "base/threading/thread_restrictions.h" #include "base/values.h" +#include "build/build_config.h" #include "chrome/browser/themes/theme_properties.h" #include "chrome/common/extensions/manifest_handlers/theme_handler.h" #include "components/crx_file/id_util.h" @@ -46,7 +50,7 @@ namespace { const int kThemePackVersion = 36; // IDs that are in the DataPack won't clash with the positive integer -// uint16. kHeaderID should always have the maximum value because we want the +// uint16_t. kHeaderID should always have the maximum value because we want the // "header" to be written last. That way we can detect whether the pack was // successfully written and ignore and regenerate if it was only partially // written (i.e. chrome crashed on a different thread while writing the pack). @@ -448,7 +452,7 @@ base::RefCountedMemory* ReadFileData(const base::FilePath& path) { if (!path.empty()) { base::File file(path, base::File::FLAG_OPEN | base::File::FLAG_READ); if (file.IsValid()) { - int64 length = file.GetLength(); + int64_t length = file.GetLength(); if (length > 0 && length < INT_MAX) { int size = static_cast<int>(length); std::vector<unsigned char> raw_data; diff --git a/chrome/browser/themes/browser_theme_pack.h b/chrome/browser/themes/browser_theme_pack.h index 7ad69c9..b7f567e 100644 --- a/chrome/browser/themes/browser_theme_pack.h +++ b/chrome/browser/themes/browser_theme_pack.h @@ -5,11 +5,13 @@ #ifndef CHROME_BROWSER_THEMES_BROWSER_THEME_PACK_H_ #define CHROME_BROWSER_THEMES_BROWSER_THEME_PACK_H_ +#include <stdint.h> + #include <map> #include <string> #include <vector> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/sequenced_task_runner_helpers.h" #include "chrome/browser/themes/custom_theme_supplier.h" @@ -97,7 +99,7 @@ class BrowserThemePack : public CustomThemeSupplier { typedef std::map<int, scoped_refptr<base::RefCountedMemory> > RawImages; // The type passed to ui::DataPack::WritePack. - typedef std::map<uint16, base::StringPiece> RawDataForWriting; + typedef std::map<uint16_t, base::StringPiece> RawDataForWriting; // Maps scale factors (enum values) to file paths. typedef std::map<ui::ScaleFactor, base::FilePath> ScaleFactorToFileMap; @@ -217,33 +219,33 @@ class BrowserThemePack : public CustomThemeSupplier { // Header that is written to disk. struct BrowserThemePackHeader { // Numeric version to make sure we're compatible in the future. - int32 version; + int32_t version; // 1 if little_endian. 0 if big_endian. On mismatch, abort load. - int32 little_endian; + int32_t little_endian; // theme_id without NULL terminator. - uint8 theme_id[16]; + uint8_t theme_id[16]; } *header_; // The remaining structs represent individual entries in an array. For the // following three structs, BrowserThemePack will either allocate an array or // will point directly to mmapped data. struct TintEntry { - int32 id; + int32_t id; double h; double s; double l; } *tints_; struct ColorPair { - int32 id; + int32_t id; SkColor color; } *colors_; struct DisplayPropertyPair { - int32 id; - int32 property; + int32_t id; + int32_t property; } *display_properties_; // A list of included source images. A pointer to a -1 terminated array of diff --git a/chrome/browser/themes/browser_theme_pack_unittest.cc b/chrome/browser/themes/browser_theme_pack_unittest.cc index 745e73c..3745741 100644 --- a/chrome/browser/themes/browser_theme_pack_unittest.cc +++ b/chrome/browser/themes/browser_theme_pack_unittest.cc @@ -4,12 +4,15 @@ #include "chrome/browser/themes/browser_theme_pack.h" +#include <stddef.h> + #include "base/files/scoped_temp_dir.h" #include "base/json/json_file_value_serializer.h" #include "base/json/json_reader.h" #include "base/message_loop/message_loop.h" #include "base/path_service.h" #include "base/values.h" +#include "build/build_config.h" #include "chrome/browser/themes/theme_properties.h" #include "chrome/common/chrome_paths.h" #include "content/public/test/test_browser_thread.h" diff --git a/chrome/browser/themes/custom_theme_supplier.h b/chrome/browser/themes/custom_theme_supplier.h index a6f2172..cf4da93 100644 --- a/chrome/browser/themes/custom_theme_supplier.h +++ b/chrome/browser/themes/custom_theme_supplier.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_THEMES_CUSTOM_THEME_SUPPLIER_H_ #define CHROME_BROWSER_THEMES_CUSTOM_THEME_SUPPLIER_H_ +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "content/public/browser/browser_thread.h" #include "third_party/skia/include/core/SkColor.h" diff --git a/chrome/browser/themes/theme_properties.cc b/chrome/browser/themes/theme_properties.cc index 3c23550..0e8ce55 100644 --- a/chrome/browser/themes/theme_properties.cc +++ b/chrome/browser/themes/theme_properties.cc @@ -4,9 +4,11 @@ #include "chrome/browser/themes/theme_properties.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" +#include "build/build_config.h" #include "chrome/browser/themes/browser_theme_pack.h" #include "grit/theme_resources.h" #include "ui/base/resource/material_design/material_design_controller.h" diff --git a/chrome/browser/themes/theme_properties.h b/chrome/browser/themes/theme_properties.h index c48e690..d03ad31 100644 --- a/chrome/browser/themes/theme_properties.h +++ b/chrome/browser/themes/theme_properties.h @@ -8,7 +8,8 @@ #include <set> #include <string> -#include "base/basictypes.h" +#include "base/macros.h" +#include "build/build_config.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/gfx/color_utils.h" diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc index 3f5cb63..24669c5 100644 --- a/chrome/browser/themes/theme_service.cc +++ b/chrome/browser/themes/theme_service.cc @@ -4,6 +4,8 @@ #include "chrome/browser/themes/theme_service.h" +#include <stddef.h> + #include <algorithm> #include "base/bind.h" @@ -15,6 +17,7 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/thread_task_runner_handle.h" +#include "build/build_config.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/profiles/profile.h" diff --git a/chrome/browser/themes/theme_service.h b/chrome/browser/themes/theme_service.h index 18a9e2d..14d02a4 100644 --- a/chrome/browser/themes/theme_service.h +++ b/chrome/browser/themes/theme_service.h @@ -16,6 +16,7 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/threading/non_thread_safe.h" +#include "build/build_config.h" #include "components/keyed_service/core/keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/themes/theme_service_aurax11.cc b/chrome/browser/themes/theme_service_aurax11.cc index 199c031..4dcee55 100644 --- a/chrome/browser/themes/theme_service_aurax11.cc +++ b/chrome/browser/themes/theme_service_aurax11.cc @@ -5,6 +5,7 @@ #include "chrome/browser/themes/theme_service_aurax11.h" #include "base/bind.h" +#include "base/macros.h" #include "base/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/themes/custom_theme_supplier.h" diff --git a/chrome/browser/themes/theme_service_aurax11.h b/chrome/browser/themes/theme_service_aurax11.h index eb229f2..56564bc 100644 --- a/chrome/browser/themes/theme_service_aurax11.h +++ b/chrome/browser/themes/theme_service_aurax11.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_THEMES_THEME_SERVICE_AURAX11_H_ #define CHROME_BROWSER_THEMES_THEME_SERVICE_AURAX11_H_ +#include "base/macros.h" #include "chrome/browser/themes/theme_service.h" // A subclass of ThemeService that manages the CustomThemeSupplier which diff --git a/chrome/browser/themes/theme_service_browsertest.cc b/chrome/browser/themes/theme_service_browsertest.cc index e936259..99802fe 100644 --- a/chrome/browser/themes/theme_service_browsertest.cc +++ b/chrome/browser/themes/theme_service_browsertest.cc @@ -4,6 +4,7 @@ #include "chrome/browser/themes/theme_service.h" +#include "base/macros.h" #include "base/prefs/pref_service.h" #include "chrome/browser/extensions/component_loader.h" #include "chrome/browser/extensions/extension_browsertest.h" diff --git a/chrome/browser/themes/theme_service_factory.cc b/chrome/browser/themes/theme_service_factory.cc index 0ec15cd..a326302 100644 --- a/chrome/browser/themes/theme_service_factory.cc +++ b/chrome/browser/themes/theme_service_factory.cc @@ -6,6 +6,7 @@ #include "base/logging.h" #include "base/prefs/pref_service.h" +#include "build/build_config.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/themes/theme_service.h" diff --git a/chrome/browser/themes/theme_service_factory.h b/chrome/browser/themes/theme_service_factory.h index 5644034..bbe8738 100644 --- a/chrome/browser/themes/theme_service_factory.h +++ b/chrome/browser/themes/theme_service_factory.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_THEMES_THEME_SERVICE_FACTORY_H_ #define CHROME_BROWSER_THEMES_THEME_SERVICE_FACTORY_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/singleton.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" diff --git a/chrome/browser/themes/theme_service_unittest.cc b/chrome/browser/themes/theme_service_unittest.cc index 5547723..a26ac53 100644 --- a/chrome/browser/themes/theme_service_unittest.cc +++ b/chrome/browser/themes/theme_service_unittest.cc @@ -5,7 +5,9 @@ #include "chrome/browser/themes/theme_service.h" #include "base/files/file_util.h" +#include "base/macros.h" #include "base/path_service.h" +#include "build/build_config.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_service_test_base.h" diff --git a/chrome/browser/themes/theme_syncable_service.cc b/chrome/browser/themes/theme_syncable_service.cc index cc169a7..d03223a 100644 --- a/chrome/browser/themes/theme_syncable_service.cc +++ b/chrome/browser/themes/theme_syncable_service.cc @@ -4,6 +4,8 @@ #include "chrome/browser/themes/theme_syncable_service.h" +#include <stddef.h> + #include "base/strings/stringprintf.h" #include "base/version.h" #include "chrome/browser/extensions/extension_service.h" diff --git a/chrome/browser/themes/theme_syncable_service.h b/chrome/browser/themes/theme_syncable_service.h index c5bd893..73d4c86 100644 --- a/chrome/browser/themes/theme_syncable_service.h +++ b/chrome/browser/themes/theme_syncable_service.h @@ -6,11 +6,12 @@ #define CHROME_BROWSER_THEMES_THEME_SYNCABLE_SERVICE_H_ #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/threading/thread_checker.h" #include "sync/api/sync_change.h" #include "sync/api/sync_data.h" -#include "sync/api/sync_error_factory.h" #include "sync/api/sync_error.h" +#include "sync/api/sync_error_factory.h" #include "sync/api/syncable_service.h" class Profile; diff --git a/chrome/browser/themes/theme_syncable_service_unittest.cc b/chrome/browser/themes/theme_syncable_service_unittest.cc index f2b6151..cab0fc9 100644 --- a/chrome/browser/themes/theme_syncable_service_unittest.cc +++ b/chrome/browser/themes/theme_syncable_service_unittest.cc @@ -9,6 +9,7 @@ #include "base/files/file_path.h" #include "base/memory/scoped_ptr.h" #include "base/time/time.h" +#include "build/build_config.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/test_extension_system.h" #include "chrome/browser/profiles/profile.h" diff --git a/chrome/browser/thumbnails/content_analysis.cc b/chrome/browser/thumbnails/content_analysis.cc index 86d28b8..c795b1f 100644 --- a/chrome/browser/thumbnails/content_analysis.cc +++ b/chrome/browser/thumbnails/content_analysis.cc @@ -4,6 +4,9 @@ #include "chrome/browser/thumbnails/content_analysis.h" +#include <stddef.h> +#include <stdint.h> + #include <algorithm> #include <cmath> #include <deque> @@ -318,7 +321,7 @@ void ApplyGaussianGradientMagnitudeFilter(SkBitmap* input_bitmap, int bit_shift = 8 - static_cast<int>( std::log10(static_cast<float>(smoothed_max)) / std::log10(2.0f)); for (int r = 0; r < image_size.height(); ++r) { - uint8* row = input_bitmap->getAddr8(0, r); + uint8_t* row = input_bitmap->getAddr8(0, r); for (int c = 0; c < image_size.width(); ++c, ++row) { *row <<= bit_shift; } @@ -349,8 +352,8 @@ void ApplyGaussianGradientMagnitudeFilter(SkBitmap* input_bitmap, unsigned grad_max = 0; for (int r = 0; r < image_size.height(); ++r) { - const uint8* grad_x_row = intermediate.getAddr8(0, r); - const uint8* grad_y_row = intermediate2.getAddr8(0, r); + const uint8_t* grad_x_row = intermediate.getAddr8(0, r); + const uint8_t* grad_y_row = intermediate2.getAddr8(0, r); for (int c = 0; c < image_size.width(); ++c) { unsigned grad_x = grad_x_row[c]; unsigned grad_y = grad_y_row[c]; @@ -363,9 +366,9 @@ void ApplyGaussianGradientMagnitudeFilter(SkBitmap* input_bitmap, bit_shift = static_cast<int>( std::log10(static_cast<float>(grad_max)) / std::log10(2.0f)) - 7; for (int r = 0; r < image_size.height(); ++r) { - const uint8* grad_x_row = intermediate.getAddr8(0, r); - const uint8* grad_y_row = intermediate2.getAddr8(0, r); - uint8* target_row = input_bitmap->getAddr8(0, r); + const uint8_t* grad_x_row = intermediate.getAddr8(0, r); + const uint8_t* grad_y_row = intermediate2.getAddr8(0, r); + uint8_t* target_row = input_bitmap->getAddr8(0, r); for (int c = 0; c < image_size.width(); ++c) { unsigned grad_x = grad_x_row[c]; unsigned grad_y = grad_y_row[c]; @@ -398,7 +401,7 @@ void ExtractImageProfileInformation(const SkBitmap& input_bitmap, for (int r = 0; r < area.height(); ++r) { // Points to the first byte of the row in the rectangle. - const uint8* image_row = input_bitmap.getAddr8(area.x(), r + area.y()); + const uint8_t* image_row = input_bitmap.getAddr8(area.x(), r + area.y()); unsigned row_sum = 0; for (int c = 0; c < area.width(); ++c, ++image_row) { row_sum += *image_row; @@ -686,10 +689,10 @@ SkBitmap ComputeDecimatedImage(const SkBitmap& bitmap, for (int r = 0; r < bitmap.height(); ++r) { if (!rows[r]) continue; // We can just skip this one. - uint8* src_row = - static_cast<uint8*>(bitmap.getPixels()) + r * bitmap.rowBytes(); - uint8* insertion_target = static_cast<uint8*>(target.getPixels()) + - target_row * target.rowBytes(); + uint8_t* src_row = + static_cast<uint8_t*>(bitmap.getPixels()) + r * bitmap.rowBytes(); + uint8_t* insertion_target = static_cast<uint8_t*>(target.getPixels()) + + target_row * target.rowBytes(); int left_copy_pixel = -1; for (int c = 0; c < bitmap.width(); ++c) { if (left_copy_pixel < 0 && columns[c]) { diff --git a/chrome/browser/thumbnails/content_analysis.h b/chrome/browser/thumbnails/content_analysis.h index 6653152..f9d0029 100644 --- a/chrome/browser/thumbnails/content_analysis.h +++ b/chrome/browser/thumbnails/content_analysis.h @@ -7,7 +7,6 @@ #include <vector> -#include "base/basictypes.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" diff --git a/chrome/browser/thumbnails/content_analysis_unittest.cc b/chrome/browser/thumbnails/content_analysis_unittest.cc index 87ee82d..23161efd 100644 --- a/chrome/browser/thumbnails/content_analysis_unittest.cc +++ b/chrome/browser/thumbnails/content_analysis_unittest.cc @@ -4,6 +4,9 @@ #include "chrome/browser/thumbnails/content_analysis.h" +#include <stddef.h> +#include <stdint.h> + #include <algorithm> #include <cmath> #include <cstdlib> @@ -35,8 +38,8 @@ unsigned long ImagePixelSum(const SkBitmap& bitmap, const gfx::Rect& rect) { DCHECK_EQ(kAlpha_8_SkColorType, bitmap.colorType()); unsigned long total = 0; for (int r = rect.y(); r < rect.bottom(); ++r) { - const uint8* row_data = static_cast<const uint8*>( - bitmap.getPixels()) + r * bitmap.rowBytes(); + const uint8_t* row_data = + static_cast<const uint8_t*>(bitmap.getPixels()) + r * bitmap.rowBytes(); for (int c = rect.x(); c < rect.right(); ++c) total += row_data[c]; } diff --git a/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc b/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc index 6278009..c65883d 100644 --- a/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc +++ b/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.cc @@ -4,6 +4,8 @@ #include "chrome/browser/thumbnails/content_based_thumbnailing_algorithm.h" +#include <stddef.h> + #include "base/metrics/histogram.h" #include "base/threading/sequenced_worker_pool.h" #include "chrome/browser/thumbnails/content_analysis.h" diff --git a/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.h b/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.h index 7d2fa19..ede432c 100644 --- a/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.h +++ b/chrome/browser/thumbnails/content_based_thumbnailing_algorithm.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_THUMBNAILS_CONTENT_BASED_THUMBNAILING_ALGORITHM_H_ #define CHROME_BROWSER_THUMBNAILS_CONTENT_BASED_THUMBNAILING_ALGORITHM_H_ +#include "base/macros.h" #include "chrome/browser/thumbnails/thumbnailing_algorithm.h" namespace thumbnails { diff --git a/chrome/browser/thumbnails/content_based_thumbnailing_algorithm_unittest.cc b/chrome/browser/thumbnails/content_based_thumbnailing_algorithm_unittest.cc index 2fa7ccd..83609bb 100644 --- a/chrome/browser/thumbnails/content_based_thumbnailing_algorithm_unittest.cc +++ b/chrome/browser/thumbnails/content_based_thumbnailing_algorithm_unittest.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/macros.h" #include "base/message_loop/message_loop.h" #include "chrome/browser/thumbnails/content_based_thumbnailing_algorithm.h" #include "chrome/browser/thumbnails/simple_thumbnail_crop.h" diff --git a/chrome/browser/thumbnails/simple_thumbnail_crop.h b/chrome/browser/thumbnails/simple_thumbnail_crop.h index b206cc2..3d96ccd 100644 --- a/chrome/browser/thumbnails/simple_thumbnail_crop.h +++ b/chrome/browser/thumbnails/simple_thumbnail_crop.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_THUMBNAILS_SIMPLE_THUMBNAIL_CROP_H_ #define CHROME_BROWSER_THUMBNAILS_SIMPLE_THUMBNAIL_CROP_H_ +#include "base/macros.h" #include "chrome/browser/thumbnails/thumbnailing_algorithm.h" namespace thumbnails { diff --git a/chrome/browser/thumbnails/simple_thumbnail_crop_unittest.cc b/chrome/browser/thumbnails/simple_thumbnail_crop_unittest.cc index 2852ef5..0c306dd 100644 --- a/chrome/browser/thumbnails/simple_thumbnail_crop_unittest.cc +++ b/chrome/browser/thumbnails/simple_thumbnail_crop_unittest.cc @@ -4,7 +4,6 @@ #include "chrome/browser/thumbnails/simple_thumbnail_crop.h" -#include "base/basictypes.h" #include "base/strings/stringprintf.h" #include "chrome/browser/thumbnails/thumbnailing_context.h" #include "content/public/browser/notification_service.h" diff --git a/chrome/browser/thumbnails/thumbnail_list_source.cc b/chrome/browser/thumbnails/thumbnail_list_source.cc index 0cad21f..51d51ac 100644 --- a/chrome/browser/thumbnails/thumbnail_list_source.cc +++ b/chrome/browser/thumbnails/thumbnail_list_source.cc @@ -4,6 +4,8 @@ #include "chrome/browser/thumbnails/thumbnail_list_source.h" +#include <stddef.h> + #include <string> #include "base/base64.h" diff --git a/chrome/browser/thumbnails/thumbnail_list_source.h b/chrome/browser/thumbnails/thumbnail_list_source.h index d587bfd..7dcf181 100644 --- a/chrome/browser/thumbnails/thumbnail_list_source.h +++ b/chrome/browser/thumbnails/thumbnail_list_source.h @@ -7,7 +7,7 @@ #include <string> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "components/history/core/browser/history_types.h" diff --git a/chrome/browser/thumbnails/thumbnail_service_factory.h b/chrome/browser/thumbnails/thumbnail_service_factory.h index bea81ba..68b8a33 100644 --- a/chrome/browser/thumbnails/thumbnail_service_factory.h +++ b/chrome/browser/thumbnails/thumbnail_service_factory.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_THUMBNAILS_THUMBNAIL_SERVICE_FACTORY_H_ #define CHROME_BROWSER_THUMBNAILS_THUMBNAIL_SERVICE_FACTORY_H_ +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/singleton.h" #include "components/keyed_service/content/refcounted_browser_context_keyed_service_factory.h" diff --git a/chrome/browser/thumbnails/thumbnail_service_impl.h b/chrome/browser/thumbnails/thumbnail_service_impl.h index 6360fc0..537bf0e 100644 --- a/chrome/browser/thumbnails/thumbnail_service_impl.h +++ b/chrome/browser/thumbnails/thumbnail_service_impl.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_THUMBNAILS_THUMBNAIL_SERVICE_IMPL_H_ #define CHROME_BROWSER_THUMBNAILS_THUMBNAIL_SERVICE_IMPL_H_ +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/thumbnails/thumbnail_service.h" diff --git a/chrome/browser/thumbnails/thumbnail_service_unittest.cc b/chrome/browser/thumbnails/thumbnail_service_unittest.cc index 435c82b..4642305 100644 --- a/chrome/browser/thumbnails/thumbnail_service_unittest.cc +++ b/chrome/browser/thumbnails/thumbnail_service_unittest.cc @@ -4,7 +4,10 @@ #include "chrome/browser/thumbnails/thumbnail_service_impl.h" +#include <stddef.h> + #include "base/bind.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "chrome/browser/history/history_utils.h" #include "chrome/browser/history/top_sites_factory.h" diff --git a/chrome/browser/thumbnails/thumbnail_tab_helper.cc b/chrome/browser/thumbnails/thumbnail_tab_helper.cc index b9a57b3..a5de4ee 100644 --- a/chrome/browser/thumbnails/thumbnail_tab_helper.cc +++ b/chrome/browser/thumbnails/thumbnail_tab_helper.cc @@ -4,6 +4,7 @@ #include "chrome/browser/thumbnails/thumbnail_tab_helper.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/thumbnails/thumbnail_service.h" diff --git a/chrome/browser/thumbnails/thumbnail_tab_helper.h b/chrome/browser/thumbnails/thumbnail_tab_helper.h index ae13bbb..df9a731 100644 --- a/chrome/browser/thumbnails/thumbnail_tab_helper.h +++ b/chrome/browser/thumbnails/thumbnail_tab_helper.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_THUMBNAILS_THUMBNAIL_TAB_HELPER_H_ #define CHROME_BROWSER_THUMBNAILS_THUMBNAIL_TAB_HELPER_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "chrome/browser/thumbnails/thumbnailing_context.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/thumbnails/thumbnailing_context.h b/chrome/browser/thumbnails/thumbnailing_context.h index 1cfe671..6575441 100644 --- a/chrome/browser/thumbnails/thumbnailing_context.h +++ b/chrome/browser/thumbnails/thumbnailing_context.h @@ -5,7 +5,6 @@ #ifndef CHROME_BROWSER_THUMBNAILS_THUMBNAILING_CONTEXT_H_ #define CHROME_BROWSER_THUMBNAILS_THUMBNAILING_CONTEXT_H_ -#include "base/basictypes.h" #include "base/memory/ref_counted.h" #include "chrome/browser/thumbnails/thumbnail_service.h" #include "components/history/core/common/thumbnail_score.h" diff --git a/chrome/browser/tracing/chrome_tracing_delegate.cc b/chrome/browser/tracing/chrome_tracing_delegate.cc index 48cf9e3..a7467f9 100644 --- a/chrome/browser/tracing/chrome_tracing_delegate.cc +++ b/chrome/browser/tracing/chrome_tracing_delegate.cc @@ -7,6 +7,7 @@ #include "base/prefs/pref_registry_simple.h" #include "base/prefs/pref_service.h" #include "base/time/time.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" diff --git a/chrome/browser/tracing/chrome_tracing_delegate_browsertest.cc b/chrome/browser/tracing/chrome_tracing_delegate_browsertest.cc index cd103c2..bc0b6a7 100644 --- a/chrome/browser/tracing/chrome_tracing_delegate_browsertest.cc +++ b/chrome/browser/tracing/chrome_tracing_delegate_browsertest.cc @@ -6,6 +6,7 @@ #include "base/bind.h" #include "base/command_line.h" #include "base/prefs/pref_service.h" +#include "build/build_config.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/tracing/background_tracing_field_trial.h" diff --git a/chrome/browser/tracing/crash_service_uploader.cc b/chrome/browser/tracing/crash_service_uploader.cc index d34249e..ddbf00d 100644 --- a/chrome/browser/tracing/crash_service_uploader.cc +++ b/chrome/browser/tracing/crash_service_uploader.cc @@ -14,6 +14,7 @@ #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/time/time.h" +#include "build/build_config.h" #include "components/tracing/tracing_switches.h" #include "components/version_info/version_info.h" #include "content/public/browser/browser_thread.h" @@ -91,8 +92,8 @@ void TraceCrashServiceUploader::OnURLFetchComplete( void TraceCrashServiceUploader::OnURLFetchUploadProgress( const net::URLFetcher* source, - int64 current, - int64 total) { + int64_t current, + int64_t total) { DCHECK(url_fetcher_.get()); LOG(WARNING) << "Upload progress: " << current << " of " << total; @@ -271,9 +272,9 @@ bool TraceCrashServiceUploader::Compress(std::string input, 8, // memLevel = 8 is default. Z_DEFAULT_STRATEGY); DCHECK_EQ(Z_OK, result); - stream.next_in = reinterpret_cast<uint8*>(&input[0]); + stream.next_in = reinterpret_cast<uint8_t*>(&input[0]); stream.avail_in = input.size(); - stream.next_out = reinterpret_cast<uint8*>(compressed); + stream.next_out = reinterpret_cast<uint8_t*>(compressed); stream.avail_out = max_compressed_bytes; // Do a one-shot compression. This will return Z_STREAM_END only if |output| // is large enough to hold all compressed data. diff --git a/chrome/browser/tracing/crash_service_uploader.h b/chrome/browser/tracing/crash_service_uploader.h index 369e8b0..55d3204 100644 --- a/chrome/browser/tracing/crash_service_uploader.h +++ b/chrome/browser/tracing/crash_service_uploader.h @@ -5,10 +5,12 @@ #ifndef CHROME_BROWSER_TRACING_CRASH_SERVICE_UPLOADER_H_ #define CHROME_BROWSER_TRACING_CRASH_SERVICE_UPLOADER_H_ +#include <stdint.h> + #include <string> #include <vector> -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" @@ -34,8 +36,8 @@ class TraceCrashServiceUploader : public content::TraceUploader, // net::URLFetcherDelegate implementation. void OnURLFetchComplete(const net::URLFetcher* source) override; void OnURLFetchUploadProgress(const net::URLFetcher* source, - int64 current, - int64 total) override; + int64_t current, + int64_t total) override; // content::TraceUploader void DoUpload(const std::string& file_contents, diff --git a/chrome/browser/tracing/navigation_tracing.h b/chrome/browser/tracing/navigation_tracing.h index 2e02fd4..c399d44 100644 --- a/chrome/browser/tracing/navigation_tracing.h +++ b/chrome/browser/tracing/navigation_tracing.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_TRACING_NAVIGATION_TRACING_H_ #define CHROME_BROWSER_TRACING_NAVIGATION_TRACING_H_ +#include "base/macros.h" #include "content/public/browser/background_tracing_manager.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_user_data.h" diff --git a/chrome/browser/translate/chrome_translate_client.cc b/chrome/browser/translate/chrome_translate_client.cc index 4d4366b..196ff58 100644 --- a/chrome/browser/translate/chrome_translate_client.cc +++ b/chrome/browser/translate/chrome_translate_client.cc @@ -10,6 +10,7 @@ #include "base/path_service.h" #include "base/prefs/pref_service.h" #include "base/strings/string_split.h" +#include "build/build_config.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/infobars/infobar_service.h" #include "chrome/browser/profiles/profile.h" diff --git a/chrome/browser/translate/chrome_translate_client.h b/chrome/browser/translate/chrome_translate_client.h index e658849..ee7ad97 100644 --- a/chrome/browser/translate/chrome_translate_client.h +++ b/chrome/browser/translate/chrome_translate_client.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/ui/translate/translate_bubble_model.h" #include "components/translate/content/browser/browser_cld_data_provider.h" diff --git a/chrome/browser/translate/cld_data_harness.cc b/chrome/browser/translate/cld_data_harness.cc index 1a3a7f3..35ab020 100644 --- a/chrome/browser/translate/cld_data_harness.cc +++ b/chrome/browser/translate/cld_data_harness.cc @@ -5,6 +5,7 @@ #include "chrome/browser/translate/cld_data_harness.h" #include "base/lazy_instance.h" +#include "base/macros.h" #include "base/path_service.h" #include "chrome/browser/translate/component_cld_data_harness.h" #include "chrome/browser/translate/standalone_cld_data_harness.h" diff --git a/chrome/browser/translate/translate_accept_languages_factory.cc b/chrome/browser/translate/translate_accept_languages_factory.cc index eba6735..fb241d6 100644 --- a/chrome/browser/translate/translate_accept_languages_factory.cc +++ b/chrome/browser/translate/translate_accept_languages_factory.cc @@ -4,6 +4,7 @@ #include "chrome/browser/translate/translate_accept_languages_factory.h" +#include "base/macros.h" #include "base/prefs/pref_service.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" diff --git a/chrome/browser/translate/translate_accept_languages_factory.h b/chrome/browser/translate/translate_accept_languages_factory.h index 7215da3..65adcf1 100644 --- a/chrome/browser/translate/translate_accept_languages_factory.h +++ b/chrome/browser/translate/translate_accept_languages_factory.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_ACCEPT_LANGUAGES_FACTORY_H_ #define CHROME_BROWSER_TRANSLATE_TRANSLATE_ACCEPT_LANGUAGES_FACTORY_H_ -#include "base/basictypes.h" +#include "base/macros.h" #include "base/memory/singleton.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" diff --git a/chrome/browser/translate/translate_browsertest.cc b/chrome/browser/translate/translate_browsertest.cc index 6c4bbbd3..2afe85a 100644 --- a/chrome/browser/translate/translate_browsertest.cc +++ b/chrome/browser/translate/translate_browsertest.cc @@ -6,8 +6,11 @@ // from Aura. The file should be ported to use the bubble. #if !defined(USE_AURA) +#include <stddef.h> + #include "base/command_line.h" #include "base/files/file_path.h" +#include "base/macros.h" #include "base/path_service.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" diff --git a/chrome/browser/translate/translate_manager_browsertest.cc b/chrome/browser/translate/translate_manager_browsertest.cc index 4a7a6d9..1a1202b 100644 --- a/chrome/browser/translate/translate_manager_browsertest.cc +++ b/chrome/browser/translate/translate_manager_browsertest.cc @@ -5,6 +5,7 @@ #include "components/translate/core/browser/translate_manager.h" #include "base/memory/scoped_ptr.h" +#include "build/build_config.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/prefs/session_startup_pref.h" #include "chrome/browser/translate/chrome_translate_client.h" diff --git a/chrome/browser/translate/translate_manager_render_view_host_unittest.cc b/chrome/browser/translate/translate_manager_render_view_host_unittest.cc index c062826..264fc65 100644 --- a/chrome/browser/translate/translate_manager_render_view_host_unittest.cc +++ b/chrome/browser/translate/translate_manager_render_view_host_unittest.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + #include <algorithm> #include <set> #include <vector> @@ -11,6 +13,7 @@ #include "base/prefs/pref_change_registrar.h" #include "base/prefs/pref_service.h" #include "base/strings/stringprintf.h" +#include "build/build_config.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/extensions/test_extension_system.h" diff --git a/chrome/browser/translate/translate_service.cc b/chrome/browser/translate/translate_service.cc index 93331a6..0ba535b 100644 --- a/chrome/browser/translate/translate_service.cc +++ b/chrome/browser/translate/translate_service.cc @@ -10,6 +10,7 @@ #include "base/prefs/pref_service.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/translate/chrome_translate_client.h" #include "chrome/common/chrome_switches.h" diff --git a/chrome/browser/translate/translate_service_unittest.cc b/chrome/browser/translate/translate_service_unittest.cc index fa9574c..455a7d7 100644 --- a/chrome/browser/translate/translate_service_unittest.cc +++ b/chrome/browser/translate/translate_service_unittest.cc @@ -4,6 +4,7 @@ #include "chrome/browser/translate/translate_service.h" +#include "build/build_config.h" #include "content/public/common/url_constants.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" diff --git a/chrome/browser/ui/panels/base_panel_browser_test.cc b/chrome/browser/ui/panels/base_panel_browser_test.cc index 752498d..1843cd9 100644 --- a/chrome/browser/ui/panels/base_panel_browser_test.cc +++ b/chrome/browser/ui/panels/base_panel_browser_test.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/panels/base_panel_browser_test.h" +#include <string.h> + #include "base/bind.h" #include "base/command_line.h" #include "base/macros.h" diff --git a/chrome/browser/ui/views/status_icons/status_icon_win.cc b/chrome/browser/ui/views/status_icons/status_icon_win.cc index 0ce341e..2ebe5f9 100644 --- a/chrome/browser/ui/views/status_icons/status_icon_win.cc +++ b/chrome/browser/ui/views/status_icons/status_icon_win.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/status_icons/status_icon_win.h" +#include <string.h> + #include "base/strings/string_number_conversions.h" #include "base/win/windows_version.h" #include "chrome/browser/ui/views/status_icons/status_tray_win.h" diff --git a/chrome/browser/undo/bookmark_undo_service_factory.h b/chrome/browser/undo/bookmark_undo_service_factory.h index c2909c6..88d8fbc 100644 --- a/chrome/browser/undo/bookmark_undo_service_factory.h +++ b/chrome/browser/undo/bookmark_undo_service_factory.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_UNDO_BOOKMARK_UNDO_SERVICE_FACTORY_H_ #define CHROME_BROWSER_UNDO_BOOKMARK_UNDO_SERVICE_FACTORY_H_ +#include "base/macros.h" #include "base/memory/singleton.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" diff --git a/chrome/browser/unload_browsertest.cc b/chrome/browser/unload_browsertest.cc index ec7d76d..4e0d2b1 100644 --- a/chrome/browser/unload_browsertest.cc +++ b/chrome/browser/unload_browsertest.cc @@ -9,6 +9,7 @@ #include "base/command_line.h" #include "base/logging.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/net/url_request_mock_util.h" #include "chrome/browser/ui/browser.h" diff --git a/chrome/browser/update_client/chrome_update_query_params_delegate.h b/chrome/browser/update_client/chrome_update_query_params_delegate.h index b77e5c5..b8f9e38 100644 --- a/chrome/browser/update_client/chrome_update_query_params_delegate.h +++ b/chrome/browser/update_client/chrome_update_query_params_delegate.h @@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "components/update_client/update_query_params_delegate.h" class ChromeUpdateQueryParamsDelegate diff --git a/chrome/browser/upgrade_detector.h b/chrome/browser/upgrade_detector.h index 75eff08..7dcbf36 100644 --- a/chrome/browser/upgrade_detector.h +++ b/chrome/browser/upgrade_detector.h @@ -6,6 +6,7 @@ #define CHROME_BROWSER_UPGRADE_DETECTOR_H_ #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/timer/timer.h" #include "chrome/browser/chrome_notification_types.h" #include "ui/base/idle/idle.h" diff --git a/chrome/browser/upgrade_detector_impl.cc b/chrome/browser/upgrade_detector_impl.cc index 64bf7ca..85a254a 100644 --- a/chrome/browser/upgrade_detector_impl.cc +++ b/chrome/browser/upgrade_detector_impl.cc @@ -4,6 +4,8 @@ #include "chrome/browser/upgrade_detector_impl.h" +#include <stdint.h> + #include <string> #include "base/bind.h" @@ -19,6 +21,7 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/time/time.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/google/google_brand.h" #include "chrome/common/channel_info.h" @@ -54,7 +57,7 @@ const int kNotifyCycleTimeMs = 20 * 60 * 1000; // 20 minutes. const int kNotifyCycleTimeForTestingMs = 500; // Half a second. // The number of days after which we identify a build/install as outdated. -const uint64 kOutdatedBuildAgeInDays = 12 * 7; +const uint64_t kOutdatedBuildAgeInDays = 12 * 7; // Return the string that was passed as a value for the // kCheckForUpdateIntervalSec switch. diff --git a/chrome/browser/upgrade_detector_impl.h b/chrome/browser/upgrade_detector_impl.h index 7beaf31..2c16ba6 100644 --- a/chrome/browser/upgrade_detector_impl.h +++ b/chrome/browser/upgrade_detector_impl.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_UPGRADE_DETECTOR_IMPL_H_ #define CHROME_BROWSER_UPGRADE_DETECTOR_IMPL_H_ +#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/timer/timer.h" #include "base/version.h" diff --git a/chrome/browser/upgrade_detector_impl_unittest.cc b/chrome/browser/upgrade_detector_impl_unittest.cc index 64f7591..9646b89 100644 --- a/chrome/browser/upgrade_detector_impl_unittest.cc +++ b/chrome/browser/upgrade_detector_impl_unittest.cc @@ -6,6 +6,7 @@ #include <vector> +#include "base/macros.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/usb/usb_chooser_bubble_delegate.cc b/chrome/browser/usb/usb_chooser_bubble_delegate.cc index b923fcd..98a09b4 100644 --- a/chrome/browser/usb/usb_chooser_bubble_delegate.cc +++ b/chrome/browser/usb/usb_chooser_bubble_delegate.cc @@ -4,6 +4,8 @@ #include "chrome/browser/usb/usb_chooser_bubble_delegate.h" +#include <stddef.h> + #include "base/bind.h" #include "base/stl_util.h" #include "chrome/browser/profiles/profile.h" diff --git a/chrome/browser/usb/web_usb_permission_provider.cc b/chrome/browser/usb/web_usb_permission_provider.cc index c2cbd69..500c487 100644 --- a/chrome/browser/usb/web_usb_permission_provider.cc +++ b/chrome/browser/usb/web_usb_permission_provider.cc @@ -4,6 +4,8 @@ #include "chrome/browser/usb/web_usb_permission_provider.h" +#include <stddef.h> + #include "chrome/browser/profiles/profile.h" #include "chrome/browser/usb/usb_chooser_context.h" #include "chrome/browser/usb/usb_chooser_context_factory.h" diff --git a/chrome/browser/usb/web_usb_permission_provider.h b/chrome/browser/usb/web_usb_permission_provider.h index 7dd9952..f8578e1 100644 --- a/chrome/browser/usb/web_usb_permission_provider.h +++ b/chrome/browser/usb/web_usb_permission_provider.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_USB_WEB_USB_PERMISSION_PROVIDER_H_ #define CHROME_BROWSER_USB_WEB_USB_PERMISSION_PROVIDER_H_ +#include <stdint.h> + #include "device/devices_app/usb/public/interfaces/permission_provider.mojom.h" #include "mojo/common/weak_binding_set.h" #include "mojo/public/cpp/bindings/array.h" diff --git a/chrome/browser/web_applications/update_shortcut_worker_win.cc b/chrome/browser/web_applications/update_shortcut_worker_win.cc index 26810eb..6306e83 100644 --- a/chrome/browser/web_applications/update_shortcut_worker_win.cc +++ b/chrome/browser/web_applications/update_shortcut_worker_win.cc @@ -4,11 +4,14 @@ #include "chrome/browser/web_applications/update_shortcut_worker_win.h" +#include <stddef.h> + #include <algorithm> #include "base/bind.h" #include "base/bind_helpers.h" #include "base/files/file_util.h" +#include "base/macros.h" #include "base/path_service.h" #include "base/strings/utf_string_conversions.h" #include "base/win/shortcut.h" diff --git a/chrome/browser/web_applications/update_shortcut_worker_win.h b/chrome/browser/web_applications/update_shortcut_worker_win.h index bd70c39..1aae4dd 100644 --- a/chrome/browser/web_applications/update_shortcut_worker_win.h +++ b/chrome/browser/web_applications/update_shortcut_worker_win.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_WEB_APPLICATIONS_UPDATE_SHORTCUT_WORKER_WIN_H_ #define CHROME_BROWSER_WEB_APPLICATIONS_UPDATE_SHORTCUT_WORKER_WIN_H_ +#include "base/macros.h" #include "chrome/browser/shell_integration.h" #include "chrome/browser/web_applications/web_app.h" #include "content/public/browser/notification_observer.h" diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc index 3237fff..5884760 100644 --- a/chrome/browser/web_applications/web_app.cc +++ b/chrome/browser/web_applications/web_app.cc @@ -4,15 +4,19 @@ #include "chrome/browser/web_applications/web_app.h" +#include <stddef.h> + #include "base/bind.h" #include "base/bind_helpers.h" #include "base/command_line.h" #include "base/files/file_util.h" #include "base/i18n/file_util_icu.h" +#include "base/macros.h" #include "base/prefs/pref_service.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/threading/thread.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/extension_ui_util.h" #include "chrome/browser/profiles/profile.h" diff --git a/chrome/browser/web_applications/web_app.h b/chrome/browser/web_applications/web_app.h index 6048034..0781349 100644 --- a/chrome/browser/web_applications/web_app.h +++ b/chrome/browser/web_applications/web_app.h @@ -10,6 +10,7 @@ #include "base/callback.h" #include "base/files/file_path.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" #include "build/build_config.h" diff --git a/chrome/browser/web_applications/web_app_linux.cc b/chrome/browser/web_applications/web_app_linux.cc index 193375c..a1429ae 100644 --- a/chrome/browser/web_applications/web_app_linux.cc +++ b/chrome/browser/web_applications/web_app_linux.cc @@ -6,6 +6,7 @@ #include "base/environment.h" #include "base/logging.h" +#include "build/build_config.h" #include "chrome/browser/shell_integration_linux.h" #include "content/public/browser/browser_thread.h" diff --git a/chrome/browser/web_applications/web_app_mac.h b/chrome/browser/web_applications/web_app_mac.h index d9062f6..3e5a1a9 100644 --- a/chrome/browser/web_applications/web_app_mac.h +++ b/chrome/browser/web_applications/web_app_mac.h @@ -5,12 +5,14 @@ #ifndef CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ #define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_MAC_H_ +#include <stddef.h> + #include <string> #include <vector> -#include "base/basictypes.h" #include "base/files/file_path.h" #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/web_applications/web_app.h" #include "extensions/common/manifest_handlers/file_handler_info.h" diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm index 51022c4..a5d4674 100644 --- a/chrome/browser/web_applications/web_app_mac.mm +++ b/chrome/browser/web_applications/web_app_mac.mm @@ -6,6 +6,7 @@ #import <Carbon/Carbon.h> #import <Cocoa/Cocoa.h> +#include <stdint.h> #include "base/command_line.h" #include "base/files/file_enumerator.h" @@ -16,6 +17,7 @@ #include "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" #include "base/mac/scoped_nsobject.h" +#include "base/macros.h" #include "base/metrics/sparse_histogram.h" #include "base/path_service.h" #include "base/process/process_handle.h" diff --git a/chrome/browser/web_applications/web_app_mac_unittest.mm b/chrome/browser/web_applications/web_app_mac_unittest.mm index a8e8e6f..7a8815d 100644 --- a/chrome/browser/web_applications/web_app_mac_unittest.mm +++ b/chrome/browser/web_applications/web_app_mac_unittest.mm @@ -6,6 +6,7 @@ #import <Cocoa/Cocoa.h> #include <errno.h> +#include <stddef.h> #include <sys/xattr.h> #include "base/command_line.h" @@ -13,6 +14,7 @@ #include "base/files/scoped_temp_dir.h" #include "base/mac/foundation_util.h" #include "base/mac/scoped_nsobject.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "base/strings/sys_string_conversions.h" diff --git a/chrome/browser/web_applications/web_app_win.cc b/chrome/browser/web_applications/web_app_win.cc index 86e5a0e..7ed731b 100644 --- a/chrome/browser/web_applications/web_app_win.cc +++ b/chrome/browser/web_applications/web_app_win.cc @@ -5,11 +5,13 @@ #include "chrome/browser/web_applications/web_app_win.h" #include <shlobj.h> +#include <stddef.h> #include "base/command_line.h" #include "base/files/file_enumerator.h" #include "base/files/file_util.h" #include "base/logging.h" +#include "base/macros.h" #include "base/md5.h" #include "base/memory/scoped_ptr.h" #include "base/path_service.h" diff --git a/chrome/browser/web_data_service_factory.cc b/chrome/browser/web_data_service_factory.cc index 3bac5d8..1da606f 100644 --- a/chrome/browser/web_data_service_factory.cc +++ b/chrome/browser/web_data_service_factory.cc @@ -7,6 +7,7 @@ #include "base/bind.h" #include "base/files/file_path.h" #include "base/memory/singleton.h" +#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" diff --git a/chrome/browser/web_data_service_factory.h b/chrome/browser/web_data_service_factory.h index d1b5608..9ab0563 100644 --- a/chrome/browser/web_data_service_factory.h +++ b/chrome/browser/web_data_service_factory.h @@ -7,6 +7,7 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "build/build_config.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" #include "components/keyed_service/core/service_access_type.h" |
