diff --git a/DEPS b/DEPS index 7bd4eca..1db8453b 100644 --- a/DEPS +++ b/DEPS
@@ -71,7 +71,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': 'e88ec8eed5a448b9fc470a6684c93f24404c7e89', + 'angle_revision': '206a58d1fbc7125d32b1ab3abe7993f6d0818573', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling build tools # and whatever else without interference from each other. @@ -400,7 +400,7 @@ Var('chromium_git') + '/external/libaddressinput.git' + '@' + '8200a3221282582ca3291ef219257ca4be7426ca', 'src/third_party/libaom/source/libaom': { - 'url': Var('aomedia_git') + '/aom.git' + '@' + 'd9f2286e4c0bbb0fee5719d151653247939c3847', + 'url': Var('aomedia_git') + '/aom.git' + '@' + '7b06dd5dbf11ee1cd65b974a2e46ec33eab65375', 'condition': 'checkout_libaom', }, @@ -605,7 +605,7 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + '34842fa3c36988840c89f5bc6a68503175acf7d9', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '1b8205f9ee8fda98ddb66c464c7e4d8bfa49cf50', # commit position 20237 + Var('webrtc_git') + '/src.git' + '@' + '7172ea13c029b56e68b0b6075034489ebe00f6c0', # commit position 20528 'src/third_party/xdg-utils': { 'url': Var('chromium_git') + '/chromium/deps/xdg-utils.git' + '@' + 'd80274d5869b17b8c9067a1022e4416ee7ed5e0d',
diff --git a/android_webview/BUILD.gn b/android_webview/BUILD.gn index e0fbc06..5410080 100644 --- a/android_webview/BUILD.gn +++ b/android_webview/BUILD.gn
@@ -16,10 +16,6 @@ system_webview_package_name = "com.android.webview" } -if (!defined(use_unpublished_apis)) { - use_unpublished_apis = false -} - if (enable_resource_whitelist_generation) { system_webview_pak_whitelist = "$target_gen_dir/system_webview_pak_whitelist.txt" @@ -29,7 +25,7 @@ "$target_gen_dir/system_webview_apk/AndroidManifest.xml" group("android_webview") { - if (!use_unpublished_apis) { + if (public_android_sdk) { deps = [ ":system_webview_apk", ] @@ -982,7 +978,7 @@ ] } -if (!use_unpublished_apis) { +if (public_android_sdk) { system_webview_apk_tmpl("system_webview_apk") { android_manifest = system_webview_android_manifest android_manifest_dep = ":system_webview_manifest"
diff --git a/ash/accelerators/accelerator_filter_unittest.cc b/ash/accelerators/accelerator_filter_unittest.cc index 03aa7bb8..dad70156 100644 --- a/ash/accelerators/accelerator_filter_unittest.cc +++ b/ash/accelerators/accelerator_filter_unittest.cc
@@ -8,12 +8,9 @@ #include "ash/accelerators/accelerator_controller.h" #include "ash/accelerators/accelerator_delegate.h" -#include "ash/public/cpp/config.h" -#include "ash/public/cpp/shell_window_ids.h" #include "ash/session/session_controller.h" #include "ash/shell.h" #include "ash/test/ash_test_base.h" -#include "ash/test/ash_test_helper.h" #include "ash/test_screenshot_delegate.h" #include "ash/wm/window_state.h" #include "ash/wm/window_util.h" @@ -21,7 +18,6 @@ #include "ui/app_list/presenter/app_list.h" #include "ui/app_list/presenter/test/test_app_list_presenter.h" #include "ui/aura/client/aura_constants.h" -#include "ui/aura/test/aura_test_base.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" #include "ui/base/accelerators/accelerator_history.h" @@ -35,10 +31,6 @@ // Tests if AcceleratorFilter works without a focused window. TEST_F(AcceleratorFilterTest, TestFilterWithoutFocus) { - // TODO: mash doesn't support ScreenshotDelgate yet. http://crbug.com/632111. - if (Shell::GetAshConfig() == Config::MASH) - return; - const TestScreenshotDelegate* delegate = GetScreenshotDelegate(); EXPECT_EQ(0, delegate->handle_take_screenshot_count()); @@ -53,10 +45,6 @@ // Tests if AcceleratorFilter works as expected with a focused window. TEST_F(AcceleratorFilterTest, TestFilterWithFocus) { - // TODO: mash doesn't support ScreenshotDelgate yet. http://crbug.com/632111. - if (Shell::GetAshConfig() == Config::MASH) - return; - aura::test::TestWindowDelegate test_delegate; std::unique_ptr<aura::Window> window( CreateTestWindowInShellWithDelegate(&test_delegate, -1, gfx::Rect())); @@ -79,10 +67,6 @@ // Tests if AcceleratorFilter ignores the flag for Caps Lock. TEST_F(AcceleratorFilterTest, TestCapsLockMask) { - // TODO: mash doesn't support ScreenshotDelgate yet. http://crbug.com/632111. - if (Shell::GetAshConfig() == Config::MASH) - return; - const TestScreenshotDelegate* delegate = GetScreenshotDelegate(); EXPECT_EQ(0, delegate->handle_take_screenshot_count());
diff --git a/ash/system/user/user_view.cc b/ash/system/user/user_view.cc index 069e0dd..9782bac7 100644 --- a/ash/system/user/user_view.cc +++ b/ash/system/user/user_view.cc
@@ -45,6 +45,9 @@ namespace { +// Vertical mergin for the top/bottom edges of the view. +constexpr size_t kVerticalMargin = 2; + // Switch to a user with the given |user_index|. void SwitchUser(UserIndex user_index) { // Do not switch users when the log screen is presented. @@ -204,9 +207,9 @@ } gfx::Insets GetInsets() const override { - return gfx::Insets(kMenuSeparatorVerticalPadding, + return gfx::Insets(kVerticalMargin + kMenuSeparatorVerticalPadding, kMenuExtraMarginFromLeftEdge, - kMenuSeparatorVerticalPadding * 2, 0); + kVerticalMargin + kMenuSeparatorVerticalPadding, 0); } gfx::Size GetMinimumSize() const override { return gfx::Size(); }
diff --git a/build/config/android/config.gni b/build/config/android/config.gni index f38bd02..5e0859f8 100644 --- a/build/config/android/config.gni +++ b/build/config/android/config.gni
@@ -27,6 +27,26 @@ if (enable_chrome_android_internal) { import("//clank/config.gni") + + # TODO(jbudorick): Remove this after landing the corresponding + # internal change. + if (!defined(android_sdk_release)) { + if (defined(use_unpublished_apis) && use_unpublished_apis) { + default_android_sdk_release = "o_mr1" + public_android_sdk = false + } else { + default_android_sdk_release = "o" + } + declare_args() { + # Android SDK release. Currently, only "o" is publicly supported. + android_sdk_release = default_android_sdk_release + } + } + } else { + declare_args() { + # Android SDK release. Currently, only "o" is publicly supported. + android_sdk_release = "o" + } } if (!defined(extra_chrome_shared_library_configs)) { @@ -45,11 +65,12 @@ assert(defined(default_android_ndk_major_version)) } - if (!defined(default_android_sdk_root)) { + if (android_sdk_release == "o") { default_android_sdk_root = "//third_party/android_tools/sdk" default_android_sdk_version = "26" default_android_sdk_build_tools_version = "26.0.2" default_android_sdk_tools_version_suffix = "-25.3.2" + public_android_sdk = true } if (!defined(default_lint_android_sdk_root)) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java b/chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java index 170ab114..267131ac 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java
@@ -162,12 +162,6 @@ TimeUnit.HOURS.toMillis(1), TimeUnit.DAYS.toMillis(30), TimeUnit.MILLISECONDS, 50); } - // TODO(ranj): Remove this function after downstream is checked in. - public static void logAvailableSpaceAboveLowSpaceLimitInUMA(boolean installSucceeded) {} - - // TODO(ranj): Remove this function after downstream is checked in. - public static void logUnimportantStorageSizeInUMA() {} - /** * Log necessary disk usage and cache size UMAs when WebAPK installation fails. */ @@ -319,8 +313,9 @@ } } + long unimportantSiteStorageTotal = siteStorageSize - importantSiteStorageTotal; logSpaceUsageUMAOnDataAvailable( - mAvailableSpaceInByte, mCacheSizeInByte, importantSiteStorageTotal); + mAvailableSpaceInByte, mCacheSizeInByte, unimportantSiteStorageTotal); } } }
diff --git a/chromeos/network/network_configuration_handler.h b/chromeos/network/network_configuration_handler.h index 48ed0d5..e809051 100644 --- a/chromeos/network/network_configuration_handler.h +++ b/chromeos/network/network_configuration_handler.h
@@ -145,7 +145,7 @@ friend class ClientCertResolverTest; friend class NetworkHandler; friend class NetworkConfigurationHandlerTest; - friend class NetworkConfigurationHandlerStubTest; + friend class NetworkConfigurationHandlerMockTest; class ProfileEntryDeleter; NetworkConfigurationHandler();
diff --git a/chromeos/network/network_configuration_handler_unittest.cc b/chromeos/network/network_configuration_handler_unittest.cc index 3ee1234..68bd7cb 100644 --- a/chromeos/network/network_configuration_handler_unittest.cc +++ b/chromeos/network/network_configuration_handler_unittest.cc
@@ -102,9 +102,7 @@ class TestNetworkConfigurationObserver : public NetworkConfigurationObserver { public: - TestNetworkConfigurationObserver() {} - ~TestNetworkConfigurationObserver() override { - } + TestNetworkConfigurationObserver() = default; // NetworkConfigurationObserver void OnConfigurationCreated( @@ -173,16 +171,156 @@ DISALLOW_COPY_AND_ASSIGN(TestNetworkConfigurationObserver); }; +class TestNetworkStateHandlerObserver + : public chromeos::NetworkStateHandlerObserver { + public: + TestNetworkStateHandlerObserver() = default; + + // Returns the number of NetworkListChanged() call. + size_t network_list_changed_count() const { + return network_list_changed_count_; + } + + // Returns the number of NetworkPropertiesUpdated() call for the + // given |service_path|. + int PropertyUpdatesForService(const std::string& service_path) const { + auto iter = property_updates_.find(service_path); + return iter == property_updates_.end() ? 0 : iter->second; + } + + // chromeos::NetworkStateHandlerObserver overrides: + void NetworkListChanged() override { ++network_list_changed_count_; } + void NetworkPropertiesUpdated(const NetworkState* network) override { + property_updates_[network->path()]++; + } + + private: + size_t network_list_changed_count_ = 0; + std::map<std::string, int> property_updates_; + + DISALLOW_COPY_AND_ASSIGN(TestNetworkStateHandlerObserver); +}; + } // namespace class NetworkConfigurationHandlerTest : public testing::Test { public: - NetworkConfigurationHandlerTest() + NetworkConfigurationHandlerTest() { + DBusThreadManager::Initialize(); + + network_state_handler_ = NetworkStateHandler::InitializeForTest(); + // Note: NetworkConfigurationHandler's contructor is private, so + // std::make_unique cannot be used. + network_configuration_handler_.reset(new NetworkConfigurationHandler()); + network_configuration_handler_->Init(network_state_handler_.get(), + nullptr /* network_device_handler */); + base::RunLoop().RunUntilIdle(); + network_state_handler_observer_ = + std::make_unique<TestNetworkStateHandlerObserver>(); + network_state_handler_->AddObserver(network_state_handler_observer_.get(), + FROM_HERE); + } + + ~NetworkConfigurationHandlerTest() override { + network_state_handler_->Shutdown(); + network_state_handler_->RemoveObserver( + network_state_handler_observer_.get(), FROM_HERE); + network_state_handler_observer_.reset(); + network_configuration_handler_.reset(); + network_state_handler_.reset(); + + DBusThreadManager::Shutdown(); + } + + void SuccessCallback(const std::string& callback_name) { + success_callback_name_ = callback_name; + } + + void GetPropertiesCallback(const std::string& service_path, + const base::DictionaryValue& dictionary) { + get_properties_path_ = service_path; + get_properties_ = dictionary.CreateDeepCopy(); + } + + void CreateConfigurationCallback(const std::string& service_path, + const std::string& guid) { + create_service_path_ = service_path; + } + + void CreateTestConfiguration(const std::string& service_path, + const std::string& type) { + base::DictionaryValue properties; + shill_property_util::SetSSID(service_path, &properties); + properties.SetKey(shill::kNameProperty, base::Value(service_path)); + properties.SetKey(shill::kGuidProperty, base::Value(service_path)); + properties.SetKey(shill::kTypeProperty, base::Value(type)); + properties.SetKey(shill::kStateProperty, base::Value(shill::kStateIdle)); + properties.SetKey( + shill::kProfileProperty, + base::Value(NetworkProfileHandler::GetSharedProfilePath())); + + network_configuration_handler_->CreateShillConfiguration( + properties, NetworkConfigurationObserver::SOURCE_USER_ACTION, + base::Bind( + &NetworkConfigurationHandlerTest::CreateConfigurationCallback, + base::Unretained(this)), + base::Bind(&ErrorCallback)); + base::RunLoop().RunUntilIdle(); + } + + protected: + bool GetServiceStringProperty(const std::string& service_path, + const std::string& key, + std::string* result) { + ShillServiceClient::TestInterface* service_test = + DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface(); + const base::DictionaryValue* properties = + service_test->GetServiceProperties(service_path); + if (!properties) + return false; + const base::Value* value = + properties->FindKeyOfType(key, base::Value::Type::STRING); + if (!value) + return false; + *result = value->GetString(); + return true; + } + + bool GetReceivedStringProperty(const std::string& service_path, + const std::string& key, + std::string* result) { + if (get_properties_path_ != service_path || !get_properties_) + return false; + const base::Value* value = + get_properties_->FindKeyOfType(key, base::Value::Type::STRING); + if (!value) + return false; + *result = value->GetString(); + return true; + } + + std::unique_ptr<NetworkStateHandler> network_state_handler_; + std::unique_ptr<NetworkConfigurationHandler> network_configuration_handler_; + std::unique_ptr<TestNetworkStateHandlerObserver> + network_state_handler_observer_; + base::MessageLoopForUI message_loop_; + std::string success_callback_name_; + std::string get_properties_path_; + std::unique_ptr<base::DictionaryValue> get_properties_; + std::string create_service_path_; +}; + +// DEPRECATED. Please use NetworkConfigurationHandlerTest with Fake +// implementation. +// TODO(hidehiko): Remove this when gmock removal is done in this file. +class NetworkConfigurationHandlerMockTest : public testing::Test { + public: + NetworkConfigurationHandlerMockTest() : mock_manager_client_(NULL), mock_profile_client_(NULL), mock_service_client_(NULL), dictionary_value_result_(NULL) {} - ~NetworkConfigurationHandlerTest() override {} + ~NetworkConfigurationHandlerMockTest() override {} void SetUp() override { std::unique_ptr<DBusThreadManagerSetter> dbus_setter = @@ -206,11 +344,10 @@ EXPECT_CALL(*mock_manager_client_, AddPropertyChangedObserver(_)) .WillRepeatedly(Invoke( this, - &NetworkConfigurationHandlerTest::AddPropertyChangedObserver)); + &NetworkConfigurationHandlerMockTest::AddPropertyChangedObserver)); EXPECT_CALL(*mock_manager_client_, RemovePropertyChangedObserver(_)) - .WillRepeatedly(Invoke( - this, - &NetworkConfigurationHandlerTest::RemovePropertyChangedObserver)); + .WillRepeatedly(Invoke(this, &NetworkConfigurationHandlerMockTest:: + RemovePropertyChangedObserver)); network_state_handler_ = NetworkStateHandler::InitializeForTest(); network_configuration_handler_.reset(new NetworkConfigurationHandler()); @@ -332,7 +469,7 @@ property_changed_observers_; }; -TEST_F(NetworkConfigurationHandlerTest, GetProperties) { +TEST_F(NetworkConfigurationHandlerMockTest, GetProperties) { std::string service_path = "/service/1"; std::string expected_json = "{\n \"SSID\": \"MyNetwork\"\n}\n"; std::string networkName = "MyNetwork"; @@ -353,7 +490,7 @@ ShillServiceClient::DictionaryValueCallback get_properties_callback; EXPECT_CALL(*mock_service_client_, GetProperties(_, _)) .WillOnce( - Invoke(this, &NetworkConfigurationHandlerTest::OnGetProperties)); + Invoke(this, &NetworkConfigurationHandlerMockTest::OnGetProperties)); network_configuration_handler_->GetShillProperties( service_path, base::Bind(&DictionaryValueCallback, service_path, expected_json), @@ -361,7 +498,7 @@ base::RunLoop().RunUntilIdle(); } -TEST_F(NetworkConfigurationHandlerTest, GetProperties_TetherNetwork) { +TEST_F(NetworkConfigurationHandlerMockTest, GetProperties_TetherNetwork) { network_state_handler_->SetTetherTechnologyState( NetworkStateHandler::TechnologyState::TECHNOLOGY_ENABLED); @@ -397,7 +534,7 @@ base::Bind(&ErrorCallback)); } -TEST_F(NetworkConfigurationHandlerTest, SetProperties) { +TEST_F(NetworkConfigurationHandlerMockTest, SetProperties) { std::string service_path = "/service/1"; std::string networkName = "MyNetwork"; std::string key = "SSID"; @@ -408,14 +545,14 @@ dictionary_value_result_ = &value; EXPECT_CALL(*mock_service_client_, SetProperties(_, _, _, _)) .WillOnce( - Invoke(this, &NetworkConfigurationHandlerTest::OnSetProperties)); + Invoke(this, &NetworkConfigurationHandlerMockTest::OnSetProperties)); network_configuration_handler_->SetShillProperties( service_path, value, NetworkConfigurationObserver::SOURCE_USER_ACTION, base::Bind(&base::DoNothing), base::Bind(&ErrorCallback)); base::RunLoop().RunUntilIdle(); } -TEST_F(NetworkConfigurationHandlerTest, ClearProperties) { +TEST_F(NetworkConfigurationHandlerMockTest, ClearProperties) { std::string service_path = "/service/1"; std::string networkName = "MyNetwork"; std::string key = "SSID"; @@ -427,37 +564,7 @@ dictionary_value_result_ = &value; EXPECT_CALL(*mock_service_client_, SetProperties(_, _, _, _)) .WillOnce( - Invoke(this, &NetworkConfigurationHandlerTest::OnSetProperties)); - network_configuration_handler_->SetShillProperties( - service_path, value, NetworkConfigurationObserver::SOURCE_USER_ACTION, - base::Bind(&base::DoNothing), base::Bind(&ErrorCallback)); - base::RunLoop().RunUntilIdle(); - - // Now clear it. - std::vector<std::string> values_to_clear; - values_to_clear.push_back(key); - EXPECT_CALL(*mock_service_client_, ClearProperties(_, _, _, _)) - .WillOnce( - Invoke(this, &NetworkConfigurationHandlerTest::OnClearProperties)); - network_configuration_handler_->ClearShillProperties( - service_path, values_to_clear, base::Bind(&base::DoNothing), - base::Bind(&ErrorCallback)); - base::RunLoop().RunUntilIdle(); -} - -TEST_F(NetworkConfigurationHandlerTest, ClearPropertiesError) { - std::string service_path = "/service/1"; - std::string networkName = "MyNetwork"; - std::string key = "SSID"; - std::unique_ptr<base::Value> networkNameValue(new base::Value(networkName)); - - // First set up a value to clear. - base::DictionaryValue value; - value.SetString(key, networkName); - dictionary_value_result_ = &value; - EXPECT_CALL(*mock_service_client_, SetProperties(_, _, _, _)) - .WillOnce( - Invoke(this, &NetworkConfigurationHandlerTest::OnSetProperties)); + Invoke(this, &NetworkConfigurationHandlerMockTest::OnSetProperties)); network_configuration_handler_->SetShillProperties( service_path, value, NetworkConfigurationObserver::SOURCE_USER_ACTION, base::Bind(&base::DoNothing), base::Bind(&ErrorCallback)); @@ -468,7 +575,37 @@ values_to_clear.push_back(key); EXPECT_CALL(*mock_service_client_, ClearProperties(_, _, _, _)) .WillOnce(Invoke( - this, &NetworkConfigurationHandlerTest::OnClearPropertiesError)); + this, &NetworkConfigurationHandlerMockTest::OnClearProperties)); + network_configuration_handler_->ClearShillProperties( + service_path, values_to_clear, base::Bind(&base::DoNothing), + base::Bind(&ErrorCallback)); + base::RunLoop().RunUntilIdle(); +} + +TEST_F(NetworkConfigurationHandlerMockTest, ClearPropertiesError) { + std::string service_path = "/service/1"; + std::string networkName = "MyNetwork"; + std::string key = "SSID"; + std::unique_ptr<base::Value> networkNameValue(new base::Value(networkName)); + + // First set up a value to clear. + base::DictionaryValue value; + value.SetString(key, networkName); + dictionary_value_result_ = &value; + EXPECT_CALL(*mock_service_client_, SetProperties(_, _, _, _)) + .WillOnce( + Invoke(this, &NetworkConfigurationHandlerMockTest::OnSetProperties)); + network_configuration_handler_->SetShillProperties( + service_path, value, NetworkConfigurationObserver::SOURCE_USER_ACTION, + base::Bind(&base::DoNothing), base::Bind(&ErrorCallback)); + base::RunLoop().RunUntilIdle(); + + // Now clear it. + std::vector<std::string> values_to_clear; + values_to_clear.push_back(key); + EXPECT_CALL(*mock_service_client_, ClearProperties(_, _, _, _)) + .WillOnce(Invoke( + this, &NetworkConfigurationHandlerMockTest::OnClearPropertiesError)); std::string error; network_configuration_handler_->ClearShillProperties( @@ -477,7 +614,7 @@ base::RunLoop().RunUntilIdle(); } -TEST_F(NetworkConfigurationHandlerTest, CreateConfiguration) { +TEST_F(NetworkConfigurationHandlerMockTest, CreateConfiguration) { std::string networkName = "MyNetwork"; std::string key = "SSID"; std::string type = "wifi"; @@ -489,13 +626,13 @@ EXPECT_CALL(*mock_manager_client_, ConfigureServiceForProfile(dbus::ObjectPath(profile), _, _, _)) - .WillOnce( - Invoke(this, &NetworkConfigurationHandlerTest::OnConfigureService)); + .WillOnce(Invoke( + this, &NetworkConfigurationHandlerMockTest::OnConfigureService)); CreateConfiguration("/service/2", value); base::RunLoop().RunUntilIdle(); } -TEST_F(NetworkConfigurationHandlerTest, RemoveConfiguration) { +TEST_F(NetworkConfigurationHandlerMockTest, RemoveConfiguration) { std::string service_path = "/service/2"; // Set up network configuration so the associated network service has the @@ -508,13 +645,13 @@ value.SetKey(shill::kProfileProperty, base::Value("profile2")); EXPECT_CALL(*mock_manager_client_, ConfigureServiceForProfile(dbus::ObjectPath("profile2"), _, _, _)) - .WillOnce( - Invoke(this, &NetworkConfigurationHandlerTest::OnConfigureService)); + .WillOnce(Invoke( + this, &NetworkConfigurationHandlerMockTest::OnConfigureService)); dictionary_value_result_ = &value; EXPECT_CALL(*mock_service_client_, GetProperties(_, _)) .WillRepeatedly( - Invoke(this, &NetworkConfigurationHandlerTest::OnGetProperties)); + Invoke(this, &NetworkConfigurationHandlerMockTest::OnGetProperties)); CreateConfiguration(service_path, value); base::RunLoop().RunUntilIdle(); @@ -524,15 +661,18 @@ EXPECT_CALL(*mock_service_client_, GetLoadableProfileEntries(dbus::ObjectPath(service_path), _)) .WillOnce(Invoke( - this, &NetworkConfigurationHandlerTest::OnGetLoadableProfileEntries)); + this, + &NetworkConfigurationHandlerMockTest::OnGetLoadableProfileEntries)); // Expectations for entries deleted during the test. EXPECT_CALL(*mock_profile_client_, DeleteEntry(dbus::ObjectPath("profile1"), "entry1", _, _)) - .WillOnce(Invoke(this, &NetworkConfigurationHandlerTest::OnDeleteEntry)); + .WillOnce( + Invoke(this, &NetworkConfigurationHandlerMockTest::OnDeleteEntry)); EXPECT_CALL(*mock_profile_client_, DeleteEntry(dbus::ObjectPath("profile2"), "entry2", _, _)) - .WillOnce(Invoke(this, &NetworkConfigurationHandlerTest::OnDeleteEntry)); + .WillOnce( + Invoke(this, &NetworkConfigurationHandlerMockTest::OnDeleteEntry)); TestCallback test_callback; network_configuration_handler_->RemoveConfiguration( @@ -545,7 +685,8 @@ EXPECT_FALSE(PendingProfileEntryDeleterForTest(service_path)); } -TEST_F(NetworkConfigurationHandlerTest, RemoveConfigurationFromCurrentProfile) { +TEST_F(NetworkConfigurationHandlerMockTest, + RemoveConfigurationFromCurrentProfile) { std::string service_path = "/service/2"; // Set up network configuration so the associated network service has the @@ -558,13 +699,13 @@ value.SetKey(shill::kProfileProperty, base::Value("profile2")); EXPECT_CALL(*mock_manager_client_, ConfigureServiceForProfile(dbus::ObjectPath("profile2"), _, _, _)) - .WillOnce( - Invoke(this, &NetworkConfigurationHandlerTest::OnConfigureService)); + .WillOnce(Invoke( + this, &NetworkConfigurationHandlerMockTest::OnConfigureService)); dictionary_value_result_ = &value; EXPECT_CALL(*mock_service_client_, GetProperties(_, _)) .WillRepeatedly( - Invoke(this, &NetworkConfigurationHandlerTest::OnGetProperties)); + Invoke(this, &NetworkConfigurationHandlerMockTest::OnGetProperties)); CreateConfiguration(service_path, value); base::RunLoop().RunUntilIdle(); @@ -574,12 +715,14 @@ EXPECT_CALL(*mock_service_client_, GetLoadableProfileEntries(dbus::ObjectPath(service_path), _)) .WillOnce(Invoke( - this, &NetworkConfigurationHandlerTest::OnGetLoadableProfileEntries)); + this, + &NetworkConfigurationHandlerMockTest::OnGetLoadableProfileEntries)); // Expectations for entries deleted during the test. EXPECT_CALL(*mock_profile_client_, DeleteEntry(dbus::ObjectPath("profile2"), "entry2", _, _)) - .WillOnce(Invoke(this, &NetworkConfigurationHandlerTest::OnDeleteEntry)); + .WillOnce( + Invoke(this, &NetworkConfigurationHandlerMockTest::OnDeleteEntry)); EXPECT_CALL(*mock_profile_client_, DeleteEntry(dbus::ObjectPath("profile1"), "entry1", _, _)) .Times(0); @@ -595,14 +738,15 @@ EXPECT_FALSE(PendingProfileEntryDeleterForTest(service_path)); } -TEST_F(NetworkConfigurationHandlerTest, +TEST_F(NetworkConfigurationHandlerMockTest, RemoveNonExistentConfigurationFromCurrentProfile) { // Set Up mock flor GetLoadableProfileEntries - it returns // [(profile1, entry1), (profile2, entry2)] profile-entry pairs. EXPECT_CALL(*mock_service_client_, GetLoadableProfileEntries(dbus::ObjectPath("/service/3"), _)) .WillRepeatedly(Invoke( - this, &NetworkConfigurationHandlerTest::OnGetLoadableProfileEntries)); + this, + &NetworkConfigurationHandlerMockTest::OnGetLoadableProfileEntries)); // Expectations for entries deleted during the test. EXPECT_CALL(*mock_profile_client_, @@ -625,139 +769,7 @@ EXPECT_FALSE(PendingProfileEntryDeleterForTest("/service/3")); } -//////////////////////////////////////////////////////////////////////////////// -// Stub based tests - -namespace { - -class TestObserver final : public chromeos::NetworkStateHandlerObserver { - public: - TestObserver() : network_list_changed_count_(0) {} - ~TestObserver() override {} - - void NetworkListChanged() override { ++network_list_changed_count_; } - - void NetworkPropertiesUpdated(const NetworkState* network) override { - property_updates_[network->path()]++; - } - - size_t network_list_changed_count() { return network_list_changed_count_; } - - int PropertyUpdatesForService(const std::string& service_path) { - return property_updates_[service_path]; - } - - void ClearPropertyUpdates() { property_updates_.clear(); } - - private: - size_t network_list_changed_count_; - std::map<std::string, int> property_updates_; - - DISALLOW_COPY_AND_ASSIGN(TestObserver); -}; - -} // namespace - -class NetworkConfigurationHandlerStubTest : public testing::Test { - public: - NetworkConfigurationHandlerStubTest() {} - - ~NetworkConfigurationHandlerStubTest() override {} - - void SetUp() override { - DBusThreadManager::Initialize(); - - network_state_handler_ = NetworkStateHandler::InitializeForTest(); - test_observer_.reset(new TestObserver()); - network_state_handler_->AddObserver(test_observer_.get(), FROM_HERE); - - network_configuration_handler_.reset(new NetworkConfigurationHandler()); - network_configuration_handler_->Init(network_state_handler_.get(), - NULL /* network_device_handler */); - - base::RunLoop().RunUntilIdle(); - test_observer_->ClearPropertyUpdates(); - } - - void TearDown() override { - network_state_handler_->Shutdown(); - network_configuration_handler_.reset(); - network_state_handler_->RemoveObserver(test_observer_.get(), FROM_HERE); - network_state_handler_.reset(); - DBusThreadManager::Shutdown(); - } - - void SuccessCallback(const std::string& callback_name) { - success_callback_name_ = callback_name; - } - - void GetPropertiesCallback(const std::string& service_path, - const base::DictionaryValue& dictionary) { - get_properties_path_ = service_path; - get_properties_ = dictionary.CreateDeepCopy(); - } - - void CreateConfigurationCallback(const std::string& service_path, - const std::string& guid) { - create_service_path_ = service_path; - } - - void CreateTestConfiguration(const std::string& service_path, - const std::string& type) { - base::DictionaryValue properties; - shill_property_util::SetSSID(service_path, &properties); - properties.SetKey(shill::kNameProperty, base::Value(service_path)); - properties.SetKey(shill::kGuidProperty, base::Value(service_path)); - properties.SetKey(shill::kTypeProperty, base::Value(type)); - properties.SetKey(shill::kStateProperty, base::Value(shill::kStateIdle)); - properties.SetKey( - shill::kProfileProperty, - base::Value(NetworkProfileHandler::GetSharedProfilePath())); - - network_configuration_handler_->CreateShillConfiguration( - properties, NetworkConfigurationObserver::SOURCE_USER_ACTION, - base::Bind( - &NetworkConfigurationHandlerStubTest::CreateConfigurationCallback, - base::Unretained(this)), - base::Bind(&ErrorCallback)); - base::RunLoop().RunUntilIdle(); - } - - protected: - bool GetServiceStringProperty(const std::string& service_path, - const std::string& key, - std::string* result) { - ShillServiceClient::TestInterface* service_test = - DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface(); - const base::DictionaryValue* properties = - service_test->GetServiceProperties(service_path); - if (properties && properties->GetStringWithoutPathExpansion(key, result)) - return true; - return false; - } - - bool GetReceivedStringProperty(const std::string& service_path, - const std::string& key, - std::string* result) { - if (get_properties_path_ != service_path) - return false; - if (get_properties_ && - get_properties_->GetStringWithoutPathExpansion(key, result)) - return true; - return false; - } - - std::unique_ptr<NetworkStateHandler> network_state_handler_; - std::unique_ptr<NetworkConfigurationHandler> network_configuration_handler_; - std::unique_ptr<TestObserver> test_observer_; - base::MessageLoopForUI message_loop_; - std::string success_callback_name_; - std::string get_properties_path_; - std::unique_ptr<base::DictionaryValue> get_properties_; - std::string create_service_path_; -}; - -TEST_F(NetworkConfigurationHandlerStubTest, StubSetAndClearProperties) { +TEST_F(NetworkConfigurationHandlerTest, StubSetAndClearProperties) { // TODO(stevenjb): Remove dependency on default Stub service. const std::string service_path("/service/wifi1"); const std::string test_identity("test_identity"); @@ -772,7 +784,7 @@ network_configuration_handler_->SetShillProperties( service_path, properties_to_set, NetworkConfigurationObserver::SOURCE_USER_ACTION, - base::Bind(&NetworkConfigurationHandlerStubTest::SuccessCallback, + base::Bind(&NetworkConfigurationHandlerTest::SuccessCallback, base::Unretained(this), "SetProperties"), base::Bind(&ErrorCallback)); base::RunLoop().RunUntilIdle(); @@ -785,7 +797,8 @@ &passphrase)); EXPECT_EQ(test_identity, identity); EXPECT_EQ(test_passphrase, passphrase); - EXPECT_EQ(1, test_observer_->PropertyUpdatesForService(service_path)); + EXPECT_EQ(1, network_state_handler_observer_->PropertyUpdatesForService( + service_path)); // Clear Properties std::vector<std::string> properties_to_clear; @@ -793,7 +806,7 @@ properties_to_clear.push_back(shill::kPassphraseProperty); network_configuration_handler_->ClearShillProperties( service_path, properties_to_clear, - base::Bind(&NetworkConfigurationHandlerStubTest::SuccessCallback, + base::Bind(&NetworkConfigurationHandlerTest::SuccessCallback, base::Unretained(this), "ClearProperties"), base::Bind(&ErrorCallback)); base::RunLoop().RunUntilIdle(); @@ -803,10 +816,11 @@ &identity)); EXPECT_FALSE(GetServiceStringProperty(service_path, shill::kIdentityProperty, &passphrase)); - EXPECT_EQ(2, test_observer_->PropertyUpdatesForService(service_path)); + EXPECT_EQ(2, network_state_handler_observer_->PropertyUpdatesForService( + service_path)); } -TEST_F(NetworkConfigurationHandlerStubTest, StubGetNameFromWifiHex) { +TEST_F(NetworkConfigurationHandlerTest, StubGetNameFromWifiHex) { // TODO(stevenjb): Remove dependency on default Stub service. const std::string service_path("/service/wifi1"); std::string wifi_hex = "5468697320697320484558205353494421"; @@ -828,7 +842,7 @@ // Get Properties network_configuration_handler_->GetShillProperties( service_path, - base::Bind(&NetworkConfigurationHandlerStubTest::GetPropertiesCallback, + base::Bind(&NetworkConfigurationHandlerTest::GetPropertiesCallback, base::Unretained(this)), base::Bind(&ErrorCallback)); base::RunLoop().RunUntilIdle(); @@ -840,7 +854,7 @@ EXPECT_EQ(expected_name, name_result); } -TEST_F(NetworkConfigurationHandlerStubTest, StubCreateConfiguration) { +TEST_F(NetworkConfigurationHandlerTest, StubCreateConfiguration) { const std::string service_path("/service/test_wifi"); CreateTestConfiguration(service_path, shill::kTypeWifi); @@ -857,19 +871,20 @@ EXPECT_EQ(NetworkProfileHandler::GetSharedProfilePath(), actual_profile); } -TEST_F(NetworkConfigurationHandlerStubTest, NetworkConfigurationObserver) { +TEST_F(NetworkConfigurationHandlerTest, NetworkConfigurationObserver) { const std::string service_path("/service/test_wifi"); const std::string test_passphrase("test_passphrase"); - std::unique_ptr<TestNetworkConfigurationObserver> test_observer( - new TestNetworkConfigurationObserver); - network_configuration_handler_->AddObserver(test_observer.get()); + auto network_configuration_observer = + std::make_unique<TestNetworkConfigurationObserver>(); + network_configuration_handler_->AddObserver( + network_configuration_observer.get()); CreateTestConfiguration(service_path, shill::kTypeWifi); - EXPECT_TRUE(test_observer->HasConfiguration(service_path)); - EXPECT_TRUE(test_observer->HasConfigurationInProfile( + EXPECT_TRUE(network_configuration_observer->HasConfiguration(service_path)); + EXPECT_TRUE(network_configuration_observer->HasConfigurationInProfile( service_path, NetworkProfileHandler::GetSharedProfilePath())); - EXPECT_EQ(shill::kTypeWifi, test_observer->GetStringProperty( + EXPECT_EQ(shill::kTypeWifi, network_configuration_observer->GetStringProperty( service_path, shill::kTypeProperty)); base::DictionaryValue properties_to_set; @@ -880,7 +895,7 @@ NetworkConfigurationObserver::SOURCE_USER_ACTION, base::Bind(&base::DoNothing), base::Bind(&ErrorCallback)); base::RunLoop().RunUntilIdle(); - EXPECT_EQ(test_passphrase, test_observer->GetStringProperty( + EXPECT_EQ(test_passphrase, network_configuration_observer->GetStringProperty( service_path, shill::kPassphraseProperty)); std::string user_profile = "/profiles/user1"; @@ -895,24 +910,25 @@ NetworkConfigurationObserver::SOURCE_USER_ACTION, base::Bind(&base::DoNothing), base::Bind(&ErrorCallback)); base::RunLoop().RunUntilIdle(); - EXPECT_TRUE(test_observer->HasConfiguration(service_path)); - EXPECT_FALSE(test_observer->HasConfigurationInProfile( + EXPECT_TRUE(network_configuration_observer->HasConfiguration(service_path)); + EXPECT_FALSE(network_configuration_observer->HasConfigurationInProfile( service_path, NetworkProfileHandler::GetSharedProfilePath())); - EXPECT_TRUE( - test_observer->HasConfigurationInProfile(service_path, user_profile)); + EXPECT_TRUE(network_configuration_observer->HasConfigurationInProfile( + service_path, user_profile)); network_configuration_handler_->RemoveConfiguration( service_path, NetworkConfigurationObserver::SOURCE_USER_ACTION, base::Bind(&base::DoNothing), base::Bind(&ErrorCallback)); base::RunLoop().RunUntilIdle(); - EXPECT_FALSE(test_observer->HasConfiguration(service_path)); - EXPECT_FALSE(test_observer->HasConfigurationInProfile( + EXPECT_FALSE(network_configuration_observer->HasConfiguration(service_path)); + EXPECT_FALSE(network_configuration_observer->HasConfigurationInProfile( service_path, NetworkProfileHandler::GetSharedProfilePath())); - EXPECT_FALSE( - test_observer->HasConfigurationInProfile(service_path, user_profile)); + EXPECT_FALSE(network_configuration_observer->HasConfigurationInProfile( + service_path, user_profile)); - network_configuration_handler_->RemoveObserver(test_observer.get()); + network_configuration_handler_->RemoveObserver( + network_configuration_observer.get()); } } // namespace chromeos
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc index 3db7aa7..d133d77 100644 --- a/content/app/content_main_runner.cc +++ b/content/app/content_main_runner.cc
@@ -450,8 +450,8 @@ : is_initialized_(false), is_shutdown_(false), completed_basic_startup_(false), - delegate_(NULL), - ui_task_(NULL) { + delegate_(nullptr), + ui_task_(nullptr) { #if defined(OS_WIN) memset(&sandbox_info_, 0, sizeof(sandbox_info_)); #endif @@ -724,9 +724,9 @@ #endif // _CRTDBG_MAP_ALLOC #endif // OS_WIN - exit_manager_.reset(NULL); + exit_manager_.reset(nullptr); - delegate_ = NULL; + delegate_ = nullptr; is_shutdown_ = true; }
diff --git a/content/browser/accessibility/accessibility_ui.cc b/content/browser/accessibility/accessibility_ui.cc index 12c82960..5aba2ef 100644 --- a/content/browser/accessibility/accessibility_ui.cc +++ b/content/browser/accessibility/accessibility_ui.cc
@@ -102,7 +102,7 @@ title = base::UTF16ToUTF8(web_contents->GetTitle()); NavigationController& controller = web_contents->GetController(); NavigationEntry* entry = controller.GetVisibleEntry(); - if (entry != NULL && entry->GetURL().is_valid()) + if (entry != nullptr && entry->GetURL().is_valid()) favicon_url = entry->GetFavicon().url; accessibility_mode = web_contents->GetAccessibilityMode(); }
diff --git a/content/browser/accessibility/browser_accessibility.cc b/content/browser/accessibility/browser_accessibility.cc index 1e697ee..bf56d135 100644 --- a/content/browser/accessibility/browser_accessibility.cc +++ b/content/browser/accessibility/browser_accessibility.cc
@@ -494,9 +494,9 @@ BrowserAccessibility* BrowserAccessibility::ApproximateHitTest( const gfx::Point& point) { // The best result found that's a child of this object. - BrowserAccessibility* child_result = NULL; + BrowserAccessibility* child_result = nullptr; // The best result that's an indirect descendant like grandchild, etc. - BrowserAccessibility* descendant_result = NULL; + BrowserAccessibility* descendant_result = nullptr; // Walk the children recursively looking for the BrowserAccessibility that // most tightly encloses the specified point. Walk backwards so that in @@ -537,8 +537,8 @@ } void BrowserAccessibility::Destroy() { - node_ = NULL; - manager_ = NULL; + node_ = nullptr; + manager_ = nullptr; NativeReleaseReference(); }
diff --git a/content/browser/accessibility/browser_accessibility_auralinux.cc b/content/browser/accessibility/browser_accessibility_auralinux.cc index 11d709d..a69f8aa9 100644 --- a/content/browser/accessibility/browser_accessibility_auralinux.cc +++ b/content/browser/accessibility/browser_accessibility_auralinux.cc
@@ -15,12 +15,12 @@ namespace content { -static gpointer browser_accessibility_parent_class = NULL; +static gpointer browser_accessibility_parent_class = nullptr; static BrowserAccessibilityAuraLinux* ToBrowserAccessibilityAuraLinux( BrowserAccessibilityAtk* atk_object) { if (!atk_object) - return NULL; + return nullptr; return atk_object->m_object; } @@ -44,7 +44,7 @@ static BrowserAccessibilityAuraLinux* ToBrowserAccessibilityAuraLinux( AtkAction* atk_action) { if (!IS_BROWSER_ACCESSIBILITY(atk_action)) - return NULL; + return nullptr; return ToBrowserAccessibilityAuraLinux(BROWSER_ACCESSIBILITY(atk_action)); } @@ -81,9 +81,9 @@ BrowserAccessibilityAuraLinux* obj = ToBrowserAccessibilityAuraLinux(atk_action); if (!obj) - return 0; + return nullptr; - return 0; + return nullptr; } static const gchar* browser_accessibility_get_name(AtkAction* atk_action, @@ -110,7 +110,7 @@ BrowserAccessibilityAuraLinux* obj = ToBrowserAccessibilityAuraLinux(atk_action); if (!obj) - return 0; + return nullptr; return obj->GetStringAttribute(ui::AX_ATTR_ACCESS_KEY).c_str(); } @@ -124,7 +124,8 @@ } static const GInterfaceInfo ActionInfo = { - reinterpret_cast<GInterfaceInitFunc>(ActionInterfaceInit), 0, 0}; + reinterpret_cast<GInterfaceInitFunc>(ActionInterfaceInit), nullptr, + nullptr}; // // AtkComponent interface. @@ -133,7 +134,7 @@ static BrowserAccessibilityAuraLinux* ToBrowserAccessibilityAuraLinux( AtkComponent* atk_component) { if (!IS_BROWSER_ACCESSIBILITY(atk_component)) - return NULL; + return nullptr; return ToBrowserAccessibilityAuraLinux(BROWSER_ACCESSIBILITY(atk_component)); } @@ -148,12 +149,12 @@ BrowserAccessibilityAuraLinux* obj = ToBrowserAccessibilityAuraLinux(atk_component); if (!obj) - return NULL; + return nullptr; gfx::Point point(x, y); BrowserAccessibility* result = obj->manager()->CachingAsyncHitTest(point); if (!result) - return NULL; + return nullptr; AtkObject* atk_result = ToBrowserAccessibilityAuraLinux(result)->GetAtkObject(); @@ -204,9 +205,8 @@ } static const GInterfaceInfo ComponentInfo = { - reinterpret_cast<GInterfaceInitFunc>(ComponentInterfaceInit), - 0, - 0}; + reinterpret_cast<GInterfaceInitFunc>(ComponentInterfaceInit), nullptr, + nullptr}; // // AtkDocument interface. @@ -215,7 +215,7 @@ static BrowserAccessibilityAuraLinux* ToBrowserAccessibilityAuraLinux( AtkDocument* atk_doc) { if (!IS_BROWSER_ACCESSIBILITY(atk_doc)) - return NULL; + return nullptr; return ToBrowserAccessibilityAuraLinux(BROWSER_ACCESSIBILITY(atk_doc)); } @@ -232,7 +232,7 @@ else if (!g_ascii_strcasecmp(attribute, "URI")) return obj->manager()->GetTreeData().url.c_str(); - return 0; + return nullptr; } AtkAttributeSet* SetAtkAttributeSet(AtkAttributeSet* attribute_set, @@ -252,7 +252,7 @@ g_return_val_if_fail(ATK_IS_DOCUMENT(atk_doc), 0); BrowserAccessibilityAuraLinux* obj = ToBrowserAccessibilityAuraLinux(atk_doc); if (!obj) - return 0; + return nullptr; return GetDocumentAttributeValue(obj, attribute); } @@ -262,11 +262,11 @@ g_return_val_if_fail(ATK_IS_DOCUMENT(atk_doc), 0); BrowserAccessibilityAuraLinux* obj = ToBrowserAccessibilityAuraLinux(atk_doc); if (!obj) - return 0; + return nullptr; - AtkAttributeSet* attribute_set = 0; + AtkAttributeSet* attribute_set = nullptr; const gchar* doc_attributes[] = {"DocType", "MimeType", "Title", "URI"}; - const gchar* value = 0; + const gchar* value = nullptr; for (unsigned i = 0; i < G_N_ELEMENTS(doc_attributes); i++) { value = GetDocumentAttributeValue(obj, doc_attributes[i]); @@ -285,7 +285,8 @@ } static const GInterfaceInfo DocumentInfo = { - reinterpret_cast<GInterfaceInitFunc>(DocumentInterfaceInit), 0, 0}; + reinterpret_cast<GInterfaceInitFunc>(DocumentInterfaceInit), nullptr, + nullptr}; // // AtkImage interface. @@ -294,7 +295,7 @@ static BrowserAccessibilityAuraLinux* ToBrowserAccessibilityAuraLinux( AtkImage* atk_img) { if (!IS_BROWSER_ACCESSIBILITY(atk_img)) - return NULL; + return nullptr; return ToBrowserAccessibilityAuraLinux(BROWSER_ACCESSIBILITY(atk_img)); } @@ -333,7 +334,7 @@ g_return_val_if_fail(ATK_IMAGE(atk_img), 0); BrowserAccessibilityAuraLinux* obj = ToBrowserAccessibilityAuraLinux(atk_img); if (!obj) - return 0; + return nullptr; return obj->GetStringAttribute(ui::AX_ATTR_DESCRIPTION).c_str(); } @@ -356,7 +357,7 @@ } static const GInterfaceInfo ImageInfo = { - reinterpret_cast<GInterfaceInitFunc>(ImageInterfaceInit), 0, 0}; + reinterpret_cast<GInterfaceInitFunc>(ImageInterfaceInit), nullptr, nullptr}; // // AtkValue interface. @@ -365,7 +366,7 @@ static BrowserAccessibilityAuraLinux* ToBrowserAccessibilityAuraLinux( AtkValue* atk_object) { if (!IS_BROWSER_ACCESSIBILITY(atk_object)) - return NULL; + return nullptr; return ToBrowserAccessibilityAuraLinux(BROWSER_ACCESSIBILITY(atk_object)); } @@ -449,9 +450,7 @@ } static const GInterfaceInfo ValueInfo = { - reinterpret_cast<GInterfaceInitFunc>(ValueInterfaceInit), - 0, - 0}; + reinterpret_cast<GInterfaceInitFunc>(ValueInterfaceInit), nullptr, nullptr}; // // AtkObject interface @@ -460,7 +459,7 @@ static BrowserAccessibilityAuraLinux* ToBrowserAccessibilityAuraLinux( AtkObject* atk_object) { if (!IS_BROWSER_ACCESSIBILITY(atk_object)) - return NULL; + return nullptr; return ToBrowserAccessibilityAuraLinux(BROWSER_ACCESSIBILITY(atk_object)); } @@ -469,11 +468,11 @@ BrowserAccessibilityAuraLinux* obj = ToBrowserAccessibilityAuraLinux(atk_object); if (!obj) - return NULL; + return nullptr; if (obj->GetStringAttribute(ui::AX_ATTR_NAME).empty() && !obj->HasExplicitlyEmptyName()) - return NULL; + return nullptr; return obj->GetStringAttribute(ui::AX_ATTR_NAME).c_str(); } @@ -483,7 +482,7 @@ BrowserAccessibilityAuraLinux* obj = ToBrowserAccessibilityAuraLinux(atk_object); if (!obj) - return NULL; + return nullptr; return obj->GetStringAttribute(ui::AX_ATTR_DESCRIPTION).c_str(); } @@ -492,7 +491,7 @@ BrowserAccessibilityAuraLinux* obj = ToBrowserAccessibilityAuraLinux(atk_object); if (!obj) - return NULL; + return nullptr; if (obj->PlatformGetParent()) return ToBrowserAccessibilityAuraLinux(obj->PlatformGetParent()) ->GetAtkObject(); @@ -516,10 +515,10 @@ BrowserAccessibilityAuraLinux* obj = ToBrowserAccessibilityAuraLinux(atk_object); if (!obj) - return NULL; + return nullptr; if (index < 0 || index >= static_cast<gint>(obj->PlatformChildCount())) - return NULL; + return nullptr; AtkObject* result = ToBrowserAccessibilityAuraLinux( obj->InternalGetChild(index))->GetAtkObject(); @@ -537,7 +536,7 @@ static AtkAttributeSet* browser_accessibility_get_attributes( AtkObject* atk_object) { - return NULL; + return nullptr; } static AtkRole browser_accessibility_get_role(AtkObject* atk_object) { @@ -552,7 +551,7 @@ BrowserAccessibilityAuraLinux* obj = ToBrowserAccessibilityAuraLinux(atk_object); if (!obj) - return NULL; + return nullptr; AtkStateSet* state_set = ATK_OBJECT_CLASS(browser_accessibility_parent_class) ->ref_state_set(atk_object); int32_t state = obj->GetState(); @@ -638,15 +637,15 @@ if (g_once_init_enter(&type_volatile)) { static const GTypeInfo tinfo = { sizeof(BrowserAccessibilityAtkClass), - (GBaseInitFunc)0, - (GBaseFinalizeFunc)0, + (GBaseInitFunc) nullptr, + (GBaseFinalizeFunc) nullptr, (GClassInitFunc)browser_accessibility_class_init, - (GClassFinalizeFunc)0, - 0, /* class data */ + (GClassFinalizeFunc) nullptr, + nullptr, /* class data */ sizeof(BrowserAccessibilityAtk), /* instance size */ 0, /* nb preallocs */ - (GInstanceInitFunc)0, - 0 /* value table */ + (GInstanceInitFunc) nullptr, + nullptr /* value table */ }; GType type = g_type_register_static(ATK_TYPE_OBJECT, "BrowserAccessibility", @@ -711,15 +710,15 @@ BrowserAccessibilityAuraLinux* obj) { static const GTypeInfo type_info = { sizeof(BrowserAccessibilityAtkClass), - (GBaseInitFunc)0, - (GBaseFinalizeFunc)0, - (GClassInitFunc)0, - (GClassFinalizeFunc)0, - 0, /* class data */ + (GBaseInitFunc) nullptr, + (GBaseFinalizeFunc) nullptr, + (GClassInitFunc) nullptr, + (GClassFinalizeFunc) nullptr, + nullptr, /* class data */ sizeof(BrowserAccessibilityAtk), /* instance size */ 0, /* nb preallocs */ - (GInstanceInitFunc)0, - 0 /* value table */ + (GInstanceInitFunc) nullptr, + nullptr /* value table */ }; int interface_mask = GetInterfaceMaskFromObject(obj); @@ -755,7 +754,7 @@ #endif GType type = GetAccessibilityTypeFromObject(obj); - AtkObject* atk_object = static_cast<AtkObject*>(g_object_new(type, 0)); + AtkObject* atk_object = static_cast<AtkObject*>(g_object_new(type, nullptr)); atk_object_initialize(atk_object, obj); @@ -763,7 +762,7 @@ } void browser_accessibility_detach(BrowserAccessibilityAtk* atk_object) { - atk_object->m_object = NULL; + atk_object->m_object = nullptr; } // static @@ -772,8 +771,7 @@ } BrowserAccessibilityAuraLinux::BrowserAccessibilityAuraLinux() - : atk_object_(NULL) { -} + : atk_object_(nullptr) {} BrowserAccessibilityAuraLinux::~BrowserAccessibilityAuraLinux() { browser_accessibility_detach(BROWSER_ACCESSIBILITY(atk_object_)); @@ -783,7 +781,7 @@ AtkObject* BrowserAccessibilityAuraLinux::GetAtkObject() const { if (!G_IS_OBJECT(atk_object_)) - return NULL; + return nullptr; return atk_object_; } @@ -798,7 +796,7 @@ int interface_mask = GetInterfaceMaskFromObject(this); if (interface_mask != interface_mask_) { g_object_unref(atk_object_); - atk_object_ = NULL; + atk_object_ = nullptr; } }
diff --git a/content/browser/accessibility/hit_testing_browsertest.cc b/content/browser/accessibility/hit_testing_browsertest.cc index 11e32bf3..1d035ed 100644 --- a/content/browser/accessibility/hit_testing_browsertest.cc +++ b/content/browser/accessibility/hit_testing_browsertest.cc
@@ -97,7 +97,7 @@ waiter.WaitForNotification(); BrowserAccessibility* hit_node = HitTestAndWaitForResult(gfx::Point(-1, -1)); - ASSERT_TRUE(hit_node != NULL); + ASSERT_TRUE(hit_node != nullptr); ASSERT_EQ(ui::AX_ROLE_ROOT_WEB_AREA, hit_node->GetRole()); } @@ -126,30 +126,30 @@ // (50, 50) -> "Button" BrowserAccessibility* hit_node; hit_node = HitTestAndWaitForResult(gfx::Point(50, 50)); - ASSERT_TRUE(hit_node != NULL); + ASSERT_TRUE(hit_node != nullptr); ASSERT_EQ(ui::AX_ROLE_BUTTON, hit_node->GetRole()); ASSERT_EQ("Button", hit_node->GetStringAttribute(ui::AX_ATTR_NAME)); // (50, 305) -> div in first iframe hit_node = HitTestAndWaitForResult(gfx::Point(50, 305)); - ASSERT_TRUE(hit_node != NULL); + ASSERT_TRUE(hit_node != nullptr); ASSERT_EQ(ui::AX_ROLE_GENERIC_CONTAINER, hit_node->GetRole()); // (50, 350) -> "Ordinary Button" hit_node = HitTestAndWaitForResult(gfx::Point(50, 350)); - ASSERT_TRUE(hit_node != NULL); + ASSERT_TRUE(hit_node != nullptr); ASSERT_EQ(ui::AX_ROLE_BUTTON, hit_node->GetRole()); ASSERT_EQ("Ordinary Button", hit_node->GetStringAttribute(ui::AX_ATTR_NAME)); // (50, 455) -> "Scrolled Button" hit_node = HitTestAndWaitForResult(gfx::Point(50, 455)); - ASSERT_TRUE(hit_node != NULL); + ASSERT_TRUE(hit_node != nullptr); ASSERT_EQ(ui::AX_ROLE_BUTTON, hit_node->GetRole()); ASSERT_EQ("Scrolled Button", hit_node->GetStringAttribute(ui::AX_ATTR_NAME)); // (50, 505) -> div in second iframe hit_node = HitTestAndWaitForResult(gfx::Point(50, 505)); - ASSERT_TRUE(hit_node != NULL); + ASSERT_TRUE(hit_node != nullptr); ASSERT_EQ(ui::AX_ROLE_GENERIC_CONTAINER, hit_node->GetRole()); // (50, 505) -> div in second iframe @@ -188,21 +188,21 @@ // (50, 50) -> "Button" BrowserAccessibility* hit_node; hit_node = CallCachingAsyncHitTest(gfx::Point(50, 50)); - ASSERT_TRUE(hit_node != NULL); + ASSERT_TRUE(hit_node != nullptr); ASSERT_NE(ui::AX_ROLE_BUTTON, hit_node->GetRole()); hit_node = CallCachingAsyncHitTest(gfx::Point(50, 50)); ASSERT_EQ("Button", hit_node->GetStringAttribute(ui::AX_ATTR_NAME)); // (50, 305) -> div in first iframe hit_node = CallCachingAsyncHitTest(gfx::Point(50, 305)); - ASSERT_TRUE(hit_node != NULL); + ASSERT_TRUE(hit_node != nullptr); ASSERT_NE(ui::AX_ROLE_GENERIC_CONTAINER, hit_node->GetRole()); hit_node = CallCachingAsyncHitTest(gfx::Point(50, 305)); ASSERT_EQ(ui::AX_ROLE_GENERIC_CONTAINER, hit_node->GetRole()); // (50, 350) -> "Ordinary Button" hit_node = CallCachingAsyncHitTest(gfx::Point(50, 350)); - ASSERT_TRUE(hit_node != NULL); + ASSERT_TRUE(hit_node != nullptr); ASSERT_NE(ui::AX_ROLE_BUTTON, hit_node->GetRole()); hit_node = CallCachingAsyncHitTest(gfx::Point(50, 350)); ASSERT_EQ(ui::AX_ROLE_BUTTON, hit_node->GetRole()); @@ -210,7 +210,7 @@ // (50, 455) -> "Scrolled Button" hit_node = CallCachingAsyncHitTest(gfx::Point(50, 455)); - ASSERT_TRUE(hit_node != NULL); + ASSERT_TRUE(hit_node != nullptr); ASSERT_NE(ui::AX_ROLE_BUTTON, hit_node->GetRole()); hit_node = CallCachingAsyncHitTest(gfx::Point(50, 455)); ASSERT_EQ(ui::AX_ROLE_BUTTON, hit_node->GetRole()); @@ -218,7 +218,7 @@ // (50, 505) -> div in second iframe hit_node = CallCachingAsyncHitTest(gfx::Point(50, 505)); - ASSERT_TRUE(hit_node != NULL); + ASSERT_TRUE(hit_node != nullptr); ASSERT_NE(ui::AX_ROLE_GENERIC_CONTAINER, hit_node->GetRole()); hit_node = CallCachingAsyncHitTest(gfx::Point(50, 505)); ASSERT_EQ(ui::AX_ROLE_GENERIC_CONTAINER, hit_node->GetRole());
diff --git a/content/browser/appcache/appcache_backend_impl.cc b/content/browser/appcache/appcache_backend_impl.cc index ea6ab791..1fe4457 100644 --- a/content/browser/appcache/appcache_backend_impl.cc +++ b/content/browser/appcache/appcache_backend_impl.cc
@@ -14,10 +14,7 @@ namespace content { AppCacheBackendImpl::AppCacheBackendImpl() - : service_(NULL), - frontend_(NULL), - process_id_(0) { -} + : service_(nullptr), frontend_(nullptr), process_id_(0) {} AppCacheBackendImpl::~AppCacheBackendImpl() { hosts_.clear();
diff --git a/content/browser/appcache/appcache_disk_cache.cc b/content/browser/appcache/appcache_disk_cache.cc index 66dba6fc..6b390ed2 100644 --- a/content/browser/appcache/appcache_disk_cache.cc +++ b/content/browser/appcache/appcache_disk_cache.cc
@@ -30,9 +30,7 @@ : appcache_diskcache_(object) { } - void Cancel() { - appcache_diskcache_ = NULL; - } + void Cancel() { appcache_diskcache_ = nullptr; } void Callback(int rv) { if (appcache_diskcache_) @@ -101,9 +99,9 @@ } void Abandon() { - owner_ = NULL; + owner_ = nullptr; disk_cache_entry_->Close(); - disk_cache_entry_ = NULL; + disk_cache_entry_ = nullptr; } private: @@ -240,7 +238,7 @@ if (create_backend_callback_.get()) { create_backend_callback_->Cancel(); - create_backend_callback_ = NULL; + create_backend_callback_ = nullptr; OnCreateBackendComplete(net::ERR_ABORTED); } @@ -302,7 +300,7 @@ return net::ERR_ABORTED; if (is_initializing_or_waiting_to_initialize()) { - pending_calls_.push_back(PendingCall(DOOM, key, NULL, callback)); + pending_calls_.push_back(PendingCall(DOOM, key, nullptr, callback)); return net::ERR_IO_PENDING; } @@ -320,10 +318,7 @@ weak_factory_(this) {} AppCacheDiskCache::PendingCall::PendingCall() - : call_type(CREATE), - key(0), - entry(NULL) { -} + : call_type(CREATE), key(0), entry(nullptr) {} AppCacheDiskCache::PendingCall::PendingCall( PendingCallType call_type, @@ -350,7 +345,7 @@ cache_type, use_simple_cache_ ? net::CACHE_BACKEND_SIMPLE : net::CACHE_BACKEND_DEFAULT, - cache_directory, cache_size, force, NULL, + cache_directory, cache_size, force, nullptr, &(create_backend_callback_->backend_ptr_), std::move(post_cleanup_callback), base::Bind(&CreateBackendCallbackShim::Callback, @@ -366,7 +361,7 @@ if (rv == net::OK) { disk_cache_ = std::move(create_backend_callback_->backend_ptr_); } - create_backend_callback_ = NULL; + create_backend_callback_ = nullptr; // Invoke our clients callback function. if (!init_callback_.is_null()) {
diff --git a/content/browser/appcache/appcache_disk_cache_unittest.cc b/content/browser/appcache/appcache_disk_cache_unittest.cc index f8ef08c..61857e2 100644 --- a/content/browser/appcache/appcache_disk_cache_unittest.cc +++ b/content/browser/appcache/appcache_disk_cache_unittest.cc
@@ -50,7 +50,7 @@ }; TEST_F(AppCacheDiskCacheTest, DisablePriorToInitCompletion) { - AppCacheDiskCache::Entry* entry = NULL; + AppCacheDiskCache::Entry* entry = nullptr; // Create an instance and start it initializing, queue up // one of each kind of "entry" function. @@ -69,7 +69,7 @@ FlushCacheTasks(); - EXPECT_EQ(NULL, entry); + EXPECT_EQ(nullptr, entry); EXPECT_EQ(4u, completion_results_.size()); for (std::vector<int>::const_iterator iter = completion_results_.begin(); iter < completion_results_.end(); ++iter) { @@ -105,7 +105,7 @@ // Methods should return immediately when disabled and not invoke // the callback at all. - AppCacheDiskCache::Entry* entry = NULL; + AppCacheDiskCache::Entry* entry = nullptr; completion_results_.clear(); EXPECT_EQ(net::ERR_ABORTED, disk_cache->CreateEntry(1, &entry, completion_callback_)); @@ -137,8 +137,8 @@ // and we do have expectations about that. // Create/open some entries. - AppCacheDiskCache::Entry* entry1 = NULL; - AppCacheDiskCache::Entry* entry2 = NULL; + AppCacheDiskCache::Entry* entry1 = nullptr; + AppCacheDiskCache::Entry* entry2 = nullptr; disk_cache->CreateEntry(1, &entry1, completion_callback_); disk_cache->CreateEntry(2, &entry2, completion_callback_); FlushCacheTasks(); @@ -167,7 +167,7 @@ EXPECT_TRUE(base::DeleteFile(directory_.GetPath(), true)); EXPECT_FALSE(base::DirectoryExists(directory_.GetPath())); - disk_cache.reset(NULL); + disk_cache.reset(nullptr); // Also, new IO operations should fail immediately. EXPECT_EQ(
diff --git a/content/browser/appcache/appcache_group.cc b/content/browser/appcache/appcache_group.cc index c5e1e5a..06cca4c 100644 --- a/content/browser/appcache/appcache_group.cc +++ b/content/browser/appcache/appcache_group.cc
@@ -46,8 +46,8 @@ update_status_(IDLE), is_obsolete_(false), is_being_deleted_(false), - newest_complete_cache_(NULL), - update_job_(NULL), + newest_complete_cache_(nullptr), + update_job_(nullptr), storage_(storage), is_in_dtor_(false) { storage_->working_set()->AddGroup(this); @@ -116,8 +116,8 @@ if (cache == newest_complete_cache_) { CancelUpdate(); AppCache* tmp_cache = newest_complete_cache_; - newest_complete_cache_ = NULL; - tmp_cache->set_owning_group(NULL); // may cause this group to be deleted + newest_complete_cache_ = nullptr; + tmp_cache->set_owning_group(nullptr); // may cause this group to be deleted } else { scoped_refptr<AppCacheGroup> protect(this); @@ -126,7 +126,7 @@ if (it != old_caches_.end()) { AppCache* tmp_cache = *it; old_caches_.erase(it); - tmp_cache->set_owning_group(NULL); // may cause group to be released + tmp_cache->set_owning_group(nullptr); // may cause group to be released } if (!is_obsolete() && old_caches_.empty() && @@ -256,12 +256,12 @@ if (status != IDLE) { DCHECK(update_job_); } else { - update_job_ = NULL; + update_job_ = nullptr; // Observers may release us in these callbacks, so we protect against // deletion by adding an extra ref in this scope (but only if we're not // in our destructor). - scoped_refptr<AppCacheGroup> protect(is_in_dtor_ ? NULL : this); + scoped_refptr<AppCacheGroup> protect(is_in_dtor_ ? nullptr : this); for (auto& observer : observers_) observer.OnUpdateComplete(this); if (!queued_updates_.empty())
diff --git a/content/browser/appcache/appcache_group_unittest.cc b/content/browser/appcache/appcache_group_unittest.cc index 9aace667..29ef669 100644 --- a/content/browser/appcache/appcache_group_unittest.cc +++ b/content/browser/appcache/appcache_group_unittest.cc
@@ -222,15 +222,15 @@ group->update_status_ = AppCacheGroup::CHECKING; group->StartUpdate(); AppCacheUpdateJob* update = group->update_job_; - EXPECT_TRUE(update != NULL); + EXPECT_TRUE(update != nullptr); // Start another update, check that same update job is in use. - group->StartUpdateWithHost(NULL); + group->StartUpdateWithHost(nullptr); EXPECT_EQ(update, group->update_job_); // Deleting the update should restore the group to APPCACHE_STATUS_IDLE. delete update; - EXPECT_TRUE(group->update_job_ == NULL); + EXPECT_TRUE(group->update_job_ == nullptr); EXPECT_EQ(AppCacheGroup::IDLE, group->update_status()); } @@ -243,12 +243,12 @@ group->update_status_ = AppCacheGroup::CHECKING; group->StartUpdate(); AppCacheUpdateJob* update = group->update_job_; - EXPECT_TRUE(update != NULL); + EXPECT_TRUE(update != nullptr); // Deleting the group should cancel the update. TestUpdateObserver observer; group->AddUpdateObserver(&observer); - group = NULL; // causes group to be deleted + group = nullptr; // causes group to be deleted EXPECT_TRUE(observer.update_completed_); EXPECT_FALSE(observer.group_has_cache_); }
diff --git a/content/browser/appcache/appcache_host.cc b/content/browser/appcache/appcache_host.cc index 8000126..20c3cc6 100644 --- a/content/browser/appcache/appcache_host.cc +++ b/content/browser/appcache/appcache_host.cc
@@ -62,7 +62,7 @@ frontend_(frontend), service_(service), storage_(service->storage()), - pending_callback_param_(NULL), + pending_callback_param_(nullptr), main_resource_was_namespace_entry_(false), main_resource_blocked_(false), associated_cache_info_pending_(false), @@ -104,7 +104,7 @@ was_select_cache_called_ = true; if (!is_cache_selection_enabled_) { - FinishCacheSelection(NULL, NULL); + FinishCacheSelection(nullptr, nullptr); return true; } @@ -134,7 +134,7 @@ AppCachePolicy* policy = service()->appcache_policy(); if (policy && !policy->CanCreateAppCache(manifest_url, first_party_url_)) { - FinishCacheSelection(NULL, NULL); + FinishCacheSelection(nullptr, nullptr); std::vector<int> host_ids(1, host_id_); frontend_->OnEventRaised(host_ids, APPCACHE_CHECKING_EVENT); frontend_->OnErrorEventRaised( @@ -160,7 +160,7 @@ // TODO(michaeln): If there was a manifest URL, the user agent may report // to the user that it was ignored, to aid in application development. - FinishCacheSelection(NULL, NULL); + FinishCacheSelection(nullptr, nullptr); return true; } @@ -178,7 +178,7 @@ LoadSelectedCache(appcache_id); return true; } - FinishCacheSelection(NULL, NULL); + FinishCacheSelection(nullptr, nullptr); return true; } @@ -215,7 +215,7 @@ std::move(pending_get_status_callback_) .Run(GetStatus(), pending_callback_param_); - pending_callback_param_ = NULL; + pending_callback_param_ = nullptr; } void AppCacheHost::StartUpdateWithCallback(StartUpdateCallback callback, @@ -247,7 +247,7 @@ std::move(pending_start_update_callback_) .Run(success, pending_callback_param_); - pending_callback_param_ = NULL; + pending_callback_param_ = nullptr; } void AppCacheHost::SwapCacheWithCallback(SwapCacheCallback callback, @@ -282,7 +282,7 @@ } std::move(pending_swap_cache_callback_).Run(success, pending_callback_param_); - pending_callback_param_ = NULL; + pending_callback_param_ = nullptr; } void AppCacheHost::SetSpawningHostId( @@ -293,13 +293,13 @@ const AppCacheHost* AppCacheHost::GetSpawningHost() const { AppCacheBackendImpl* backend = service_->GetBackend(spawning_process_id_); - return backend ? backend->GetHost(spawning_host_id_) : NULL; + return backend ? backend->GetHost(spawning_host_id_) : nullptr; } AppCacheHost* AppCacheHost::GetParentAppCacheHost() const { DCHECK(is_for_dedicated_worker()); AppCacheBackendImpl* backend = service_->GetBackend(parent_process_id_); - return backend ? backend->GetHost(parent_host_id_) : NULL; + return backend ? backend->GetHost(parent_host_id_) : nullptr; } std::unique_ptr<AppCacheRequestHandler> AppCacheHost::CreateRequestHandler( @@ -311,7 +311,7 @@ if (parent_host) return parent_host->CreateRequestHandler( std::move(request), resource_type, should_reset_appcache); - return NULL; + return nullptr; } if (AppCacheRequestHandler::IsMainResourceType(resource_type)) { @@ -327,7 +327,7 @@ return base::WrapUnique(new AppCacheRequestHandler( this, resource_type, should_reset_appcache, std::move(request))); } - return NULL; + return nullptr; } void AppCacheHost::GetResourceList( @@ -368,7 +368,7 @@ const GURL& manifest_url) { DCHECK(manifest_url == pending_selected_manifest_url_); pending_selected_manifest_url_ = GURL(); - FinishCacheSelection(NULL, group); + FinishCacheSelection(nullptr, group); } void AppCacheHost::LoadSelectedCache(int64_t cache_id) { @@ -383,7 +383,7 @@ main_resource_cache_ = cache; } else if (cache_id == pending_selected_cache_id_) { pending_selected_cache_id_ = kAppCacheNoCacheId; - FinishCacheSelection(cache, NULL); + FinishCacheSelection(cache, nullptr); } } @@ -472,8 +472,8 @@ // Add a reference to the newest complete cache. SetSwappableCache(group); - group_being_updated_ = NULL; - newest_cache_of_group_being_updated_ = NULL; + group_being_updated_ = nullptr; + newest_cache_of_group_being_updated_ = nullptr; if (associated_cache_info_pending_ && associated_cache_.get() && associated_cache_->is_complete()) { @@ -491,13 +491,13 @@ void AppCacheHost::SetSwappableCache(AppCacheGroup* group) { if (!group) { - swappable_cache_ = NULL; + swappable_cache_ = nullptr; } else { AppCache* new_cache = group->newest_complete_cache(); if (new_cache != associated_cache_.get()) swappable_cache_ = new_cache; else - swappable_cache_ = NULL; + swappable_cache_ = nullptr; } } @@ -529,7 +529,7 @@ DCHECK(!is_selection_pending()); DCHECK(!group_being_updated_.get()); host_id_ = kAppCacheNoHostId; - frontend_ = NULL; + frontend_ = nullptr; } void AppCacheHost::CompleteTransfer(int host_id, AppCacheFrontend* frontend) { @@ -566,7 +566,7 @@ void AppCacheHost::AssociateNoCache(const GURL& manifest_url) { // manifest url can be empty. - AssociateCacheHelper(NULL, manifest_url); + AssociateCacheHelper(nullptr, manifest_url); } void AppCacheHost::AssociateIncompleteCache(AppCache* cache, @@ -588,7 +588,7 @@ } associated_cache_ = cache; - SetSwappableCache(cache ? cache->owning_group() : NULL); + SetSwappableCache(cache ? cache->owning_group() : nullptr); associated_cache_info_pending_ = cache && !cache->is_complete(); AppCacheInfo info; if (cache)
diff --git a/content/browser/appcache/appcache_host_unittest.cc b/content/browser/appcache/appcache_host_unittest.cc index 2fb1b61..8a3057c6 100644 --- a/content/browser/appcache/appcache_host_unittest.cc +++ b/content/browser/appcache/appcache_host_unittest.cc
@@ -89,7 +89,7 @@ class MockQuotaManagerProxy : public storage::QuotaManagerProxy { public: - MockQuotaManagerProxy() : QuotaManagerProxy(NULL, NULL) {} + MockQuotaManagerProxy() : QuotaManagerProxy(nullptr, nullptr) {} // Not needed for our tests. void RegisterClient(storage::QuotaClient* client) override {} @@ -166,7 +166,7 @@ EXPECT_EQ(1, host.host_id()); EXPECT_EQ(&service_, host.service()); EXPECT_EQ(&mock_frontend_, host.frontend()); - EXPECT_EQ(NULL, host.associated_cache()); + EXPECT_EQ(nullptr, host.associated_cache()); EXPECT_FALSE(host.is_selection_pending()); // See that the callbacks are delivered immediately @@ -219,12 +219,12 @@ EXPECT_EQ(1, host.host_id()); EXPECT_EQ(&service_, host.service()); EXPECT_EQ(&mock_frontend_, host.frontend()); - EXPECT_EQ(NULL, host.associated_cache()); + EXPECT_EQ(nullptr, host.associated_cache()); EXPECT_FALSE(host.is_selection_pending()); EXPECT_TRUE(host.preferred_manifest_url().is_empty()); } EXPECT_EQ(0, mock_quota_proxy->GetInUseCount(kDocAndOriginUrl)); - service_.set_quota_manager_proxy(NULL); + service_.set_quota_manager_proxy(nullptr); } TEST_F(AppCacheHostTest, ForeignEntry) { @@ -251,7 +251,7 @@ EXPECT_EQ(1, host.host_id()); EXPECT_EQ(&service_, host.service()); EXPECT_EQ(&mock_frontend_, host.frontend()); - EXPECT_EQ(NULL, host.associated_cache()); + EXPECT_EQ(nullptr, host.associated_cache()); EXPECT_FALSE(host.is_selection_pending()); // See that the entry was marked as foreign. @@ -308,7 +308,7 @@ EXPECT_EQ(reinterpret_cast<void*>(-1), last_callback_param_); // Satisfy the load with NULL, a failure. - host.OnCacheLoaded(NULL, kMockCacheId); + host.OnCacheLoaded(nullptr, kMockCacheId); // Cache selection should have finished EXPECT_FALSE(host.is_selection_pending()); @@ -340,7 +340,7 @@ EXPECT_EQ(reinterpret_cast<void*>(-1), last_callback_param_); // Satisfy the load will NULL, a failure. - host.OnGroupLoaded(NULL, kMockManifestUrl); + host.OnGroupLoaded(nullptr, kMockManifestUrl); // Cache selection should have finished EXPECT_FALSE(host.is_selection_pending()); @@ -355,7 +355,7 @@ TEST_F(AppCacheHostTest, SetSwappableCache) { AppCacheHost host(1, &mock_frontend_, &service_); - host.SetSwappableCache(NULL); + host.SetSwappableCache(nullptr); EXPECT_FALSE(host.swappable_cache_.get()); scoped_refptr<AppCacheGroup> group1(new AppCacheGroup( @@ -456,7 +456,7 @@ EXPECT_TRUE(host.is_selection_pending()); } EXPECT_EQ(0, mock_quota_proxy->GetInUseCount(kDocAndOriginUrl)); - service_.set_quota_manager_proxy(NULL); + service_.set_quota_manager_proxy(nullptr); } TEST_F(AppCacheHostTest, SelectCacheBlocked) { @@ -495,12 +495,12 @@ EXPECT_EQ(1, host.host_id()); EXPECT_EQ(&service_, host.service()); EXPECT_EQ(&mock_frontend_, host.frontend()); - EXPECT_EQ(NULL, host.associated_cache()); + EXPECT_EQ(nullptr, host.associated_cache()); EXPECT_FALSE(host.is_selection_pending()); EXPECT_TRUE(host.preferred_manifest_url().is_empty()); } EXPECT_EQ(0, mock_quota_proxy->GetInUseCount(kDocAndOriginUrl)); - service_.set_quota_manager_proxy(NULL); + service_.set_quota_manager_proxy(nullptr); } TEST_F(AppCacheHostTest, SelectCacheTwice) {
diff --git a/content/browser/appcache/appcache_interceptor.cc b/content/browser/appcache/appcache_interceptor.cc index 95e24b0..ce69544 100644 --- a/content/browser/appcache/appcache_interceptor.cc +++ b/content/browser/appcache/appcache_interceptor.cc
@@ -140,7 +140,7 @@ net::URLRequest* request, net::NetworkDelegate* network_delegate) const { AppCacheRequestHandler* handler = GetHandler(request); if (!handler) - return NULL; + return nullptr; AppCacheJob* job = handler->MaybeLoadResource(network_delegate); return job ? job->AsURLRequestJob() : nullptr; @@ -152,7 +152,7 @@ const GURL& location) const { AppCacheRequestHandler* handler = GetHandler(request); if (!handler) - return NULL; + return nullptr; AppCacheJob* job = handler->MaybeLoadFallbackForRedirect(network_delegate, location); @@ -163,7 +163,7 @@ net::URLRequest* request, net::NetworkDelegate* network_delegate) const { AppCacheRequestHandler* handler = GetHandler(request); if (!handler) - return NULL; + return nullptr; AppCacheJob* job = handler->MaybeLoadFallbackForResponse(network_delegate); return job ? job->AsURLRequestJob() : nullptr;
diff --git a/content/browser/appcache/appcache_quota_client.cc b/content/browser/appcache/appcache_quota_client.cc index c20f8b8a..97b6ef7 100644 --- a/content/browser/appcache/appcache_quota_client.cc +++ b/content/browser/appcache/appcache_quota_client.cc
@@ -231,7 +231,7 @@ } void AppCacheQuotaClient::NotifyAppCacheDestroyed() { - service_ = NULL; + service_ = nullptr; while (!pending_batch_requests_.empty()) RunFront(&pending_batch_requests_);
diff --git a/content/browser/appcache/appcache_request_handler.cc b/content/browser/appcache/appcache_request_handler.cc index 9c8cb77..1f44a7c 100644 --- a/content/browser/appcache/appcache_request_handler.cc +++ b/content/browser/appcache/appcache_request_handler.cc
@@ -81,7 +81,7 @@ if (!host_ || !AppCacheRequest::IsSchemeAndMethodSupportedForAppCache(request_.get()) || cache_entry_not_found_) { - return NULL; + return nullptr; } // This method can get called multiple times over the life @@ -93,7 +93,7 @@ // This time through, we return NULL so the request hits the wire. if (is_delivering_network_response_) { is_delivering_network_response_ = false; - return NULL; + return nullptr; } // Clear out our 'found' fields since we're starting a request for a @@ -132,15 +132,15 @@ if (!host_ || !AppCacheRequest::IsSchemeAndMethodSupportedForAppCache(request_.get()) || cache_entry_not_found_) - return NULL; + return nullptr; if (is_main_resource()) - return NULL; + return nullptr; // TODO(vabr) This is a temporary fix (see crbug/141114). We should get rid of // it once a more general solution to crbug/121325 is in place. if (!maybe_load_resource_executed_) - return NULL; + return nullptr; if (request_->GetURL().GetOrigin() == location.GetOrigin()) - return NULL; + return nullptr; DCHECK(!job_.get()); // our jobs never generate redirects @@ -168,30 +168,30 @@ if (!host_ || !AppCacheRequest::IsSchemeAndMethodSupportedForAppCache(request_.get()) || cache_entry_not_found_) - return NULL; + return nullptr; if (!found_fallback_entry_.has_response_id()) - return NULL; + return nullptr; if (request_->IsCancelled()) { // 6.9.6, step 4: But not if the user canceled the download. - return NULL; + return nullptr; } // We don't fallback for responses that we delivered. if (job_.get()) { if (!base::FeatureList::IsEnabled(features::kNetworkService)) { DCHECK(!job_->IsDeliveringNetworkResponse()); - return NULL; + return nullptr; } else if (job_->IsDeliveringAppCacheResponse() || job_->IsDeliveringErrorResponse()) { - return NULL; + return nullptr; } } if (request_->IsSuccess()) { int code_major = request_->GetResponseCode() / 100; if (code_major !=4 && code_major != 5) - return NULL; + return nullptr; // Servers can override the fallback behavior with a response header. const std::string kFallbackOverrideHeader( @@ -201,7 +201,7 @@ std::string header_value; header_value = request_->GetResponseHeaderByName(kFallbackOverrideHeader); if (header_value == kFallbackOverrideValue) - return NULL; + return nullptr; } // 6.9.6, step 4: If this results in a 4xx or 5xx status code @@ -269,7 +269,7 @@ void AppCacheRequestHandler::OnDestructionImminent(AppCacheHost* host) { storage()->CancelDelegateCallbacks(this); - host_ = NULL; // no need to RemoveObserver, the host is being deleted + host_ = nullptr; // no need to RemoveObserver, the host is being deleted // Since the host is being deleted, we don't have to complete any job // that is current running. It's destined for the bit bucket anyway.
diff --git a/content/browser/appcache/appcache_request_handler_unittest.cc b/content/browser/appcache/appcache_request_handler_unittest.cc index fb0c365..4b6191b3 100644 --- a/content/browser/appcache/appcache_request_handler_unittest.cc +++ b/content/browser/appcache/appcache_request_handler_unittest.cc
@@ -217,7 +217,7 @@ // Test harness -------------------------------------------------- AppCacheRequestHandlerTest() - : host_(NULL), request_(nullptr), request_handler_type_(GetParam()) { + : host_(nullptr), request_(nullptr), request_handler_type_(GetParam()) { AppCacheRequestHandler::SetRunningInTests(true); if (request_handler_type_ == URLLOADER) feature_list_.InitAndEnableFeature(features::kNetworkService); @@ -271,7 +271,7 @@ mock_policy_.reset(); job_factory_.reset(); empty_context_.reset(); - host_ = NULL; + host_ = nullptr; } void TestFinished() { @@ -620,7 +620,7 @@ EXPECT_TRUE(job()); EXPECT_TRUE(job()->IsWaiting()); - host_->FinishCacheSelection(cache.get(), NULL); + host_->FinishCacheSelection(cache.get(), nullptr); EXPECT_FALSE(job()->IsWaiting()); EXPECT_TRUE(job()->IsDeliveringErrorResponse()); @@ -750,7 +750,7 @@ EXPECT_TRUE(handler_.get()); backend_impl_->UnregisterHost(1); - host_ = NULL; + host_ = nullptr; EXPECT_FALSE(handler_->MaybeLoadResource(nullptr)); EXPECT_FALSE(handler_->MaybeLoadFallbackForRedirect( @@ -775,7 +775,7 @@ EXPECT_TRUE(job()->IsWaiting()); backend_impl_->UnregisterHost(1); - host_ = NULL; + host_ = nullptr; if (request_handler_type_ == URLREQUEST) { EXPECT_TRUE(appcache_url_request_job_->has_been_killed()); @@ -806,7 +806,7 @@ mock_frontend_.reset(); mock_service_.reset(); mock_policy_.reset(); - host_ = NULL; + host_ = nullptr; if (request_handler_type_ == URLREQUEST) { EXPECT_TRUE(appcache_url_request_job_->has_been_killed()); @@ -830,7 +830,7 @@ mock_frontend_.reset(); mock_service_.reset(); mock_policy_.reset(); - host_ = NULL; + host_ = nullptr; EXPECT_FALSE(handler_->host_for_cross_site_transfer_.get()); EXPECT_FALSE(handler_->MaybeLoadResource(nullptr));
diff --git a/content/browser/appcache/appcache_response.cc b/content/browser/appcache/appcache_response.cc index 4c7b074..dd47432b 100644 --- a/content/browser/appcache/appcache_response.cc +++ b/content/browser/appcache/appcache_response.cc
@@ -98,7 +98,7 @@ const base::WeakPtr<AppCacheDiskCacheInterface>& disk_cache) : response_id_(response_id), disk_cache_(disk_cache), - entry_(NULL), + entry_(nullptr), buffer_len_(0), weak_factory_(this) {} @@ -116,8 +116,8 @@ void AppCacheResponseIO::InvokeUserCompletionCallback(int result) { // Clear the user callback and buffers prior to invoking the callback // so the caller can schedule additional operations in the callback. - buffer_ = NULL; - info_buffer_ = NULL; + buffer_ = nullptr; + info_buffer_ = nullptr; OnceCompletionCallback cb = std::move(callback_); callback_.Reset(); std::move(cb).Run(result); @@ -152,7 +152,7 @@ void AppCacheResponseIO::OpenEntryIfNeeded() { int rv; - AppCacheDiskCacheInterface::Entry** entry_ptr = NULL; + AppCacheDiskCacheInterface::Entry** entry_ptr = nullptr; if (entry_) { rv = net::OK; } else if (!disk_cache_) { @@ -398,7 +398,7 @@ void AppCacheResponseWriter::CreateEntryIfNeededAndContinue() { int rv; - AppCacheDiskCacheInterface::Entry** entry_ptr = NULL; + AppCacheDiskCacheInterface::Entry** entry_ptr = nullptr; if (entry_) { creation_phase_ = NO_ATTEMPT; rv = net::OK; @@ -430,7 +430,7 @@ creation_phase_ = DOOM_EXISTING; rv = disk_cache_->DoomEntry(response_id_, create_callback_); if (rv != net::ERR_IO_PENDING) - OnCreateEntryComplete(NULL, rv); + OnCreateEntryComplete(nullptr, rv); return; } } else if (creation_phase_ == DOOM_EXISTING) {
diff --git a/content/browser/appcache/appcache_response_unittest.cc b/content/browser/appcache/appcache_response_unittest.cc index e6996565..524c4a66 100644 --- a/content/browser/appcache/appcache_response_unittest.cc +++ b/content/browser/appcache/appcache_response_unittest.cc
@@ -116,11 +116,11 @@ task_stack_.pop(); reader_.reset(); - read_buffer_ = NULL; - read_info_buffer_ = NULL; + read_buffer_ = nullptr; + read_info_buffer_ = nullptr; writer_.reset(); - write_buffer_ = NULL; - write_info_buffer_ = NULL; + write_buffer_ = nullptr; + write_info_buffer_ = nullptr; storage_delegate_.reset(); service_.reset(); }
diff --git a/content/browser/appcache/appcache_service_unittest.cc b/content/browser/appcache/appcache_service_unittest.cc index 7eb6044b..38d0dd1 100644 --- a/content/browser/appcache/appcache_service_unittest.cc +++ b/content/browser/appcache/appcache_service_unittest.cc
@@ -98,8 +98,9 @@ AppCacheServiceImplTest() : kOrigin("http://hello/"), kManifestUrl(kOrigin.Resolve("manifest")), - service_(new AppCacheServiceImpl(NULL)), - delete_result_(net::OK), delete_completion_count_(0), + service_(new AppCacheServiceImpl(nullptr)), + delete_result_(net::OK), + delete_completion_count_(0), deletion_callback_( base::Bind(&AppCacheServiceImplTest::OnDeleteAppCachesComplete, base::Unretained(this))) { @@ -149,9 +150,9 @@ void SetupMockReader( bool valid_info, bool valid_data, bool valid_size) { - net::HttpResponseInfo* info = valid_info ? MakeMockResponseInfo() : NULL; + net::HttpResponseInfo* info = valid_info ? MakeMockResponseInfo() : nullptr; int info_size = info ? GetResponseInfoSize(info) : 0; - const char* data = valid_data ? kMockBody : NULL; + const char* data = valid_data ? kMockBody : nullptr; int data_size = valid_size ? kMockBodySize : 3; mock_storage()->SimulateResponseReader( new MockResponseReader(kMockResponseId, info, info_size, @@ -336,7 +337,8 @@ const base::TimeDelta kOneHour(base::TimeDelta::FromHours(1)); // Do things get initialized as expected? - std::unique_ptr<AppCacheServiceImpl> service(new AppCacheServiceImpl(NULL)); + std::unique_ptr<AppCacheServiceImpl> service( + new AppCacheServiceImpl(nullptr)); EXPECT_TRUE(service->last_reinit_time_.is_null()); EXPECT_FALSE(service->reinit_timer_.IsRunning()); EXPECT_EQ(kNoDelay, service->next_reinit_delay_); @@ -380,7 +382,7 @@ EXPECT_EQ(kOneHour, service->next_reinit_delay_); // Fine to delete while pending. - service.reset(NULL); + service.reset(nullptr); }
diff --git a/content/browser/appcache/appcache_storage_impl.cc b/content/browser/appcache/appcache_storage_impl.cc index 67ee70fc..7cbf946c 100644 --- a/content/browser/appcache/appcache_storage_impl.cc +++ b/content/browser/appcache/appcache_storage_impl.cc
@@ -204,7 +204,7 @@ void AppCacheStorageImpl::DatabaseTask::CancelCompletion() { DCHECK(io_thread_->RunsTasksInCurrentSequence()); delegates_.clear(); - storage_ = NULL; + storage_ = nullptr; } void AppCacheStorageImpl::DatabaseTask::CallRun( @@ -644,7 +644,7 @@ } void AppCacheStorageImpl::StoreGroupAndCacheTask::GetQuotaThenSchedule() { - storage::QuotaManager* quota_manager = NULL; + storage::QuotaManager* quota_manager = nullptr; if (storage_->service()->quota_manager_proxy()) { quota_manager = storage_->service()->quota_manager_proxy()->quota_manager(); @@ -809,8 +809,8 @@ delegates_, OnGroupAndNewestCacheStored( group_.get(), cache_.get(), success_, would_exceed_quota_)); - group_ = NULL; - cache_ = NULL; + group_ = nullptr; + cache_ = nullptr; // TODO(michaeln): if (would_exceed_quota_) what if the current usage // also exceeds the quota? http://crbug.com/83968 @@ -820,8 +820,8 @@ // Overriden to safely drop our reference to the group and cache // which are not thread safe refcounted. DatabaseTask::CancelCompletion(); - group_ = NULL; - cache_ = NULL; + group_ = nullptr; + cache_ = nullptr; } // FindMainResponseTask ------- @@ -869,7 +869,7 @@ WhiteListMap::value_type(cache_id, AppCacheNamespaceVector())); if (result.second) GetOnlineWhiteListForCache(cache_id, &result.first->second); - return AppCache::FindNamespace(result.first->second, url) != NULL; + return AppCache::FindNamespace(result.first->second, url) != nullptr; } private: @@ -1222,14 +1222,14 @@ } FOR_EACH_DELEGATE( delegates_, OnGroupMadeObsolete(group_.get(), success_, response_code_)); - group_ = NULL; + group_ = nullptr; } void AppCacheStorageImpl::MakeGroupObsoleteTask::CancelCompletion() { // Overriden to safely drop our reference to the group // which is not thread safe refcounted. DatabaseTask::CancelCompletion(); - group_ = NULL; + group_ = nullptr; } // GetDeletableResponseIdsTask ------- @@ -1392,7 +1392,7 @@ is_response_deletion_scheduled_(false), did_start_deleting_responses_(false), last_deletable_response_rowid_(0), - database_(NULL), + database_(nullptr), is_disabled_(false), delete_and_start_over_pending_(false), expecting_cleanup_complete_on_disable_(false), @@ -1412,7 +1412,7 @@ service()->force_keep_session_state()))) { delete database_; } - database_ = NULL; // So no further database tasks can be scheduled. + database_ = nullptr; // So no further database tasks can be scheduled. } void AppCacheStorageImpl::Initialize( @@ -1455,7 +1455,7 @@ void AppCacheStorageImpl::LoadCache(int64_t id, Delegate* delegate) { DCHECK(delegate); if (is_disabled_) { - delegate->OnCacheLoaded(NULL, id); + delegate->OnCacheLoaded(nullptr, id); return; } @@ -1485,7 +1485,7 @@ const GURL& manifest_url, Delegate* delegate) { DCHECK(delegate); if (is_disabled_) { - delegate->OnGroupLoaded(NULL, manifest_url); + delegate->OnGroupLoaded(nullptr, manifest_url); return; } @@ -1842,7 +1842,7 @@ PendingCacheLoads::iterator found = pending_cache_loads_.find(cache_id); if (found != pending_cache_loads_.end()) return found->second; - return NULL; + return nullptr; } AppCacheStorageImpl::GroupLoadTask* @@ -1850,7 +1850,7 @@ PendingGroupLoads::iterator found = pending_group_loads_.find(manifest_url); if (found != pending_group_loads_.end()) return found->second; - return NULL; + return nullptr; } void AppCacheStorageImpl::GetPendingForeignMarkingsForCache(
diff --git a/content/browser/appcache/appcache_storage_impl_unittest.cc b/content/browser/appcache/appcache_storage_impl_unittest.cc index f16dede..a02afef 100644 --- a/content/browser/appcache/appcache_storage_impl_unittest.cc +++ b/content/browser/appcache/appcache_storage_impl_unittest.cc
@@ -214,8 +214,8 @@ const GURL& manifest_url) override { loaded_group_ = group; loaded_manifest_url_ = manifest_url; - loaded_groups_newest_cache_ = group ? group->newest_complete_cache() - : NULL; + loaded_groups_newest_cache_ = + group ? group->newest_complete_cache() : nullptr; test_->ScheduleNextTask(); } @@ -310,7 +310,7 @@ class MockQuotaManagerProxy : public storage::QuotaManagerProxy { public: MockQuotaManagerProxy() - : QuotaManagerProxy(NULL, NULL), + : QuotaManagerProxy(nullptr, nullptr), notify_storage_accessed_count_(0), notify_storage_modified_count_(0), last_delta_(0), @@ -431,10 +431,10 @@ scoped_refptr<base::SequencedTaskRunner> db_runner = storage()->db_task_runner_; storage()->CancelDelegateCallbacks(delegate()); - group_ = NULL; - cache_ = NULL; - cache2_ = NULL; - mock_quota_manager_proxy_ = NULL; + group_ = nullptr; + cache_ = nullptr; + cache2_ = nullptr; + mock_quota_manager_proxy_ = nullptr; delegate_.reset(); service_.reset(); FlushTasks(db_runner.get()); @@ -588,8 +588,8 @@ // Setup some preconditions. Create a group and newest cache that // appear to be "stored" and "not currently in use". MakeCacheAndGroup(kManifestUrl, 1, 1, true); - group_ = NULL; - cache_ = NULL; + group_ = nullptr; + cache_ = nullptr; // Conduct the cache load test, completes async storage()->LoadCache(1, delegate()); @@ -609,7 +609,7 @@ EXPECT_EQ(0, mock_quota_manager_proxy_->notify_storage_modified_count_); // Drop things from the working set. - delegate()->loaded_cache_ = NULL; + delegate()->loaded_cache_ = nullptr; EXPECT_FALSE(delegate()->loaded_group_.get()); // Conduct the group load test, also complete asynchronously. @@ -624,7 +624,7 @@ EXPECT_TRUE(delegate()->loaded_group_.get()); EXPECT_EQ(kManifestUrl, delegate()->loaded_manifest_url_); EXPECT_TRUE(delegate()->loaded_group_->newest_complete_cache()); - delegate()->loaded_groups_newest_cache_ = NULL; + delegate()->loaded_groups_newest_cache_ = nullptr; EXPECT_TRUE(delegate()->loaded_group_->HasOneRef()); EXPECT_EQ(2, mock_quota_manager_proxy_->notify_storage_accessed_count_); EXPECT_EQ(0, mock_quota_manager_proxy_->notify_storage_modified_count_); @@ -947,8 +947,8 @@ EXPECT_TRUE(database()->InsertEntry(&entry_record)); EXPECT_FALSE(cache_->GetEntry(kEntryUrl)->IsForeign()); EXPECT_TRUE(cache_->HasOneRef()); - cache_ = NULL; - group_ = NULL; + cache_ = nullptr; + group_ = nullptr; // Conduct the test, start a cache load, and prior to completion // of that load, mark the entry as foreign. @@ -1027,9 +1027,9 @@ // Optionally drop the cache/group pair from the working set. if (drop_from_working_set) { EXPECT_TRUE(cache_->HasOneRef()); - cache_ = NULL; + cache_ = nullptr; EXPECT_TRUE(group_->HasOneRef()); - group_ = NULL; + group_ = nullptr; } // Conduct the test. @@ -1103,9 +1103,9 @@ EXPECT_TRUE(database()->InsertOnlineWhiteListRecords(whitelists)); if (drop_from_working_set) { EXPECT_TRUE(cache_->HasOneRef()); - cache_ = NULL; + cache_ = nullptr; EXPECT_TRUE(group_->HasOneRef()); - group_ = NULL; + group_ = nullptr; } // Conduct the test. The test url is in both fallback namespace urls, @@ -1177,9 +1177,9 @@ EXPECT_TRUE(database()->InsertOnlineWhiteListRecords(whitelists)); if (drop_from_working_set) { EXPECT_TRUE(cache_->HasOneRef()); - cache_ = NULL; + cache_ = nullptr; EXPECT_TRUE(group_->HasOneRef()); - group_ = NULL; + group_ = nullptr; } // Conduct the test. The test url is in both intercept namespaces, @@ -1243,9 +1243,9 @@ EXPECT_TRUE(database()->InsertNamespaceRecords(intercepts)); if (drop_from_working_set) { EXPECT_TRUE(cache_->HasOneRef()); - cache_ = NULL; + cache_ = nullptr; EXPECT_TRUE(group_->HasOneRef()); - group_ = NULL; + group_ = nullptr; } // First test something that does not match the pattern. @@ -1330,9 +1330,9 @@ EXPECT_TRUE(database()->InsertNamespaceRecords(fallbacks)); if (drop_from_working_set) { EXPECT_TRUE(cache_->HasOneRef()); - cache_ = NULL; + cache_ = nullptr; EXPECT_TRUE(group_->HasOneRef()); - group_ = NULL; + group_ = nullptr; } // First test something that does not match the pattern. @@ -1581,8 +1581,8 @@ whitelist_record.namespace_url = kOnlineNamespaceWithinFallback; EXPECT_TRUE(database()->InsertOnlineWhiteList(&whitelist_record)); if (drop_from_working_set) { - cache_ = NULL; - group_ = NULL; + cache_ = nullptr; + group_ = nullptr; } // We should not find anything for the foreign entry. @@ -1748,7 +1748,7 @@ } // Recreate the service to point at the db and corruption on disk. - service_.reset(new AppCacheServiceImpl(NULL)); + service_.reset(new AppCacheServiceImpl(nullptr)); service_->set_request_context(io_thread->request_context()); service_->Initialize(temp_directory_.GetPath()); mock_quota_manager_proxy_ = new MockQuotaManagerProxy();
diff --git a/content/browser/appcache/appcache_storage_unittest.cc b/content/browser/appcache/appcache_storage_unittest.cc index ab582aa7..242c33b 100644 --- a/content/browser/appcache/appcache_storage_unittest.cc +++ b/content/browser/appcache/appcache_storage_unittest.cc
@@ -98,7 +98,7 @@ service.storage()->GetDelegateReference(&delegate)->delegate); EXPECT_EQ(service.storage()->GetDelegateReference(&delegate), service.storage()->GetOrCreateDelegateReference(&delegate)); - delegate_reference1 = NULL; + delegate_reference1 = nullptr; EXPECT_FALSE(service.storage()->GetDelegateReference(&delegate)); delegate_reference1 = @@ -123,7 +123,7 @@ MockAppCacheService service; scoped_refptr<MockQuotaManagerProxy> mock_proxy( - new MockQuotaManagerProxy(NULL, NULL)); + new MockQuotaManagerProxy(nullptr, nullptr)); service.set_quota_manager_proxy(mock_proxy.get()); service.storage()->UpdateUsageMapAndNotify(kOrigin, 0);
diff --git a/content/browser/appcache/appcache_unittest.cc b/content/browser/appcache/appcache_unittest.cc index 1806bca..e64b3b0 100644 --- a/content/browser/appcache/appcache_unittest.cc +++ b/content/browser/appcache/appcache_unittest.cc
@@ -607,7 +607,7 @@ EXPECT_EQ(1u, intercepts.size()); EXPECT_EQ(1u, fallbacks.size()); EXPECT_EQ(1u, whitelists.size()); - cache = NULL; + cache = nullptr; // Create a new AppCache and populate it with those records and verify. cache = new AppCache(service.storage(), kCacheId);
diff --git a/content/browser/appcache/appcache_update_job.cc b/content/browser/appcache/appcache_update_job.cc index ac3597c..dab85357 100644 --- a/content/browser/appcache/appcache_update_job.cc +++ b/content/browser/appcache/appcache_update_job.cc
@@ -178,12 +178,12 @@ doing_full_update_check_(false), master_entries_completed_(0), url_fetches_completed_(0), - manifest_fetcher_(NULL), + manifest_fetcher_(nullptr), manifest_has_valid_mime_type_(false), stored_state_(UNSTORED), storage_(service->storage()), weak_factory_(this) { - service_->AddObserver(this); + service_->AddObserver(this); } AppCacheUpdateJob::~AppCacheUpdateJob() { @@ -323,7 +323,7 @@ // DeleteAppCacheGroup, otherwise that method would delete |this| // and we need the stack to unwind prior to deletion. group_->SetUpdateAppCacheStatus(AppCacheGroup::IDLE); - group_ = NULL; + group_ = nullptr; service_->DeleteAppCacheGroup(manifest_url_, base::Bind(EmptyCompletionCallback)); } @@ -341,8 +341,10 @@ if (is_first_fetch) { // Maybe load the cached headers to make a condiditional request. - AppCacheEntry* entry = (update_type_ == UPGRADE_ATTEMPT) ? - group_->newest_complete_cache()->GetEntry(manifest_url_) : NULL; + AppCacheEntry* entry = + (update_type_ == UPGRADE_ATTEMPT) + ? group_->newest_complete_cache()->GetEntry(manifest_url_) + : nullptr; if (entry && !doing_full_update_check_) { // Asynchronously load response info for manifest from newest cache. storage_->LoadResponseInfo(manifest_url_, entry->response_id(), this); @@ -364,7 +366,7 @@ DCHECK_EQ(internal_state_, FETCH_MANIFEST); DCHECK_EQ(manifest_fetcher_, fetcher); - manifest_fetcher_ = NULL; + manifest_fetcher_ = nullptr; UpdateRequestBase* request = fetcher->request(); int response_code = -1; @@ -694,7 +696,7 @@ int net_error) { DCHECK(internal_state_ == REFETCH_MANIFEST); DCHECK(manifest_fetcher_ == fetcher); - manifest_fetcher_ = NULL; + manifest_fetcher_ = nullptr; int response_code = net_error == net::OK ? fetcher->request()->GetResponseCode() : -1; @@ -911,7 +913,7 @@ void AppCacheUpdateJob::CheckIfManifestChanged() { DCHECK(update_type_ == UPGRADE_ATTEMPT); - AppCacheEntry* entry = NULL; + AppCacheEntry* entry = nullptr; if (group_->newest_complete_cache()) entry = group_->newest_complete_cache()->GetEntry(manifest_url_); if (!entry) { @@ -953,7 +955,7 @@ base::Bind(&AppCacheUpdateJob::OnManifestDataReadComplete, base::Unretained(this))); // read more } else { - read_manifest_buffer_ = NULL; + read_manifest_buffer_ = nullptr; manifest_response_reader_.reset(); ContinueHandleManifestFetchCompleted( result < 0 || manifest_data_ != loaded_manifest_data_); @@ -999,7 +1001,7 @@ AppCache::EntryMap::value_type(url, AppCacheEntry(type))); if (ret.second) - urls_to_fetch_.push_back(UrlToFetch(url, false, NULL)); + urls_to_fetch_.push_back(UrlToFetch(url, false, nullptr)); else ret.first->second.add_types(type); // URL already exists. Merge types. } @@ -1223,8 +1225,8 @@ void AppCacheUpdateJob::OnResponseInfoLoaded( AppCacheResponseInfo* response_info, int64_t response_id) { - const net::HttpResponseInfo* http_info = response_info ? - response_info->http_response_info() : NULL; + const net::HttpResponseInfo* http_info = + response_info ? response_info->http_response_info() : nullptr; // Needed response info for a manifest fetch request. if (internal_state_ == FETCH_MANIFEST) { @@ -1240,7 +1242,7 @@ const GURL& url = found->second; if (!http_info) { - LoadFromNewestCacheFailed(url, NULL); // no response found + LoadFromNewestCacheFailed(url, nullptr); // no response found } else if (!CanUseExistingResource(http_info)) { LoadFromNewestCacheFailed(url, response_info); } else { @@ -1356,7 +1358,7 @@ if (manifest_fetcher_) { delete manifest_fetcher_; - manifest_fetcher_ = NULL; + manifest_fetcher_ = nullptr; } for (PendingUrlFetches::iterator it = pending_url_fetches_.begin(); @@ -1399,7 +1401,7 @@ // We can make no assumptions about whether the StoreGroupAndCacheTask // actually completed or not. This condition should only be reachable // during shutdown. Free things up and return to do no harm. - inprogress_cache_ = NULL; + inprogress_cache_ = nullptr; added_master_entries_.clear(); return; } @@ -1422,7 +1424,7 @@ while (!hosts.empty()) (*hosts.begin())->AssociateNoCache(GURL()); - inprogress_cache_ = NULL; + inprogress_cache_ = nullptr; added_master_entries_.clear(); } @@ -1466,13 +1468,13 @@ manifest_response_writer_.reset(); storage_->CancelDelegateCallbacks(this); service_->RemoveObserver(this); - service_ = NULL; + service_ = nullptr; // Break the connection with the group so the group cannot call delete // on this object after we've posted a task to delete ourselves. if (group_) { group_->SetUpdateAppCacheStatus(AppCacheGroup::IDLE); - group_ = NULL; + group_ = nullptr; } base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
diff --git a/content/browser/appcache/appcache_update_job_unittest.cc b/content/browser/appcache/appcache_update_job_unittest.cc index 7bd144d7..cb26c412 100644 --- a/content/browser/appcache/appcache_update_job_unittest.cc +++ b/content/browser/appcache/appcache_update_job_unittest.cc
@@ -245,10 +245,12 @@ class MockFrontend : public AppCacheFrontend { public: MockFrontend() - : ignore_progress_events_(false), verify_progress_events_(false), - last_progress_total_(-1), last_progress_complete_(-1), - start_update_trigger_(APPCACHE_CHECKING_EVENT), update_(NULL) { - } + : ignore_progress_events_(false), + verify_progress_events_(false), + last_progress_total_(-1), + last_progress_complete_(-1), + start_update_trigger_(APPCACHE_CHECKING_EVENT), + update_(nullptr) {} void OnCacheSelected(int host_id, const AppCacheInfo& info) override {} @@ -709,11 +711,11 @@ expect_group_is_being_deleted_(false), expect_evictable_error_(false), expect_eviction_(false), - expect_old_cache_(NULL), - expect_newest_cache_(NULL), + expect_old_cache_(nullptr), + expect_newest_cache_(nullptr), expect_non_null_update_time_(false), tested_manifest_(NONE), - tested_manifest_path_override_(NULL), + tested_manifest_path_override_(nullptr), request_handler_type_(GetParam()), thread_bundle_(content::TestBrowserThreadBundle::REAL_IO_THREAD) { BrowserThread::PostTask( @@ -912,7 +914,7 @@ group_->set_last_full_update_check_time( base::Time::Now() - kFullUpdateInterval - kOneHour); - update->StartUpdate(NULL, GURL()); + update->StartUpdate(nullptr, GURL()); EXPECT_TRUE(update->doing_full_update_check_); // Set up checks for when update job finishes. @@ -983,7 +985,7 @@ frontend->SetVerifyProgressEvents(true); - update->StartUpdate(NULL, GURL()); + update->StartUpdate(nullptr, GURL()); // Set up checks for when update job finishes. do_checks_after_update_finished_ = true; @@ -1020,7 +1022,7 @@ host1->AssociateCompleteCache(cache); host2->AssociateCompleteCache(cache); - update->StartUpdate(NULL, GURL()); + update->StartUpdate(nullptr, GURL()); // Set up checks for when update job finishes. do_checks_after_update_finished_ = true; @@ -1109,7 +1111,7 @@ group_->set_last_full_update_check_time( base::Time::Now() - kFullUpdateInterval - kOneHour); group_->set_first_evictable_error_time(base::Time::Now()); - update->StartUpdate(NULL, GURL()); + update->StartUpdate(nullptr, GURL()); EXPECT_TRUE(update->doing_full_update_check_); // Set up checks for when update job finishes. @@ -1197,7 +1199,7 @@ AppCacheHost* host = MakeHost(1, frontend); host->AssociateCompleteCache(cache); - update->StartUpdate(NULL, GURL()); + update->StartUpdate(nullptr, GURL()); // Set up checks for when update job finishes. do_checks_after_update_finished_ = true; @@ -1217,7 +1219,7 @@ response_writer_.reset(); AppCacheUpdateJob* update = group_->update_job_; - update->StartUpdate(NULL, GURL()); + update->StartUpdate(nullptr, GURL()); WaitForUpdateToFinish(); } @@ -1613,7 +1615,7 @@ cache->AddEntry(MockHttpServer::GetMockUrl("files/explicit1"), AppCacheEntry(AppCacheEntry::MASTER, 111)); - update->StartUpdate(NULL, GURL()); + update->StartUpdate(nullptr, GURL()); // Set up checks for when update job finishes. do_checks_after_update_finished_ = true; @@ -1687,7 +1689,7 @@ host1->AssociateCompleteCache(cache); host2->AssociateCompleteCache(cache); - update->StartUpdate(NULL, GURL()); + update->StartUpdate(nullptr, GURL()); // Set up checks for when update job finishes. do_checks_after_update_finished_ = true; @@ -1755,7 +1757,7 @@ MakeAppCacheResponseInfo(kManifestUrl, 444, kRawHeaders); MakeAppCacheResponseInfo(kManifestUrl, 555, kRawHeaders); - update->StartUpdate(NULL, GURL()); + update->StartUpdate(nullptr, GURL()); // Set up checks for when update job finishes. do_checks_after_update_finished_ = true; @@ -1823,7 +1825,7 @@ frontend1->SetVerifyProgressEvents(true); - update->StartUpdate(NULL, GURL()); + update->StartUpdate(nullptr, GURL()); // Set up checks for when update job finishes. do_checks_after_update_finished_ = true; @@ -2117,7 +2119,7 @@ host1->AssociateCompleteCache(cache); host2->AssociateCompleteCache(cache); - update->StartUpdate(NULL, GURL()); + update->StartUpdate(nullptr, GURL()); // Set up checks for when update job finishes. do_checks_after_update_finished_ = true; @@ -2213,7 +2215,7 @@ host1->AssociateCompleteCache(cache); host2->AssociateCompleteCache(cache); - update->StartUpdate(NULL, GURL()); + update->StartUpdate(nullptr, GURL()); // Set up checks for when update job finishes. do_checks_after_update_finished_ = true; @@ -2640,7 +2642,7 @@ frontend1->AdditionalUpdateHost(host2); // fetch will fail frontend1->AdditionalUpdateHost(host3); // same as an explicit entry frontend1->AdditionalUpdateHost(host4); // same as another master entry - frontend1->AdditionalUpdateHost(NULL); // no host + frontend1->AdditionalUpdateHost(nullptr); // no host frontend1->AdditionalUpdateHost(host5); // no master entry url // Set up checks for when update job finishes. @@ -2734,7 +2736,7 @@ frontend2->TriggerAdditionalUpdates(APPCACHE_ERROR_EVENT, update); frontend2->AdditionalUpdateHost(host3); - frontend2->AdditionalUpdateHost(NULL); // no host + frontend2->AdditionalUpdateHost(nullptr); // no host frontend2->AdditionalUpdateHost(host4); // no master entry url frontend2->AdditionalUpdateHost(host5); // same as existing cache entry frontend2->AdditionalUpdateHost(host6); // same as another master entry @@ -2782,7 +2784,7 @@ AppCacheHost* host1 = MakeHost(1, frontend1); host1->AssociateCompleteCache(cache); - update->StartUpdate(NULL, GURL()); + update->StartUpdate(nullptr, GURL()); // Set up additional updates to be started while update is in progress. MockFrontend* frontend2 = MakeMockFrontend(); @@ -2805,7 +2807,7 @@ frontend1->TriggerAdditionalUpdates(APPCACHE_PROGRESS_EVENT, update); frontend1->AdditionalUpdateHost(host2); // same as entry in manifest - frontend1->AdditionalUpdateHost(NULL); // no host + frontend1->AdditionalUpdateHost(nullptr); // no host frontend1->AdditionalUpdateHost(host3); // new master entry frontend1->AdditionalUpdateHost(host4); // no master entry url frontend1->AdditionalUpdateHost(host5); // same as another master entry @@ -3369,17 +3371,17 @@ void UpdateFinishedUnwound() { EXPECT_EQ(AppCacheGroup::IDLE, group_->update_status()); - EXPECT_TRUE(group_->update_job() == NULL); + EXPECT_TRUE(group_->update_job() == nullptr); if (do_checks_after_update_finished_) VerifyExpectations(); // Clean up everything that was created on the IO thread. - protect_newest_cache_ = NULL; - group_ = NULL; + protect_newest_cache_ = nullptr; + group_ = nullptr; hosts_.clear(); frontends_.clear(); response_infos_.clear(); - service_.reset(NULL); + service_.reset(nullptr); event_->Signal(); } @@ -3470,7 +3472,7 @@ } if (expect_group_has_cache_) { - EXPECT_TRUE(group_->newest_complete_cache() != NULL); + EXPECT_TRUE(group_->newest_complete_cache() != nullptr); if (expect_non_null_update_time_) EXPECT_TRUE(!group_->newest_complete_cache()->update_time().is_null()); @@ -3517,7 +3519,7 @@ } } } else { - EXPECT_TRUE(group_->newest_complete_cache() == NULL); + EXPECT_TRUE(group_->newest_complete_cache() == nullptr); } // Check expected events. @@ -3554,7 +3556,7 @@ // and will abort the test if they fail. if (tested_manifest_) { AppCache* cache = group_->newest_complete_cache(); - ASSERT_TRUE(cache != NULL); + ASSERT_TRUE(cache != nullptr); EXPECT_EQ(group_.get(), cache->owning_group()); EXPECT_TRUE(cache->is_complete()); @@ -3803,7 +3805,7 @@ group->update_job_ = &update; group->update_status_ = AppCacheGroup::CHECKING; - update.StartUpdate(NULL, GURL()); + update.StartUpdate(nullptr, GURL()); EXPECT_EQ(AppCacheGroup::CHECKING, group->update_status()); MockFrontend mock_frontend; @@ -3831,7 +3833,7 @@ group->update_job_ = &update; group->update_status_ = AppCacheGroup::DOWNLOADING; - update.StartUpdate(NULL, GURL()); + update.StartUpdate(nullptr, GURL()); EXPECT_EQ(AppCacheGroup::DOWNLOADING, group->update_status()); MockFrontend mock_frontend;
diff --git a/content/browser/appcache/appcache_url_request_job.cc b/content/browser/appcache/appcache_url_request_job.cc index 13e4707f..6460fbfa 100644 --- a/content/browser/appcache/appcache_url_request_job.cc +++ b/content/browser/appcache/appcache_url_request_job.cc
@@ -43,12 +43,12 @@ handler_source_reader_.reset(); if (storage_) { storage_->CancelDelegateCallbacks(this); - storage_ = NULL; + storage_ = nullptr; } - host_ = NULL; - info_ = NULL; - cache_ = NULL; - group_ = NULL; + host_ = nullptr; + info_ = nullptr; + cache_ = nullptr; + group_ = nullptr; range_response_info_.reset(); net::URLRequestJob::Kill(); weak_factory_.InvalidateWeakPtrs(); @@ -76,14 +76,14 @@ void AppCacheURLRequestJob::DeliverNetworkResponse() { DCHECK(!has_delivery_orders()); delivery_type_ = NETWORK_DELIVERY; - storage_ = NULL; // not needed + storage_ = nullptr; // not needed MaybeBeginDelivery(); } void AppCacheURLRequestJob::DeliverErrorResponse() { DCHECK(!has_delivery_orders()); delivery_type_ = ERROR_DELIVERY; - storage_ = NULL; // not needed + storage_ = nullptr; // not needed MaybeBeginDelivery(); } @@ -177,7 +177,7 @@ host_->frontend()->OnLogMessage(host_->host_id(), APPCACHE_LOG_ERROR, message); delivery_type_ = ERROR_DELIVERY; - storage_ = NULL; + storage_ = nullptr; BeginDelivery(); } @@ -219,7 +219,7 @@ const net::HttpResponseInfo* AppCacheURLRequestJob::http_info() const { if (!info_.get()) - return NULL; + return nullptr; if (range_response_info_) return range_response_info_.get(); return info_->http_response_info();
diff --git a/content/browser/appcache/appcache_url_request_job_unittest.cc b/content/browser/appcache/appcache_url_request_job_unittest.cc index 7e6d05d7..b2adce0 100644 --- a/content/browser/appcache/appcache_url_request_job_unittest.cc +++ b/content/browser/appcache/appcache_url_request_job_unittest.cc
@@ -284,11 +284,11 @@ task_stack_.pop(); reader_.reset(); - read_buffer_ = NULL; - read_info_buffer_ = NULL; + read_buffer_ = nullptr; + read_info_buffer_ = nullptr; writer_.reset(); - write_buffer_ = NULL; - write_info_buffer_ = NULL; + write_buffer_ = nullptr; + write_info_buffer_ = nullptr; storage_delegate_.reset(); service_.reset(); @@ -636,8 +636,8 @@ // Setup to create an AppCacheURLRequestJob with orders to deliver // a network response. std::unique_ptr<AppCacheURLRequestJob> job( - new AppCacheURLRequestJob(request_.get(), NULL, storage, NULL, false, - base::BindOnce(&ExpectNotRestarted))); + new AppCacheURLRequestJob(request_.get(), nullptr, storage, nullptr, + false, base::BindOnce(&ExpectNotRestarted))); if (start_after_delivery_orders) { job->DeliverAppCachedResponse( @@ -756,8 +756,8 @@ // Create job with orders to deliver an appcached entry. std::unique_ptr<AppCacheURLRequestJob> job( - new AppCacheURLRequestJob(request_.get(), NULL, storage, NULL, false, - base::BindOnce(&ExpectNotRestarted))); + new AppCacheURLRequestJob(request_.get(), nullptr, storage, nullptr, + false, base::BindOnce(&ExpectNotRestarted))); job->DeliverAppCachedResponse( GURL(), 111, AppCacheEntry(AppCacheEntry::EXPLICIT, written_response_id_), false);
diff --git a/content/browser/appcache/chrome_appcache_service.cc b/content/browser/appcache/chrome_appcache_service.cc index e6d557a..db7f04b2 100644 --- a/content/browser/appcache/chrome_appcache_service.cc +++ b/content/browser/appcache/chrome_appcache_service.cc
@@ -17,8 +17,7 @@ ChromeAppCacheService::ChromeAppCacheService( storage::QuotaManagerProxy* quota_manager_proxy) - : AppCacheServiceImpl(quota_manager_proxy), resource_context_(NULL) { -} + : AppCacheServiceImpl(quota_manager_proxy), resource_context_(nullptr) {} void ChromeAppCacheService::InitializeOnIOThread( const base::FilePath& cache_path,
diff --git a/content/browser/appcache/chrome_appcache_service_unittest.cc b/content/browser/appcache/chrome_appcache_service_unittest.cc index 9b98d31..2db6bb0e 100644 --- a/content/browser/appcache/chrome_appcache_service_unittest.cc +++ b/content/browser/appcache/chrome_appcache_service_unittest.cc
@@ -94,7 +94,7 @@ const base::FilePath& appcache_path, bool init_storage) { scoped_refptr<ChromeAppCacheService> appcache_service = - new ChromeAppCacheService(NULL); + new ChromeAppCacheService(nullptr); scoped_refptr<MockSpecialStoragePolicy> mock_policy = new MockSpecialStoragePolicy; mock_policy->AddProtected(kProtectedManifestURL.GetOrigin()); @@ -152,7 +152,7 @@ InsertDataIntoAppCache(appcache_service.get()); // Test: delete the ChromeAppCacheService - appcache_service = NULL; + appcache_service = nullptr; scoped_task_environment_.RunUntilIdle(); // Recreate the appcache (for reading the data back) @@ -172,7 +172,7 @@ origins.end()); // Delete and let cleanup tasks run prior to returning. - appcache_service = NULL; + appcache_service = nullptr; scoped_task_environment_.RunUntilIdle(); } @@ -192,7 +192,7 @@ appcache_service->set_force_keep_session_state(); // Test: delete the ChromeAppCacheService - appcache_service = NULL; + appcache_service = nullptr; scoped_task_environment_.RunUntilIdle(); // Recreate the appcache (for reading the data back) @@ -212,7 +212,7 @@ origins.end()); // Delete and let cleanup tasks run prior to returning. - appcache_service = NULL; + appcache_service = nullptr; scoped_task_environment_.RunUntilIdle(); }
diff --git a/content/browser/appcache/mock_appcache_storage_unittest.cc b/content/browser/appcache/mock_appcache_storage_unittest.cc index 55fb9149..25ad99c 100644 --- a/content/browser/appcache/mock_appcache_storage_unittest.cc +++ b/content/browser/appcache/mock_appcache_storage_unittest.cc
@@ -186,8 +186,8 @@ // these objects appear as "not currently in use". AppCache* cache_ptr = cache.get(); AppCacheGroup* group_ptr = group.get(); - cache = NULL; - group = NULL; + cache = nullptr; + group = nullptr; // Setup a delegate to receive completion callbacks. MockStorageDelegate delegate; @@ -201,7 +201,7 @@ base::RunLoop().RunUntilIdle(); // Do async task execution. EXPECT_EQ(cache_id, delegate.loaded_cache_id_); EXPECT_EQ(cache_ptr, delegate.loaded_cache_.get()); - delegate.loaded_cache_ = NULL; + delegate.loaded_cache_ = nullptr; // Conduct the group load test. EXPECT_NE(manifest_url, delegate.loaded_manifest_url_); @@ -373,8 +373,8 @@ EXPECT_TRUE(storage->stored_groups_.empty()); EXPECT_TRUE(cache->HasOneRef()); EXPECT_FALSE(group->HasOneRef()); - delegate.obsoleted_group_ = NULL; - cache = NULL; + delegate.obsoleted_group_ = nullptr; + cache = nullptr; EXPECT_TRUE(group->HasOneRef()); } @@ -543,8 +543,8 @@ storage->AddStoredGroup(group.get()); storage->AddStoredCache(cache.get()); // Drop our references to cache1 so it appears as "not in use". - cache = NULL; - group = NULL; + cache = nullptr; + group = nullptr; // The second cache. cache = new AppCache(service.storage(), kCacheId2);
diff --git a/content/browser/blob_storage/blob_dispatcher_host_unittest.cc b/content/browser/blob_storage/blob_dispatcher_host_unittest.cc index 9f5a167..a836dee 100644 --- a/content/browser/blob_storage/blob_dispatcher_host_unittest.cc +++ b/content/browser/blob_storage/blob_dispatcher_host_unittest.cc
@@ -97,7 +97,7 @@ : chrome_blob_storage_context_( ChromeBlobStorageContext::GetFor(&browser_context_)) { file_system_context_ = - CreateFileSystemContextForTesting(NULL, base::FilePath()); + CreateFileSystemContextForTesting(nullptr, base::FilePath()); host_ = new TestableBlobDispatcherHost(chrome_blob_storage_context_, file_system_context_.get(), &sink_); }
diff --git a/content/browser/blob_storage/blob_url_unittest.cc b/content/browser/blob_storage/blob_url_unittest.cc index 04a4e70..8640a946d 100644 --- a/content/browser/blob_storage/blob_url_unittest.cc +++ b/content/browser/blob_storage/blob_url_unittest.cc
@@ -195,7 +195,7 @@ void SetUpFileSystem() { // Prepare file system. file_system_context_ = - CreateFileSystemContextForTesting(NULL, temp_dir_.GetPath()); + CreateFileSystemContextForTesting(nullptr, temp_dir_.GetPath()); file_system_context_->OpenFileSystem( GURL(kFileSystemURLOrigin), kFileSystemType, @@ -480,7 +480,7 @@ large_data.append(1, static_cast<char>(i % 256)); const char kFilename[] = "LargeBlob.dat"; - WriteFileSystemFile(kFilename, large_data.data(), large_data.size(), NULL); + WriteFileSystemFile(kFilename, large_data.data(), large_data.size(), nullptr); blob_data_->AppendFileSystemFile(GetFileSystemURL(kFilename), 0, std::numeric_limits<uint64_t>::max(),
diff --git a/content/browser/blob_storage/chrome_blob_storage_context.cc b/content/browser/blob_storage/chrome_blob_storage_context.cc index 2795360..bf41a25 100644 --- a/content/browser/blob_storage/chrome_blob_storage_context.cc +++ b/content/browser/blob_storage/chrome_blob_storage_context.cc
@@ -197,7 +197,7 @@ storage::BlobStorageContext* GetBlobStorageContext( ChromeBlobStorageContext* blob_storage_context) { if (!blob_storage_context) - return NULL; + return nullptr; return blob_storage_context->context(); }
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc index 0e4d5ff..5c185b3 100644 --- a/content/browser/browser_context.cc +++ b/content/browser/browser_context.cc
@@ -239,7 +239,7 @@ return UserDataAdapter<storage::ExternalMountPoints>::Get(context, kMountPointsKey); #else - return NULL; + return nullptr; #endif } @@ -307,7 +307,7 @@ StoragePartition* BrowserContext::GetDefaultStoragePartition( BrowserContext* browser_context) { - return GetStoragePartition(browser_context, NULL); + return GetStoragePartition(browser_context, nullptr); } // static
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index 4709b59..bb4c3f0 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc
@@ -312,14 +312,12 @@ const char* const kLogDomains[] = { nullptr, "Gtk", "Gdk", "GLib", "GLib-GObject" }; for (size_t i = 0; i < arraysize(kLogDomains); i++) { - g_log_set_handler(kLogDomains[i], - static_cast<GLogLevelFlags>(G_LOG_FLAG_RECURSION | - G_LOG_FLAG_FATAL | - G_LOG_LEVEL_ERROR | - G_LOG_LEVEL_CRITICAL | - G_LOG_LEVEL_WARNING), - GLibLogHandler, - NULL); + g_log_set_handler( + kLogDomains[i], + static_cast<GLogLevelFlags>(G_LOG_FLAG_RECURSION | G_LOG_FLAG_FATAL | + G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | + G_LOG_LEVEL_WARNING), + GLibLogHandler, nullptr); } } #endif // defined(USE_GLIB) @@ -568,7 +566,7 @@ #endif // The currently-running BrowserMainLoop. There can be one or zero. -BrowserMainLoop* g_current_browser_main_loop = NULL; +BrowserMainLoop* g_current_browser_main_loop = nullptr; #if defined(OS_ANDROID) bool g_browser_main_loop_shutting_down = false; @@ -603,7 +601,7 @@ BrowserMainLoop::~BrowserMainLoop() { DCHECK_EQ(this, g_current_browser_main_loop); ui::Clipboard::DestroyClipboardForCurrentThread(); - g_current_browser_main_loop = NULL; + g_current_browser_main_loop = nullptr; } void BrowserMainLoop::Init() { @@ -1627,7 +1625,7 @@ // When running the GPU thread in-process, avoid optimistically starting it // since creating the GPU thread races against creation of the one-and-only // ChildProcess instance which is created by the renderer thread. - if (GpuDataManagerImpl::GetInstance()->GpuAccessAllowed(NULL) && + if (GpuDataManagerImpl::GetInstance()->GpuAccessAllowed(nullptr) && !established_gpu_channel && always_uses_gpu && !UsingInProcessGpu() && !is_mus) { TRACE_EVENT_INSTANT0("gpu", "Post task to launch GPU process",
diff --git a/content/browser/browser_main_runner.cc b/content/browser/browser_main_runner.cc index 6d510b3..7848d47 100644 --- a/content/browser/browser_main_runner.cc +++ b/content/browser/browser_main_runner.cc
@@ -210,9 +210,9 @@ if (base::RunLoop::IsRunningOnCurrentThread()) base::RunLoop::QuitCurrentDeprecated(); #endif - main_loop_.reset(NULL); + main_loop_.reset(nullptr); - notification_service_.reset(NULL); + notification_service_.reset(nullptr); is_shutdown_ = true; }
diff --git a/content/browser/browser_shutdown_profile_dumper.cc b/content/browser/browser_shutdown_profile_dumper.cc index 6840acd1..84ccc3f0 100644 --- a/content/browser/browser_shutdown_profile_dumper.cc +++ b/content/browser/browser_shutdown_profile_dumper.cc
@@ -21,10 +21,7 @@ BrowserShutdownProfileDumper::BrowserShutdownProfileDumper( const base::FilePath& dump_file_name) - : dump_file_name_(dump_file_name), - blocks_(0), - dump_file_(NULL) { -} + : dump_file_name_(dump_file_name), blocks_(0), dump_file_(nullptr) {} BrowserShutdownProfileDumper::~BrowserShutdownProfileDumper() { WriteTracesToDisc(); @@ -144,7 +141,7 @@ if (!dump_file_) return; base::CloseFile(dump_file_); - dump_file_ = NULL; + dump_file_ = nullptr; } } // namespace content
diff --git a/content/browser/browser_url_handler_impl.cc b/content/browser/browser_url_handler_impl.cc index feef0ca9..2c6e862f 100644 --- a/content/browser/browser_url_handler_impl.cc +++ b/content/browser/browser_url_handler_impl.cc
@@ -82,7 +82,7 @@ // static BrowserURLHandler::URLHandler BrowserURLHandler::null_handler() { // Required for VS2010: http://connect.microsoft.com/VisualStudio/feedback/details/520043/error-converting-from-null-to-a-pointer-type-in-std-pair - return NULL; + return nullptr; } // static
diff --git a/content/browser/browsing_data/storage_partition_http_cache_data_remover.cc b/content/browser/browsing_data/storage_partition_http_cache_data_remover.cc index a405c158..b427ca1 100644 --- a/content/browser/browsing_data/storage_partition_http_cache_data_remover.cc +++ b/content/browser/browsing_data/storage_partition_http_cache_data_remover.cc
@@ -160,12 +160,12 @@ base::Bind(&StoragePartitionHttpCacheDataRemover::DoClearCache, base::Unretained(this))); } - cache_ = NULL; + cache_ = nullptr; } break; } case CacheState::DONE: { - cache_ = NULL; + cache_ = nullptr; next_cache_state_ = CacheState::NONE; // Notify the UI thread that we are done.
diff --git a/content/browser/byte_stream.cc b/content/browser/byte_stream.cc index 0244811..48c6dbbd 100644 --- a/content/browser/byte_stream.cc +++ b/content/browser/byte_stream.cc
@@ -185,7 +185,7 @@ my_lifetime_flag_(lifetime_flag), input_contents_size_(0), output_size_used_(0), - peer_(NULL) { + peer_(nullptr) { DCHECK(my_lifetime_flag_.get()); my_lifetime_flag_->is_alive = true; } @@ -313,7 +313,7 @@ received_status_(false), status_(0), unreported_consumed_bytes_(0), - peer_(NULL) { + peer_(nullptr) { DCHECK(my_lifetime_flag_.get()); my_lifetime_flag_->is_alive = true; }
diff --git a/content/browser/cache_storage/cache_storage.cc b/content/browser/cache_storage/cache_storage.cc index 73bbfe4..31c9fb22e 100644 --- a/content/browser/cache_storage/cache_storage.cc +++ b/content/browser/cache_storage/cache_storage.cc
@@ -399,7 +399,7 @@ } // Atomically rename the temporary index file to become the real one. - return base::ReplaceFile(tmp_path, index_path, NULL); + return base::ReplaceFile(tmp_path, index_path, nullptr); } void LoadIndex(CacheStorageIndexLoadCallback callback) override {
diff --git a/content/browser/cache_storage/cache_storage_cache.cc b/content/browser/cache_storage/cache_storage_cache.cc index a20a008..1a8344c 100644 --- a/content/browser/cache_storage/cache_storage_cache.cc +++ b/content/browser/cache_storage/cache_storage_cache.cc
@@ -1369,7 +1369,7 @@ DCHECK(put_context->blob_data_handle); disk_cache::ScopedEntryPtr entry(std::move(put_context->cache_entry)); - put_context->cache_entry = NULL; + put_context->cache_entry = nullptr; auto blob_to_cache = std::make_unique<CacheStorageBlobToDiskCache>(); CacheStorageBlobToDiskCache* blob_to_cache_raw = blob_to_cache.get(); @@ -1647,7 +1647,7 @@ int rv = disk_cache::CreateCacheBackend( cache_type, net::CACHE_BACKEND_SIMPLE, path_, kMaxCacheBytes, false, /* force */ - NULL, backend, + nullptr, backend, base::BindOnce(&CacheStorageCache::DeleteBackendCompletedIO, weak_ptr_factory_.GetWeakPtr()), create_cache_callback);
diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc index 2819d9ff..892efb7 100644 --- a/content/browser/child_process_security_policy_impl.cc +++ b/content/browser/child_process_security_policy_impl.cc
@@ -1046,7 +1046,7 @@ // TODO(creis): We must pass the valid browser_context to convert hosted apps // URLs. Currently, hosted apps cannot set cookies in this mode. See // http://crbug.com/160576. - GURL site_url = SiteInstanceImpl::GetSiteForURL(NULL, url); + GURL site_url = SiteInstanceImpl::GetSiteForURL(nullptr, url); base::AutoLock lock(lock_); SecurityStateMap::iterator state = security_state_.find(child_id); @@ -1080,7 +1080,7 @@ void ChildProcessSecurityPolicyImpl::LockToOrigin(int child_id, const GURL& gurl) { // "gurl" can be currently empty in some cases, such as file://blah. - DCHECK(SiteInstanceImpl::GetSiteForURL(NULL, gurl) == gurl); + DCHECK(SiteInstanceImpl::GetSiteForURL(nullptr, gurl) == gurl); base::AutoLock lock(lock_); SecurityStateMap::iterator state = security_state_.find(child_id); DCHECK(state != security_state_.end());
diff --git a/content/browser/child_process_security_policy_unittest.cc b/content/browser/child_process_security_policy_unittest.cc index abad838..e49053d 100644 --- a/content/browser/child_process_security_policy_unittest.cc +++ b/content/browser/child_process_security_policy_unittest.cc
@@ -54,8 +54,7 @@ class ChildProcessSecurityPolicyTest : public testing::Test { public: - ChildProcessSecurityPolicyTest() : old_browser_client_(NULL) { - } + ChildProcessSecurityPolicyTest() : old_browser_client_(nullptr) {} void SetUp() override { old_browser_client_ = SetBrowserClientForTesting(&test_browser_client_);
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc index 85243f5..dff2818a 100644 --- a/content/browser/compositor/gpu_process_transport_factory.cc +++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -1055,7 +1055,7 @@ shared_main_thread_contexts_->RemoveObserver(this); scoped_refptr<ContextProvider> lost_shared_main_thread_contexts = shared_main_thread_contexts_; - shared_main_thread_contexts_ = NULL; + shared_main_thread_contexts_ = nullptr; std::unique_ptr<viz::GLHelper> lost_gl_helper = std::move(gl_helper_); @@ -1064,7 +1064,7 @@ // Kill things that use the shared context before killing the shared context. lost_gl_helper.reset(); - lost_shared_main_thread_contexts = NULL; + lost_shared_main_thread_contexts = nullptr; } scoped_refptr<viz::VulkanInProcessContextProvider>
diff --git a/content/browser/compositor/owned_mailbox.cc b/content/browser/compositor/owned_mailbox.cc index ecf7f3b..4313540 100644 --- a/content/browser/compositor/owned_mailbox.cc +++ b/content/browser/compositor/owned_mailbox.cc
@@ -34,7 +34,7 @@ gl_helper_->DeleteTexture(texture_id_); texture_id_ = 0; mailbox_holder_ = gpu::MailboxHolder(); - gl_helper_ = NULL; + gl_helper_ = nullptr; } void OwnedMailbox::OnLostResources() {
diff --git a/content/browser/compositor/software_browser_compositor_output_surface_unittest.cc b/content/browser/compositor/software_browser_compositor_output_surface_unittest.cc index f39783b1..c04fa2ab 100644 --- a/content/browser/compositor/software_browser_compositor_output_surface_unittest.cc +++ b/content/browser/compositor/software_browser_compositor_output_surface_unittest.cc
@@ -140,7 +140,7 @@ output_surface_->BindToClient(&output_surface_client); output_surface_->SwapBuffers(viz::OutputSurfaceFrame()); - EXPECT_EQ(NULL, output_surface_->software_device()->GetVSyncProvider()); + EXPECT_EQ(nullptr, output_surface_->software_device()->GetVSyncProvider()); EXPECT_EQ(0, update_vsync_parameters_call_count_); }
diff --git a/content/browser/devtools/devtools_agent_host_impl.cc b/content/browser/devtools/devtools_agent_host_impl.cc index 15bd37e..497472b 100644 --- a/content/browser/devtools/devtools_agent_host_impl.cc +++ b/content/browser/devtools/devtools_agent_host_impl.cc
@@ -113,11 +113,11 @@ // static scoped_refptr<DevToolsAgentHost> DevToolsAgentHost::GetForId( const std::string& id) { - if (g_devtools_instances == NULL) - return NULL; + if (g_devtools_instances == nullptr) + return nullptr; DevToolsMap::iterator it = g_devtools_instances.Get().find(id); if (it == g_devtools_instances.Get().end()) - return NULL; + return nullptr; return it->second; } @@ -264,7 +264,7 @@ } WebContents* DevToolsAgentHostImpl::GetWebContents() { - return NULL; + return nullptr; } void DevToolsAgentHostImpl::DisconnectWebContents() { @@ -305,7 +305,7 @@ // static void DevToolsAgentHost::DetachAllClients() { - if (g_devtools_instances == NULL) + if (g_devtools_instances == nullptr) return; // Make a copy, since detaching may lead to agent destruction, which
diff --git a/content/browser/devtools/devtools_http_handler.cc b/content/browser/devtools/devtools_http_handler.cc index 1f550cf2a..72ffe59 100644 --- a/content/browser/devtools/devtools_http_handler.cc +++ b/content/browser/devtools/devtools_http_handler.cc
@@ -494,9 +494,7 @@ std::string command; std::string target_id; if (!ParseJsonPath(path, &command, &target_id)) { - SendJson(connection_id, - net::HTTP_NOT_FOUND, - NULL, + SendJson(connection_id, net::HTTP_NOT_FOUND, nullptr, "Malformed query: " + info.path); return; } @@ -544,7 +542,7 @@ scoped_refptr<DevToolsAgentHost> agent_host = nullptr; agent_host = delegate_->CreateNewTarget(url); if (!agent_host) { - SendJson(connection_id, net::HTTP_INTERNAL_SERVER_ERROR, NULL, + SendJson(connection_id, net::HTTP_INTERNAL_SERVER_ERROR, nullptr, "Could not create new page"); return; } @@ -559,20 +557,16 @@ scoped_refptr<DevToolsAgentHost> agent_host = DevToolsAgentHost::GetForId(target_id); if (!agent_host) { - SendJson(connection_id, - net::HTTP_NOT_FOUND, - NULL, + SendJson(connection_id, net::HTTP_NOT_FOUND, nullptr, "No such target id: " + target_id); return; } if (command == "activate") { if (agent_host->Activate()) { - SendJson(connection_id, net::HTTP_OK, NULL, "Target activated"); + SendJson(connection_id, net::HTTP_OK, nullptr, "Target activated"); } else { - SendJson(connection_id, - net::HTTP_INTERNAL_SERVER_ERROR, - NULL, + SendJson(connection_id, net::HTTP_INTERNAL_SERVER_ERROR, nullptr, "Could not activate target id: " + target_id); } return; @@ -580,19 +574,15 @@ if (command == "close") { if (agent_host->Close()) { - SendJson(connection_id, net::HTTP_OK, NULL, "Target is closing"); + SendJson(connection_id, net::HTTP_OK, nullptr, "Target is closing"); } else { - SendJson(connection_id, - net::HTTP_INTERNAL_SERVER_ERROR, - NULL, + SendJson(connection_id, net::HTTP_INTERNAL_SERVER_ERROR, nullptr, "Could not close target id: " + target_id); } return; } } - SendJson(connection_id, - net::HTTP_NOT_FOUND, - NULL, + SendJson(connection_id, net::HTTP_NOT_FOUND, nullptr, "Unknown command: " + command); return; }
diff --git a/content/browser/devtools/devtools_manager_unittest.cc b/content/browser/devtools/devtools_manager_unittest.cc index 9c61be1d..e5e81e5a 100644 --- a/content/browser/devtools/devtools_manager_unittest.cc +++ b/content/browser/devtools/devtools_manager_unittest.cc
@@ -39,10 +39,7 @@ class TestDevToolsClientHost : public DevToolsAgentHostClient { public: - TestDevToolsClientHost() - : last_sent_message(NULL), - closed_(false) { - } + TestDevToolsClientHost() : last_sent_message(nullptr), closed_(false) {} ~TestDevToolsClientHost() override { EXPECT_TRUE(closed_); } @@ -169,7 +166,7 @@ base::RunLoop().Run(); EXPECT_TRUE(delegate.renderer_unresponsive_received()); - contents()->SetDelegate(NULL); + contents()->SetDelegate(nullptr); } TEST_F(DevToolsManagerTest, ReattachOnCancelPendingNavigation) {
diff --git a/content/browser/devtools/protocol/devtools_protocol_browsertest.cc b/content/browser/devtools/protocol/devtools_protocol_browsertest.cc index d12c6b8..24c8b35 100644 --- a/content/browser/devtools/protocol/devtools_protocol_browsertest.cc +++ b/content/browser/devtools/protocol/devtools_protocol_browsertest.cc
@@ -252,7 +252,7 @@ } bool HasValue(const std::string& path) { - base::Value* value = 0; + base::Value* value = nullptr; return result_->Get(path, &value); } @@ -1880,7 +1880,7 @@ EXPECT_TRUE(notifications_.empty()); WebContents::CreateParams create_params( - ShellContentBrowserClient::Get()->browser_context(), NULL); + ShellContentBrowserClient::Get()->browser_context(), nullptr); std::unique_ptr<content::WebContents> web_contents( content::WebContents::Create(create_params)); EXPECT_TRUE(notifications_.empty());
diff --git a/content/browser/devtools/protocol/tethering_handler.cc b/content/browser/devtools/protocol/tethering_handler.cc index 304af587..44f2102 100644 --- a/content/browser/devtools/protocol/tethering_handler.cc +++ b/content/browser/devtools/protocol/tethering_handler.cc
@@ -167,9 +167,8 @@ const CreateServerSocketCallback& socket_callback) : accepted_callback_(accepted_callback), socket_callback_(socket_callback), - socket_(new net::TCPServerSocket(NULL, net::NetLogSource())), - port_(0) { - } + socket_(new net::TCPServerSocket(nullptr, net::NetLogSource())), + port_(0) {} virtual ~BoundSocket() { }
diff --git a/content/browser/devtools/render_frame_devtools_agent_host.cc b/content/browser/devtools/render_frame_devtools_agent_host.cc index 0c196be..8db893a 100644 --- a/content/browser/devtools/render_frame_devtools_agent_host.cc +++ b/content/browser/devtools/render_frame_devtools_agent_host.cc
@@ -62,15 +62,15 @@ LAZY_INSTANCE_INITIALIZER; RenderFrameDevToolsAgentHost* FindAgentHost(FrameTreeNode* frame_tree_node) { - if (g_agent_host_instances == NULL) - return NULL; + if (g_agent_host_instances == nullptr) + return nullptr; for (RenderFrameDevToolsArray::iterator it = g_agent_host_instances.Get().begin(); it != g_agent_host_instances.Get().end(); ++it) { if ((*it)->frame_tree_node() == frame_tree_node) return *it; } - return NULL; + return nullptr; } bool ShouldCreateDevToolsForHost(RenderFrameHost* rfh) {
diff --git a/content/browser/devtools/shared_worker_devtools_manager_unittest.cc b/content/browser/devtools/shared_worker_devtools_manager_unittest.cc index 42a71b492..03ed973 100644 --- a/content/browser/devtools/shared_worker_devtools_manager_unittest.cc +++ b/content/browser/devtools/shared_worker_devtools_manager_unittest.cc
@@ -54,15 +54,15 @@ : browser_thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP), browser_context_(new TestBrowserContext()), partition_(new WorkerStoragePartition( - BrowserContext::GetDefaultStoragePartition(browser_context_.get())-> - GetURLRequestContext(), - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL)), + BrowserContext::GetDefaultStoragePartition(browser_context_.get()) + ->GetURLRequestContext(), + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr)), partition_id_(*partition_.get()) {} protected: @@ -135,7 +135,7 @@ CheckWorkerState(1, 2, WorkerState::WORKER_UNINSPECTED); manager_->WorkerDestroyed(1, 2); CheckWorkerState(1, 2, WorkerState::WORKER_TERMINATED); - agent_host = NULL; + agent_host = nullptr; CheckWorkerNotExist(1, 2); // Created -> Started -> GetDevToolsAgentHost -> Destroyed @@ -149,7 +149,7 @@ CheckWorkerState(1, 3, WorkerState::WORKER_UNINSPECTED); manager_->WorkerDestroyed(1, 3); CheckWorkerState(1, 3, WorkerState::WORKER_TERMINATED); - agent_host = NULL; + agent_host = nullptr; CheckWorkerNotExist(1, 3); // Created -> Destroyed @@ -168,7 +168,7 @@ CheckWorkerState(1, 5, WorkerState::WORKER_UNINSPECTED); manager_->WorkerDestroyed(1, 5); CheckWorkerState(1, 5, WorkerState::WORKER_TERMINATED); - agent_host = NULL; + agent_host = nullptr; CheckWorkerNotExist(1, 5); // Created -> GetDevToolsAgentHost -> Free agent_host -> Destroyed @@ -178,7 +178,7 @@ agent_host = manager_->GetDevToolsAgentHostForWorker(1, 6); EXPECT_TRUE(agent_host.get()); CheckWorkerState(1, 6, WorkerState::WORKER_UNINSPECTED); - agent_host = NULL; + agent_host = nullptr; manager_->WorkerDestroyed(1, 6); CheckWorkerNotExist(1, 6); } @@ -244,10 +244,10 @@ EXPECT_EQ(agent_host1.get(), manager_->GetDevToolsAgentHostForWorker(2, 3)); manager_->WorkerReadyForInspection(2, 3); CheckWorkerState(2, 3, WorkerState::WORKER_INSPECTED); - client_host1->InspectAgentHost(NULL); + client_host1->InspectAgentHost(nullptr); manager_->WorkerDestroyed(2, 3); CheckWorkerState(2, 3, WorkerState::WORKER_TERMINATED); - agent_host1 = NULL; + agent_host1 = nullptr; CheckWorkerNotExist(2, 3); // Re-created -> Destroyed @@ -265,9 +265,9 @@ CheckWorkerNotExist(2, 2); CheckWorkerState(2, 5, WorkerState::WORKER_PAUSED_FOR_REATTACH); EXPECT_EQ(agent_host2.get(), manager_->GetDevToolsAgentHostForWorker(2, 5)); - client_host2->InspectAgentHost(NULL); + client_host2->InspectAgentHost(nullptr); CheckWorkerCount(1); - agent_host2 = NULL; + agent_host2 = nullptr; CheckWorkerCount(1); manager_->WorkerDestroyed(2, 5); CheckWorkerCount(0); @@ -294,11 +294,11 @@ manager_->WorkerDestroyed(3, 1); CheckWorkerState(3, 1, WorkerState::WORKER_TERMINATED); // ClientHostClosing -> Re-created -> release agent_host -> Destroyed - client_host->InspectAgentHost(NULL); + client_host->InspectAgentHost(nullptr); CheckWorkerState(3, 1, WorkerState::WORKER_TERMINATED); manager_->WorkerCreated(3, 2, instance); CheckWorkerState(3, 2, WorkerState::WORKER_UNINSPECTED); - agent_host = NULL; + agent_host = nullptr; CheckWorkerState(3, 2, WorkerState::WORKER_UNINSPECTED); manager_->WorkerDestroyed(3, 2); CheckWorkerNotExist(3, 2);
diff --git a/content/browser/dom_storage/dom_storage_area.cc b/content/browser/dom_storage/dom_storage_area.cc index 5da5949..2e4a765e 100644 --- a/content/browser/dom_storage/dom_storage_area.cc +++ b/content/browser/dom_storage/dom_storage_area.cc
@@ -449,7 +449,7 @@ PopulateCommitBatchValues(); } - map_ = NULL; + map_ = nullptr; if (!backing_) return; @@ -735,7 +735,7 @@ } commit_batches_.clear(); backing_.reset(); - session_storage_backing_ = NULL; + session_storage_backing_ = nullptr; } } // namespace content
diff --git a/content/browser/dom_storage/dom_storage_area_unittest.cc b/content/browser/dom_storage/dom_storage_area_unittest.cc index 4fd7d350..b96f5cc 100644 --- a/content/browser/dom_storage/dom_storage_area_unittest.cc +++ b/content/browser/dom_storage/dom_storage_area_unittest.cc
@@ -105,7 +105,7 @@ TEST_P(DOMStorageAreaParamTest, DOMStorageAreaBasics) { scoped_refptr<DOMStorageArea> area( - new DOMStorageArea(1, std::string(), NULL, kOrigin, NULL, NULL)); + new DOMStorageArea(1, std::string(), nullptr, kOrigin, nullptr, nullptr)); const bool values_cached = GetParam(); area->SetCacheOnlyKeys(!values_cached); base::string16 old_value; @@ -175,8 +175,8 @@ // No directory, backing should be null. { scoped_refptr<DOMStorageArea> area( - new DOMStorageArea(kOrigin, base::FilePath(), NULL)); - EXPECT_EQ(NULL, area->backing_.get()); + new DOMStorageArea(kOrigin, base::FilePath(), nullptr)); + EXPECT_EQ(nullptr, area->backing_.get()); EXPECT_EQ(DOMStorageArea::LOAD_STATE_KEYS_AND_VALUES, area->load_state_); EXPECT_FALSE(base::PathExists(kExpectedOriginFilePath)); } @@ -184,16 +184,17 @@ // Valid directory and origin but no session storage backing. Backing should // be null. { - scoped_refptr<DOMStorageArea> area(new DOMStorageArea( - kSessionStorageNamespaceId, std::string(), NULL, kOrigin, NULL, NULL)); - EXPECT_EQ(NULL, area->backing_.get()); + scoped_refptr<DOMStorageArea> area( + new DOMStorageArea(kSessionStorageNamespaceId, std::string(), nullptr, + kOrigin, nullptr, nullptr)); + EXPECT_EQ(nullptr, area->backing_.get()); base::NullableString16 old_value; EXPECT_TRUE(area->SetItem(kKey, kValue, old_value, &old_value)); ASSERT_TRUE(old_value.is_null()); // Check that saving a value has still left us without a backing database. - EXPECT_EQ(NULL, area->backing_.get()); + EXPECT_EQ(nullptr, area->backing_.get()); EXPECT_FALSE(base::PathExists(kExpectedOriginFilePath)); } @@ -243,7 +244,7 @@ scoped_refptr<SessionStorageDatabase> db = new SessionStorageDatabase(temp_dir.GetPath()); scoped_refptr<DOMStorageArea> area(new DOMStorageArea( - 1, kNamespaceId, NULL, kOrigin, db.get(), + 1, kNamespaceId, nullptr, kOrigin, db.get(), new MockDOMStorageTaskRunner(base::ThreadTaskRunnerHandle::Get().get()))); EXPECT_TRUE(area->backing_.get()); EXPECT_TRUE(area->session_storage_backing_); @@ -306,7 +307,7 @@ TEST_F(DOMStorageAreaTest, SetCacheOnlyKeysWithoutBacking) { scoped_refptr<DOMStorageArea> area( - new DOMStorageArea(1, std::string(), NULL, kOrigin, NULL, NULL)); + new DOMStorageArea(1, std::string(), nullptr, kOrigin, nullptr, nullptr)); EXPECT_EQ(DOMStorageArea::LOAD_STATE_KEYS_AND_VALUES, area->desired_load_state_); EXPECT_FALSE(area->map_->has_only_keys());
diff --git a/content/browser/dom_storage/dom_storage_context_impl.cc b/content/browser/dom_storage/dom_storage_context_impl.cc index 48911300..adc1d1a 100644 --- a/content/browser/dom_storage/dom_storage_context_impl.cc +++ b/content/browser/dom_storage/dom_storage_context_impl.cc
@@ -107,7 +107,7 @@ // shouldn't happen on this thread. SessionStorageDatabase* to_release = session_storage_database_.get(); to_release->AddRef(); - session_storage_database_ = NULL; + session_storage_database_ = nullptr; task_runner_->PostShutdownBlockingTask( FROM_HERE, DOMStorageTaskRunner::COMMIT_SEQUENCE, base::BindOnce(&SessionStorageDatabase::Release, @@ -118,7 +118,7 @@ DOMStorageNamespace* DOMStorageContextImpl::GetStorageNamespace( int64_t namespace_id) { if (is_shutdown_) - return NULL; + return nullptr; StorageNamespaceMap::iterator found = namespaces_.find(namespace_id); if (found == namespaces_.end()) { if (namespace_id == kLocalStorageNamespaceId) { @@ -134,7 +134,7 @@ namespaces_[kLocalStorageNamespaceId] = local; return local; } - return NULL; + return nullptr; } return found->second.get(); } @@ -243,7 +243,7 @@ void DOMStorageContextImpl::DeleteSessionStorage( const SessionStorageUsageInfo& usage_info) { DCHECK(!is_shutdown_); - DOMStorageNamespace* dom_storage_namespace = NULL; + DOMStorageNamespace* dom_storage_namespace = nullptr; std::map<std::string, int64_t>::const_iterator it = persistent_namespace_id_to_namespace_id_.find( usage_info.persistent_namespace_id);
diff --git a/content/browser/dom_storage/dom_storage_context_impl_unittest.cc b/content/browser/dom_storage/dom_storage_context_impl_unittest.cc index eb4587c..893cd8a 100644 --- a/content/browser/dom_storage/dom_storage_context_impl_unittest.cc +++ b/content/browser/dom_storage/dom_storage_context_impl_unittest.cc
@@ -63,7 +63,7 @@ void VerifySingleOriginRemains(const GURL& origin) { // Use a new instance to examine the contexts of temp_dir_. scoped_refptr<DOMStorageContextImpl> context = new DOMStorageContextImpl( - temp_dir_.GetPath(), base::FilePath(), NULL, NULL); + temp_dir_.GetPath(), base::FilePath(), nullptr, nullptr); std::vector<LocalStorageUsageInfo> infos; context->GetLocalStorageUsage(&infos, kDontIncludeFileInfo); ASSERT_EQ(1u, infos.size()); @@ -115,13 +115,13 @@ ->OpenStorageArea(kOrigin) ->SetItem(kKey, kValue, old_value, &old_value)); context_->Shutdown(); - context_ = NULL; + context_ = nullptr; base::RunLoop().RunUntilIdle(); // Create a new context that points to the same directory, see that // it knows about the origin that we stored data for. context_ = new DOMStorageContextImpl(temp_dir_.GetPath(), base::FilePath(), - NULL, NULL); + nullptr, nullptr); context_->GetLocalStorageUsage(&infos, kDontIncludeFileInfo); EXPECT_EQ(1u, infos.size()); EXPECT_EQ(kOrigin, infos[0].origin); @@ -150,7 +150,7 @@ ->OpenStorageArea(kSessionOnlyOrigin) ->SetItem(kKey, kValue, old_value, &old_value)); context_->Shutdown(); - context_ = NULL; + context_ = nullptr; base::RunLoop().RunUntilIdle(); // Verify that the session-only origin data is gone. @@ -169,7 +169,7 @@ ->SetItem(kKey, kValue, old_value, &old_value)); context_->SetForceKeepSessionState(); // Should override clear behavior. context_->Shutdown(); - context_ = NULL; + context_ = nullptr; base::RunLoop().RunUntilIdle(); VerifySingleOriginRemains(kSessionOnlyOrigin); @@ -229,7 +229,7 @@ // Destroy and recreate the DOMStorageContextImpl. context_->Shutdown(); - context_ = NULL; + context_ = nullptr; base::RunLoop().RunUntilIdle(); context_ = new DOMStorageContextImpl(temp_dir_.GetPath(), temp_dir_.GetPath(), @@ -252,7 +252,7 @@ // Destroy and recreate again. context_->Shutdown(); - context_ = NULL; + context_ = nullptr; base::RunLoop().RunUntilIdle(); context_ = new DOMStorageContextImpl(temp_dir_.GetPath(), temp_dir_.GetPath(), @@ -268,7 +268,7 @@ EXPECT_EQ(0u, area->Length()); dom_namespace->CloseStorageArea(area); context_->Shutdown(); - context_ = NULL; + context_ = nullptr; base::RunLoop().RunUntilIdle(); }
diff --git a/content/browser/dom_storage/dom_storage_database.cc b/content/browser/dom_storage/dom_storage_database.cc index 2f47c3af..5bf7d94 100644 --- a/content/browser/dom_storage/dom_storage_database.cc +++ b/content/browser/dom_storage/dom_storage_database.cc
@@ -304,7 +304,7 @@ } void DOMStorageDatabase::Close() { - db_.reset(NULL); + db_.reset(nullptr); } } // namespace content
diff --git a/content/browser/dom_storage/dom_storage_host.cc b/content/browser/dom_storage/dom_storage_host.cc index a509f08..3f060d3 100644 --- a/content/browser/dom_storage/dom_storage_host.cc +++ b/content/browser/dom_storage/dom_storage_host.cc
@@ -155,14 +155,14 @@ DOMStorageArea* DOMStorageHost::GetOpenArea(int connection_id) const { const auto found = connections_.find(connection_id); if (found == connections_.end()) - return NULL; + return nullptr; return found->second.area_.get(); } DOMStorageNamespace* DOMStorageHost::GetNamespace(int connection_id) const { const auto found = connections_.find(connection_id); if (found == connections_.end()) - return NULL; + return nullptr; return found->second.namespace_.get(); }
diff --git a/content/browser/dom_storage/dom_storage_message_filter.cc b/content/browser/dom_storage/dom_storage_message_filter.cc index 70315b7..6c823a6 100644 --- a/content/browser/dom_storage/dom_storage_message_filter.cc +++ b/content/browser/dom_storage/dom_storage_message_filter.cc
@@ -61,7 +61,7 @@ const IPC::Message& message) { if (IPC_MESSAGE_CLASS(message) == DOMStorageMsgStart) return context_->task_runner(); - return NULL; + return nullptr; } bool DOMStorageMessageFilter::OnMessageReceived(const IPC::Message& message) {
diff --git a/content/browser/dom_storage/dom_storage_namespace.cc b/content/browser/dom_storage/dom_storage_namespace.cc index 5a44fb6..09a3746 100644 --- a/content/browser/dom_storage/dom_storage_namespace.cc +++ b/content/browser/dom_storage/dom_storage_namespace.cc
@@ -72,7 +72,7 @@ AreaHolder* holder = GetAreaHolder(origin); if (holder && holder->open_count_) return holder->area_.get(); - return NULL; + return nullptr; } DOMStorageNamespace* DOMStorageNamespace::Clone( @@ -215,7 +215,7 @@ DOMStorageNamespace::GetAreaHolder(const GURL& origin) { AreaMap::iterator found = areas_.find(origin); if (found == areas_.end()) - return NULL; + return nullptr; return &(found->second); }
diff --git a/content/browser/dom_storage/session_storage_database.cc b/content/browser/dom_storage/session_storage_database.cc index 5e558d3c..c5e0981 100644 --- a/content/browser/dom_storage/session_storage_database.cc +++ b/content/browser/dom_storage/session_storage_database.cc
@@ -462,7 +462,7 @@ } bool SessionStorageDatabase::IsOpen() const { - return db_.get() != NULL; + return db_.get() != nullptr; } bool SessionStorageDatabase::CallerErrorCheck(bool ok) const {
diff --git a/content/browser/download/download_browsertest.cc b/content/browser/download/download_browsertest.cc index 7b0df1cf..b4ee77496 100644 --- a/content/browser/download/download_browsertest.cc +++ b/content/browser/download/download_browsertest.cc
@@ -127,7 +127,7 @@ MockManagerGoingDown(manager); manager_->RemoveObserver(this); - manager_ = NULL; + manager_ = nullptr; } MOCK_METHOD1(MockManagerGoingDown, void(DownloadManager*)); @@ -515,20 +515,20 @@ class DownloadCreateObserver : DownloadManager::Observer { public: DownloadCreateObserver(DownloadManager* manager) - : manager_(manager), item_(NULL) { + : manager_(manager), item_(nullptr) { manager_->AddObserver(this); } ~DownloadCreateObserver() override { if (manager_) manager_->RemoveObserver(this); - manager_ = NULL; + manager_ = nullptr; } void ManagerGoingDown(DownloadManager* manager) override { DCHECK_EQ(manager_, manager); manager_->RemoveObserver(this); - manager_ = NULL; + manager_ = nullptr; } void OnDownloadCreated(DownloadManager* manager,
diff --git a/content/browser/download/download_file_unittest.cc b/content/browser/download/download_file_unittest.cc index 7e29d5b..583e1638 100644 --- a/content/browser/download/download_file_unittest.cc +++ b/content/browser/download/download_file_unittest.cc
@@ -165,7 +165,7 @@ DownloadFileTest() : observer_(new StrictMock<MockDownloadDestinationObserver>), observer_factory_(observer_.get()), - input_stream_(NULL), + input_stream_(nullptr), additional_streams_( std::vector<StrictMock<MockByteStreamReader>*>{nullptr, nullptr}), bytes_(-1), @@ -653,7 +653,7 @@ base::WriteFile(path_1, file_data, sizeof(file_data))); ASSERT_TRUE(base::PathExists(path_1)); - EXPECT_EQ(DOWNLOAD_INTERRUPT_REASON_NONE, RenameAndUniquify(path_1, NULL)); + EXPECT_EQ(DOWNLOAD_INTERRUPT_REASON_NONE, RenameAndUniquify(path_1, nullptr)); EXPECT_TRUE(base::PathExists(path_1_suffixed)); FinishStream(DOWNLOAD_INTERRUPT_REASON_NONE, true, kEmptyHash); @@ -704,7 +704,7 @@ // Expect nulling out of further processing. EXPECT_CALL(*input_stream_, RegisterCallback(IsNullCallback())); - ExpectPermissionError(InvokeSelectedRenameMethod(target_path, NULL)); + ExpectPermissionError(InvokeSelectedRenameMethod(target_path, nullptr)); EXPECT_FALSE(base::PathExists(target_path_suffixed)); } @@ -814,7 +814,7 @@ // Test that calling the sink_callback_ on an empty stream shouldn't // do anything. - AppendDataToFile(NULL, 0); + AppendDataToFile(nullptr, 0); // Finish the download this way and make sure we see it on the observer. FinishStream(DOWNLOAD_INTERRUPT_REASON_NONE, true, kEmptyHash);
diff --git a/content/browser/download/download_item_impl_delegate.cc b/content/browser/download/download_item_impl_delegate.cc index 2e3367a..7619c32b8 100644 --- a/content/browser/download/download_item_impl_delegate.cc +++ b/content/browser/download/download_item_impl_delegate.cc
@@ -65,7 +65,7 @@ uint32_t id) {} BrowserContext* DownloadItemImplDelegate::GetBrowserContext() const { - return NULL; + return nullptr; } void DownloadItemImplDelegate::UpdatePersistence(DownloadItemImpl* download) {}
diff --git a/content/browser/download/download_item_impl_unittest.cc b/content/browser/download/download_item_impl_unittest.cc index 8bee210..0797c3c1 100644 --- a/content/browser/download/download_item_impl_unittest.cc +++ b/content/browser/download/download_item_impl_unittest.cc
@@ -1242,7 +1242,7 @@ DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED), 1); EXPECT_EQ(target_path, item->GetTargetFilePath()); - CleanupItem(item, NULL, DownloadItem::INTERRUPTED); + CleanupItem(item, nullptr, DownloadItem::INTERRUPTED); } // Test that the delegate is invoked after the download file is renamed.
diff --git a/content/browser/download/download_manager_impl_unittest.cc b/content/browser/download/download_manager_impl_unittest.cc index c2b0de35a..01b76bd 100644 --- a/content/browser/download/download_manager_impl_unittest.cc +++ b/content/browser/download/download_manager_impl_unittest.cc
@@ -183,13 +183,13 @@ MockDownloadItemImpl* MockDownloadItemFactory::GetItem(int id) { if (items_.find(id) == items_.end()) - return NULL; + return nullptr; return items_[id]; } MockDownloadItemImpl* MockDownloadItemFactory::PopItem() { if (items_.empty()) - return NULL; + return nullptr; std::map<uint32_t, MockDownloadItemImpl*>::iterator first_item = items_.begin();
diff --git a/content/browser/download/download_request_core.cc b/content/browser/download/download_request_core.cc index 0e9499a2..ce0f576 100644 --- a/content/browser/download/download_request_core.cc +++ b/content/browser/download/download_request_core.cc
@@ -330,7 +330,7 @@ last_stream_pause_time_ = base::TimeTicks::Now(); } - read_buffer_ = NULL; // Drop our reference. + read_buffer_ = nullptr; // Drop our reference. if (pause_count_ > 0) *defer = was_deferred_ = true;
diff --git a/content/browser/download/drag_download_file.cc b/content/browser/download/drag_download_file.cc index da0ab7b..da99ae7 100644 --- a/content/browser/download/drag_download_file.cc +++ b/content/browser/download/drag_download_file.cc
@@ -52,7 +52,7 @@ referrer_(referrer), referrer_encoding_(referrer_encoding), web_contents_(web_contents), - download_item_(NULL), + download_item_(nullptr), weak_ptr_factory_(this) { DCHECK(on_completed_task_runner_); DCHECK(!on_completed_.is_null()); @@ -151,7 +151,7 @@ on_completed_.Reset(); } download_item_->RemoveObserver(this); - download_item_ = NULL; + download_item_ = nullptr; } // Ignore other states. } @@ -167,7 +167,7 @@ on_completed_.Reset(); } download_item_->RemoveObserver(this); - download_item_ = NULL; + download_item_ = nullptr; } scoped_refptr<base::SingleThreadTaskRunner> const on_completed_task_runner_; @@ -194,7 +194,7 @@ file_(std::move(file)), drag_task_runner_(base::ThreadTaskRunnerHandle::Get()), state_(INITIALIZED), - drag_ui_(NULL), + drag_ui_(nullptr), weak_ptr_factory_(this) { drag_ui_ = new DragDownloadFileUI( url, referrer, referrer_encoding, web_contents, drag_task_runner_, @@ -213,7 +213,7 @@ BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::BindOnce(&DragDownloadFileUI::Delete, base::Unretained(drag_ui_))); - drag_ui_ = NULL; + drag_ui_ = nullptr; } void DragDownloadFile::Start(ui::DownloadFileObserver* observer) { @@ -260,7 +260,7 @@ observer_->OnDownloadAborted(); // Release the observer since we do not need it any more. - observer_ = NULL; + observer_ = nullptr; if (nested_loop_.running()) nested_loop_.Quit();
diff --git a/content/browser/download/drag_download_util.cc b/content/browser/download/drag_download_util.cc index 5e37610..0996ac7 100644 --- a/content/browser/download/drag_download_util.cc +++ b/content/browser/download/drag_download_util.cc
@@ -109,7 +109,7 @@ void PromiseFileFinalizer::Cleanup() { if (drag_file_downloader_.get()) - drag_file_downloader_ = NULL; + drag_file_downloader_ = nullptr; } } // namespace content
diff --git a/content/browser/download/save_file_manager.cc b/content/browser/download/save_file_manager.cc index 6473cd1..44046744 100644 --- a/content/browser/download/save_file_manager.cc +++ b/content/browser/download/save_file_manager.cc
@@ -327,7 +327,7 @@ policy_exception_justification: "Not implemented." })"); std::unique_ptr<net::URLRequest> request(request_context->CreateRequest( - url, net::DEFAULT_PRIORITY, NULL, traffic_annotation)); + url, net::DEFAULT_PRIORITY, nullptr, traffic_annotation)); request->set_method("GET"); // The URLRequest needs to be initialized with the referrer and other
diff --git a/content/browser/fileapi/browser_file_system_helper.cc b/content/browser/fileapi/browser_file_system_helper.cc index 23f303a4..fb3533d5 100644 --- a/content/browser/fileapi/browser_file_system_helper.cc +++ b/content/browser/fileapi/browser_file_system_helper.cc
@@ -61,7 +61,7 @@ switches::kAllowFileAccessFromFiles)) { additional_allowed_schemes.push_back(url::kFileScheme); } - return FileSystemOptions(profile_mode, additional_allowed_schemes, NULL); + return FileSystemOptions(profile_mode, additional_allowed_schemes, nullptr); } } // namespace @@ -110,7 +110,7 @@ if (!url.is_valid()) return false; - return context->GetFileSystemBackend(url.type()) != NULL; + return context->GetFileSystemBackend(url.type()) != nullptr; } void SyncGetPlatformPath(storage::FileSystemContext* context,
diff --git a/content/browser/fileapi/fileapi_message_filter.cc b/content/browser/fileapi/fileapi_message_filter.cc index a4ad98a7..f2727575f 100644 --- a/content/browser/fileapi/fileapi_message_filter.cc +++ b/content/browser/fileapi/fileapi_message_filter.cc
@@ -75,7 +75,7 @@ context_(file_system_context), security_policy_(ChildProcessSecurityPolicyImpl::GetInstance()), request_context_getter_(request_context_getter), - request_context_(NULL), + request_context_(nullptr), blob_storage_context_(blob_storage_context) { DCHECK(context_); DCHECK(request_context_getter_.get()); @@ -105,7 +105,7 @@ if (request_context_getter_.get()) { DCHECK(!request_context_); request_context_ = request_context_getter_->GetURLRequestContext(); - request_context_getter_ = NULL; + request_context_getter_ = nullptr; DCHECK(request_context_); } @@ -125,7 +125,7 @@ const IPC::Message& message) { if (message.type() == FileSystemHostMsg_SyncGetPlatformPath::ID) return context_->default_file_task_runner(); - return NULL; + return nullptr; } bool FileAPIMessageFilter::OnMessageReceived(const IPC::Message& message) {
diff --git a/content/browser/fileapi/fileapi_message_filter_unittest.cc b/content/browser/fileapi/fileapi_message_filter_unittest.cc index 18eef3b..0c6ee25 100644 --- a/content/browser/fileapi/fileapi_message_filter_unittest.cc +++ b/content/browser/fileapi/fileapi_message_filter_unittest.cc
@@ -43,7 +43,7 @@ protected: void SetUp() override { file_system_context_ = - CreateFileSystemContextForTesting(NULL, base::FilePath()); + CreateFileSystemContextForTesting(nullptr, base::FilePath()); std::vector<storage::FileSystemType> types; file_system_context_->GetFileSystemTypes(&types);
diff --git a/content/browser/frame_host/interstitial_page_impl.cc b/content/browser/frame_host/interstitial_page_impl.cc index c86530f5..2f24f1b 100644 --- a/content/browser/frame_host/interstitial_page_impl.cc +++ b/content/browser/frame_host/interstitial_page_impl.cc
@@ -131,7 +131,7 @@ InterstitialPageMap::const_iterator iter = g_web_contents_to_interstitial_page->find(web_contents); if (iter == g_web_contents_to_interstitial_page->end()) - return NULL; + return nullptr; return iter->second; } @@ -160,7 +160,7 @@ should_discard_pending_nav_entry_(new_navigation), enabled_(true), action_taken_(NO_ACTION), - render_view_host_(NULL), + render_view_host_(nullptr), // TODO(nasko): The InterstitialPageImpl will need to provide its own // NavigationControllerImpl to the Navigator, which is separate from // the WebContents one, so we can enforce no navigation policy here. @@ -297,7 +297,7 @@ weak_ptr_factory_.GetWeakPtr())); bool has_focus = render_view_host_->GetWidget()->GetView() && render_view_host_->GetWidget()->GetView()->HasFocus(); - render_view_host_ = NULL; + render_view_host_ = nullptr; frame_tree_->root()->ResetForNewProcess(); controller_->delegate()->DetachInterstitialPage(has_focus); // Let's revert to the original title if necessary. @@ -315,7 +315,7 @@ // Clear the WebContents pointer, because it may now be deleted. // This signifies that we are in the process of shutting down. - web_contents_ = NULL; + web_contents_ = nullptr; } void InterstitialPageImpl::Observe( @@ -583,7 +583,7 @@ RenderViewHostImpl* InterstitialPageImpl::CreateRenderViewHost() { if (!enabled()) - return NULL; + return nullptr; // Interstitial pages don't want to share the session storage so we mint a // new one. @@ -609,7 +609,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() { if (!enabled() || !create_view_) - return NULL; + return nullptr; WebContentsView* wcv = static_cast<WebContentsImpl*>(web_contents())->GetView(); RenderWidgetHostViewBase* view =
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc index 59820f26..4cf5056 100644 --- a/content/browser/frame_host/navigation_controller_impl.cc +++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -197,12 +197,9 @@ &loaded_url, browser_context, &reverse_on_redirect); NavigationEntryImpl* entry = new NavigationEntryImpl( - NULL, // The site instance for tabs is sent on navigation - // (WebContents::GetSiteInstance). - loaded_url, - referrer, - base::string16(), - transition, + nullptr, // The site instance for tabs is sent on navigation + // (WebContents::GetSiteInstance). + loaded_url, referrer, base::string16(), transition, is_renderer_initiated); entry->SetVirtualURL(dest_url); entry->set_user_typed_url(dest_url); @@ -309,7 +306,7 @@ return; } - NavigationEntryImpl* entry = NULL; + NavigationEntryImpl* entry = nullptr; int current_index = -1; // If we are reloading the initial navigation, just use the current @@ -516,7 +513,7 @@ NavigationEntryImpl* NavigationControllerImpl::GetLastCommittedEntry() const { if (last_committed_entry_index_ == -1) - return NULL; + return nullptr; return entries_[last_committed_entry_index_].get(); } @@ -1805,7 +1802,7 @@ SessionStorageNamespace* NavigationControllerImpl::GetDefaultSessionStorageNamespace() { // TODO(ajwong): Remove if statement in GetSessionStorageNamespace(). - return GetSessionStorageNamespace(NULL); + return GetSessionStorageNamespace(nullptr); } const SessionStorageNamespaceMap& @@ -2263,7 +2260,7 @@ NavigationEntryImpl* NavigationControllerImpl::GetTransientEntry() const { if (transient_entry_index_ == -1) - return NULL; + return nullptr; return entries_[transient_entry_index_].get(); }
diff --git a/content/browser/frame_host/navigation_controller_impl_browsertest.cc b/content/browser/frame_host/navigation_controller_impl_browsertest.cc index 191725b9..fcb3421 100644 --- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc +++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -6668,7 +6668,7 @@ : WebContentsObserver(web_contents), expected_url_(expected_url), message_loop_runner_(new MessageLoopRunner) { - EXPECT_TRUE(web_contents != NULL); + EXPECT_TRUE(web_contents != nullptr); } void Wait() { message_loop_runner_->Run(); }
diff --git a/content/browser/frame_host/navigation_controller_impl_unittest.cc b/content/browser/frame_host/navigation_controller_impl_unittest.cc index aea5a4e..0c4a532 100644 --- a/content/browser/frame_host/navigation_controller_impl_unittest.cc +++ b/content/browser/frame_host/navigation_controller_impl_unittest.cc
@@ -867,7 +867,8 @@ params.transition = ui::PAGE_TRANSITION_TYPED; params.method = "POST"; params.post_id = 123; - params.page_state = PageState::CreateForTesting(url1, false, 0, 0); + params.page_state = + PageState::CreateForTesting(url1, false, nullptr, nullptr); main_test_rfh()->PrepareForCommit(); main_test_rfh()->SendNavigateWithParams(¶ms); @@ -1196,7 +1197,7 @@ EXPECT_EQ(-1, controller.GetLastCommittedEntryIndex()); EXPECT_EQ(2, delegate->navigation_state_change_count()); - contents()->SetDelegate(NULL); + contents()->SetDelegate(nullptr); } // Tests that the pending entry state is correct after an abort. @@ -1249,7 +1250,7 @@ EXPECT_EQ(pending_entry, controller.GetPendingEntry()); EXPECT_EQ(-1, controller.GetLastCommittedEntryIndex()); - contents()->SetDelegate(NULL); + contents()->SetDelegate(nullptr); } // Tests that the pending URL is not visible during a renderer-initiated @@ -1316,7 +1317,7 @@ // so that no spoof is possible. EXPECT_EQ(kExistingURL, controller.GetVisibleEntry()->GetURL()); - contents()->SetDelegate(NULL); + contents()->SetDelegate(nullptr); } // Ensure that NavigationEntries track which bindings their RenderViewHost had
diff --git a/content/browser/frame_host/navigation_entry_impl_unittest.cc b/content/browser/frame_host/navigation_entry_impl_unittest.cc index c255cda3ff..328727d 100644 --- a/content/browser/frame_host/navigation_entry_impl_unittest.cc +++ b/content/browser/frame_host/navigation_entry_impl_unittest.cc
@@ -46,13 +46,12 @@ class NavigationEntryTest : public testing::Test { public: - NavigationEntryTest() : instance_(NULL) { - } + NavigationEntryTest() : instance_(nullptr) {} void SetUp() override { entry1_.reset(new NavigationEntryImpl); - instance_ = SiteInstanceImpl::Create(NULL); + instance_ = SiteInstanceImpl::Create(nullptr); entry2_.reset(new NavigationEntryImpl( instance_, GURL("test:url"), Referrer(GURL("from"), blink::kWebReferrerPolicyDefault), @@ -194,7 +193,7 @@ // Test other basic accessors TEST_F(NavigationEntryTest, NavigationEntryAccessors) { // SiteInstance - EXPECT_TRUE(entry1_->site_instance() == NULL); + EXPECT_TRUE(entry1_->site_instance() == nullptr); EXPECT_EQ(instance_, entry2_->site_instance()); entry1_->set_site_instance(instance_); EXPECT_EQ(instance_, entry1_->site_instance());
diff --git a/content/browser/frame_host/navigation_entry_screenshot_manager.cc b/content/browser/frame_host/navigation_entry_screenshot_manager.cc index 46b61da..5ea71b3 100644 --- a/content/browser/frame_host/navigation_entry_screenshot_manager.cc +++ b/content/browser/frame_host/navigation_entry_screenshot_manager.cc
@@ -183,7 +183,7 @@ if (!entry->screenshot().get()) return false; - entry->SetScreenshotPNGData(NULL); + entry->SetScreenshotPNGData(nullptr); return true; }
diff --git a/content/browser/frame_host/navigator.cc b/content/browser/frame_host/navigator.cc index c1fc47b..f6cd6d0c 100644 --- a/content/browser/frame_host/navigator.cc +++ b/content/browser/frame_host/navigator.cc
@@ -14,7 +14,7 @@ } NavigationController* Navigator::GetController() { - return NULL; + return nullptr; } bool Navigator::NavigateToPendingEntry(FrameTreeNode* frame_tree_node,
diff --git a/content/browser/frame_host/navigator_impl_unittest.cc b/content/browser/frame_host/navigator_impl_unittest.cc index 5aae89f9..d2b38662 100644 --- a/content/browser/frame_host/navigator_impl_unittest.cc +++ b/content/browser/frame_host/navigator_impl_unittest.cc
@@ -882,7 +882,7 @@ int entry_id = controller().GetPendingEntry()->GetUniqueID(); // A NavigationRequest should have been generated. NavigationRequest* main_request = node->navigation_request(); - ASSERT_TRUE(main_request != NULL); + ASSERT_TRUE(main_request != nullptr); EXPECT_EQ(FrameMsg_Navigate_Type::RELOAD, main_request->common_params().navigation_type); main_test_rfh()->PrepareForCommit(); @@ -895,7 +895,7 @@ controller().Reload(ReloadType::BYPASSING_CACHE, false); // A NavigationRequest should have been generated. main_request = node->navigation_request(); - ASSERT_TRUE(main_request != NULL); + ASSERT_TRUE(main_request != nullptr); EXPECT_EQ(FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE, main_request->common_params().navigation_type); main_test_rfh()->PrepareForCommit();
diff --git a/content/browser/frame_host/render_frame_host_delegate.cc b/content/browser/frame_host/render_frame_host_delegate.cc index 7f23cd1..d2d2723 100644 --- a/content/browser/frame_host/render_frame_host_delegate.cc +++ b/content/browser/frame_host/render_frame_host_delegate.cc
@@ -34,7 +34,7 @@ } WebContents* RenderFrameHostDelegate::GetAsWebContents() { - return NULL; + return nullptr; } InterstitialPage* RenderFrameHostDelegate::GetAsInterstitialPage() {
diff --git a/content/browser/frame_host/render_frame_host_factory.cc b/content/browser/frame_host/render_frame_host_factory.cc index f94453e..4276b86 100644 --- a/content/browser/frame_host/render_frame_host_factory.cc +++ b/content/browser/frame_host/render_frame_host_factory.cc
@@ -12,7 +12,7 @@ namespace content { // static -RenderFrameHostFactory* RenderFrameHostFactory::factory_ = NULL; +RenderFrameHostFactory* RenderFrameHostFactory::factory_ = nullptr; // static std::unique_ptr<RenderFrameHostImpl> RenderFrameHostFactory::Create( @@ -47,7 +47,7 @@ // static void RenderFrameHostFactory::UnregisterFactory() { DCHECK(factory_) << "No factory to unregister."; - factory_ = NULL; + factory_ = nullptr; } } // namespace content
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc index 9d2145d..e044cac5 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -694,7 +694,7 @@ gfx::NativeView RenderFrameHostImpl::GetNativeView() { RenderWidgetHostView* view = render_view_host_->GetWidget()->GetView(); if (!view) - return NULL; + return nullptr; return view->GetNativeView(); } @@ -1017,7 +1017,7 @@ } void RenderFrameHostImpl::AccessibilityFatalError() { - browser_accessibility_manager_.reset(NULL); + browser_accessibility_manager_.reset(nullptr); if (accessibility_reset_token_) return; @@ -1051,7 +1051,7 @@ render_view_host_->GetWidget()->GetView()); if (view) return view->AccessibilityGetNativeViewAccessible(); - return NULL; + return nullptr; } void RenderFrameHostImpl::RenderProcessGone(SiteInstanceImpl* site_instance) {
diff --git a/content/browser/frame_host/render_frame_host_manager_browsertest.cc b/content/browser/frame_host/render_frame_host_manager_browsertest.cc index 58326e85..3fcf02d 100644 --- a/content/browser/frame_host/render_frame_host_manager_browsertest.cc +++ b/content/browser/frame_host/render_frame_host_manager_browsertest.cc
@@ -200,7 +200,7 @@ // Get the original SiteInstance for later comparison. scoped_refptr<SiteInstance> orig_site_instance( shell()->web_contents()->GetSiteInstance()); - EXPECT_TRUE(orig_site_instance.get() != NULL); + EXPECT_TRUE(orig_site_instance.get() != nullptr); // Open a same-site link in a new window. ShellAddedObserver new_shell_observer; @@ -277,7 +277,7 @@ // Get the original SiteInstance for later comparison. scoped_refptr<SiteInstance> orig_site_instance( shell()->web_contents()->GetSiteInstance()); - EXPECT_TRUE(orig_site_instance.get() != NULL); + EXPECT_TRUE(orig_site_instance.get() != nullptr); // Test clicking a rel=noreferrer + target=blank link. ShellAddedObserver new_shell_observer; @@ -323,7 +323,7 @@ // Get the original SiteInstance for later comparison. scoped_refptr<SiteInstance> orig_site_instance( shell()->web_contents()->GetSiteInstance()); - EXPECT_TRUE(orig_site_instance.get() != NULL); + EXPECT_TRUE(orig_site_instance.get() != nullptr); // Test clicking a rel=noreferrer + target=blank link. ShellAddedObserver new_shell_observer; @@ -442,7 +442,7 @@ // Get the original SiteInstance for later comparison. scoped_refptr<SiteInstance> orig_site_instance( shell()->web_contents()->GetSiteInstance()); - EXPECT_TRUE(orig_site_instance.get() != NULL); + EXPECT_TRUE(orig_site_instance.get() != nullptr); // Test clicking a same-site rel=noreferrer + target=foo link. ShellAddedObserver new_shell_observer; @@ -490,7 +490,7 @@ // Get the original SiteInstance for later comparison. scoped_refptr<SiteInstance> orig_site_instance( shell()->web_contents()->GetSiteInstance()); - EXPECT_TRUE(orig_site_instance.get() != NULL); + EXPECT_TRUE(orig_site_instance.get() != nullptr); // Test clicking a same-site rel=noopener + target=foo link. ShellAddedObserver new_shell_observer; @@ -541,7 +541,7 @@ // Get the original SiteInstance for later comparison. scoped_refptr<SiteInstance> orig_site_instance( shell()->web_contents()->GetSiteInstance()); - EXPECT_TRUE(orig_site_instance.get() != NULL); + EXPECT_TRUE(orig_site_instance.get() != nullptr); // Test clicking a target=blank link. ShellAddedObserver new_shell_observer; @@ -580,7 +580,7 @@ // Get the original SiteInstance for later comparison. scoped_refptr<SiteInstance> orig_site_instance( shell()->web_contents()->GetSiteInstance()); - EXPECT_TRUE(orig_site_instance.get() != NULL); + EXPECT_TRUE(orig_site_instance.get() != nullptr); // Test clicking a rel=noreferrer link. bool success = false; @@ -617,7 +617,7 @@ // Get the original SiteInstance for later comparison. scoped_refptr<SiteInstance> orig_site_instance( shell()->web_contents()->GetSiteInstance()); - EXPECT_TRUE(orig_site_instance.get() != NULL); + EXPECT_TRUE(orig_site_instance.get() != nullptr); // Test clicking a rel=noreferrer link. bool success = false; @@ -655,7 +655,7 @@ // Get the original SiteInstance for later comparison. scoped_refptr<SiteInstance> orig_site_instance( shell()->web_contents()->GetSiteInstance()); - EXPECT_TRUE(orig_site_instance.get() != NULL); + EXPECT_TRUE(orig_site_instance.get() != nullptr); // Test clicking a target=foo link. ShellAddedObserver new_shell_observer; @@ -729,7 +729,7 @@ // Get the original SiteInstance for later comparison. scoped_refptr<SiteInstance> orig_site_instance( shell()->web_contents()->GetSiteInstance()); - EXPECT_TRUE(orig_site_instance.get() != NULL); + EXPECT_TRUE(orig_site_instance.get() != nullptr); // Test clicking a target=_blank link. ShellAddedObserver new_shell_observer; @@ -823,7 +823,7 @@ // Get the original SiteInstance for later comparison. scoped_refptr<SiteInstance> orig_site_instance( shell()->web_contents()->GetSiteInstance()); - EXPECT_TRUE(orig_site_instance.get() != NULL); + EXPECT_TRUE(orig_site_instance.get() != nullptr); // Open a popup using window.open with a 'foo' window.name. Shell* new_shell = OpenPopup(shell(), GURL(url::kAboutBlankURL), "foo"); @@ -886,7 +886,7 @@ WebContents* opener_contents = shell()->web_contents(); scoped_refptr<SiteInstance> orig_site_instance( opener_contents->GetSiteInstance()); - EXPECT_TRUE(orig_site_instance.get() != NULL); + EXPECT_TRUE(orig_site_instance.get() != nullptr); RenderFrameHostManager* opener_manager = static_cast<WebContentsImpl*>( opener_contents)->GetRenderManagerForTesting(); @@ -1023,7 +1023,7 @@ WebContents* opener_contents = shell()->web_contents(); scoped_refptr<SiteInstance> orig_site_instance( opener_contents->GetSiteInstance()); - EXPECT_TRUE(orig_site_instance.get() != NULL); + EXPECT_TRUE(orig_site_instance.get() != nullptr); RenderFrameHostManager* opener_manager = static_cast<WebContentsImpl*>( opener_contents)->GetRenderManagerForTesting(); @@ -1106,7 +1106,7 @@ WebContents* orig_contents = shell()->web_contents(); scoped_refptr<SiteInstance> orig_site_instance( orig_contents->GetSiteInstance()); - EXPECT_TRUE(orig_site_instance.get() != NULL); + EXPECT_TRUE(orig_site_instance.get() != nullptr); // Test clicking a target=foo link. ShellAddedObserver new_shell_observer; @@ -1206,7 +1206,7 @@ // Get the original SiteInstance for later comparison. scoped_refptr<SiteInstance> orig_site_instance( shell()->web_contents()->GetSiteInstance()); - EXPECT_TRUE(orig_site_instance.get() != NULL); + EXPECT_TRUE(orig_site_instance.get() != nullptr); // Test clicking a target=foo link. ShellAddedObserver new_shell_observer; @@ -1261,7 +1261,7 @@ // Get the original SiteInstance for later comparison. scoped_refptr<SiteInstance> orig_site_instance( shell()->web_contents()->GetSiteInstance()); - EXPECT_TRUE(orig_site_instance.get() != NULL); + EXPECT_TRUE(orig_site_instance.get() != nullptr); // Load a cross-site page that fails with a 204 error. EXPECT_TRUE( @@ -1831,8 +1831,9 @@ // Ensure that such URLs can still work as the initial navigation of a tab. // We postpone the initial navigation of the tab using an empty GURL, so that // we can add a watcher for crashes. - Shell* shell2 = Shell::CreateNewWindow( - shell()->web_contents()->GetBrowserContext(), GURL(), NULL, gfx::Size()); + Shell* shell2 = + Shell::CreateNewWindow(shell()->web_contents()->GetBrowserContext(), + GURL(), nullptr, gfx::Size()); RenderProcessHostWatcher crash_observer2( shell2->web_contents(), RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); @@ -1971,7 +1972,7 @@ // Open a new tab. Initially it gets a render view in the original tab's // current site instance. - TestNavigationObserver nav_observer(NULL); + TestNavigationObserver nav_observer(nullptr); nav_observer.StartWatchingNewWebContents(); ShellAddedObserver shao; OpenUrlViaClickTarget(shell(), url2);
diff --git a/content/browser/frame_host/render_frame_host_manager_unittest.cc b/content/browser/frame_host/render_frame_host_manager_unittest.cc index d0364932..ce5d787 100644 --- a/content/browser/frame_host/render_frame_host_manager_unittest.cc +++ b/content/browser/frame_host/render_frame_host_manager_unittest.cc
@@ -364,7 +364,7 @@ EXPECT_TRUE(rfh_observer.deleted()); } EXPECT_EQ(active_rfh, contents()->GetMainFrame()); - EXPECT_EQ(NULL, contents()->GetPendingMainFrame()); + EXPECT_EQ(nullptr, contents()->GetPendingMainFrame()); } bool ShouldSwapProcesses(RenderFrameHostManager* manager, @@ -515,7 +515,7 @@ // Make a second tab. std::unique_ptr<TestWebContents> contents2( - TestWebContents::Create(browser_context(), NULL)); + TestWebContents::Create(browser_context(), nullptr)); // Load the two URLs in the second tab. Note that the first navigation creates // a RFH that's not pending (since there is no cross-site transition), so @@ -908,14 +908,13 @@ RenderViewHostChangedObserver change_observer(web_contents.get()); RenderFrameHostManager* manager = web_contents->GetRenderManagerForTesting(); - RenderFrameHostImpl* host = NULL; + RenderFrameHostImpl* host = nullptr; // 1) The first navigation. -------------------------- const GURL kUrl1("http://www.google.com/"); NavigationEntryImpl entry1( - NULL /* instance */, kUrl1, Referrer(), - base::string16() /* title */, ui::PAGE_TRANSITION_TYPED, - false /* is_renderer_init */); + nullptr /* instance */, kUrl1, Referrer(), base::string16() /* title */, + ui::PAGE_TRANSITION_TYPED, false /* is_renderer_init */); host = NavigateToEntry(manager, entry1); // The RenderFrameHost created in Init will be reused. @@ -934,7 +933,7 @@ // 2) Navigate to next site. ------------------------- const GURL kUrl2("http://www.google.com/foo"); - NavigationEntryImpl entry2(NULL /* instance */, kUrl2, + NavigationEntryImpl entry2(nullptr /* instance */, kUrl2, Referrer(kUrl1, blink::kWebReferrerPolicyDefault), base::string16() /* title */, ui::PAGE_TRANSITION_LINK, @@ -956,7 +955,7 @@ // 3) Cross-site navigate to next site. -------------- const GURL kUrl3("http://webkit.org/"); - NavigationEntryImpl entry3(NULL /* instance */, kUrl3, + NavigationEntryImpl entry3(nullptr /* instance */, kUrl3, Referrer(kUrl2, blink::kWebReferrerPolicyDefault), base::string16() /* title */, ui::PAGE_TRANSITION_LINK, @@ -1000,10 +999,9 @@ EXPECT_TRUE(initial_rfh); const GURL kUrl("chrome://foo"); - NavigationEntryImpl entry(NULL /* instance */, kUrl, - Referrer(), base::string16() /* title */, - ui::PAGE_TRANSITION_TYPED, - false /* is_renderer_init */); + NavigationEntryImpl entry( + nullptr /* instance */, kUrl, Referrer(), base::string16() /* title */, + ui::PAGE_TRANSITION_TYPED, false /* is_renderer_init */); RenderFrameHostImpl* host = NavigateToEntry(manager, entry); // We commit the pending RenderFrameHost immediately because the previous @@ -1063,10 +1061,9 @@ // Navigate to a WebUI page. const GURL kUrl1("chrome://foo"); - NavigationEntryImpl entry1(NULL /* instance */, kUrl1, - Referrer(), base::string16() /* title */, - ui::PAGE_TRANSITION_TYPED, - false /* is_renderer_init */); + NavigationEntryImpl entry1( + nullptr /* instance */, kUrl1, Referrer(), base::string16() /* title */, + ui::PAGE_TRANSITION_TYPED, false /* is_renderer_init */); RenderFrameHostImpl* host1 = NavigateToEntry(manager1, entry1); // We should have a pending navigation to the WebUI RenderViewHost. @@ -1094,10 +1091,9 @@ EXPECT_TRUE(manager2->current_host()->IsRenderViewLive()); const GURL kUrl2("chrome://foo/bar"); - NavigationEntryImpl entry2(NULL /* instance */, kUrl2, - Referrer(), base::string16() /* title */, - ui::PAGE_TRANSITION_LINK, - true /* is_renderer_init */); + NavigationEntryImpl entry2( + nullptr /* instance */, kUrl2, Referrer(), base::string16() /* title */, + ui::PAGE_TRANSITION_LINK, true /* is_renderer_init */); RenderFrameHostImpl* host2 = NavigateToEntry(manager2, entry2); // No cross-process transition happens because we are already in the right @@ -1202,19 +1198,20 @@ // That should NOT have cancelled the pending RFH, because the reload did // not have a user gesture. Thus, the pending back navigation will still // eventually commit. - EXPECT_TRUE(contents()->GetRenderManagerForTesting()-> - pending_render_view_host() != NULL); + EXPECT_TRUE( + contents()->GetRenderManagerForTesting()->pending_render_view_host() != + nullptr); EXPECT_TRUE(contents()->GetRenderManagerForTesting()->pending_frame_host() != - NULL); + nullptr); EXPECT_EQ(evil_rfh, contents()->GetRenderManagerForTesting()->current_frame_host()); EXPECT_EQ(evil_rfh->GetRenderViewHost(), contents()->GetRenderManagerForTesting()->current_host()); // Also we should not have a pending navigation entry. - EXPECT_TRUE(contents()->GetController().GetPendingEntry() == NULL); + EXPECT_TRUE(contents()->GetController().GetPendingEntry() == nullptr); NavigationEntry* entry = contents()->GetController().GetVisibleEntry(); - ASSERT_TRUE(entry != NULL); + ASSERT_TRUE(entry != nullptr); EXPECT_EQ(kUrl2, entry->GetURL()); // Now do the same but as a user gesture. @@ -1224,19 +1221,20 @@ evil_rfh->SimulateNavigationStop(); // User navigation should have cancelled the pending RFH. - EXPECT_TRUE(contents()->GetRenderManagerForTesting()-> - pending_render_view_host() == NULL); + EXPECT_TRUE( + contents()->GetRenderManagerForTesting()->pending_render_view_host() == + nullptr); EXPECT_TRUE(contents()->GetRenderManagerForTesting()->pending_frame_host() == - NULL); + nullptr); EXPECT_EQ(evil_rfh, contents()->GetRenderManagerForTesting()->current_frame_host()); EXPECT_EQ(evil_rfh->GetRenderViewHost(), contents()->GetRenderManagerForTesting()->current_host()); // Also we should not have a pending navigation entry. - EXPECT_TRUE(contents()->GetController().GetPendingEntry() == NULL); + EXPECT_TRUE(contents()->GetController().GetPendingEntry() == nullptr); entry = contents()->GetController().GetVisibleEntry(); - ASSERT_TRUE(entry != NULL); + ASSERT_TRUE(entry != nullptr); EXPECT_EQ(kUrl2, entry->GetURL()); } @@ -1606,14 +1604,13 @@ RenderFrameHostManager* manager = web_contents->GetRenderManagerForTesting(); - RenderFrameHostImpl* host = NULL; + RenderFrameHostImpl* host = nullptr; // 1) The first navigation. -------------------------- const GURL kUrl1("http://www.google.com/"); NavigationEntryImpl entry1( - NULL /* instance */, kUrl1, Referrer(), - base::string16() /* title */, ui::PAGE_TRANSITION_TYPED, - false /* is_renderer_init */); + nullptr /* instance */, kUrl1, Referrer(), base::string16() /* title */, + ui::PAGE_TRANSITION_TYPED, false /* is_renderer_init */); host = NavigateToEntry(manager, entry1); // The RenderFrameHost created in Init will be reused. @@ -1631,7 +1628,7 @@ // 2) Navigate to a different domain. ------------------------- // Guests stay in the same process on navigation. const GURL kUrl2("http://www.chromium.org"); - NavigationEntryImpl entry2(NULL /* instance */, kUrl2, + NavigationEntryImpl entry2(nullptr /* instance */, kUrl2, Referrer(kUrl1, blink::kWebReferrerPolicyDefault), base::string16() /* title */, ui::PAGE_TRANSITION_LINK, @@ -1667,10 +1664,9 @@ // 1) The first navigation. -------------------------- const GURL kUrl1("http://www.google.com/"); - NavigationEntryImpl entry1(NULL /* instance */, kUrl1, - Referrer(), base::string16() /* title */, - ui::PAGE_TRANSITION_TYPED, - false /* is_renderer_init */); + NavigationEntryImpl entry1( + nullptr /* instance */, kUrl1, Referrer(), base::string16() /* title */, + ui::PAGE_TRANSITION_TYPED, false /* is_renderer_init */); RenderFrameHostImpl* host = NavigateToEntry(manager, entry1); // The RenderFrameHost created in Init will be reused. @@ -1691,9 +1687,8 @@ // 2) Cross-site navigate to next site. ------------------------- const GURL kUrl2("http://www.example.com"); NavigationEntryImpl entry2( - NULL /* instance */, kUrl2, Referrer(), - base::string16() /* title */, ui::PAGE_TRANSITION_TYPED, - false /* is_renderer_init */); + nullptr /* instance */, kUrl2, Referrer(), base::string16() /* title */, + ui::PAGE_TRANSITION_TYPED, false /* is_renderer_init */); RenderFrameHostImpl* host2 = NavigateToEntry(manager, entry2); // A new RenderFrameHost should be created. @@ -1775,7 +1770,7 @@ ui::PAGE_TRANSITION_TYPED); EXPECT_FALSE(contents()->CrossProcessNavigationPending()); EXPECT_EQ(rfh2, contents()->GetMainFrame()); - EXPECT_TRUE(contents()->GetPendingMainFrame() == NULL); + EXPECT_TRUE(contents()->GetPendingMainFrame() == nullptr); EXPECT_TRUE(rfh2->is_active()); EXPECT_FALSE(rfh1->is_active()); @@ -1784,7 +1779,7 @@ // rfh1 should have been deleted. EXPECT_TRUE(rfh_deleted_observer.deleted()); - rfh1 = NULL; + rfh1 = nullptr; } // Tests that the RenderFrameHost is properly swapped out when the SwapOut ACK @@ -1817,7 +1812,7 @@ ui::PAGE_TRANSITION_TYPED); EXPECT_FALSE(contents()->CrossProcessNavigationPending()); EXPECT_EQ(rfh2, contents()->GetMainFrame()); - EXPECT_TRUE(contents()->GetPendingMainFrame() == NULL); + EXPECT_TRUE(contents()->GetPendingMainFrame() == nullptr); EXPECT_FALSE(rfh1->is_active()); EXPECT_TRUE(rfh2->is_active()); @@ -1862,7 +1857,7 @@ ui::PAGE_TRANSITION_TYPED); EXPECT_FALSE(contents()->CrossProcessNavigationPending()); EXPECT_EQ(rfh2, contents()->GetMainFrame()); - EXPECT_TRUE(contents()->GetPendingMainFrame() == NULL); + EXPECT_TRUE(contents()->GetPendingMainFrame() == nullptr); EXPECT_FALSE(rfh1->is_active()); EXPECT_TRUE(rfh2->is_active()); @@ -1881,7 +1876,7 @@ CancelPendingProperlyDeletesOrSwaps) { const GURL kUrl1("http://www.google.com/"); const GURL kUrl2("http://www.chromium.org/"); - RenderFrameHostImpl* pending_rfh = NULL; + RenderFrameHostImpl* pending_rfh = nullptr; base::TimeTicks now = base::TimeTicks::Now(); // Navigate to the first page. @@ -1965,10 +1960,9 @@ contents()->GetFrameTree()->root()->child_at(1)->render_manager(); // 1) The first navigation. - NavigationEntryImpl entryA(NULL /* instance */, kUrlA, - Referrer(), base::string16() /* title */, - ui::PAGE_TRANSITION_TYPED, - false /* is_renderer_init */); + NavigationEntryImpl entryA( + nullptr /* instance */, kUrlA, Referrer(), base::string16() /* title */, + ui::PAGE_TRANSITION_TYPED, false /* is_renderer_init */); RenderFrameHostImpl* host1 = NavigateToEntry(iframe1, entryA); // The RenderFrameHost created in Init will be reused. @@ -1983,7 +1977,7 @@ EXPECT_TRUE(host1->GetSiteInstance()->HasSite()); // 2) Cross-site navigate both frames to next site. - NavigationEntryImpl entryB(NULL /* instance */, kUrlB, + NavigationEntryImpl entryB(nullptr /* instance */, kUrlB, Referrer(kUrlA, blink::kWebReferrerPolicyDefault), base::string16() /* title */, ui::PAGE_TRANSITION_LINK, @@ -2030,7 +2024,7 @@ // not yet destroy proxies in |site_instance| since the other child remains. iframe1->current_frame_host()->OnMessageReceived( FrameHostMsg_Detach(iframe1->current_frame_host()->GetRoutingID())); - iframe1 = NULL; // Was just destroyed. + iframe1 = nullptr; // Was just destroyed. EXPECT_TRUE(delete_watcher1.deleted()); EXPECT_FALSE(delete_watcher2.deleted()); @@ -2046,7 +2040,7 @@ // RenderFrameProxyHosts in |site_instance|. iframe2->current_frame_host()->OnMessageReceived( FrameHostMsg_Detach(iframe2->current_frame_host()->GetRoutingID())); - iframe2 = NULL; // Was just destroyed. + iframe2 = nullptr; // Was just destroyed. EXPECT_TRUE(delete_watcher1.deleted()); EXPECT_TRUE(delete_watcher2.deleted()); @@ -2095,7 +2089,7 @@ base::UnguessableToken::Create(), FramePolicy(), FrameOwnerProperties()); RenderFrameHostManager* iframe = contents()->GetFrameTree()->root()->child_at(0)->render_manager(); - NavigationEntryImpl entry(NULL /* instance */, kUrl2, + NavigationEntryImpl entry(nullptr /* instance */, kUrl2, Referrer(kUrl1, blink::kWebReferrerPolicyDefault), base::string16() /* title */, ui::PAGE_TRANSITION_LINK, @@ -2617,10 +2611,9 @@ // Navigation request to a non-WebUI page. const GURL kUrl("http://google.com"); - NavigationEntryImpl entry(NULL /* instance */, kUrl, - Referrer(), base::string16() /* title */, - ui::PAGE_TRANSITION_TYPED, - false /* is_renderer_init */); + NavigationEntryImpl entry( + nullptr /* instance */, kUrl, Referrer(), base::string16() /* title */, + ui::PAGE_TRANSITION_TYPED, false /* is_renderer_init */); RenderFrameHostImpl* host2 = NavigateToEntry(manager, entry); ASSERT_TRUE(host2); @@ -2709,10 +2702,9 @@ // Navigation another WebUI page, with a different type. set_webui_type(2); const GURL kUrl("chrome://bar/"); - NavigationEntryImpl entry(NULL /* instance */, kUrl, - Referrer(), base::string16() /* title */, - ui::PAGE_TRANSITION_TYPED, - false /* is_renderer_init */); + NavigationEntryImpl entry( + nullptr /* instance */, kUrl, Referrer(), base::string16() /* title */, + ui::PAGE_TRANSITION_TYPED, false /* is_renderer_init */); RenderFrameHostImpl* host2 = NavigateToEntry(manager, entry); ASSERT_TRUE(host2);
diff --git a/content/browser/frame_host/render_widget_host_view_guest_unittest.cc b/content/browser/frame_host/render_widget_host_view_guest_unittest.cc index 22f1179..9b4eb74 100644 --- a/content/browser/frame_host/render_widget_host_view_guest_unittest.cc +++ b/content/browser/frame_host/render_widget_host_view_guest_unittest.cc
@@ -58,7 +58,7 @@ widget_host_ = new RenderWidgetHostImpl( &delegate_, process_host, routing_id, std::move(widget), false); view_ = RenderWidgetHostViewGuest::Create( - widget_host_, NULL, + widget_host_, nullptr, (new TestRenderWidgetHostView(widget_host_))->GetWeakPtr()); }
diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.cc b/content/browser/gpu/browser_gpu_channel_host_factory.cc index c9f929ce..bedf6c1 100644 --- a/content/browser/gpu/browser_gpu_channel_host_factory.cc +++ b/content/browser/gpu/browser_gpu_channel_host_factory.cc
@@ -46,7 +46,7 @@ } // namespace #endif // OS_ANDROID -BrowserGpuChannelHostFactory* BrowserGpuChannelHostFactory::instance_ = NULL; +BrowserGpuChannelHostFactory* BrowserGpuChannelHostFactory::instance_ = nullptr; class BrowserGpuChannelHostFactory::EstablishRequest : public base::RefCountedThreadSafe<EstablishRequest> { @@ -216,7 +216,7 @@ void BrowserGpuChannelHostFactory::Terminate() { DCHECK(instance_); delete instance_; - instance_ = NULL; + instance_ = nullptr; } BrowserGpuChannelHostFactory::BrowserGpuChannelHostFactory() @@ -251,7 +251,7 @@ shutdown_event_->Signal(); if (gpu_channel_) { gpu_channel_->DestroyChannel(); - gpu_channel_ = NULL; + gpu_channel_ = nullptr; } } @@ -282,7 +282,7 @@ DCHECK(!pending_request_.get()); // Recreate the channel if it has been lost. gpu_channel_->DestroyChannel(); - gpu_channel_ = NULL; + gpu_channel_ = nullptr; } if (!gpu_channel_.get() && !pending_request_.get()) { @@ -328,7 +328,7 @@ if (gpu_channel_.get() && !gpu_channel_->IsLost()) return gpu_channel_.get(); - return NULL; + return nullptr; } void BrowserGpuChannelHostFactory::GpuChannelEstablished() { @@ -344,7 +344,7 @@ pending_request_->channel_handle(), shutdown_event_.get(), gpu_memory_buffer_manager_.get()); } - pending_request_ = NULL; + pending_request_ = nullptr; timeout_.Stop(); std::vector<gpu::GpuChannelEstablishedCallback> established_callbacks;
diff --git a/content/browser/gpu/gpu_data_manager_impl_private_unittest.cc b/content/browser/gpu/gpu_data_manager_impl_private_unittest.cc index 9e8d89c..ece02a812 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private_unittest.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private_unittest.cc
@@ -242,7 +242,7 @@ TEST_F(GpuDataManagerImplPrivateTest, GpuSideExceptions) { ScopedGpuDataManagerImplPrivate manager; EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount()); - EXPECT_TRUE(manager->GpuAccessAllowed(NULL)); + EXPECT_TRUE(manager->GpuAccessAllowed(nullptr)); const gpu::GpuControlList::Entry kEntries[] = { gpu::kGpuDataManagerTestingEntries @@ -255,7 +255,7 @@ gpu_info.gpu.device_id = 0x0640; manager->InitializeForTesting(kData, gpu_info); - EXPECT_TRUE(manager->GpuAccessAllowed(NULL)); + EXPECT_TRUE(manager->GpuAccessAllowed(nullptr)); EXPECT_EQ(manager->ShouldUseSwiftShader() ? static_cast<size_t>(gpu::NUMBER_OF_GPU_FEATURE_TYPES) : 1u, @@ -264,7 +264,7 @@ // Now assume gpu process launches and full GPU info is collected. gpu_info.gl_renderer = "NVIDIA GeForce GT 120"; manager->UpdateGpuInfo(gpu_info); - EXPECT_TRUE(manager->GpuAccessAllowed(NULL)); + EXPECT_TRUE(manager->GpuAccessAllowed(nullptr)); // Since SwiftShader was enabled by first gpu_info, UpdateGpuInfo // should have failed and SwiftShader should still be active EXPECT_EQ(manager->ShouldUseSwiftShader() @@ -300,11 +300,12 @@ const gpu::GpuControlListData kData; manager->InitializeForTesting(kData, gpu::GPUInfo()); EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount()); - EXPECT_TRUE(manager->GpuAccessAllowed(NULL)); + EXPECT_TRUE(manager->GpuAccessAllowed(nullptr)); EXPECT_FALSE(manager->ShouldUseSwiftShader()); manager->DisableHardwareAcceleration(); - EXPECT_EQ(manager->ShouldUseSwiftShader(), manager->GpuAccessAllowed(NULL)); + EXPECT_EQ(manager->ShouldUseSwiftShader(), + manager->GpuAccessAllowed(nullptr)); EXPECT_EQ(static_cast<size_t>(gpu::NUMBER_OF_GPU_FEATURE_TYPES), manager->GetBlacklistedFeatureCount()); EXPECT_TRUE(manager->IsFeatureBlacklisted( @@ -319,14 +320,14 @@ const gpu::GpuControlListData kData; manager->InitializeForTesting(kData, gpu::GPUInfo()); EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount()); - EXPECT_TRUE(manager->GpuAccessAllowed(NULL)); + EXPECT_TRUE(manager->GpuAccessAllowed(nullptr)); EXPECT_FALSE(manager->ShouldUseSwiftShader()); manager->DisableHardwareAcceleration(); if (manager->ShouldUseSwiftShader()) { - EXPECT_TRUE(manager->GpuAccessAllowed(NULL)); + EXPECT_TRUE(manager->GpuAccessAllowed(nullptr)); } else { - EXPECT_FALSE(manager->GpuAccessAllowed(NULL)); + EXPECT_FALSE(manager->GpuAccessAllowed(nullptr)); } EXPECT_EQ(static_cast<size_t>(gpu::NUMBER_OF_GPU_FEATURE_TYPES), manager->GetBlacklistedFeatureCount()); @@ -364,9 +365,9 @@ manager->DisableHardwareAcceleration(); if (manager->ShouldUseSwiftShader()) { - EXPECT_TRUE(manager->GpuAccessAllowed(NULL)); + EXPECT_TRUE(manager->GpuAccessAllowed(nullptr)); } else { - EXPECT_FALSE(manager->GpuAccessAllowed(NULL)); + EXPECT_FALSE(manager->GpuAccessAllowed(nullptr)); } { @@ -526,7 +527,7 @@ ScopedGpuDataManagerImplPrivate manager; EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount()); - EXPECT_TRUE(manager->GpuAccessAllowed(NULL)); + EXPECT_TRUE(manager->GpuAccessAllowed(nullptr)); const gpu::GpuControlList::Entry kEntries[] = { gpu::kGpuDataManagerTestingEntries @@ -540,7 +541,7 @@ manager->InitializeForTesting(kData, gpu_info); // Not enough GPUInfo. - EXPECT_TRUE(manager->GpuAccessAllowed(NULL)); + EXPECT_TRUE(manager->GpuAccessAllowed(nullptr)); if (manager->ShouldUseSwiftShader()) { EXPECT_EQ(static_cast<size_t>(gpu::NUMBER_OF_GPU_FEATURE_TYPES), manager->GetBlacklistedFeatureCount()); @@ -553,7 +554,7 @@ // However, GPU process is not blocked because this is all browser side and // happens before renderer launching. manager->SetGLStrings(kGLVendorMesa, kGLRendererMesa, kGLVersionMesa801); - EXPECT_TRUE(manager->GpuAccessAllowed(NULL)); + EXPECT_TRUE(manager->GpuAccessAllowed(nullptr)); if (manager->ShouldUseSwiftShader()) { EXPECT_EQ(static_cast<size_t>(gpu::NUMBER_OF_GPU_FEATURE_TYPES), manager->GetBlacklistedFeatureCount()); @@ -572,7 +573,7 @@ ScopedGpuDataManagerImplPrivate manager; EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount()); - EXPECT_TRUE(manager->GpuAccessAllowed(NULL)); + EXPECT_TRUE(manager->GpuAccessAllowed(nullptr)); const gpu::GpuControlList::Entry kEntries[] = { gpu::kGpuDataManagerTestingEntries @@ -591,7 +592,7 @@ manager->InitializeForTesting(kData, gpu_info); // Full GPUInfo, the entry applies. - EXPECT_TRUE(manager->GpuAccessAllowed(NULL)); + EXPECT_TRUE(manager->GpuAccessAllowed(nullptr)); if (manager->ShouldUseSwiftShader()) { EXPECT_EQ(static_cast<size_t>(gpu::NUMBER_OF_GPU_FEATURE_TYPES), manager->GetBlacklistedFeatureCount()); @@ -605,7 +606,7 @@ // SetGLStrings() has no effects because GPUInfo already got these strings. // (Otherwise the entry should not apply.) manager->SetGLStrings(kGLVendorMesa, kGLRendererMesa, kGLVersionMesa802); - EXPECT_TRUE(manager->GpuAccessAllowed(NULL)); + EXPECT_TRUE(manager->GpuAccessAllowed(nullptr)); if (manager->ShouldUseSwiftShader()) { EXPECT_EQ(static_cast<size_t>(gpu::NUMBER_OF_GPU_FEATURE_TYPES), manager->GetBlacklistedFeatureCount()); @@ -623,7 +624,7 @@ ScopedGpuDataManagerImplPrivate manager; EXPECT_EQ(0u, manager->GetBlacklistedFeatureCount()); - EXPECT_TRUE(manager->GpuAccessAllowed(NULL)); + EXPECT_TRUE(manager->GpuAccessAllowed(nullptr)); const gpu::GpuControlList::Entry kEntries[] = { gpu::kGpuDataManagerTestingEntries @@ -641,7 +642,7 @@ gpu_info.gpu.device_id = 0x0042; manager->InitializeForTesting(kData, gpu_info); - EXPECT_TRUE(manager->GpuAccessAllowed(NULL)); + EXPECT_TRUE(manager->GpuAccessAllowed(nullptr)); if (manager->ShouldUseSwiftShader()) { EXPECT_EQ(static_cast<size_t>(gpu::NUMBER_OF_GPU_FEATURE_TYPES), manager->GetBlacklistedFeatureCount());
diff --git a/content/browser/gpu/gpu_feature_checker_impl.cc b/content/browser/gpu/gpu_feature_checker_impl.cc index 1e3f5c3..7c3b5f6 100644 --- a/content/browser/gpu/gpu_feature_checker_impl.cc +++ b/content/browser/gpu/gpu_feature_checker_impl.cc
@@ -16,7 +16,7 @@ // A false return value is always valid, but a true one is only valid if full // GPU info has been collected in a GPU process. bool IsFeatureAllowed(GpuDataManager* manager, gpu::GpuFeatureType feature) { - return (manager->GpuAccessAllowed(NULL) && + return (manager->GpuAccessAllowed(nullptr) && !manager->IsFeatureBlacklisted(feature)); }
diff --git a/content/browser/gpu/gpu_ipc_browsertests.cc b/content/browser/gpu/gpu_ipc_browsertests.cc index 0f6e88f9..5573fc78 100644 --- a/content/browser/gpu/gpu_ipc_browsertests.cc +++ b/content/browser/gpu/gpu_ipc_browsertests.cc
@@ -187,7 +187,7 @@ IN_PROC_BROWSER_TEST_F(BrowserGpuChannelHostFactoryTest, MAYBE_Basic) { DCHECK(!IsChannelEstablished()); EstablishAndWait(); - EXPECT_TRUE(GetGpuChannel() != NULL); + EXPECT_TRUE(GetGpuChannel() != nullptr); } #if !defined(OS_ANDROID)
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc index d960e56..c78c6dc 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc
@@ -377,8 +377,8 @@ // Don't grant further access to GPU if it is not allowed. GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); DCHECK(gpu_data_manager); - if (!gpu_data_manager->GpuAccessAllowed(NULL)) - return NULL; + if (!gpu_data_manager->GpuAccessAllowed(nullptr)) + return nullptr; if (g_gpu_process_hosts[kind] && ValidateHost(g_gpu_process_hosts[kind])) return g_gpu_process_hosts[kind]; @@ -403,7 +403,7 @@ host->RecordProcessCrash(); delete host; - return NULL; + return nullptr; } // static @@ -457,7 +457,7 @@ return host; } - return NULL; + return nullptr; } GpuProcessHost::GpuProcessHost(int host_id, GpuProcessKind kind) @@ -479,7 +479,7 @@ // If the 'single GPU process' policy ever changes, we still want to maintain // it for 'gpu thread' mode and only create one instance of host and thread. - DCHECK(!in_process_ || g_gpu_process_hosts[kind] == NULL); + DCHECK(!in_process_ || g_gpu_process_hosts[kind] == nullptr); g_gpu_process_hosts[kind] = this; @@ -507,7 +507,7 @@ // This is only called on the IO thread so no race against the constructor // for another GpuProcessHost. if (g_gpu_process_hosts[kind_] == this) - g_gpu_process_hosts[kind_] = NULL; + g_gpu_process_hosts[kind_] = nullptr; #if defined(OS_MACOSX) || defined(OS_ANDROID) UMA_HISTOGRAM_COUNTS_100("GPU.AtExitSurfaceCount", @@ -688,7 +688,7 @@ TRACE_EVENT0("gpu", "GpuProcessHost::EstablishGpuChannel"); // If GPU features are already blacklisted, no need to establish the channel. - if (!GpuDataManagerImpl::GetInstance()->GpuAccessAllowed(NULL)) { + if (!GpuDataManagerImpl::GetInstance()->GpuAccessAllowed(nullptr)) { DVLOG(1) << "GPU blacklisted, refusing to open a GPU channel."; callback.Run(IPC::ChannelHandle(), gpu::GPUInfo(), gpu::GpuFeatureInfo(), EstablishChannelStatus::GPU_ACCESS_DENIED); @@ -847,7 +847,7 @@ SendOutstandingReplies(); RecordProcessCrash(); GpuDataManagerImpl::GetInstance()->ProcessCrashed( - process_->GetTerminationStatus(true /* known_dead */, NULL)); + process_->GetTerminationStatus(true /* known_dead */, nullptr)); } void GpuProcessHost::DidInitialize( @@ -999,7 +999,7 @@ // This is only called on the IO thread so no race against the constructor // for another GpuProcessHost. if (g_gpu_process_hosts[kind_] == this) - g_gpu_process_hosts[kind_] = NULL; + g_gpu_process_hosts[kind_] = nullptr; process_->ForceShutdown(); }
diff --git a/content/browser/histogram_controller.cc b/content/browser/histogram_controller.cc index 2860b84..fdb868a 100644 --- a/content/browser/histogram_controller.cc +++ b/content/browser/histogram_controller.cc
@@ -25,8 +25,7 @@ HistogramController>>::get(); } -HistogramController::HistogramController() : subscriber_(NULL) { -} +HistogramController::HistogramController() : subscriber_(nullptr) {} HistogramController::~HistogramController() { } @@ -95,7 +94,7 @@ void HistogramController::Unregister( const HistogramSubscriber* subscriber) { DCHECK_EQ(subscriber_, subscriber); - subscriber_ = NULL; + subscriber_ = nullptr; } template <class T>
diff --git a/content/browser/histogram_synchronizer.cc b/content/browser/histogram_synchronizer.cc index 90da2ed..bbfb0e48 100644 --- a/content/browser/histogram_synchronizer.cc +++ b/content/browser/histogram_synchronizer.cc
@@ -97,7 +97,7 @@ RequestContextMap::iterator it = outstanding_requests_.Get().find(sequence_number); if (it == outstanding_requests_.Get().end()) - return NULL; + return nullptr; RequestContext* request = it->second; DCHECK_EQ(sequence_number, request->sequence_number_); @@ -198,7 +198,7 @@ HistogramSynchronizer* current_synchronizer = HistogramSynchronizer::GetInstance(); - if (current_synchronizer == NULL) + if (current_synchronizer == nullptr) return; current_synchronizer->RegisterAndNotifyAllProcesses(
diff --git a/content/browser/indexed_db/indexed_db_active_blob_registry.cc b/content/browser/indexed_db/indexed_db_active_blob_registry.cc index 883ec0d..700d595 100644 --- a/content/browser/indexed_db/indexed_db_active_blob_registry.cc +++ b/content/browser/indexed_db/indexed_db_active_blob_registry.cc
@@ -135,7 +135,7 @@ void IndexedDBActiveBlobRegistry::ForceShutdown() { weak_factory_.InvalidateWeakPtrs(); use_tracker_.clear(); - backing_store_ = NULL; + backing_store_ = nullptr; } } // namespace content
diff --git a/content/browser/indexed_db/indexed_db_backing_store.cc b/content/browser/indexed_db/indexed_db_backing_store.cc index 376b1dd5..04cb848 100644 --- a/content/browser/indexed_db/indexed_db_backing_store.cc +++ b/content/browser/indexed_db/indexed_db_backing_store.cc
@@ -395,8 +395,8 @@ INTERNAL_CONSISTENCY_ERROR_UNTESTED(GET_IDBDATABASE_METADATA); return InternalInconsistencyStatus(); } - transaction->PutBlobInfo(database_id, object_store_id, user_key, NULL, - NULL); + transaction->PutBlobInfo(database_id, object_store_id, user_key, nullptr, + nullptr); } return s; } @@ -967,7 +967,7 @@ LOG(ERROR) << "IndexedDB backing store cleanup succeeded, reopening"; *status = - leveldb_factory->OpenLevelDB(file_path, comparator.get(), &db, NULL); + leveldb_factory->OpenLevelDB(file_path, comparator.get(), &db, nullptr); if (!status->ok()) { DCHECK(!db); LOG(ERROR) << "IndexedDB backing store reopen after recovery failed"; @@ -1037,8 +1037,8 @@ db.get(), "IndexedDBBackingStore", task_runner, base::trace_event::MemoryDumpProvider::Options()); - return Create(NULL /* indexed_db_factory */, origin, FilePath(), - NULL /* request_context */, std::move(db), + return Create(nullptr /* indexed_db_factory */, origin, FilePath(), + nullptr /* request_context */, std::move(db), std::move(comparator), task_runner, status); } @@ -1260,7 +1260,7 @@ database_id, object_store_id, record_identifier.primary_key()); leveldb_transaction->Remove(object_store_data_key); Status s = transaction->PutBlobInfoIfNeeded( - database_id, object_store_id, object_store_data_key, NULL, NULL); + database_id, object_store_id, object_store_data_key, nullptr, nullptr); if (!s.ok()) return s; @@ -1490,7 +1490,7 @@ content::BrowserThread::DeleteSoon( content::BrowserThread::IO, FROM_HERE, delegate_.release()); if (aborted_) { - self_ref_ = NULL; + self_ref_ = nullptr; return; } if (iter_->size() != -1 && iter_->size() != bytes_written) @@ -1653,7 +1653,7 @@ IndexedDBBackingStore::Transaction::ChainedBlobWriter* raw_tmp = chained_blob_writer_.get(); raw_tmp->AddRef(); - chained_blob_writer_ = NULL; + chained_blob_writer_ = nullptr; task_runner_->ReleaseSoon(FROM_HERE, raw_tmp); } friend class base::RefCountedThreadSafe<LocalWriteClosure>; @@ -2211,7 +2211,7 @@ if (!s->ok()) return false; } - return Continue(0, READY, s); + return Continue(nullptr, READY, s); } bool IndexedDBBackingStore::Cursor::Advance(uint32_t count, Status* s) { @@ -2467,7 +2467,7 @@ // IndexedDBBackingStore::Cursor IndexedDBValue* value() override { NOTREACHED(); - return NULL; + return nullptr; } bool LoadCurrentRow(Status* s) override; @@ -2618,7 +2618,7 @@ // IndexedDBBackingStore::Cursor IndexedDBValue* value() override { NOTREACHED(); - return NULL; + return nullptr; } const IndexedDBKey& primary_key() const override { return *primary_key_; } const IndexedDBBackingStore::RecordIdentifier& record_identifier() @@ -3059,7 +3059,7 @@ if (!BlobEntryKey::FromObjectStoreDataKey(&key_piece, &blob_entry_key)) { NOTREACHED(); INTERNAL_WRITE_ERROR_UNTESTED(TRANSACTION_COMMIT_METHOD); - transaction_ = NULL; + transaction_ = nullptr; return false; } if (database_id_ < 0) @@ -3075,7 +3075,7 @@ std::vector<IndexedDBBlobInfo> blob_info; if (!DecodeBlobData(blob_entry_value_bytes, &blob_info)) { INTERNAL_READ_ERROR_UNTESTED(TRANSACTION_COMMIT_METHOD); - transaction_ = NULL; + transaction_ = nullptr; return false; } for (const auto& blob : blob_info) { @@ -3113,7 +3113,7 @@ s = HandleBlobPreTransaction(&new_blob_entries, &new_files_to_write); if (!s.ok()) { INTERNAL_WRITE_ERROR_UNTESTED(TRANSACTION_COMMIT_METHOD); - transaction_ = NULL; + transaction_ = nullptr; return s; } @@ -3121,7 +3121,7 @@ KeyPrefix::IsValidDatabaseId(database_id_)); if (!CollectBlobFilesToRemove()) { INTERNAL_WRITE_ERROR_UNTESTED(TRANSACTION_COMMIT_METHOD); - transaction_ = NULL; + transaction_ = nullptr; return InternalInconsistencyStatus(); } @@ -3191,7 +3191,7 @@ // reflect pending blob work - dead files that should be deleted // immediately, and live files to monitor. s = transaction_->Commit(); - transaction_ = NULL; + transaction_ = nullptr; if (!s.ok()) { INTERNAL_WRITE_ERROR(TRANSACTION_COMMIT_METHOD); @@ -3306,12 +3306,12 @@ if (chained_blob_writer_.get()) { chained_blob_writer_->Abort(); - chained_blob_writer_ = NULL; + chained_blob_writer_ = nullptr; } if (!transaction_) return; transaction_->Rollback(); - transaction_ = NULL; + transaction_ = nullptr; } uint64_t IndexedDBBackingStore::Transaction::GetTransactionSize() {
diff --git a/content/browser/indexed_db/indexed_db_browsertest.cc b/content/browser/indexed_db/indexed_db_browsertest.cc index c385c242..f104a33 100644 --- a/content/browser/indexed_db/indexed_db_browsertest.cc +++ b/content/browser/indexed_db/indexed_db_browsertest.cc
@@ -71,7 +71,7 @@ } void TearDown() override { - IndexedDBClassFactory::SetIndexedDBClassFactoryGetter(NULL); + IndexedDBClassFactory::SetIndexedDBClassFactoryGetter(nullptr); ContentBrowserTest::TearDown(); } @@ -837,7 +837,7 @@ // Verify that a "close" event is fired at database connections when // the backing store is deleted. IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, ForceCloseEventTest) { - NavigateAndWaitForTitle(shell(), "force_close_event.html", NULL, + NavigateAndWaitForTitle(shell(), "force_close_event.html", nullptr, "connection ready"); // TODO(jsbell): Remove static_cast<> when overloads are eliminated. GetContext()->TaskRunner()->PostTask(
diff --git a/content/browser/indexed_db/indexed_db_cleanup_on_io_error_unittest.cc b/content/browser/indexed_db/indexed_db_cleanup_on_io_error_unittest.cc index 74a0ab52..9ee6009 100644 --- a/content/browser/indexed_db/indexed_db_cleanup_on_io_error_unittest.cc +++ b/content/browser/indexed_db/indexed_db_cleanup_on_io_error_unittest.cc
@@ -52,7 +52,7 @@ leveldb::Status Get(const base::StringPiece& key, std::string* value, bool* found, - const LevelDBSnapshot* = 0) override { + const LevelDBSnapshot* = nullptr) override { return leveldb::Status::IOError("It's busted!"); } @@ -65,7 +65,7 @@ leveldb::Status OpenLevelDB(const base::FilePath& file_name, const LevelDBComparator* comparator, std::unique_ptr<LevelDBDatabase>* db, - bool* is_disk_full = 0) override { + bool* is_disk_full = nullptr) override { if (open_error_.ok()) *db = BustedLevelDBDatabase::Open(file_name, comparator); return open_error_; @@ -82,7 +82,7 @@ }; TEST(IndexedDBIOErrorTest, CleanUpTest) { - content::IndexedDBFactory* factory = NULL; + content::IndexedDBFactory* factory = nullptr; const url::Origin origin = url::Origin::Create(GURL("http://localhost:81")); base::ScopedTempDir temp_directory; ASSERT_TRUE(temp_directory.CreateUniqueTempDir()); @@ -100,7 +100,7 @@ EXPECT_CALL(mock_leveldb_factory, DestroyLevelDB(_)).Times(Exactly(1)); content::IndexedDBDataLossInfo data_loss_info; bool disk_full = false; - base::SequencedTaskRunner* task_runner = NULL; + base::SequencedTaskRunner* task_runner = nullptr; bool clean_journal = false; leveldb::Status s; scoped_refptr<IndexedDBBackingStore> backing_store = @@ -110,7 +110,7 @@ } TEST(IndexedDBNonRecoverableIOErrorTest, NuancedCleanupTest) { - content::IndexedDBFactory* factory = NULL; + content::IndexedDBFactory* factory = nullptr; const url::Origin origin = url::Origin::Create(GURL("http://localhost:81")); scoped_refptr<net::URLRequestContextGetter> request_context_getter; base::ScopedTempDir temp_directory; @@ -118,7 +118,7 @@ const base::FilePath path = temp_directory.GetPath(); content::IndexedDBDataLossInfo data_loss_info; bool disk_full = false; - base::SequencedTaskRunner* task_runner = NULL; + base::SequencedTaskRunner* task_runner = nullptr; bool clean_journal = false; leveldb::Status s;
diff --git a/content/browser/indexed_db/indexed_db_connection.cc b/content/browser/indexed_db/indexed_db_connection.cc index c7744d4..c820dce 100644 --- a/content/browser/indexed_db/indexed_db_connection.cc +++ b/content/browser/indexed_db/indexed_db_connection.cc
@@ -68,7 +68,7 @@ } bool IndexedDBConnection::IsConnected() { - return database_.get() != NULL; + return database_.get() != nullptr; } // The observers begin listening to changes only once they are activated.
diff --git a/content/browser/indexed_db/indexed_db_context_impl.cc b/content/browser/indexed_db/indexed_db_context_impl.cc index 5fc5aee..3d2b18ec 100644 --- a/content/browser/indexed_db/indexed_db_context_impl.cc +++ b/content/browser/indexed_db/indexed_db_context_impl.cc
@@ -591,7 +591,7 @@ std::set<Origin>* IndexedDBContextImpl::GetOriginSet() { if (!origin_set_) { std::vector<Origin> origins; - GetAllOriginsAndPaths(data_path_, &origins, NULL); + GetAllOriginsAndPaths(data_path_, &origins, nullptr); origin_set_ = std::make_unique<std::set<Origin>>(origins.begin(), origins.end()); }
diff --git a/content/browser/indexed_db/indexed_db_database.cc b/content/browser/indexed_db/indexed_db_database.cc index 5fb1aa9c..e0cff52 100644 --- a/content/browser/indexed_db/indexed_db_database.cc +++ b/content/browser/indexed_db/indexed_db_database.cc
@@ -398,7 +398,7 @@ identifier_(unique_identifier), factory_(factory), metadata_coding_(std::move(metadata_coding)) { - DCHECK(factory != NULL); + DCHECK(factory != nullptr); } void IndexedDBDatabase::AddObjectStore(
diff --git a/content/browser/indexed_db/indexed_db_database_unittest.cc b/content/browser/indexed_db/indexed_db_database_unittest.cc index 4c6d68fe..e2825b4 100644 --- a/content/browser/indexed_db/indexed_db_database_unittest.cc +++ b/content/browser/indexed_db/indexed_db_database_unittest.cc
@@ -70,7 +70,7 @@ TEST_F(IndexedDBDatabaseTest, BackingStoreRetention) { EXPECT_FALSE(backing_store_->HasOneRef()); // local and db - db_ = NULL; + db_ = nullptr; EXPECT_TRUE(backing_store_->HasOneRef()); // local } @@ -110,7 +110,7 @@ EXPECT_TRUE(backing_store_->HasOneRef()); EXPECT_FALSE(db_->backing_store()); - db_ = NULL; + db_ = nullptr; } TEST_F(IndexedDBDatabaseTest, ForcedClose) {
diff --git a/content/browser/indexed_db/indexed_db_factory_impl.cc b/content/browser/indexed_db/indexed_db_factory_impl.cc index 317912a3..cbe0c4f 100644 --- a/content/browser/indexed_db/indexed_db_factory_impl.cc +++ b/content/browser/indexed_db/indexed_db_factory_impl.cc
@@ -315,7 +315,7 @@ } backing_store_map_.clear(); backing_stores_with_active_blobs_.clear(); - context_ = NULL; + context_ = nullptr; } void IndexedDBFactoryImpl::ReportOutstandingBlobs(const Origin& origin, @@ -370,13 +370,13 @@ "Internal error opening backing store for " "indexedDB.webkitGetDatabaseNames."); callbacks->OnError(error); - backing_store = NULL; + backing_store = nullptr; if (s.IsCorruption()) HandleBackingStoreCorruption(origin, error); return; } callbacks->OnSuccess(names); - backing_store = NULL; + backing_store = nullptr; ReleaseBackingStore(origin, false /* immediate */); } @@ -426,7 +426,7 @@ "Internal error opening backing store for " "indexedDB.deleteDatabase."); callbacks->OnError(error); - backing_store = NULL; + backing_store = nullptr; if (s.IsCorruption()) HandleBackingStoreCorruption(origin, error); return; @@ -434,7 +434,7 @@ if (!base::ContainsValue(names, name)) { const int64_t version = 0; callbacks->OnSuccess(version); - backing_store = NULL; + backing_store = nullptr; ReleaseBackingStore(origin, false /* immediate */); return; } @@ -450,7 +450,7 @@ "indexedDB.deleteDatabase.")); callbacks->OnError(error); if (s.IsCorruption()) { - backing_store = NULL; + backing_store = nullptr; HandleBackingStoreCorruption(origin, error); } return; @@ -460,8 +460,8 @@ origin_dbs_.insert(std::make_pair(origin, database.get())); database->DeleteDatabase(callbacks, force_close); RemoveDatabaseFromMaps(unique_identifier); - database = NULL; - backing_store = NULL; + database = nullptr; + backing_store = nullptr; ReleaseBackingStore(origin, false /* immediate */); } @@ -625,7 +625,7 @@ return backing_store; } - return 0; + return nullptr; } void IndexedDBFactoryImpl::Open( @@ -676,7 +676,8 @@ "indexedDB.open.")); connection->callbacks->OnError(error); if (s.IsCorruption()) { - backing_store = NULL; // Closes the LevelDB so that it can be deleted + backing_store = + nullptr; // Closes the LevelDB so that it can be deleted HandleBackingStoreCorruption(origin, error); } return;
diff --git a/content/browser/indexed_db/indexed_db_fake_backing_store.cc b/content/browser/indexed_db/indexed_db_fake_backing_store.cc index f80a9ca..3c68fcd 100644 --- a/content/browser/indexed_db/indexed_db_fake_backing_store.cc +++ b/content/browser/indexed_db/indexed_db_fake_backing_store.cc
@@ -10,20 +10,20 @@ namespace content { IndexedDBFakeBackingStore::IndexedDBFakeBackingStore() - : IndexedDBBackingStore(NULL /* indexed_db_factory */, + : IndexedDBBackingStore(nullptr /* indexed_db_factory */, url::Origin::Create(GURL("http://localhost:81")), base::FilePath(), scoped_refptr<net::URLRequestContextGetter>(), std::unique_ptr<LevelDBDatabase>(), std::unique_ptr<LevelDBComparator>(), - NULL /* task_runner */) {} + nullptr /* task_runner */) {} IndexedDBFakeBackingStore::IndexedDBFakeBackingStore( IndexedDBFactory* factory, base::SequencedTaskRunner* task_runner) : IndexedDBBackingStore(factory, url::Origin::Create(GURL("http://localhost:81")), base::FilePath(), - NULL /* request_context */, + nullptr /* request_context */, std::unique_ptr<LevelDBDatabase>(), std::unique_ptr<LevelDBComparator>(), task_runner) {} @@ -148,8 +148,7 @@ IndexedDBFakeBackingStore::FakeTransaction::FakeTransaction( leveldb::Status result) - : IndexedDBBackingStore::Transaction(NULL), result_(result) { -} + : IndexedDBBackingStore::Transaction(nullptr), result_(result) {} void IndexedDBFakeBackingStore::FakeTransaction::Begin() {} leveldb::Status IndexedDBFakeBackingStore::FakeTransaction::CommitPhaseOne( scoped_refptr<BlobWriteCallback> callback) {
diff --git a/content/browser/indexed_db/indexed_db_quota_client_unittest.cc b/content/browser/indexed_db/indexed_db_quota_client_unittest.cc index ee800d05..fa90cef 100644 --- a/content/browser/indexed_db/indexed_db_quota_client_unittest.cc +++ b/content/browser/indexed_db/indexed_db_quota_client_unittest.cc
@@ -69,7 +69,7 @@ ~IndexedDBQuotaClientTest() override { RunAllTasksUntilIdle(); - idb_context_ = NULL; + idb_context_ = nullptr; browser_context_.reset(); base::RunLoop().RunUntilIdle(); }
diff --git a/content/browser/indexed_db/leveldb/leveldb_database.cc b/content/browser/indexed_db/leveldb/leveldb_database.cc index bf01b07..415c057f 100644 --- a/content/browser/indexed_db/leveldb/leveldb_database.cc +++ b/content/browser/indexed_db/leveldb/leveldb_database.cc
@@ -275,7 +275,7 @@ const base::FilePath& file_name) { leveldb::Env* env = LevelDBEnv::Get(); base::FilePath lock_path = file_name.AppendASCII("LOCK"); - leveldb::FileLock* lock = NULL; + leveldb::FileLock* lock = nullptr; leveldb::Status status = env->LockFile(lock_path.AsUTF8Unsafe(), &lock); if (!status.ok()) return std::unique_ptr<LevelDBLock>(); @@ -397,7 +397,7 @@ leveldb::ReadOptions read_options; read_options.verify_checksums = true; // TODO(jsbell): Disable this if the // performance impact is too great. - read_options.snapshot = snapshot ? snapshot->snapshot_ : 0; + read_options.snapshot = snapshot ? snapshot->snapshot_ : nullptr; const leveldb::Status s = db_->Get(read_options, leveldb_env::MakeSlice(key), value); @@ -434,7 +434,7 @@ leveldb::ReadOptions read_options; read_options.verify_checksums = true; // TODO(jsbell): Disable this if the // performance impact is too great. - read_options.snapshot = snapshot ? snapshot->snapshot_ : 0; + read_options.snapshot = snapshot ? snapshot->snapshot_ : nullptr; num_iterators_++; max_iterators_ = std::max(max_iterators_, num_iterators_); @@ -456,11 +456,13 @@ const leveldb::Slice start_slice = leveldb_env::MakeSlice(start); const leveldb::Slice stop_slice = leveldb_env::MakeSlice(stop); // NULL batch means just wait for earlier writes to be done - db_->Write(leveldb::WriteOptions(), NULL); + db_->Write(leveldb::WriteOptions(), nullptr); db_->CompactRange(&start_slice, &stop_slice); } -void LevelDBDatabase::CompactAll() { db_->CompactRange(NULL, NULL); } +void LevelDBDatabase::CompactAll() { + db_->CompactRange(nullptr, nullptr); +} bool LevelDBDatabase::OnMemoryDump( const base::trace_event::MemoryDumpArgs& args,
diff --git a/content/browser/loader/detachable_resource_handler.cc b/content/browser/loader/detachable_resource_handler.cc index fc6cc26..3d4c3b6 100644 --- a/content/browser/loader/detachable_resource_handler.cc +++ b/content/browser/loader/detachable_resource_handler.cc
@@ -82,7 +82,7 @@ DetachableResourceHandler::~DetachableResourceHandler() { // Cleanup back-pointer stored on the request info. - GetRequestInfo()->set_detachable_handler(NULL); + GetRequestInfo()->set_detachable_handler(nullptr); } void DetachableResourceHandler::SetDelegate(Delegate* delegate) {
diff --git a/content/browser/loader/mime_sniffing_resource_handler.cc b/content/browser/loader/mime_sniffing_resource_handler.cc index 5f391ff..531a4aa 100644 --- a/content/browser/loader/mime_sniffing_resource_handler.cc +++ b/content/browser/loader/mime_sniffing_resource_handler.cc
@@ -450,7 +450,7 @@ bool has_plugin = plugin_service_->GetPluginInfo( info->GetChildID(), info->GetRenderFrameID(), info->GetContext(), request()->url(), url::Origin(), response_->head.mime_type, - allow_wildcard, &stale, &plugin, NULL); + allow_wildcard, &stale, &plugin, nullptr); if (stale) { // Refresh the plugins asynchronously.
diff --git a/content/browser/loader/redirect_to_file_resource_handler.cc b/content/browser/loader/redirect_to_file_resource_handler.cc index 1031b01..722831e 100644 --- a/content/browser/loader/redirect_to_file_resource_handler.cc +++ b/content/browser/loader/redirect_to_file_resource_handler.cc
@@ -84,7 +84,7 @@ } void Close() { - handler_ = NULL; + handler_ = nullptr; if (!is_writing_) CloseAndDelete(); } @@ -139,7 +139,7 @@ // Orphan the writer to asynchronously close and release the temporary file. if (writer_) { writer_->Close(); - writer_ = NULL; + writer_ = nullptr; } }
diff --git a/content/browser/loader/resource_buffer.cc b/content/browser/loader/resource_buffer.cc index 3f5a5c89..5e34dd2 100644 --- a/content/browser/loader/resource_buffer.cc +++ b/content/browser/loader/resource_buffer.cc
@@ -58,7 +58,7 @@ } bool ResourceBuffer::IsInitialized() const { - return shared_mem_.memory() != NULL; + return shared_mem_.memory() != nullptr; } base::SharedMemory& ResourceBuffer::GetSharedMemory() {
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc index 5af4065..307b67ff 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.cc +++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -387,7 +387,7 @@ DCHECK(outstanding_requests_per_tab_map_.empty()); DCHECK(g_resource_dispatcher_host); DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); - g_resource_dispatcher_host = NULL; + g_resource_dispatcher_host = nullptr; } // static @@ -579,7 +579,7 @@ ResourceLoader* loader, net::AuthChallengeInfo* auth_info) { if (!delegate_) - return NULL; + return nullptr; return delegate_->CreateLoginDelegate(auth_info, loader->request()); } @@ -1091,8 +1091,8 @@ return; } - ResourceContext* resource_context = NULL; - net::URLRequestContext* request_context = NULL; + ResourceContext* resource_context = nullptr; + net::URLRequestContext* request_context = nullptr; requester_info->GetContexts(request_data.resource_type, &resource_context, &request_context); @@ -1208,8 +1208,8 @@ IsBrowserSideNavigationEnabled() && IsResourceTypeFrame(request_data.resource_type); - ResourceContext* resource_context = NULL; - net::URLRequestContext* request_context = NULL; + ResourceContext* resource_context = nullptr; + net::URLRequestContext* request_context = nullptr; requester_info->GetContexts(request_data.resource_type, &resource_context, &request_context); @@ -2412,7 +2412,7 @@ const GlobalRequestID& id) { ResourceLoader* loader = GetLoader(id); if (!loader) - return NULL; + return nullptr; return loader->request(); } @@ -2618,7 +2618,7 @@ LoaderMap::const_iterator i = pending_loaders_.find(id); if (i == pending_loaders_.end()) - return NULL; + return nullptr; return i->second.get(); }
diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc index be03152..15b52bb 100644 --- a/content/browser/loader/resource_dispatcher_host_unittest.cc +++ b/content/browser/loader/resource_dispatcher_host_unittest.cc
@@ -262,10 +262,10 @@ int process_id) : ResourceMessageFilter( process_id, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, base::Bind(&TestFilterSpecifyingChild::GetContexts, base::Unretained(this)), BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)), @@ -395,7 +395,7 @@ LOG(ERROR) << "Unreleased entries on URLRequestTestDelayedStartJob delay queue" << "; may result in leaks."; - list_head_ = NULL; + list_head_ = nullptr; } } @@ -421,8 +421,8 @@ URLRequestTestDelayedStartJob* next_; }; -URLRequestTestDelayedStartJob* -URLRequestTestDelayedStartJob::list_head_ = NULL; +URLRequestTestDelayedStartJob* URLRequestTestDelayedStartJob::list_head_ = + nullptr; // This class is a variation on URLRequestTestJob in that it // returns IO_pending errors before every read, not just the first one. @@ -659,12 +659,12 @@ ~GenericResourceThrottle() override { if (active_throttle_ == this) - active_throttle_ = NULL; + active_throttle_ = nullptr; } // ResourceThrottle implementation: void WillStartRequest(bool* defer) override { - ASSERT_EQ(NULL, active_throttle_); + ASSERT_EQ(nullptr, active_throttle_); if (flags_ & DEFER_STARTING_REQUEST) { active_throttle_ = this; *defer = true; @@ -680,7 +680,7 @@ } void WillProcessResponse(bool* defer) override { - ASSERT_EQ(NULL, active_throttle_); + ASSERT_EQ(nullptr, active_throttle_); if (flags_ & DEFER_PROCESSING_RESPONSE) { active_throttle_ = this; *defer = true; @@ -701,7 +701,7 @@ void AssertAndResume() { ASSERT_TRUE(this == active_throttle_); - active_throttle_ = NULL; + active_throttle_ = nullptr; ResourceThrottle::Resume(); } @@ -721,7 +721,7 @@ static GenericResourceThrottle* active_throttle_; }; // static -GenericResourceThrottle* GenericResourceThrottle::active_throttle_ = NULL; +GenericResourceThrottle* GenericResourceThrottle::active_throttle_ = nullptr; class TestResourceDispatcherHostDelegate : public ResourceDispatcherHostDelegate { @@ -1244,7 +1244,7 @@ net::URLRequestContext* request_context = browser_context_->GetResourceContext()->GetRequestContext(); std::unique_ptr<net::URLRequest> request(request_context->CreateRequest( - url, net::DEFAULT_PRIORITY, NULL, TRAFFIC_ANNOTATION_FOR_TESTS)); + url, net::DEFAULT_PRIORITY, nullptr, TRAFFIC_ANNOTATION_FOR_TESTS)); DownloadManagerImpl::BeginDownloadRequest( std::move(request), Referrer(), browser_context_->GetResourceContext(), false, // is_content_initiated @@ -2310,7 +2310,7 @@ TEST_F(ResourceDispatcherHostTest, CalculateApproximateMemoryCost) { net::URLRequestContext context; std::unique_ptr<net::URLRequest> req(context.CreateRequest( - GURL("http://www.google.com"), net::DEFAULT_PRIORITY, NULL, + GURL("http://www.google.com"), net::DEFAULT_PRIORITY, nullptr, TRAFFIC_ANNOTATION_FOR_TESTS)); EXPECT_EQ(4425, ResourceDispatcherHostImpl::CalculateApproximateMemoryCost( req.get())); @@ -3485,7 +3485,7 @@ // Register it for a resource request. host_.RegisterDownloadedTempFile(filter_->child_id(), kRequestID, file_path); - deletable_file = NULL; + deletable_file = nullptr; // Should be readable now. EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile(
diff --git a/content/browser/loader/resource_loader.cc b/content/browser/loader/resource_loader.cc index e0f12593..dbc47e23 100644 --- a/content/browser/loader/resource_loader.cc +++ b/content/browser/loader/resource_loader.cc
@@ -311,7 +311,7 @@ } void ResourceLoader::ClearLoginDelegate() { - login_delegate_ = NULL; + login_delegate_ = nullptr; } void ResourceLoader::OutOfBandCancel(int error_code, bool tell_renderer) { @@ -615,7 +615,7 @@ if (login_delegate_.get()) { login_delegate_->OnRequestCancelled(); - login_delegate_ = NULL; + login_delegate_ = nullptr; } ssl_client_auth_handler_.reset();
diff --git a/content/browser/loader/resource_loader_unittest.cc b/content/browser/loader/resource_loader_unittest.cc index 99e5fd0..7def420 100644 --- a/content/browser/loader/resource_loader_unittest.cc +++ b/content/browser/loader/resource_loader_unittest.cc
@@ -352,8 +352,8 @@ : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), test_url_request_context_(true), resource_context_(&test_url_request_context_), - raw_ptr_resource_handler_(NULL), - raw_ptr_to_request_(NULL) { + raw_ptr_resource_handler_(nullptr), + raw_ptr_to_request_(nullptr) { test_url_request_context_.set_job_factory(&job_factory_); test_url_request_context_.set_network_quality_estimator( &network_quality_estimator_); @@ -460,7 +460,7 @@ ResourceDispatcherHostLoginDelegate* CreateLoginDelegate( ResourceLoader* loader, net::AuthChallengeInfo* auth_info) override { - return NULL; + return nullptr; } bool HandleExternalProtocol(ResourceLoader* loader, const GURL& url) override {
diff --git a/content/browser/loader/resource_request_info_impl.cc b/content/browser/loader/resource_request_info_impl.cc index 9efcf7f0..611c0fe2 100644 --- a/content/browser/loader/resource_request_info_impl.cc +++ b/content/browser/loader/resource_request_info_impl.cc
@@ -151,7 +151,7 @@ PreviewsState previews_state, const scoped_refptr<ResourceRequestBody> body, bool initiated_in_secure_context) - : detachable_handler_(NULL), + : detachable_handler_(nullptr), requester_info_(std::move(requester_info)), route_id_(route_id), frame_tree_node_id_(frame_tree_node_id),
diff --git a/content/browser/loader/resource_scheduler.cc b/content/browser/loader/resource_scheduler.cc index 9cec9270..af17d6d 100644 --- a/content/browser/loader/resource_scheduler.cc +++ b/content/browser/loader/resource_scheduler.cc
@@ -1165,7 +1165,7 @@ ClientId client_id = MakeClientId(child_id, route_id); ClientMap::iterator client_it = client_map_.find(client_id); if (client_it == client_map_.end()) { - return NULL; + return nullptr; } return client_it->second; }
diff --git a/content/browser/loader/resource_scheduler_unittest.cc b/content/browser/loader/resource_scheduler_unittest.cc index 4c2a358..b815a63 100644 --- a/content/browser/loader/resource_scheduler_unittest.cc +++ b/content/browser/loader/resource_scheduler_unittest.cc
@@ -163,8 +163,8 @@ class FakeResourceContext : public ResourceContext { private: - net::HostResolver* GetHostResolver() override { return NULL; } - net::URLRequestContext* GetRequestContext() override { return NULL; } + net::HostResolver* GetHostResolver() override { return nullptr; } + net::URLRequestContext* GetRequestContext() override { return nullptr; } }; class ResourceSchedulerTest : public testing::Test {
diff --git a/content/browser/loader/temporary_file_stream_unittest.cc b/content/browser/loader/temporary_file_stream_unittest.cc index 7ba8fbc8..e32ae5b 100644 --- a/content/browser/loader/temporary_file_stream_unittest.cc +++ b/content/browser/loader/temporary_file_stream_unittest.cc
@@ -53,8 +53,8 @@ } void Release() { - file_stream_.reset(NULL); - deletable_file_ = NULL; + file_stream_.reset(nullptr); + deletable_file_ = nullptr; } private: base::RunLoop loop_;
diff --git a/content/browser/loader/throttling_resource_handler_unittest.cc b/content/browser/loader/throttling_resource_handler_unittest.cc index 369fc3d..14b223d 100644 --- a/content/browser/loader/throttling_resource_handler_unittest.cc +++ b/content/browser/loader/throttling_resource_handler_unittest.cc
@@ -208,7 +208,7 @@ EXPECT_EQ(0, test_handler_->on_read_completed_called()); ASSERT_EQ(MockResourceLoader::Status::IDLE, - mock_loader_->OnReadCompleted(0)); + mock_loader_->OnReadCompleted(nullptr)); EXPECT_EQ(1, test_handler_->on_read_completed_called()); EXPECT_EQ(0, test_handler_->on_response_completed_called());
diff --git a/content/browser/loader/upload_data_stream_builder_unittest.cc b/content/browser/loader/upload_data_stream_builder_unittest.cc index a6aab088..2a67237 100644 --- a/content/browser/loader/upload_data_stream_builder_unittest.cc +++ b/content/browser/loader/upload_data_stream_builder_unittest.cc
@@ -64,7 +64,7 @@ std::unique_ptr<net::UploadDataStream> upload( UploadDataStreamBuilder::Build( - request_body.get(), &context, NULL, + request_body.get(), &context, nullptr, base::ThreadTaskRunnerHandle::Get().get())); EXPECT_EQ(kIdentifier, upload->identifier()); @@ -122,7 +122,7 @@ scoped_refptr<ResourceRequestBody> request_body(new ResourceRequestBody()); std::unique_ptr<net::UploadDataStream> upload( UploadDataStreamBuilder::Build( - request_body.get(), &blob_storage_context, NULL, + request_body.get(), &blob_storage_context, nullptr, base::ThreadTaskRunnerHandle::Get().get())); request_body = new ResourceRequestBody(); @@ -131,7 +131,7 @@ request_body->AppendBlob(blob_id); upload = UploadDataStreamBuilder::Build( - request_body.get(), &blob_storage_context, NULL, + request_body.get(), &blob_storage_context, nullptr, base::ThreadTaskRunnerHandle::Get().get()); ASSERT_TRUE(upload->GetElementReaders()); const auto& readers = *upload->GetElementReaders();
diff --git a/content/browser/media/capture/audio_mirroring_manager.cc b/content/browser/media/capture/audio_mirroring_manager.cc index c7683cb..35793ad3 100644 --- a/content/browser/media/capture/audio_mirroring_manager.cc +++ b/content/browser/media/capture/audio_mirroring_manager.cc
@@ -45,7 +45,7 @@ // the stream. std::set<SourceFrameRef> candidates; candidates.insert(routes_.back().source_render_frame); - InitiateQueriesToFindNewDestination(NULL, candidates); + InitiateQueriesToFindNewDestination(nullptr, candidates); } void AudioMirroringManager::RemoveDiverter(Diverter* diverter) { @@ -56,7 +56,7 @@ for (StreamRoutes::iterator it = routes_.begin(); it != routes_.end(); ++it) { if (it->diverter == diverter) { // Stop the diverted flow. - RouteDivertedFlow(&(*it), NULL); + RouteDivertedFlow(&(*it), nullptr); // Stop duplication flows. for (auto& dup : it->duplications) { @@ -107,7 +107,7 @@ std::set<SourceFrameRef> redivert_candidates; for (StreamRoutes::iterator it = routes_.begin(); it != routes_.end(); ++it) { if (it->destination == destination) { - RouteDivertedFlow(&(*it), NULL); + RouteDivertedFlow(&(*it), nullptr); redivert_candidates.insert(it->source_render_frame); } auto dup_it = it->duplications.find(destination); @@ -182,7 +182,7 @@ } else if (!add_only) { // Only stop diverting if the stream is currently routed to |destination|. if (it->destination == destination) { - RouteDivertedFlow(&(*it), NULL); + RouteDivertedFlow(&(*it), nullptr); redivert_candidates.insert(it->source_render_frame); } } @@ -241,7 +241,7 @@ << route->source_render_frame.second << " --> MirroringDestination@" << route->destination; route->diverter->StopDiverting(); - route->destination = NULL; + route->destination = nullptr; } if (new_destination) { @@ -256,10 +256,11 @@ } AudioMirroringManager::StreamRoutingState::StreamRoutingState( - const SourceFrameRef& source_frame, Diverter* stream_diverter) - : source_render_frame(source_frame), - diverter(stream_diverter), - destination(NULL) {} + const SourceFrameRef& source_frame, + Diverter* stream_diverter) + : source_render_frame(source_frame), + diverter(stream_diverter), + destination(nullptr) {} AudioMirroringManager::StreamRoutingState::StreamRoutingState( const StreamRoutingState& other) = default;
diff --git a/content/browser/media/capture/aura_window_capture_machine.cc b/content/browser/media/capture/aura_window_capture_machine.cc index 6040707..6e50e3f 100644 --- a/content/browser/media/capture/aura_window_capture_machine.cc +++ b/content/browser/media/capture/aura_window_capture_machine.cc
@@ -37,7 +37,7 @@ namespace content { AuraWindowCaptureMachine::AuraWindowCaptureMachine() - : desktop_window_(NULL), + : desktop_window_(nullptr), screen_capture_(false), frame_capture_active_(true), weak_factory_(this) {} @@ -165,7 +165,7 @@ } } desktop_window_->RemoveObserver(this); - desktop_window_ = NULL; + desktop_window_ = nullptr; cursor_renderer_.reset(); }
diff --git a/content/browser/media/capture/desktop_capture_device_unittest.cc b/content/browser/media/capture/desktop_capture_device_unittest.cc index ec0eda7..2ca9d760 100644 --- a/content/browser/media/capture/desktop_capture_device_unittest.cc +++ b/content/browser/media/capture/desktop_capture_device_unittest.cc
@@ -176,11 +176,10 @@ class FakeScreenCapturer : public webrtc::DesktopCapturer { public: FakeScreenCapturer() - : callback_(NULL), + : callback_(nullptr), frame_index_(0), generate_inverted_frames_(false), - generate_cropped_frames_(false) { - } + generate_cropped_frames_(false) {} ~FakeScreenCapturer() override {} void set_generate_inverted_frames(bool generate_inverted_frames) {
diff --git a/content/browser/media/capture/web_contents_audio_input_stream.cc b/content/browser/media/capture/web_contents_audio_input_stream.cc index 303d910..9de6f4f 100644 --- a/content/browser/media/capture/web_contents_audio_input_stream.cc +++ b/content/browser/media/capture/web_contents_audio_input_stream.cc
@@ -145,7 +145,7 @@ mixer_stream_(mixer_stream), state_(CONSTRUCTED), is_target_lost_(false), - callback_(NULL), + callback_(nullptr), is_duplication_(is_duplication) { DCHECK(mirroring_manager_); DCHECK(tracker_); @@ -195,7 +195,7 @@ callback_ = callback; if (is_target_lost_) { ReportError(); - callback_ = NULL; + callback_ = nullptr; return; } @@ -220,7 +220,7 @@ state_ = OPENED; mixer_stream_->Stop(); - callback_ = NULL; + callback_ = nullptr; StopMirroring(); } @@ -367,7 +367,7 @@ AudioMirroringManager* audio_mirroring_manager) { WebContentsMediaCaptureId media_id; if (!WebContentsMediaCaptureId::Parse(device_id, &media_id)) { - return NULL; + return nullptr; } return new WebContentsAudioInputStream(
diff --git a/content/browser/media/capture/web_contents_audio_input_stream_unittest.cc b/content/browser/media/capture/web_contents_audio_input_stream_unittest.cc index bdff30f..7c1911b 100644 --- a/content/browser/media/capture/web_contents_audio_input_stream_unittest.cc +++ b/content/browser/media/capture/web_contents_audio_input_stream_unittest.cc
@@ -188,9 +188,9 @@ audio_thread_("Audio thread"), mock_mirroring_manager_(new MockAudioMirroringManager()), mock_tracker_(new MockWebContentsTracker()), - mock_vais_(NULL), - wcais_(NULL), - destination_(NULL), + mock_vais_(nullptr), + wcais_(nullptr), + destination_(nullptr), current_render_process_id_(kRenderProcessId), current_render_frame_id_(kRenderFrameId), on_data_event_(base::WaitableEvent::ResetPolicy::AUTOMATIC, @@ -250,7 +250,7 @@ EXPECT_CALL(*mock_mirroring_manager_, StopMirroring(NotNull())) .WillOnce(Assign( &destination_, - static_cast<AudioMirroringManager::MirroringDestination*>(NULL))) + static_cast<AudioMirroringManager::MirroringDestination*>(nullptr))) .RetiresOnSaturation(); EXPECT_CALL(mock_input_callback_, OnData(NotNull(), _, _)) @@ -377,8 +377,8 @@ // objects hang around until they are no longer referred to (e.g., as tasks // on other threads shut things down). wcais_->Close(); - wcais_ = NULL; - mock_vais_ = NULL; + wcais_ = nullptr; + mock_vais_ = nullptr; } void RunOnAudioThread(const base::Closure& closure) {
diff --git a/content/browser/media/capture/web_contents_video_capture_device_unittest.cc b/content/browser/media/capture/web_contents_video_capture_device_unittest.cc index 1e21f84..3f91cb4 100644 --- a/content/browser/media/capture/web_contents_video_capture_device_unittest.cc +++ b/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
@@ -507,7 +507,7 @@ base::RunLoop().RunUntilIdle(); - RenderProcessHostImpl::set_render_process_host_factory(NULL); + RenderProcessHostImpl::set_render_process_host_factory(nullptr); render_frame_host_factory_.reset(); render_view_host_factory_.reset(); render_process_host_factory_.reset();
diff --git a/content/browser/media/media_internals.cc b/content/browser/media/media_internals.cc index bec48b8..997bb38 100644 --- a/content/browser/media/media_internals.cc +++ b/content/browser/media/media_internals.cc
@@ -793,7 +793,7 @@ std::unique_ptr<base::Value> out_value; CHECK(audio_streams_cached_data_.Remove(cache_key, &out_value)); } else { - base::DictionaryValue* existing_dict = NULL; + base::DictionaryValue* existing_dict = nullptr; CHECK( audio_streams_cached_data_.GetDictionary(cache_key, &existing_dict)); existing_dict->MergeDictionary(value);
diff --git a/content/browser/media/media_internals_unittest.cc b/content/browser/media/media_internals_unittest.cc index e355c4b..0e64d39a 100644 --- a/content/browser/media/media_internals_unittest.cc +++ b/content/browser/media/media_internals_unittest.cc
@@ -51,7 +51,7 @@ utf8_update.substr(first_brace, last_brace - first_brace + 1)); CHECK(output_value); - base::DictionaryValue* output_dict = NULL; + base::DictionaryValue* output_dict = nullptr; CHECK(output_value->GetAsDictionary(&output_dict)); update_data_.MergeDictionary(output_dict); }
diff --git a/content/browser/net/view_http_cache_job_factory.cc b/content/browser/net/view_http_cache_job_factory.cc index 5fef2a7..2b5ebb9 100644 --- a/content/browser/net/view_http_cache_job_factory.cc +++ b/content/browser/net/view_http_cache_job_factory.cc
@@ -110,7 +110,7 @@ weak_factory_.InvalidateWeakPtrs(); if (core_.get()) { core_->Orphan(); - core_ = NULL; + core_ = nullptr; } net::URLRequestJob::Kill(); }
diff --git a/content/browser/notification_service_impl.cc b/content/browser/notification_service_impl.cc index de21769..9f38bb05 100644 --- a/content/browser/notification_service_impl.cc +++ b/content/browser/notification_service_impl.cc
@@ -40,7 +40,7 @@ } NotificationServiceImpl::NotificationServiceImpl() { - DCHECK(current() == NULL); + DCHECK(current() == nullptr); lazy_tls_ptr.Pointer()->Set(this); } @@ -131,7 +131,7 @@ NotificationServiceImpl::~NotificationServiceImpl() { - lazy_tls_ptr.Pointer()->Set(NULL); + lazy_tls_ptr.Pointer()->Set(nullptr); #ifndef NDEBUG for (int i = 0; i < static_cast<int>(observer_counts_.size()); i++) {
diff --git a/content/browser/plugin_data_remover_impl.cc b/content/browser/plugin_data_remover_impl.cc index fe5ca2f..169c492 100644 --- a/content/browser/plugin_data_remover_impl.cc +++ b/content/browser/plugin_data_remover_impl.cc
@@ -47,7 +47,7 @@ bool allow_wildcard = false; std::vector<WebPluginInfo> plugins; PluginService::GetInstance()->GetPluginInfoArray( - GURL(), kFlashPluginSwfMimeType, allow_wildcard, &plugins, NULL); + GURL(), kFlashPluginSwfMimeType, allow_wildcard, &plugins, nullptr); base::Version min_version(kMinFlashVersion); for (std::vector<WebPluginInfo>::iterator it = plugins.begin(); it != plugins.end(); ++it) { @@ -88,8 +88,8 @@ // Get the plugin file path. std::vector<WebPluginInfo> plugins; - plugin_service->GetPluginInfoArray( - GURL(), mime_type, false, &plugins, NULL); + plugin_service->GetPluginInfoArray(GURL(), mime_type, false, &plugins, + nullptr); if (plugins.empty()) { // May be empty for some tests and on the CrOS login OOBE screen.
diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc index 4bdfa1d..545d953d 100644 --- a/content/browser/plugin_service_impl.cc +++ b/content/browser/plugin_service_impl.cc
@@ -79,8 +79,7 @@ return base::Singleton<PluginServiceImpl>::get(); } -PluginServiceImpl::PluginServiceImpl() - : filter_(NULL) { +PluginServiceImpl::PluginServiceImpl() : filter_(nullptr) { plugin_list_sequence_checker_.DetachFromSequence(); // Collect the total number of browser processes (which create @@ -116,7 +115,7 @@ return *iter; } } - return NULL; + return nullptr; } PpapiPluginProcessHost* PluginServiceImpl::FindPpapiBrokerProcess( @@ -126,7 +125,7 @@ return *iter; } - return NULL; + return nullptr; } PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiPluginProcess( @@ -137,7 +136,7 @@ if (filter_ && !filter_->CanLoadPlugin(render_process_id, plugin_path)) { VLOG(1) << "Unable to load ppapi plugin: " << plugin_path.MaybeAsASCII(); - return NULL; + return nullptr; } PpapiPluginProcessHost* plugin_host = @@ -150,7 +149,7 @@ if (!info) { VLOG(1) << "Unable to find ppapi plugin registration for: " << plugin_path.MaybeAsASCII(); - return NULL; + return nullptr; } // Record when PPAPI Flash process is started for the first time. @@ -179,7 +178,7 @@ DCHECK_CURRENTLY_ON(BrowserThread::IO); if (filter_ && !filter_->CanLoadPlugin(render_process_id, plugin_path)) - return NULL; + return nullptr; PpapiPluginProcessHost* plugin_host = FindPpapiBrokerProcess(plugin_path); if (plugin_host) @@ -188,7 +187,7 @@ // Validate that the plugin is actually registered. PepperPluginInfo* info = GetRegisteredPpapiPluginInfo(plugin_path); if (!info) - return NULL; + return nullptr; // TODO(ddorwin): Uncomment once out of process is supported. // DCHECK(info->is_out_of_process);
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc index 2a10afaf..e6183361 100644 --- a/content/browser/ppapi_plugin_process_host.cc +++ b/content/browser/ppapi_plugin_process_host.cc
@@ -187,7 +187,7 @@ return plugin_host; NOTREACHED(); // Init is not expected to fail. - return NULL; + return nullptr; } // static @@ -199,7 +199,7 @@ return plugin_host; NOTREACHED(); // Init is not expected to fail. - return NULL; + return nullptr; } // static @@ -296,8 +296,8 @@ // We don't have to do any whitelisting for APIs in this process host, so // don't bother passing a browser context or document url here. - if (GetContentClient()->browser()->IsPluginAllowedToUseDevChannelAPIs( - NULL, GURL())) + if (GetContentClient()->browser()->IsPluginAllowedToUseDevChannelAPIs(nullptr, + GURL())) base_permissions |= ppapi::PERMISSION_DEV_CHANNEL; permissions_ = ppapi::PpapiPermissions::GetForCommandLine(base_permissions);
diff --git a/content/browser/quota_dispatcher_host.cc b/content/browser/quota_dispatcher_host.cc index 88487ce..af7cbb8a 100644 --- a/content/browser/quota_dispatcher_host.cc +++ b/content/browser/quota_dispatcher_host.cc
@@ -52,11 +52,11 @@ return dispatcher_host_.get(); } storage::QuotaManager* quota_manager() const { - return dispatcher_host_ ? dispatcher_host_->quota_manager_ : NULL; + return dispatcher_host_ ? dispatcher_host_->quota_manager_ : nullptr; } QuotaPermissionContext* permission_context() const { - return dispatcher_host_ ? - dispatcher_host_->permission_context_.get() : NULL; + return dispatcher_host_ ? dispatcher_host_->permission_context_.get() + : nullptr; } int render_process_id() const { return render_process_id_; } int request_id() const { return request_id_; }
diff --git a/content/browser/renderer_host/delegated_frame_host.cc b/content/browser/renderer_host/delegated_frame_host.cc index 34814f6..af26c141 100644 --- a/content/browser/renderer_host/delegated_frame_host.cc +++ b/content/browser/renderer_host/delegated_frame_host.cc
@@ -101,7 +101,7 @@ void DelegatedFrameHost::WasHidden() { frame_evictor_->SetVisible(false); - released_front_lock_ = NULL; + released_front_lock_ = nullptr; } void DelegatedFrameHost::MaybeCreateResizeLock() { @@ -590,7 +590,7 @@ surface_info.id()); local_surface_id_ = surface_info.id().local_surface_id(); - released_front_lock_ = NULL; + released_front_lock_ = nullptr; gfx::Size frame_size_in_dip = gfx::ConvertSizeToDIP( surface_info.device_scale_factor(), surface_info.size_in_pixels()); current_frame_size_in_dip_ = frame_size_in_dip;
diff --git a/content/browser/renderer_host/dip_util.cc b/content/browser/renderer_host/dip_util.cc index 3d20622..465ffa88 100644 --- a/content/browser/renderer_host/dip_util.cc +++ b/content/browser/renderer_host/dip_util.cc
@@ -17,7 +17,8 @@ namespace content { float GetScaleFactorForView(const RenderWidgetHostView* view) { - return ui::GetScaleFactorForNativeView(view ? view->GetNativeView() : NULL); + return ui::GetScaleFactorForNativeView(view ? view->GetNativeView() + : nullptr); } gfx::Point ConvertViewPointToDIP(const RenderWidgetHostView* view,
diff --git a/content/browser/renderer_host/font_utils_linux.cc b/content/browser/renderer_host/font_utils_linux.cc index f32f6a1b..e5fd81a 100644 --- a/content/browser/renderer_host/font_utils_linux.cc +++ b/content/browser/renderer_host/font_utils_linux.cc
@@ -160,11 +160,11 @@ FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); FcPatternAddLangSet(pattern, FC_LANG, langset); FcPatternAddBool(pattern, FC_SCALABLE, FcTrue); - FcConfigSubstitute(NULL, pattern, FcMatchPattern); + FcConfigSubstitute(nullptr, pattern, FcMatchPattern); FcDefaultSubstitute(pattern); FcResult result; - FcFontSet* font_set = FcFontSort(0, pattern, 0, 0, &result); + FcFontSet* font_set = FcFontSort(nullptr, pattern, 0, nullptr, &result); int font_fd = -1; int good_enough_index = -1; bool good_enough_index_set = false;
diff --git a/content/browser/renderer_host/input/composited_scrolling_browsertest.cc b/content/browser/renderer_host/input/composited_scrolling_browsertest.cc index 0d433e4..a4f829f 100644 --- a/content/browser/renderer_host/input/composited_scrolling_browsertest.cc +++ b/content/browser/renderer_host/input/composited_scrolling_browsertest.cc
@@ -136,7 +136,7 @@ // Runs until we get the OnSyntheticGestureCompleted callback runner_->Run(); - runner_ = NULL; + runner_ = nullptr; return GetScrollTop(); }
diff --git a/content/browser/renderer_host/input/input_router_impl_unittest.cc b/content/browser/renderer_host/input/input_router_impl_unittest.cc index adb19f6..b56b681f 100644 --- a/content/browser/renderer_host/input/input_router_impl_unittest.cc +++ b/content/browser/renderer_host/input/input_router_impl_unittest.cc
@@ -72,7 +72,7 @@ } WebInputEvent& GetEventWithType(WebInputEvent::Type type) { - WebInputEvent* event = NULL; + WebInputEvent* event = nullptr; if (WebInputEvent::IsMouseEventType(type)) { static WebMouseEvent mouse; event = &mouse;
diff --git a/content/browser/renderer_host/input/legacy_input_router_impl_unittest.cc b/content/browser/renderer_host/input/legacy_input_router_impl_unittest.cc index 16196134..a85f9fe 100644 --- a/content/browser/renderer_host/input/legacy_input_router_impl_unittest.cc +++ b/content/browser/renderer_host/input/legacy_input_router_impl_unittest.cc
@@ -75,12 +75,12 @@ const char* data; int data_length; if (!iter.ReadData(&data, &data_length)) - return NULL; + return nullptr; return reinterpret_cast<const WebInputEvent*>(data); } WebInputEvent& GetEventWithType(WebInputEvent::Type type) { - WebInputEvent* event = NULL; + WebInputEvent* event = nullptr; if (WebInputEvent::IsMouseEventType(type)) { static WebMouseEvent mouse; event = &mouse;
diff --git a/content/browser/renderer_host/input/mock_input_disposition_handler.cc b/content/browser/renderer_host/input/mock_input_disposition_handler.cc index 6595ebe..134e2817 100644 --- a/content/browser/renderer_host/input/mock_input_disposition_handler.cc +++ b/content/browser/renderer_host/input/mock_input_disposition_handler.cc
@@ -18,7 +18,7 @@ namespace content { MockInputDispositionHandler::MockInputDispositionHandler() - : input_router_(NULL), + : input_router_(nullptr), ack_count_(0), unexpected_event_ack_called_(false), ack_event_type_(WebInputEvent::kUndefined),
diff --git a/content/browser/renderer_host/input/mock_input_router_client.cc b/content/browser/renderer_host/input/mock_input_router_client.cc index 95f5cdb2..a46a930 100644 --- a/content/browser/renderer_host/input/mock_input_router_client.cc +++ b/content/browser/renderer_host/input/mock_input_router_client.cc
@@ -19,7 +19,7 @@ namespace content { MockInputRouterClient::MockInputRouterClient() - : input_router_(NULL), + : input_router_(nullptr), in_flight_event_count_(0), has_touch_handler_(false), filter_state_(INPUT_EVENT_ACK_STATE_NOT_CONSUMED),
diff --git a/content/browser/renderer_host/input/render_widget_host_latency_tracker.cc b/content/browser/renderer_host/input/render_widget_host_latency_tracker.cc index e44d36dd..0c4d542 100644 --- a/content/browser/renderer_host/input/render_widget_host_latency_tracker.cc +++ b/content/browser/renderer_host/input/render_widget_host_latency_tracker.cc
@@ -288,13 +288,13 @@ } if (latency->FindLatency(ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, - latency_component_id_, NULL)) { + latency_component_id_, nullptr)) { return; } if (event.TimeStampSeconds() && !latency->FindLatency(ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, - NULL)) { + nullptr)) { base::TimeTicks timestamp_now = base::TimeTicks::Now(); base::TimeTicks timestamp_original = base::TimeTicks() +
diff --git a/content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc b/content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc index f1431bd..1912ee0 100644 --- a/content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc +++ b/content/browser/renderer_host/input/render_widget_host_latency_tracker_unittest.cc
@@ -97,7 +97,7 @@ : public RenderViewHostImplTestHarness { public: RenderWidgetHostLatencyTrackerTest() - : tracker_(false), old_browser_client_(NULL) { + : tracker_(false), old_browser_client_(nullptr) { tracker_.Initialize(kTestRoutingId, kTestProcessId); ResetHistograms(); }
diff --git a/content/browser/renderer_host/input/touch_action_browsertest.cc b/content/browser/renderer_host/input/touch_action_browsertest.cc index 3261346..c16cb1a 100644 --- a/content/browser/renderer_host/input/touch_action_browsertest.cc +++ b/content/browser/renderer_host/input/touch_action_browsertest.cc
@@ -156,7 +156,7 @@ // Runs until we get the OnSyntheticGestureCompleted callback runner_->Run(); - runner_ = NULL; + runner_ = nullptr; // Expect that the compositor scrolled at least one pixel while the // main thread was in a busy loop.
diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc index 5b14a8a..cf6cff4 100644 --- a/content/browser/renderer_host/media/media_stream_manager.cc +++ b/content/browser/renderer_host/media/media_stream_manager.cc
@@ -915,7 +915,7 @@ std::string unique_label; do { unique_label = RandomLabel(); - } while (FindRequest(unique_label) != NULL); + } while (FindRequest(unique_label) != nullptr); requests_.push_back(std::make_pair(unique_label, request)); @@ -928,7 +928,7 @@ if (labeled_request.first == label) return labeled_request.second; } - return NULL; + return nullptr; } void MediaStreamManager::DeleteRequest(const std::string& label) {
diff --git a/content/browser/renderer_host/media/media_stream_ui_proxy.cc b/content/browser/renderer_host/media/media_stream_ui_proxy.cc index e6afeb387..0dc1f3bf 100644 --- a/content/browser/renderer_host/media/media_stream_ui_proxy.cc +++ b/content/browser/renderer_host/media/media_stream_ui_proxy.cc
@@ -45,13 +45,13 @@ RenderFrameHostImpl::FromID(request->render_process_id, request->render_frame_id); - if (rfh == NULL) { + if (rfh == nullptr) { // RenderFrame destroyed before the request is handled? return; } FrameTreeNode* node = rfh->frame_tree_node(); - while (node->parent() != NULL) { + while (node->parent() != nullptr) { if (!node->HasSameOrigin(*node->parent())) { request->all_ancestors_have_same_origin = false; return; @@ -189,12 +189,12 @@ return test_render_delegate_; RenderFrameHostImpl* host = RenderFrameHostImpl::FromID(render_process_id, render_frame_id); - return host ? host->delegate() : NULL; + return host ? host->delegate() : nullptr; } // static std::unique_ptr<MediaStreamUIProxy> MediaStreamUIProxy::Create() { - return std::unique_ptr<MediaStreamUIProxy>(new MediaStreamUIProxy(NULL)); + return std::unique_ptr<MediaStreamUIProxy>(new MediaStreamUIProxy(nullptr)); } // static
diff --git a/content/browser/renderer_host/media/video_capture_buffer_pool_unittest.cc b/content/browser/renderer_host/media/video_capture_buffer_pool_unittest.cc index c5b4bda..3b324aae 100644 --- a/content/browser/renderer_host/media/video_capture_buffer_pool_unittest.cc +++ b/content/browser/renderer_host/media/video_capture_buffer_pool_unittest.cc
@@ -276,7 +276,7 @@ // the lifetime of the underlying memory. buffer3.reset(); ASSERT_EQ(2.0 / kTestBufferPoolSize, pool_->GetBufferPoolUtilization()); - pool_ = NULL; + pool_ = nullptr; // Touch the memory. if (buffer2->data() != nullptr)
diff --git a/content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc b/content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc index 9479695..851a223 100644 --- a/content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc +++ b/content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc
@@ -235,8 +235,8 @@ void BrowserPpapiHostImpl::HostMessageFilter::OnHostDestroyed() { DCHECK(ppapi_host_); - ppapi_host_ = NULL; - browser_ppapi_host_impl_ = NULL; + ppapi_host_ = nullptr; + browser_ppapi_host_impl_ = nullptr; } BrowserPpapiHostImpl::HostMessageFilter::~HostMessageFilter() {}
diff --git a/content/browser/renderer_host/pepper/pepper_file_ref_host.cc b/content/browser/renderer_host/pepper/pepper_file_ref_host.cc index 6a1d9af..8af8c580 100644 --- a/content/browser/renderer_host/pepper/pepper_file_ref_host.cc +++ b/content/browser/renderer_host/pepper/pepper_file_ref_host.cc
@@ -45,7 +45,7 @@ ResourceHost* fs_resource_host = host->GetPpapiHost()->GetResourceHost(file_system); - if (fs_resource_host == NULL) { + if (fs_resource_host == nullptr) { DLOG(ERROR) << "Couldn't find FileSystem host: " << resource << " path: " << path; return; @@ -211,7 +211,7 @@ if (!resource_host) return PP_ERROR_BADRESOURCE; - PepperFileRefHost* file_ref_host = NULL; + PepperFileRefHost* file_ref_host = nullptr; if (resource_host->IsFileRefHost()) file_ref_host = static_cast<PepperFileRefHost*>(resource_host); if (!file_ref_host)
diff --git a/content/browser/renderer_host/pepper/pepper_file_system_browser_host.cc b/content/browser/renderer_host/pepper/pepper_file_system_browser_host.cc index d827ac0f..76a102a 100644 --- a/content/browser/renderer_host/pepper/pepper_file_system_browser_host.cc +++ b/content/browser/renderer_host/pepper/pepper_file_system_browser_host.cc
@@ -40,10 +40,10 @@ DCHECK_CURRENTLY_ON(BrowserThread::UI); RenderProcessHost* host = RenderProcessHost::FromID(render_process_id); if (!host) - return NULL; + return nullptr; StoragePartition* storage_partition = host->GetStoragePartition(); if (!storage_partition) - return NULL; + return nullptr; return storage_partition->GetFileSystemContext(); } @@ -58,7 +58,7 @@ type_(type), called_open_(false), opened_(false), - file_system_context_(NULL), + file_system_context_(nullptr), reserved_quota_(0), reserving_quota_(false), weak_factory_(this) {}
diff --git a/content/browser/renderer_host/pepper/pepper_host_resolver_message_filter.cc b/content/browser/renderer_host/pepper/pepper_host_resolver_message_filter.cc index f5c86d89..a7eb917 100644 --- a/content/browser/renderer_host/pepper/pepper_host_resolver_message_filter.cc +++ b/content/browser/renderer_host/pepper/pepper_host_resolver_message_filter.cc
@@ -104,7 +104,7 @@ const IPC::Message& message) { if (message.type() == PpapiHostMsg_HostResolver_Resolve::ID) return BrowserThread::GetTaskRunnerForThread(BrowserThread::UI); - return NULL; + return nullptr; } int32_t PepperHostResolverMessageFilter::OnResourceMessageReceived(
diff --git a/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.cc b/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.cc index db1ace0..ab1c3fc 100644 --- a/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.cc +++ b/content/browser/renderer_host/pepper/pepper_internal_file_ref_backend.cc
@@ -80,7 +80,7 @@ scoped_refptr<storage::FileSystemContext> PepperInternalFileRefBackend::GetFileSystemContext() const { if (!fs_host_.get()) - return NULL; + return nullptr; return fs_host_->GetFileSystemContext(); }
diff --git a/content/browser/renderer_host/pepper/pepper_network_proxy_host.cc b/content/browser/renderer_host/pepper/pepper_network_proxy_host.cc index 6ad7bff..8a426aa 100644 --- a/content/browser/renderer_host/pepper/pepper_network_proxy_host.cc +++ b/content/browser/renderer_host/pepper/pepper_network_proxy_host.cc
@@ -28,7 +28,7 @@ PP_Instance instance, PP_Resource resource) : ResourceHost(host->GetPpapiHost(), instance, resource), - proxy_service_(NULL), + proxy_service_(nullptr), is_allowed_(false), waiting_for_ui_thread_data_(true), weak_factory_(this) { @@ -139,7 +139,7 @@ } else { // Everything looks valid, so try to resolve the proxy. net::ProxyInfo* proxy_info = new net::ProxyInfo; - net::ProxyService::PacRequest* pending_request = NULL; + net::ProxyService::PacRequest* pending_request = nullptr; base::Callback<void(int)> callback = base::Bind(&PepperNetworkProxyHost::OnResolveProxyCompleted, weak_factory_.GetWeakPtr(), @@ -147,7 +147,7 @@ base::Owned(proxy_info)); int result = proxy_service_->ResolveProxy( request.url, std::string(), proxy_info, callback, &pending_request, - NULL, net::NetLogWithSource()); + nullptr, net::NetLogWithSource()); pending_requests_.push(pending_request); // If it was handled synchronously, we must run the callback now; // proxy_service_ won't run it for us in this case.
diff --git a/content/browser/renderer_host/pepper/pepper_print_settings_manager.cc b/content/browser/renderer_host/pepper/pepper_print_settings_manager.cc index f18aa82e..94d7951 100644 --- a/content/browser/renderer_host/pepper/pepper_print_settings_manager.cc +++ b/content/browser/renderer_host/pepper/pepper_print_settings_manager.cc
@@ -51,7 +51,7 @@ class PrintingContextDelegate : public printing::PrintingContext::Delegate { public: // PrintingContext::Delegate methods. - gfx::NativeView GetParentView() override { return NULL; } + gfx::NativeView GetParentView() override { return nullptr; } std::string GetAppLocale() override { return GetContentClient()->browser()->GetApplicationLocale(); }
diff --git a/content/browser/renderer_host/pepper/pepper_tcp_server_socket_message_filter.cc b/content/browser/renderer_host/pepper/pepper_tcp_server_socket_message_filter.cc index abb4407..3a8cb7c6 100644 --- a/content/browser/renderer_host/pepper/pepper_tcp_server_socket_message_filter.cc +++ b/content/browser/renderer_host/pepper/pepper_tcp_server_socket_message_filter.cc
@@ -87,7 +87,7 @@ case PpapiHostMsg_TCPServerSocket_StopListening::ID: return BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); } - return NULL; + return nullptr; } int32_t PepperTCPServerSocketMessageFilter::OnResourceMessageReceived( @@ -181,7 +181,7 @@ state_ = STATE_LISTEN_IN_PROGRESS; - socket_.reset(new net::TCPSocket(NULL, NULL, net::NetLogSource())); + socket_.reset(new net::TCPSocket(nullptr, nullptr, net::NetLogSource())); int net_result = net::OK; do { net::IPEndPoint ip_end_point(net::IPAddress(address), port);
diff --git a/content/browser/renderer_host/pepper/pepper_tcp_socket_message_filter.cc b/content/browser/renderer_host/pepper/pepper_tcp_socket_message_filter.cc index 10be37c..e70df7a4 100644 --- a/content/browser/renderer_host/pepper/pepper_tcp_socket_message_filter.cc +++ b/content/browser/renderer_host/pepper/pepper_tcp_socket_message_filter.cc
@@ -77,7 +77,7 @@ rcvbuf_size_(0), sndbuf_size_(0), address_index_(0), - socket_(new net::TCPSocket(NULL, NULL, net::NetLogSource())), + socket_(new net::TCPSocket(nullptr, nullptr, net::NetLogSource())), ssl_context_helper_(host->ssl_context_helper()), pending_accept_(false), pending_read_on_unthrottle_(false), @@ -105,7 +105,7 @@ render_process_id_(0), render_frame_id_(0), host_(host), - factory_(NULL), + factory_(nullptr), instance_(instance), state_(TCPSocketState::CONNECTED), end_of_file_reached_(false), @@ -166,7 +166,7 @@ case PpapiHostMsg_TCPSocket_SetOption::ID: return BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); } - return NULL; + return nullptr; } int32_t PepperTCPSocketMessageFilter::OnResourceMessageReceived( @@ -222,11 +222,9 @@ return PP_ERROR_NOACCESS; } - if (!pepper_socket_utils::CanUseSocketAPIs(external_plugin_, - false /* private_api */, - NULL, - render_process_id_, - render_frame_id_)) { + if (!pepper_socket_utils::CanUseSocketAPIs( + external_plugin_, false /* private_api */, nullptr, + render_process_id_, render_frame_id_)) { return PP_ERROR_NOACCESS; } @@ -848,7 +846,7 @@ // We have to recreate |socket_| because it doesn't allow a second connect // attempt. We won't lose any state such as bound address or set options, // because in the private or v1.0 API, connect must be the first operation. - socket_.reset(new net::TCPSocket(NULL, NULL, net::NetLogSource())); + socket_.reset(new net::TCPSocket(nullptr, nullptr, net::NetLogSource())); if (address_index_ + 1 < address_list_.size()) { DCHECK_EQ(version_, ppapi::TCP_SOCKET_VERSION_PRIVATE); @@ -900,7 +898,7 @@ } else { SendReadError(context, NetErrorToPepperError(net_result)); } - read_buffer_ = NULL; + read_buffer_ = nullptr; } void PepperTCPSocketMessageFilter::OnWriteCompleted( @@ -925,8 +923,8 @@ else SendWriteReply(context, NetErrorToPepperError(net_result)); - write_buffer_ = NULL; - write_buffer_base_ = NULL; + write_buffer_ = nullptr; + write_buffer_base_ = nullptr; } void PepperTCPSocketMessageFilter::OnListenCompleted(
diff --git a/content/browser/renderer_host/pepper/pepper_truetype_font_host.cc b/content/browser/renderer_host/pepper/pepper_truetype_font_host.cc index 0df16ef..036149f4 100644 --- a/content/browser/renderer_host/pepper/pepper_truetype_font_host.cc +++ b/content/browser/renderer_host/pepper/pepper_truetype_font_host.cc
@@ -50,7 +50,7 @@ // long blocking operations. font_->AddRef(); PepperTrueTypeFont* raw_font = font_.get(); - font_ = NULL; + font_ = nullptr; task_runner_->ReleaseSoon(FROM_HERE, raw_font); } } @@ -124,7 +124,7 @@ initialize_completed_ = true; // Release the font if there was an error, so future calls will fail. if (result != PP_OK) - font_ = NULL; + font_ = nullptr; host()->SendUnsolicitedReply( pp_resource(), PpapiPluginMsg_TrueTypeFont_CreateReply(*desc, result)); }
diff --git a/content/browser/renderer_host/pepper/pepper_truetype_font_linux.cc b/content/browser/renderer_host/pepper/pepper_truetype_font_linux.cc index 9b37b39..464dcbd 100644 --- a/content/browser/renderer_host/pepper/pepper_truetype_font_linux.cc +++ b/content/browser/renderer_host/pepper/pepper_truetype_font_linux.cc
@@ -138,7 +138,7 @@ size_t table_size = 0; // Tags are byte swapped on Linux. table_tag = base::ByteSwap(table_tag); - if (!GetFontTable(fd_.get(), table_tag, offset, NULL, &table_size)) + if (!GetFontTable(fd_.get(), table_tag, offset, nullptr, &table_size)) return PP_ERROR_FAILED; // Only retrieve as much as the caller requested. table_size = std::min(table_size, static_cast<size_t>(max_data_length));
diff --git a/content/browser/renderer_host/pepper/pepper_truetype_font_list_pango.cc b/content/browser/renderer_host/pepper/pepper_truetype_font_list_pango.cc index cd1a5e57..05bd58e 100644 --- a/content/browser/renderer_host/pepper/pepper_truetype_font_list_pango.cc +++ b/content/browser/renderer_host/pepper/pepper_truetype_font_list_pango.cc
@@ -15,7 +15,7 @@ void GetFontFamilies_SlowBlocking(std::vector<std::string>* font_families) { PangoFontMap* font_map = ::pango_cairo_font_map_get_default(); - PangoFontFamily** families = NULL; + PangoFontFamily** families = nullptr; int num_families = 0; ::pango_font_map_list_families(font_map, &families, &num_families); @@ -28,14 +28,14 @@ const std::string& family, std::vector<ppapi::proxy::SerializedTrueTypeFontDesc>* fonts_in_family) { PangoFontMap* font_map = ::pango_cairo_font_map_get_default(); - PangoFontFamily** font_families = NULL; + PangoFontFamily** font_families = nullptr; int num_families = 0; ::pango_font_map_list_families(font_map, &font_families, &num_families); for (int i = 0; i < num_families; ++i) { PangoFontFamily* font_family = font_families[i]; if (family.compare(::pango_font_family_get_name(font_family)) == 0) { - PangoFontFace** font_faces = NULL; + PangoFontFace** font_faces = nullptr; int num_faces = 0; ::pango_font_family_list_faces(font_family, &font_faces, &num_faces);
diff --git a/content/browser/renderer_host/pepper/pepper_udp_socket_message_filter.cc b/content/browser/renderer_host/pepper/pepper_udp_socket_message_filter.cc index 249de77..ed3a9dae 100644 --- a/content/browser/renderer_host/pepper/pepper_udp_socket_message_filter.cc +++ b/content/browser/renderer_host/pepper/pepper_udp_socket_message_filter.cc
@@ -115,7 +115,7 @@ case PpapiHostMsg_UDPSocket_LeaveGroup::ID: return BrowserThread::GetTaskRunnerForThread(BrowserThread::UI); } - return NULL; + return nullptr; } int32_t PepperUDPSocketMessageFilter::OnResourceMessageReceived( @@ -401,7 +401,7 @@ std::unique_ptr<net::UDPSocket> socket( new net::UDPSocket(net::DatagramSocket::DEFAULT_BIND, - net::RandIntCallback(), NULL, net::NetLogSource())); + net::RandIntCallback(), nullptr, net::NetLogSource())); net::IPAddressBytes address; uint16_t port; @@ -660,7 +660,7 @@ SendRecvFromError(pp_result); } - recvfrom_buffer_ = NULL; + recvfrom_buffer_ = nullptr; DCHECK_GT(remaining_recv_slots_, 0u); remaining_recv_slots_--;
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index db2e2cf..aca6104e 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -366,7 +366,7 @@ SiteToProcessMap::iterator i = map_.find(site); if (i != map_.end()) return i->second; - return NULL; + return nullptr; } void RemoveProcess(RenderProcessHost* host) { @@ -3424,7 +3424,7 @@ return suitable_renderers[random_index]; } - return NULL; + return nullptr; } // static @@ -3472,7 +3472,7 @@ RecordAction( base::UserMetricsAction("BindingsMismatch_GetProcessHostPerSite")); map->RemoveProcess(host); - host = NULL; + host = nullptr; } return host;
diff --git a/content/browser/renderer_host/render_process_host_unittest.cc b/content/browser/renderer_host/render_process_host_unittest.cc index 9b80395e..c969594e 100644 --- a/content/browser/renderer_host/render_process_host_unittest.cc +++ b/content/browser/renderer_host/render_process_host_unittest.cc
@@ -867,7 +867,7 @@ void SetUp() override { SetRenderProcessHostFactory(&rph_factory_); RenderViewHostImplTestHarness::SetUp(); - SetContents(NULL); // Start with no renderers. + SetContents(nullptr); // Start with no renderers. while (!rph_factory_.GetProcesses()->empty()) { rph_factory_.Remove(rph_factory_.GetProcesses()->back().get()); }
diff --git a/content/browser/renderer_host/render_view_host_delegate.cc b/content/browser/renderer_host/render_view_host_delegate.cc index 6f56365..6ceb1543 100644 --- a/content/browser/renderer_host/render_view_host_delegate.cc +++ b/content/browser/renderer_host/render_view_host_delegate.cc
@@ -10,7 +10,7 @@ namespace content { RenderViewHostDelegateView* RenderViewHostDelegate::GetDelegateView() { - return NULL; + return nullptr; } bool RenderViewHostDelegate::OnMessageReceived( @@ -20,12 +20,12 @@ } WebContents* RenderViewHostDelegate::GetAsWebContents() { - return NULL; + return nullptr; } SessionStorageNamespace* RenderViewHostDelegate::GetSessionStorageNamespace( SiteInstance* instance) { - return NULL; + return nullptr; } SessionStorageNamespaceMap @@ -34,7 +34,7 @@ } FrameTree* RenderViewHostDelegate::GetFrameTree() { - return NULL; + return nullptr; } double RenderViewHostDelegate::GetPendingPageZoomLevel() {
diff --git a/content/browser/renderer_host/render_view_host_unittest.cc b/content/browser/renderer_host/render_view_host_unittest.cc index ca1837cb..2ecf202 100644 --- a/content/browser/renderer_host/render_view_host_unittest.cc +++ b/content/browser/renderer_host/render_view_host_unittest.cc
@@ -47,7 +47,7 @@ class RenderViewHostTest : public RenderViewHostImplTestHarness { public: - RenderViewHostTest() : old_browser_client_(NULL) {} + RenderViewHostTest() : old_browser_client_(nullptr) {} ~RenderViewHostTest() override {} void SetUp() override {
diff --git a/content/browser/renderer_host/render_widget_helper.cc b/content/browser/renderer_host/render_widget_helper.cc index 98bc9bbd1..6a7e9ee 100644 --- a/content/browser/renderer_host/render_widget_helper.cc +++ b/content/browser/renderer_host/render_widget_helper.cc
@@ -32,9 +32,7 @@ } // namespace RenderWidgetHelper::RenderWidgetHelper() - : render_process_id_(-1), - resource_dispatcher_host_(NULL) { -} + : render_process_id_(-1), resource_dispatcher_host_(nullptr) {} RenderWidgetHelper::~RenderWidgetHelper() { DCHECK_CURRENTLY_ON(BrowserThread::IO);
diff --git a/content/browser/renderer_host/render_widget_host_delegate.cc b/content/browser/renderer_host/render_widget_host_delegate.cc index 9a97fd2..9dbc1af 100644 --- a/content/browser/renderer_host/render_widget_host_delegate.cc +++ b/content/browser/renderer_host/render_widget_host_delegate.cc
@@ -31,12 +31,12 @@ BrowserAccessibilityManager* RenderWidgetHostDelegate::GetRootBrowserAccessibilityManager() { - return NULL; + return nullptr; } BrowserAccessibilityManager* RenderWidgetHostDelegate::GetOrCreateRootBrowserAccessibilityManager() { - return NULL; + return nullptr; } // If a delegate does not override this, the RenderWidgetHostView will
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index 8b2826c..929a42d 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -162,7 +162,7 @@ // RenderWidgetHostIterator: RenderWidgetHost* GetNextHost() override { - RenderWidgetHost* host = NULL; + RenderWidgetHost* host = nullptr; while (current_index_ < hosts_.size() && !host) { RenderWidgetHostID id = hosts_[current_index_]; host = RenderWidgetHost::FromID(id.first, id.second); @@ -924,7 +924,7 @@ // TODO(evanm): tracking this may no longer be necessary; // eliminate this function if so. - SetView(NULL); + SetView(nullptr); } #if defined(OS_MACOSX) @@ -2231,7 +2231,7 @@ // It is assumed that the disambiguation popup will make a copy of the // provided zoomed image, so we delete this one. - zoomed_bitmap.setPixels(0); + zoomed_bitmap.setPixels(nullptr); Send(new ViewMsg_ReleaseDisambiguationPopupBitmap(GetRoutingID(), id)); } @@ -2473,7 +2473,7 @@ } void RenderWidgetHostImpl::DetachDelegate() { - delegate_ = NULL; + delegate_ = nullptr; latency_tracker_.SetDelegate(nullptr); } @@ -2593,13 +2593,13 @@ BrowserAccessibilityManager* RenderWidgetHostImpl::GetRootBrowserAccessibilityManager() { - return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; + return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : nullptr; } BrowserAccessibilityManager* RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { - return delegate_ ? - delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; + return delegate_ ? delegate_->GetOrCreateRootBrowserAccessibilityManager() + : nullptr; } void RenderWidgetHostImpl::GrantFileAccessFromDropData(DropData* drop_data) {
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc index c824efa5..6359aab3 100644 --- a/content/browser/renderer_host/render_widget_host_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -559,7 +559,7 @@ RenderWidgetHostTest( UseMojoInputMessages input_messages_mode = UseMojoInputMessages::kEnabled, WheelScrollingMode wheel_scrolling_mode = kWheelScrollLatching) - : process_(NULL), + : process_(nullptr), handle_key_press_event_(false), handle_mouse_event_(false), simulated_event_time_delta_seconds_(0), @@ -652,7 +652,7 @@ view_.reset(); host_.reset(); delegate_.reset(); - process_ = NULL; + process_ = nullptr; browser_context_.reset(); #if defined(USE_AURA) @@ -834,7 +834,7 @@ const char* data; int data_length; if (!iter.ReadData(&data, &data_length)) - return NULL; + return nullptr; return reinterpret_cast<const WebInputEvent*>(data); } @@ -1097,7 +1097,7 @@ // Simulate a renderer crash before the update message. Ensure all the // resize ack logic is cleared. Must clear the view first so it doesn't get // deleted. - host_->SetView(NULL); + host_->SetView(nullptr); host_->RendererExited(base::TERMINATION_STATUS_PROCESS_CRASHED, -1); EXPECT_FALSE(host_->resize_ack_pending_); EXPECT_EQ(gfx::Size(), host_->old_resize_params_->new_size); @@ -1115,7 +1115,7 @@ view.reset(new RenderWidgetHostViewAura( host_.get(), false, false /* enable_surface_synchronization */)); // TODO(derat): Call this on all platforms: http://crbug.com/102450. - view->InitAsChild(NULL); + view->InitAsChild(nullptr); #elif defined(OS_ANDROID) view.reset(new RenderWidgetHostViewAndroid(host_.get(), NULL)); #endif @@ -1135,7 +1135,7 @@ ViewMsg_SetBackgroundOpaque::Read(set_background, &sent_background); EXPECT_FALSE(std::get<0>(sent_background)); - host_->SetView(NULL); + host_->SetView(nullptr); static_cast<RenderWidgetHostViewBase*>(view.release())->Destroy(); } #endif @@ -2360,7 +2360,7 @@ EXPECT_TRUE(event->GetType() == expected_type); EXPECT_TRUE(latency_info.FindLatency( - ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, component_id, NULL)); + ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, component_id, nullptr)); process->sink().ClearMessages(); } @@ -2388,7 +2388,7 @@ EXPECT_TRUE(event->GetType() == WebInputEvent::kGestureScrollUpdate); EXPECT_TRUE(latency_info.FindLatency( - ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, component_id, NULL)); + ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, component_id, nullptr)); process->sink().ClearMessages(); } @@ -2477,7 +2477,7 @@ expected_type); EXPECT_TRUE( dispatched_events[0]->ToEvent()->Event()->latency_info.FindLatency( - ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, component_id, NULL)); + ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, component_id, nullptr)); dispatched_events[0]->ToEvent()->CallCallback(INPUT_EVENT_ACK_STATE_CONSUMED); } @@ -2494,7 +2494,7 @@ dispatched_events[1]->ToEvent()->Event()->web_event->GetType()); EXPECT_TRUE( dispatched_events[1]->ToEvent()->Event()->latency_info.FindLatency( - ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, component_id, NULL)); + ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, component_id, nullptr)); dispatched_events[1]->ToEvent()->CallCallback(INPUT_EVENT_ACK_STATE_CONSUMED); }
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index e9b0ec5..e5c1096 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -478,7 +478,7 @@ transient_window_client->RemoveTransientChild( popup_parent_host_view_->window_, old_child->window_); } - old_child->popup_parent_host_view_ = NULL; + old_child->popup_parent_host_view_ = nullptr; } popup_parent_host_view_->SetPopupChild(this); CreateAuraWindow(aura::client::WINDOW_TYPE_MENU); @@ -512,7 +512,7 @@ CreateAuraWindow(aura::client::WINDOW_TYPE_NORMAL); window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); - aura::Window* parent = NULL; + aura::Window* parent = nullptr; gfx::Rect bounds; if (reference_host_view) { aura::Window* reference_window = @@ -601,7 +601,7 @@ #endif NOTIMPLEMENTED(); - return static_cast<gfx::NativeViewAccessible>(NULL); + return static_cast<gfx::NativeViewAccessible>(nullptr); } ui::TextInputClient* RenderWidgetHostViewAura::GetTextInputClient() { @@ -1143,7 +1143,7 @@ BrowserAccessibilityManager* RenderWidgetHostViewAura::CreateBrowserAccessibilityManager( BrowserAccessibilityDelegate* delegate, bool for_root_frame) { - BrowserAccessibilityManager* manager = NULL; + BrowserAccessibilityManager* manager = nullptr; #if defined(OS_WIN) manager = new BrowserAccessibilityManagerWin( BrowserAccessibilityManagerWin::GetEmptyDocument(), delegate); @@ -1169,7 +1169,7 @@ if (legacy_render_widget_host_HWND_) return legacy_render_widget_host_HWND_->window_accessible(); #endif - return NULL; + return nullptr; } void RenderWidgetHostViewAura::SetMainFrameAXTreeID( @@ -1873,7 +1873,7 @@ if (window_->GetHost()) window_->GetHost()->RemoveObserver(this); UnlockMouse(); - wm::SetTooltipText(window_, NULL); + wm::SetTooltipText(window_, nullptr); display::Screen::GetScreen()->RemoveObserver(this); // This call is usually no-op since |this| object is already removed from @@ -1882,14 +1882,14 @@ DetachFromInputMethod(); } if (popup_parent_host_view_) { - DCHECK(popup_parent_host_view_->popup_child_host_view_ == NULL || + DCHECK(popup_parent_host_view_->popup_child_host_view_ == nullptr || popup_parent_host_view_->popup_child_host_view_ == this); popup_parent_host_view_->SetPopupChild(nullptr); } if (popup_child_host_view_) { - DCHECK(popup_child_host_view_->popup_parent_host_view_ == NULL || + DCHECK(popup_child_host_view_->popup_parent_host_view_ == nullptr || popup_child_host_view_->popup_parent_host_view_ == this); - popup_child_host_view_->popup_parent_host_view_ = NULL; + popup_child_host_view_->popup_parent_host_view_ = nullptr; } event_filter_for_popup_exit_.reset();
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc index a0f5b89..6f7bda20 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.cc +++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -134,7 +134,7 @@ ui::TextInputClient* RenderWidgetHostViewBase::GetTextInputClient() { NOTREACHED(); - return NULL; + return nullptr; } void RenderWidgetHostViewBase::SetIsInVR(bool is_in_vr) { @@ -210,11 +210,11 @@ RenderWidgetHostViewBase::CreateBrowserAccessibilityManager( BrowserAccessibilityDelegate* delegate, bool for_root_frame) { NOTREACHED(); - return NULL; + return nullptr; } void RenderWidgetHostViewBase::AccessibilityShowMenu(const gfx::Point& point) { - RenderWidgetHostImpl* impl = NULL; + RenderWidgetHostImpl* impl = nullptr; if (GetRenderWidgetHost()) impl = RenderWidgetHostImpl::From(GetRenderWidgetHost()); @@ -234,11 +234,11 @@ gfx::NativeViewAccessible RenderWidgetHostViewBase::AccessibilityGetNativeViewAccessible() { - return NULL; + return nullptr; } void RenderWidgetHostViewBase::UpdateScreenInfo(gfx::NativeView view) { - RenderWidgetHostImpl* impl = NULL; + RenderWidgetHostImpl* impl = nullptr; if (GetRenderWidgetHost()) impl = RenderWidgetHostImpl::From(GetRenderWidgetHost());
diff --git a/content/browser/renderer_host/render_widget_host_view_browsertest.cc b/content/browser/renderer_host/render_widget_host_view_browsertest.cc index 743ad09..a74b7bc2 100644 --- a/content/browser/renderer_host/render_widget_host_view_browsertest.cc +++ b/content/browser/renderer_host/render_widget_host_view_browsertest.cc
@@ -158,7 +158,7 @@ // Copy one frame using the CopyFromSurface API. void RunBasicCopyFromSurfaceTest() { - SET_UP_SURFACE_OR_PASS_TEST(NULL); + SET_UP_SURFACE_OR_PASS_TEST(nullptr); // Repeatedly call CopyFromBackingStore() since, on some platforms (e.g., // Windows), the operation will fail until the first "present" has been @@ -303,7 +303,7 @@ bool SetUpSourceSurface(const char* wait_message) override { content::DOMMessageQueue message_queue; NavigateToURL(shell(), TestUrl()); - if (wait_message != NULL) { + if (wait_message != nullptr) { std::string result(wait_message); if (!message_queue.WaitForMessage(&result)) { EXPECT_TRUE(false) << "WaitForMessage " << result << " failed."; @@ -369,7 +369,7 @@ // when the RenderWidgetHostView is deleting in the middle of an async copy. IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewBrowserTest, CopyFromSurface_CallbackDespiteDelete) { - SET_UP_SURFACE_OR_PASS_TEST(NULL); + SET_UP_SURFACE_OR_PASS_TEST(nullptr); base::RunLoop run_loop; GetRenderWidgetHostView()->CopyFromSurface( @@ -387,7 +387,7 @@ // async copy. IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewBrowserTest, CopyFromSurfaceToVideoFrame_CallbackDespiteDelete) { - SET_UP_SURFACE_OR_PASS_TEST(NULL); + SET_UP_SURFACE_OR_PASS_TEST(nullptr); base::RunLoop run_loop; scoped_refptr<media::VideoFrame> dest = @@ -406,7 +406,7 @@ // until at least one DeliverFrameCallback has been invoked. IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewBrowserTest, FrameSubscriberTest) { - SET_UP_SURFACE_OR_PASS_TEST(NULL); + SET_UP_SURFACE_OR_PASS_TEST(nullptr); RenderWidgetHostViewBase* const view = GetRenderWidgetHostView(); base::RunLoop run_loop; @@ -424,7 +424,7 @@ } IN_PROC_BROWSER_TEST_P(CompositingRenderWidgetHostViewBrowserTest, CopyTwice) { - SET_UP_SURFACE_OR_PASS_TEST(NULL); + SET_UP_SURFACE_OR_PASS_TEST(nullptr); RenderWidgetHostViewBase* const view = GetRenderWidgetHostView(); base::RunLoop run_loop;
diff --git a/content/browser/resolve_proxy_msg_helper.cc b/content/browser/resolve_proxy_msg_helper.cc index a546ec22..ee96818 100644 --- a/content/browser/resolve_proxy_msg_helper.cc +++ b/content/browser/resolve_proxy_msg_helper.cc
@@ -19,8 +19,7 @@ net::URLRequestContextGetter* getter) : BrowserMessageFilter(ViewMsgStart), context_getter_(getter), - proxy_service_(NULL) { -} + proxy_service_(nullptr) {} ResolveProxyMsgHelper::ResolveProxyMsgHelper(net::ProxyService* proxy_service) : BrowserMessageFilter(ViewMsgStart), @@ -83,11 +82,11 @@ PendingRequest& req = pending_requests_.front(); // Verify the request wasn't started yet. - DCHECK(NULL == req.pac_req); + DCHECK(nullptr == req.pac_req); if (context_getter_.get()) { proxy_service_ = context_getter_->GetURLRequestContext()->proxy_service(); - context_getter_ = NULL; + context_getter_ = nullptr; } // Start the request. @@ -95,7 +94,7 @@ req.url, std::string(), &proxy_info_, base::Bind(&ResolveProxyMsgHelper::OnResolveProxyCompleted, base::Unretained(this)), - &req.pac_req, NULL, net::NetLogWithSource()); + &req.pac_req, nullptr, net::NetLogWithSource()); // Completed synchronously. if (result != net::ERR_IO_PENDING)
diff --git a/content/browser/resolve_proxy_msg_helper_unittest.cc b/content/browser/resolve_proxy_msg_helper_unittest.cc index 1afc7094..9a6ae81 100644 --- a/content/browser/resolve_proxy_msg_helper_unittest.cc +++ b/content/browser/resolve_proxy_msg_helper_unittest.cc
@@ -65,7 +65,7 @@ service_( new net::ProxyService(base::WrapUnique(new MockProxyConfigService), base::WrapUnique(resolver_factory_), - NULL)), + nullptr)), helper_(new TestResolveProxyMsgHelper(service_.get(), this)) { test_sink_.AddFilter(this); } @@ -251,13 +251,13 @@ // Delete the underlying ResolveProxyMsgHelper -- this should cancel all // the requests which are outstanding. - helper_ = NULL; + helper_ = nullptr; // The pending requests sent to the proxy resolver should have been cancelled. EXPECT_EQ(0u, resolver_.pending_jobs().size()); - EXPECT_TRUE(pending_result() == NULL); + EXPECT_TRUE(pending_result() == nullptr); // It should also be the case that msg1, msg2, msg3 were deleted by the // cancellation. (Else will show up as a leak in Valgrind).
diff --git a/content/browser/security_exploit_browsertest.cc b/content/browser/security_exploit_browsertest.cc index fee17d1a..ee02f31 100644 --- a/content/browser/security_exploit_browsertest.cc +++ b/content/browser/security_exploit_browsertest.cc
@@ -382,7 +382,7 @@ InterstitialPage* interstitial_page = shell()->web_contents()->GetInterstitialPage(); - ASSERT_TRUE(interstitial_page != NULL); + ASSERT_TRUE(interstitial_page != nullptr); ASSERT_TRUE(shell()->web_contents()->ShowingInterstitialPage()); ASSERT_TRUE(interstitial_page->GetDelegateForTesting() == interstitial);
diff --git a/content/browser/service_worker/embedded_worker_test_helper.cc b/content/browser/service_worker/embedded_worker_test_helper.cc index 5ecc446a..9e509fb 100644 --- a/content/browser/service_worker/embedded_worker_test_helper.cc +++ b/content/browser/service_worker/embedded_worker_test_helper.cc
@@ -481,7 +481,7 @@ void EmbeddedWorkerTestHelper::ShutdownContext() { wrapper_->Shutdown(); - wrapper_ = NULL; + wrapper_ = nullptr; } ServiceWorkerDispatcherHost*
diff --git a/content/browser/service_worker/service_worker_browsertest.cc b/content/browser/service_worker/service_worker_browsertest.cc index d3b99114..e0fc1f2 100644 --- a/content/browser/service_worker/service_worker_browsertest.cc +++ b/content/browser/service_worker/service_worker_browsertest.cc
@@ -447,7 +447,7 @@ void TearDownOnMainThread() override { RunOnIOThread( base::Bind(&self::TearDownOnIOThread, base::Unretained(this))); - wrapper_ = NULL; + wrapper_ = nullptr; } // Starts the test server and navigates the renderer to an empty page. Call @@ -577,8 +577,8 @@ ~ServiceWorkerVersionBrowserTest() override {} void TearDownOnIOThread() override { - registration_ = NULL; - version_ = NULL; + registration_ = nullptr; + version_ = nullptr; remote_endpoints_.clear(); }
diff --git a/content/browser/service_worker/service_worker_controllee_request_handler.cc b/content/browser/service_worker/service_worker_controllee_request_handler.cc index d32b4ca4..162f9a1 100644 --- a/content/browser/service_worker/service_worker_controllee_request_handler.cc +++ b/content/browser/service_worker/service_worker_controllee_request_handler.cc
@@ -133,7 +133,7 @@ if (!context_ || !provider_host_) { // We can't do anything other than to fall back to network. - return NULL; + return nullptr; } // This may get called multiple times for original and redirect requests: @@ -150,7 +150,7 @@ // requests. if (is_main_resource_load_) use_network_ = false; - return NULL; + return nullptr; } #if BUILDFLAG(ENABLE_OFFLINE_PAGES)
diff --git a/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc b/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc index 3b0ed81..0ac6436 100644 --- a/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc +++ b/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc
@@ -137,8 +137,8 @@ } void TearDown() override { - version_ = NULL; - registration_ = NULL; + version_ = nullptr; + registration_ = nullptr; helper_.reset(); } @@ -277,8 +277,8 @@ version_.get(), base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); base::RunLoop().RunUntilIdle(); - version_ = NULL; - registration_ = NULL; + version_ = nullptr; + registration_ = nullptr; // Conduct a main resource load. ServiceWorkerRequestTestResources test_resources(
diff --git a/content/browser/service_worker/service_worker_database.cc b/content/browser/service_worker/service_worker_database.cc index 446eff3..ba3613a 100644 --- a/content/browser/service_worker/service_worker_database.cc +++ b/content/browser/service_worker/service_worker_database.cc
@@ -445,7 +445,7 @@ break; } - if (!RemovePrefix(itr->key().ToString(), prefix, NULL)) + if (!RemovePrefix(itr->key().ToString(), prefix, nullptr)) break; RegistrationData registration; @@ -496,7 +496,7 @@ break; } - if (!RemovePrefix(itr->key().ToString(), kRegKeyPrefix, NULL)) + if (!RemovePrefix(itr->key().ToString(), kRegKeyPrefix, nullptr)) break; RegistrationData registration; @@ -1529,7 +1529,7 @@ break; } - if (!RemovePrefix(itr->key().ToString(), prefix, NULL)) + if (!RemovePrefix(itr->key().ToString(), prefix, nullptr)) break; ResourceRecord resource; @@ -1843,7 +1843,7 @@ } bool ServiceWorkerDatabase::IsOpen() { - return db_ != NULL; + return db_ != nullptr; } void ServiceWorkerDatabase::Disable(const base::Location& from_here,
diff --git a/content/browser/service_worker/service_worker_handle_unittest.cc b/content/browser/service_worker/service_worker_handle_unittest.cc index f5c8f17..b3118765 100644 --- a/content/browser/service_worker/service_worker_handle_unittest.cc +++ b/content/browser/service_worker/service_worker_handle_unittest.cc
@@ -35,7 +35,7 @@ void VerifyStateChangedMessage(int expected_handle_id, blink::mojom::ServiceWorkerState expected_state, const IPC::Message* message) { - ASSERT_TRUE(message != NULL); + ASSERT_TRUE(message != nullptr); ServiceWorkerMsg_ServiceWorkerStateChanged::Param param; ASSERT_TRUE(ServiceWorkerMsg_ServiceWorkerStateChanged::Read( message, ¶m)); @@ -118,9 +118,9 @@ } void TearDown() override { - dispatcher_host_ = NULL; - registration_ = NULL; - version_ = NULL; + dispatcher_host_ = nullptr; + registration_ = nullptr; + version_ = nullptr; provider_host_.reset(); helper_.reset(); }
diff --git a/content/browser/service_worker/service_worker_internals_ui.cc b/content/browser/service_worker/service_worker_internals_ui.cc index e799954..f20e5b91 100644 --- a/content/browser/service_worker/service_worker_internals_ui.cc +++ b/content/browser/service_worker/service_worker_internals_ui.cc
@@ -462,7 +462,7 @@ scoped_refptr<ServiceWorkerContextWrapper>* context) const { BrowserContext* browser_context = web_ui()->GetWebContents()->GetBrowserContext(); - StoragePartition* result_partition(NULL); + StoragePartition* result_partition(nullptr); BrowserContext::StoragePartitionCallback find_context_cb = base::Bind(&ServiceWorkerInternalsUI::FindContext, base::Unretained(this), @@ -479,7 +479,7 @@ void ServiceWorkerInternalsUI::StopWorker(const ListValue* args) { DCHECK_CURRENTLY_ON(BrowserThread::UI); int callback_id; - const DictionaryValue* cmd_args = NULL; + const DictionaryValue* cmd_args = nullptr; int partition_id; scoped_refptr<ServiceWorkerContextWrapper> context; std::string version_id_string; @@ -501,7 +501,7 @@ void ServiceWorkerInternalsUI::InspectWorker(const ListValue* args) { DCHECK_CURRENTLY_ON(BrowserThread::UI); int callback_id; - const DictionaryValue* cmd_args = NULL; + const DictionaryValue* cmd_args = nullptr; int process_host_id = 0; int devtools_agent_route_id = 0; if (!args->GetInteger(0, &callback_id) || @@ -530,7 +530,7 @@ int callback_id; int partition_id; std::string scope_string; - const DictionaryValue* cmd_args = NULL; + const DictionaryValue* cmd_args = nullptr; scoped_refptr<ServiceWorkerContextWrapper> context; if (!args->GetInteger(0, &callback_id) || !args->GetDictionary(1, &cmd_args) || @@ -550,7 +550,7 @@ int callback_id; int partition_id; std::string scope_string; - const DictionaryValue* cmd_args = NULL; + const DictionaryValue* cmd_args = nullptr; scoped_refptr<ServiceWorkerContextWrapper> context; if (!args->GetInteger(0, &callback_id) || !args->GetDictionary(1, &cmd_args) ||
diff --git a/content/browser/service_worker/service_worker_register_job.cc b/content/browser/service_worker/service_worker_register_job.cc index 506a376..f3ffb04 100644 --- a/content/browser/service_worker/service_worker_register_job.cc +++ b/content/browser/service_worker/service_worker_register_job.cc
@@ -600,7 +600,7 @@ } } if (!is_promise_resolved_) - ResolvePromise(status, status_message, NULL); + ResolvePromise(status, status_message, nullptr); } DCHECK(callbacks_.empty()); if (registration()) {
diff --git a/content/browser/service_worker/service_worker_registration.cc b/content/browser/service_worker/service_worker_registration.cc index 6f55751..05f0087 100644 --- a/content/browser/service_worker/service_worker_registration.cc +++ b/content/browser/service_worker/service_worker_registration.cc
@@ -178,15 +178,15 @@ ChangedVersionAttributesMask* mask) { DCHECK(version); if (installing_version_.get() == version) { - installing_version_ = NULL; + installing_version_ = nullptr; mask->add(ChangedVersionAttributesMask::INSTALLING_VERSION); } else if (waiting_version_.get() == version) { - waiting_version_ = NULL; + waiting_version_ = nullptr; should_activate_when_ready_ = false; mask->add(ChangedVersionAttributesMask::WAITING_VERSION); } else if (active_version_.get() == version) { active_version_->RemoveListener(this); - active_version_ = NULL; + active_version_ = nullptr; mask->add(ChangedVersionAttributesMask::ACTIVE_VERSION); } }
diff --git a/content/browser/service_worker/service_worker_registration_unittest.cc b/content/browser/service_worker/service_worker_registration_unittest.cc index 348b284..4e77a93 100644 --- a/content/browser/service_worker/service_worker_registration_unittest.cc +++ b/content/browser/service_worker/service_worker_registration_unittest.cc
@@ -160,7 +160,7 @@ } void Reset() { - observed_registration_ = NULL; + observed_registration_ = nullptr; observed_changed_mask_ = ChangedVersionAttributesMask(); observed_info_ = ServiceWorkerRegistrationInfo(); }
diff --git a/content/browser/service_worker/service_worker_request_handler.cc b/content/browser/service_worker/service_worker_request_handler.cc index 887cb26..532f38d9c 100644 --- a/content/browser/service_worker/service_worker_request_handler.cc +++ b/content/browser/service_worker/service_worker_request_handler.cc
@@ -50,7 +50,7 @@ ServiceWorkerRequestHandler* handler = ServiceWorkerRequestHandler::GetHandler(request); if (!handler) - return NULL; + return nullptr; return handler->MaybeCreateJob( request, network_delegate, resource_context_); }
diff --git a/content/browser/service_worker/service_worker_storage_unittest.cc b/content/browser/service_worker/service_worker_storage_unittest.cc index cadecb7..423fbf1 100644 --- a/content/browser/service_worker/service_worker_storage_unittest.cc +++ b/content/browser/service_worker/service_worker_storage_unittest.cc
@@ -757,13 +757,13 @@ found_registration->resources_total_size_bytes()); EXPECT_EQ(used_features, found_registration->waiting_version()->used_features()); - found_registration = NULL; + found_registration = nullptr; // But FindRegistrationForPattern is always async. EXPECT_EQ(SERVICE_WORKER_OK, FindRegistrationForPattern(kScope, &found_registration)); EXPECT_EQ(live_registration, found_registration); - found_registration = NULL; + found_registration = nullptr; // Can be found by id too. EXPECT_EQ(SERVICE_WORKER_OK, @@ -772,7 +772,7 @@ ASSERT_TRUE(found_registration.get()); EXPECT_EQ(kRegistrationId, found_registration->id()); EXPECT_EQ(live_registration, found_registration); - found_registration = NULL; + found_registration = nullptr; // Can be found by just the id too. EXPECT_EQ(SERVICE_WORKER_OK, @@ -780,10 +780,10 @@ ASSERT_TRUE(found_registration.get()); EXPECT_EQ(kRegistrationId, found_registration->id()); EXPECT_EQ(live_registration, found_registration); - found_registration = NULL; + found_registration = nullptr; // Drop the live registration, but keep the version live. - live_registration = NULL; + live_registration = nullptr; // Now FindRegistrationForDocument should be async. EXPECT_EQ(SERVICE_WORKER_OK, @@ -817,10 +817,10 @@ ®istrations_for_origin)); EXPECT_TRUE(registrations_for_origin.empty()); - found_registration = NULL; + found_registration = nullptr; // Drop the live version too. - live_version = NULL; + live_version = nullptr; // And FindRegistrationForPattern is always async. EXPECT_EQ(SERVICE_WORKER_OK, @@ -848,12 +848,12 @@ found_registration->waiting_version(); temp_version->SetStatus(ServiceWorkerVersion::ACTIVATED); found_registration->SetActiveVersion(temp_version); - temp_version = NULL; + temp_version = nullptr; EXPECT_EQ(SERVICE_WORKER_OK, UpdateToActiveState(found_registration)); found_registration->set_last_update_check(kToday); UpdateLastUpdateCheckTime(found_registration.get()); - found_registration = NULL; + found_registration = nullptr; // Trying to update a unstored registration to active should fail. scoped_refptr<ServiceWorkerRegistration> unstored_registration = @@ -862,7 +862,7 @@ kRegistrationId + 1, context()->AsWeakPtr()); EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, UpdateToActiveState(unstored_registration)); - unstored_registration = NULL; + unstored_registration = nullptr; // The Find methods should return a registration with an active version // and the expected update time. @@ -958,22 +958,22 @@ FindRegistrationForId( kRegistrationId, kScope.GetOrigin(), &found_registration)); EXPECT_EQ(live_registration, found_registration); - found_registration = NULL; + found_registration = nullptr; EXPECT_EQ(SERVICE_WORKER_OK, FindRegistrationForIdOnly(kRegistrationId, &found_registration)); EXPECT_EQ(live_registration, found_registration); - found_registration = NULL; + found_registration = nullptr; EXPECT_EQ(SERVICE_WORKER_OK, FindRegistrationForDocument(kDocumentUrl, &found_registration)); EXPECT_EQ(live_registration, found_registration); - found_registration = NULL; + found_registration = nullptr; EXPECT_EQ(SERVICE_WORKER_OK, FindRegistrationForPattern(kScope, &found_registration)); EXPECT_EQ(live_registration, found_registration); - found_registration = NULL; + found_registration = nullptr; EXPECT_EQ(SERVICE_WORKER_OK, GetAllRegistrationsInfos(&all_registrations)); EXPECT_EQ(1u, all_registrations.size()); @@ -992,8 +992,8 @@ EXPECT_TRUE(registrations_for_origin.empty()); // Notify storage of installation no longer happening. - storage()->NotifyDoneInstallingRegistration( - live_registration.get(), NULL, SERVICE_WORKER_OK); + storage()->NotifyDoneInstallingRegistration(live_registration.get(), nullptr, + SERVICE_WORKER_OK); // Once again, should not be findable. EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, @@ -1367,8 +1367,8 @@ ServiceWorkerStatusCode result = SERVICE_WORKER_ERROR_FAILED; std::set<int64_t> verify_ids; - registration_->SetWaitingVersion(NULL); - registration_ = NULL; + registration_->SetWaitingVersion(nullptr); + registration_ = nullptr; // Deleting the registration should result in the resources being added to the // purgeable list and then doomed in the disk cache and removed from that @@ -1478,7 +1478,7 @@ TEST_F(ServiceWorkerResourceStorageDiskTest, CleanupOnRestart) { // Promote the worker to active and add a controllee. registration_->SetActiveVersion(registration_->waiting_version()); - registration_->SetWaitingVersion(NULL); + registration_->SetWaitingVersion(nullptr); storage()->UpdateToActiveState( registration_.get(), base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); ServiceWorkerRemoteProviderEndpoint remote_endpoint; @@ -1725,7 +1725,7 @@ EXPECT_EQ(SERVICE_WORKER_OK, FindRegistrationForDocument(kDocumentUrl, &found_registration)); EXPECT_EQ(live_registration2, found_registration); - found_registration = NULL; + found_registration = nullptr; // Store registrations. EXPECT_EQ(SERVICE_WORKER_OK, @@ -1739,12 +1739,12 @@ live_registration3->waiting_version())); // Notify storage of installations no longer happening. - storage()->NotifyDoneInstallingRegistration( - live_registration1.get(), NULL, SERVICE_WORKER_OK); - storage()->NotifyDoneInstallingRegistration( - live_registration2.get(), NULL, SERVICE_WORKER_OK); - storage()->NotifyDoneInstallingRegistration( - live_registration3.get(), NULL, SERVICE_WORKER_OK); + storage()->NotifyDoneInstallingRegistration(live_registration1.get(), nullptr, + SERVICE_WORKER_OK); + storage()->NotifyDoneInstallingRegistration(live_registration2.get(), nullptr, + SERVICE_WORKER_OK); + storage()->NotifyDoneInstallingRegistration(live_registration3.get(), nullptr, + SERVICE_WORKER_OK); // Find a registration among installed ones. EXPECT_EQ(SERVICE_WORKER_OK,
diff --git a/content/browser/service_worker/service_worker_version_unittest.cc b/content/browser/service_worker/service_worker_version_unittest.cc index 6649e08..974f965 100644 --- a/content/browser/service_worker/service_worker_version_unittest.cc +++ b/content/browser/service_worker/service_worker_version_unittest.cc
@@ -213,8 +213,8 @@ } void TearDown() override { - version_ = 0; - registration_ = 0; + version_ = nullptr; + registration_ = nullptr; helper_.reset(); }
diff --git a/content/browser/shareable_file_reference_unittest.cc b/content/browser/shareable_file_reference_unittest.cc index 2d6fbd6..5003f6c 100644 --- a/content/browser/shareable_file_reference_unittest.cc +++ b/content/browser/shareable_file_reference_unittest.cc
@@ -46,13 +46,13 @@ EXPECT_EQ(reference1.get(), reference2.get()); // Drop the first reference, the file and reference should still be there. - reference1 = NULL; + reference1 = nullptr; EXPECT_TRUE(ShareableFileReference::Get(file).get()); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(base::PathExists(file)); // Drop the second reference, the file and reference should get deleted. - reference2 = NULL; + reference2 = nullptr; EXPECT_FALSE(ShareableFileReference::Get(file).get()); base::RunLoop().RunUntilIdle(); EXPECT_FALSE(base::PathExists(file));
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc index 8087788e..c36132e 100644 --- a/content/browser/site_instance_impl.cc +++ b/content/browser/site_instance_impl.cc
@@ -70,7 +70,7 @@ } bool SiteInstanceImpl::HasProcess() const { - if (process_ != NULL) + if (process_ != nullptr) return true; // If we would use process-per-site for this site, also check if there is an
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc index fe833c7..b7eb0cc 100644 --- a/content/browser/site_per_process_browsertest.cc +++ b/content/browser/site_per_process_browsertest.cc
@@ -3712,7 +3712,7 @@ // It is safe to obtain the root frame tree node here, as it doesn't change. FrameTreeNode* root = web_contents()->GetFrameTree()->root(); - EXPECT_TRUE(root->child_at(1) != NULL); + EXPECT_TRUE(root->child_at(1) != nullptr); EXPECT_EQ(2U, root->child_at(1)->child_count()); { @@ -3743,7 +3743,7 @@ // navigating frame to still be present. The reason is that we don't run the // message loop, so no IPCs that alter the frame tree can be processed. FrameTreeNode* child = root->child_at(1); - SiteInstance* site = NULL; + SiteInstance* site = nullptr; bool browser_side_navigation = IsBrowserSideNavigationEnabled(); std::string cross_site_rfh_type = browser_side_navigation ? "speculative" : "pending";
diff --git a/content/browser/speech/audio_encoder.cc b/content/browser/speech/audio_encoder.cc index 950948b..c036c2d 100644 --- a/content/browser/speech/audio_encoder.cc +++ b/content/browser/speech/audio_encoder.cc
@@ -55,8 +55,9 @@ DCHECK_EQ(raw_audio.bytes_per_sample(), 2); if (!is_encoder_initialized_) { const FLAC__StreamEncoderInitStatus encoder_status = - FLAC__stream_encoder_init_stream(encoder_, WriteCallback, NULL, NULL, - NULL, &encoded_audio_buffer_); + FLAC__stream_encoder_init_stream(encoder_, WriteCallback, nullptr, + nullptr, nullptr, + &encoded_audio_buffer_); DCHECK_EQ(encoder_status, FLAC__STREAM_ENCODER_INIT_STATUS_OK); is_encoder_initialized_ = true; }
diff --git a/content/browser/speech/chunked_byte_buffer.cc b/content/browser/speech/chunked_byte_buffer.cc index 6a5a517..ae219c7 100644 --- a/content/browser/speech/chunked_byte_buffer.cc +++ b/content/browser/speech/chunked_byte_buffer.cc
@@ -36,7 +36,7 @@ const uint8_t* next_data = start; while (remaining_bytes > 0) { - DCHECK(partial_chunk_ != NULL); + DCHECK(partial_chunk_ != nullptr); size_t insert_length = 0; bool header_completed = false; bool content_completed = false;
diff --git a/content/browser/speech/chunked_byte_buffer_unittest.cc b/content/browser/speech/chunked_byte_buffer_unittest.cc index d8a5cb27..099d311 100644 --- a/content/browser/speech/chunked_byte_buffer_unittest.cc +++ b/content/browser/speech/chunked_byte_buffer_unittest.cc
@@ -44,7 +44,7 @@ // Remove and check chunk 1. std::unique_ptr<ByteVector> chunk; chunk = buffer.PopChunk(); - EXPECT_TRUE(chunk != NULL); + EXPECT_TRUE(chunk != nullptr); EXPECT_EQ(4U, chunk->size()); EXPECT_EQ(0, std::char_traits<uint8_t>::compare(kChunks + 4, &(*chunk)[0], chunk->size())); @@ -53,7 +53,7 @@ // Read and check chunk 2. chunk = buffer.PopChunk(); - EXPECT_TRUE(chunk != NULL); + EXPECT_TRUE(chunk != nullptr); EXPECT_EQ(2U, chunk->size()); EXPECT_EQ(0, std::char_traits<uint8_t>::compare(kChunks + 12, &(*chunk)[0], chunk->size())); @@ -66,7 +66,7 @@ // Remove and check chunk 3. chunk = buffer.PopChunk(); - EXPECT_TRUE(chunk != NULL); + EXPECT_TRUE(chunk != nullptr); EXPECT_EQ(1U, chunk->size()); EXPECT_EQ((*chunk)[0], kChunks[18]); EXPECT_EQ(0U, buffer.GetTotalLength());
diff --git a/content/browser/speech/endpointer/endpointer_unittest.cc b/content/browser/speech/endpointer/endpointer_unittest.cc index 53ec4d1..200c42c 100644 --- a/content/browser/speech/endpointer/endpointer_unittest.cc +++ b/content/browser/speech/endpointer/endpointer_unittest.cc
@@ -80,7 +80,7 @@ EpStatus ProcessFrame(int64_t time, int16_t* samples, int frame_size) override { - endpointer_->ProcessAudioFrame(time, samples, kFrameSize, NULL); + endpointer_->ProcessAudioFrame(time, samples, kFrameSize, nullptr); int64_t ep_time; return endpointer_->Status(&ep_time); } @@ -127,7 +127,7 @@ int frame_size) override { scoped_refptr<AudioChunk> frame( new AudioChunk(reinterpret_cast<uint8_t*>(samples), kFrameSize * 2, 2)); - endpointer_->ProcessAudio(*frame.get(), NULL); + endpointer_->ProcessAudio(*frame.get(), nullptr); int64_t ep_time; return endpointer_->Status(&ep_time); }
diff --git a/content/browser/speech/speech_recognition_engine_unittest.cc b/content/browser/speech/speech_recognition_engine_unittest.cc index 4ea8fc4..fd880ae2 100644 --- a/content/browser/speech/speech_recognition_engine_unittest.cc +++ b/content/browser/speech/speech_recognition_engine_unittest.cc
@@ -420,7 +420,7 @@ void SpeechRecognitionEngineTest::SetUp() { engine_under_test_.reset( - new SpeechRecognitionEngine(NULL /*URLRequestContextGetter*/)); + new SpeechRecognitionEngine(nullptr /*URLRequestContextGetter*/)); engine_under_test_->set_delegate(this); }
diff --git a/content/browser/speech/speech_recognition_manager_impl.cc b/content/browser/speech/speech_recognition_manager_impl.cc index f31d844..03ef916e 100644 --- a/content/browser/speech/speech_recognition_manager_impl.cc +++ b/content/browser/speech/speech_recognition_manager_impl.cc
@@ -82,7 +82,7 @@ DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(g_speech_recognition_manager_impl); - g_speech_recognition_manager_impl = NULL; + g_speech_recognition_manager_impl = nullptr; for (SessionsTable::iterator it = sessions_.begin(); it != sessions_.end(); ++it) { @@ -588,7 +588,8 @@ } void SpeechRecognitionManagerImpl::SessionDelete(Session* session) { - DCHECK(session->recognizer.get() == NULL || !session->recognizer->IsActive()); + DCHECK(session->recognizer.get() == nullptr || + !session->recognizer->IsActive()); if (primary_session_id_ == session->id) primary_session_id_ = kSessionIDInvalid; if (!session->context.label.empty()) @@ -629,12 +630,12 @@ Session* session = GetSession(session_id); if (session->listener_is_active && session->config.event_listener) return session->config.event_listener.get(); - return NULL; + return nullptr; } SpeechRecognitionEventListener* SpeechRecognitionManagerImpl::GetDelegateListener() const { - return delegate_.get() ? delegate_->GetEventListener() : NULL; + return delegate_.get() ? delegate_->GetEventListener() : nullptr; } const SpeechRecognitionSessionConfig&
diff --git a/content/browser/speech/speech_recognizer_impl.cc b/content/browser/speech/speech_recognizer_impl.cc index 62d3c4f..e09035b 100644 --- a/content/browser/speech/speech_recognizer_impl.cc +++ b/content/browser/speech/speech_recognizer_impl.cc
@@ -259,8 +259,8 @@ DCHECK_CURRENTLY_ON(BrowserThread::IO); // See IsActive(). const bool is_capturing_audio = state_ >= STATE_STARTING && state_ <= STATE_RECOGNIZING; - DCHECK((is_capturing_audio && (audio_controller_.get() != NULL)) || - (!is_capturing_audio && audio_controller_.get() == NULL)); + DCHECK((is_capturing_audio && (audio_controller_.get() != nullptr)) || + (!is_capturing_audio && audio_controller_.get() == nullptr)); return is_capturing_audio; } @@ -364,7 +364,7 @@ scoped_refptr<SpeechRecognizerImpl> me(this); if (event_args.event == EVENT_AUDIO_DATA) { - DCHECK(event_args.audio_data.get() != NULL); + DCHECK(event_args.audio_data.get() != nullptr); ProcessAudioPipeline(*event_args.audio_data.get()); } @@ -548,7 +548,7 @@ UpdateSignalAndNoiseLevels(rms, clip_detected); } if (route_to_sr_engine) { - DCHECK(recognition_engine_.get() != NULL); + DCHECK(recognition_engine_.get() != nullptr); recognition_engine_->TakeAudioChunk(raw_audio); } } @@ -564,7 +564,7 @@ SpeechRecognizerImpl::FSMState SpeechRecognizerImpl::PrepareRecognition( const FSMEventArgs&) { DCHECK(state_ == STATE_IDLE); - DCHECK(recognition_engine_.get() != NULL); + DCHECK(recognition_engine_.get() != nullptr); DCHECK(!IsCapturingAudio()); GetAudioSystem()->GetInputStreamParameters( device_id_, base::BindOnce(&SpeechRecognizerImpl::OnDeviceInfo, @@ -577,7 +577,7 @@ SpeechRecognizerImpl::FSMState SpeechRecognizerImpl::StartRecording(const FSMEventArgs&) { DCHECK(state_ == STATE_PREPARING); - DCHECK(recognition_engine_.get() != NULL); + DCHECK(recognition_engine_.get() != nullptr); DCHECK(!IsCapturingAudio()); DVLOG(1) << "SpeechRecognizerImpl starting audio capture."; @@ -662,7 +662,7 @@ SpeechRecognizerImpl::StartRecognitionEngine(const FSMEventArgs& event_args) { // This is the first audio packet captured, so the recognition engine is // started and the delegate notified about the event. - DCHECK(recognition_engine_.get() != NULL); + DCHECK(recognition_engine_.get() != nullptr); recognition_engine_->StartRecognition(); listener()->OnAudioStart(session_id()); @@ -752,7 +752,7 @@ // The recognition engine is initialized only after STATE_STARTING. if (state_ > STATE_STARTING) { - DCHECK(recognition_engine_.get() != NULL); + DCHECK(recognition_engine_.get() != nullptr); recognition_engine_->EndRecognition(); } @@ -856,7 +856,7 @@ audio_controller_->Close( base::BindOnce(&SpeechRecognizerImpl::OnAudioClosed, this, base::RetainedRef(audio_controller_))); - audio_controller_ = NULL; // The controller is still refcounted by Bind. + audio_controller_ = nullptr; // The controller is still refcounted by Bind. audio_log_->OnClosed(0); } @@ -903,9 +903,8 @@ SpeechRecognizerImpl::FSMEventArgs::FSMEventArgs(FSMEvent event_value) : event(event_value), - audio_data(NULL), - engine_error(SPEECH_RECOGNITION_ERROR_NONE) { -} + audio_data(nullptr), + engine_error(SPEECH_RECOGNITION_ERROR_NONE) {} SpeechRecognizerImpl::FSMEventArgs::FSMEventArgs(const FSMEventArgs& other) = default;
diff --git a/content/browser/speech/speech_recognizer_impl_unittest.cc b/content/browser/speech/speech_recognizer_impl_unittest.cc index 4515018..db08209 100644 --- a/content/browser/speech/speech_recognizer_impl_unittest.cc +++ b/content/browser/speech/speech_recognizer_impl_unittest.cc
@@ -55,7 +55,7 @@ volume_(-1.0f) { // SpeechRecognizer takes ownership of sr_engine. SpeechRecognitionEngine* sr_engine = - new SpeechRecognitionEngine(NULL /* URLRequestContextGetter */); + new SpeechRecognitionEngine(nullptr /* URLRequestContextGetter */); SpeechRecognitionEngine::Config config; config.audio_num_bits_per_sample = SpeechRecognizerImpl::kNumBitsPerAudioSample; @@ -169,7 +169,7 @@ } void TearDown() override { - AudioInputController::set_factory_for_testing(NULL); + AudioInputController::set_factory_for_testing(nullptr); } void CopyPacketToAudioBus() {
diff --git a/content/browser/storage_partition_impl_unittest.cc b/content/browser/storage_partition_impl_unittest.cc index b1d88e15..d9992fc 100644 --- a/content/browser/storage_partition_impl_unittest.cc +++ b/content/browser/storage_partition_impl_unittest.cc
@@ -177,7 +177,7 @@ class RemoveLocalStorageTester { public: explicit RemoveLocalStorageTester(TestBrowserContext* profile) - : dom_storage_context_(NULL), + : dom_storage_context_(nullptr), mock_db_(&mock_data_), db_binding_(&mock_db_) { dom_storage_context_ = @@ -664,7 +664,7 @@ } ~StoragePartitionShaderClearTest() override { - cache_ = NULL; + cache_ = nullptr; GetShaderCacheFactorySingleton()->RemoveCacheInfo(kDefaultClientId); }
diff --git a/content/browser/streams/stream.cc b/content/browser/streams/stream.cc index 7c0bc8a..6c3db96e 100644 --- a/content/browser/streams/stream.cc +++ b/content/browser/streams/stream.cc
@@ -32,9 +32,9 @@ data_bytes_read_(0), last_total_buffered_bytes_(0), registry_(registry), - read_observer_(NULL), + read_observer_(nullptr), write_observer_(write_observer), - stream_handle_(NULL), + stream_handle_(nullptr), weak_ptr_factory_(this) { CreateByteStream(base::ThreadTaskRunnerHandle::Get(), base::ThreadTaskRunnerHandle::Get(), kDeferSizeThreshold, @@ -61,12 +61,12 @@ void Stream::RemoveReadObserver(StreamReadObserver* observer) { DCHECK(observer == read_observer_); - read_observer_ = NULL; + read_observer_ = nullptr; } void Stream::RemoveWriteObserver(StreamWriteObserver* observer) { DCHECK(observer == write_observer_); - write_observer_ = NULL; + write_observer_ = nullptr; } void Stream::Abort() { @@ -181,7 +181,7 @@ scoped_refptr<Stream> ref(this); CHECK(stream_handle_); - stream_handle_ = NULL; + stream_handle_ = nullptr; registry_->UnregisterStream(url()); if (write_observer_) write_observer_->OnClose(this); @@ -203,7 +203,7 @@ } void Stream::ClearBuffer() { - data_ = NULL; + data_ = nullptr; data_length_ = 0; data_bytes_read_ = 0; }
diff --git a/content/browser/streams/stream_registry.cc b/content/browser/streams/stream_registry.cc index b9cba5b..ca6baee3 100644 --- a/content/browser/streams/stream_registry.cc +++ b/content/browser/streams/stream_registry.cc
@@ -47,7 +47,7 @@ if (stream != streams_.end()) return stream->second; - return NULL; + return nullptr; } bool StreamRegistry::CloneStream(const GURL& url, const GURL& src_url) {
diff --git a/content/browser/streams/stream_url_request_job.cc b/content/browser/streams/stream_url_request_job.cc index 5c895f4..8b1ed9d 100644 --- a/content/browser/streams/stream_url_request_job.cc +++ b/content/browser/streams/stream_url_request_job.cc
@@ -70,7 +70,7 @@ // Clear the buffers before notifying the read is complete, so that it is // safe for the observer to read. - pending_buffer_ = NULL; + pending_buffer_ = nullptr; pending_buffer_size_ = 0; if (result > 0) @@ -221,7 +221,7 @@ void StreamURLRequestJob::ClearStream() { if (stream_.get()) { stream_->RemoveReadObserver(this); - stream_ = NULL; + stream_ = nullptr; } }
diff --git a/content/browser/streams/stream_url_request_job_unittest.cc b/content/browser/streams/stream_url_request_job_unittest.cc index 21cfab09..a1ce724 100644 --- a/content/browser/streams/stream_url_request_job_unittest.cc +++ b/content/browser/streams/stream_url_request_job_unittest.cc
@@ -48,7 +48,7 @@ scoped_refptr<Stream> stream = registry_->GetStream(request->url()); if (stream.get()) return new StreamURLRequestJob(request, network_delegate, stream); - return NULL; + return nullptr; } private: @@ -111,7 +111,7 @@ TEST_F(StreamURLRequestJobTest, TestGetSimpleDataRequest) { scoped_refptr<Stream> stream( - new Stream(registry_.get(), NULL, kStreamURL)); + new Stream(registry_.get(), nullptr, kStreamURL)); scoped_refptr<net::StringIOBuffer> buffer( new net::StringIOBuffer(kTestData1)); @@ -124,7 +124,7 @@ TEST_F(StreamURLRequestJobTest, TestGetLargeStreamRequest) { scoped_refptr<Stream> stream( - new Stream(registry_.get(), NULL, kStreamURL)); + new Stream(registry_.get(), nullptr, kStreamURL)); std::string large_data; large_data.reserve(kBufferSize * 5); @@ -155,7 +155,7 @@ TEST_F(StreamURLRequestJobTest, TestRangeDataRequest) { scoped_refptr<Stream> stream( - new Stream(registry_.get(), NULL, kStreamURL)); + new Stream(registry_.get(), nullptr, kStreamURL)); scoped_refptr<net::StringIOBuffer> buffer( new net::StringIOBuffer(kTestData2)); @@ -172,7 +172,7 @@ TEST_F(StreamURLRequestJobTest, TestInvalidRangeDataRequest) { scoped_refptr<Stream> stream( - new Stream(registry_.get(), NULL, kStreamURL)); + new Stream(registry_.get(), nullptr, kStreamURL)); scoped_refptr<net::StringIOBuffer> buffer( new net::StringIOBuffer(kTestData2));
diff --git a/content/browser/tracing/background_memory_tracing_observer_unittest.cc b/content/browser/tracing/background_memory_tracing_observer_unittest.cc index a54a19bf..013da385 100644 --- a/content/browser/tracing/background_memory_tracing_observer_unittest.cc +++ b/content/browser/tracing/background_memory_tracing_observer_unittest.cc
@@ -30,7 +30,7 @@ const std::string& json_text) { std::unique_ptr<base::Value> json_value(base::JSONReader::Read(json_text)); - base::DictionaryValue* dict = NULL; + base::DictionaryValue* dict = nullptr; if (json_value) json_value->GetAsDictionary(&dict);
diff --git a/content/browser/tracing/background_tracing_config_unittest.cc b/content/browser/tracing/background_tracing_config_unittest.cc index dadffb3..7124ddf 100644 --- a/content/browser/tracing/background_tracing_config_unittest.cc +++ b/content/browser/tracing/background_tracing_config_unittest.cc
@@ -29,7 +29,7 @@ const std::string& json_text) { std::unique_ptr<base::Value> json_value(base::JSONReader::Read(json_text)); - base::DictionaryValue* dict = NULL; + base::DictionaryValue* dict = nullptr; if (json_value) json_value->GetAsDictionary(&dict);
diff --git a/content/browser/tracing/background_tracing_manager_browsertest.cc b/content/browser/tracing/background_tracing_manager_browsertest.cc index 0c100ae..f364552 100644 --- a/content/browser/tracing/background_tracing_manager_browsertest.cc +++ b/content/browser/tracing/background_tracing_manager_browsertest.cc
@@ -123,7 +123,7 @@ const size_t kOutputBufferLength = 10 * 1024 * 1024; std::vector<char> output_str(kOutputBufferLength); - z_stream stream = {0}; + z_stream stream = {nullptr}; stream.avail_in = compressed_length; stream.avail_out = kOutputBufferLength; stream.next_in = (Bytef*)&file_contents->data()[0]; @@ -224,7 +224,7 @@ void DisableScenarioWhenIdle() { BackgroundTracingManager::GetInstance()->SetActiveScenario( - NULL, BackgroundTracingManager::ReceiveCallback(), + nullptr, BackgroundTracingManager::ReceiveCallback(), BackgroundTracingManager::NO_DATA_FILTERING); }
diff --git a/content/browser/tracing/tracing_controller_browsertest.cc b/content/browser/tracing/tracing_controller_browsertest.cc index ba3e452..a65ee7a 100644 --- a/content/browser/tracing/tracing_controller_browsertest.cc +++ b/content/browser/tracing/tracing_controller_browsertest.cc
@@ -379,7 +379,7 @@ TestStartAndStopTracingString(); // Check that a number of important keys exist in the metadata dictionary. The // values are not checked to ensure the test is robust. - EXPECT_TRUE(last_metadata() != NULL); + EXPECT_TRUE(last_metadata() != nullptr); std::string network_type; last_metadata()->GetString("network-type", &network_type); EXPECT_TRUE(network_type.length() > 0); @@ -405,7 +405,7 @@ DISABLED_NotWhitelistedMetadataStripped) { TestStartAndStopTracingStringWithFilter(); // Check that a number of important keys exist in the metadata dictionary. - EXPECT_TRUE(last_metadata() != NULL); + EXPECT_TRUE(last_metadata() != nullptr); std::string cpu_brand; last_metadata()->GetString("cpu-brand", &cpu_brand); EXPECT_TRUE(cpu_brand.length() > 0);
diff --git a/content/browser/tracing/tracing_controller_impl_data_endpoint.cc b/content/browser/tracing/tracing_controller_impl_data_endpoint.cc index 9d69891d..586f096a 100644 --- a/content/browser/tracing/tracing_controller_impl_data_endpoint.cc +++ b/content/browser/tracing/tracing_controller_impl_data_endpoint.cc
@@ -63,7 +63,7 @@ const base::Closure& callback) : file_path_(trace_file_path), completion_callback_(callback), - file_(NULL) {} + file_(nullptr) {} void ReceiveTraceChunk(std::unique_ptr<std::string> chunk) override { background_task_runner_->PostTask( @@ -80,7 +80,7 @@ } private: - ~FileTraceDataEndpoint() override { DCHECK(file_ == NULL); } + ~FileTraceDataEndpoint() override { DCHECK(file_ == nullptr); } void ReceiveTraceChunkOnBlockingThread(std::unique_ptr<std::string> chunk) { if (!OpenFileIfNeededOnBlockingThread()) @@ -90,10 +90,10 @@ bool OpenFileIfNeededOnBlockingThread() { base::AssertBlockingAllowed(); - if (file_ != NULL) + if (file_ != nullptr) return true; file_ = base::OpenFile(file_path_, "w"); - if (file_ == NULL) { + if (file_ == nullptr) { LOG(ERROR) << "Failed to open " << file_path_.value(); return false; } @@ -103,7 +103,7 @@ void CloseOnBlockingThread() { if (OpenFileIfNeededOnBlockingThread()) { base::CloseFile(file_); - file_ = NULL; + file_ = nullptr; } BrowserThread::PostTask( @@ -162,7 +162,7 @@ already_tried_open_ = true; stream_.reset(new z_stream); - *stream_ = {0}; + *stream_ = {nullptr}; stream_->zalloc = Z_NULL; stream_->zfree = Z_NULL; stream_->opaque = Z_NULL;
diff --git a/content/browser/utility_process_host_impl.cc b/content/browser/utility_process_host_impl.cc index 1d0d0829..52eb5529b 100644 --- a/content/browser/utility_process_host_impl.cc +++ b/content/browser/utility_process_host_impl.cc
@@ -124,7 +124,7 @@ service_manager::SandboxType sandbox_type_; }; -UtilityMainThreadFactoryFunction g_utility_main_thread_factory = NULL; +UtilityMainThreadFactoryFunction g_utility_main_thread_factory = nullptr; UtilityProcessHost* UtilityProcessHost::Create( const scoped_refptr<UtilityProcessHostClient>& client,
diff --git a/content/browser/web_contents/opened_by_dom_browsertest.cc b/content/browser/web_contents/opened_by_dom_browsertest.cc index 0f506b5..9ef6e2b 100644 --- a/content/browser/web_contents/opened_by_dom_browsertest.cc +++ b/content/browser/web_contents/opened_by_dom_browsertest.cc
@@ -74,7 +74,7 @@ Shell* OpenWindowFromJavaScript(Shell* shell, const GURL& url) { // Wait for the popup to be created and for it to have navigated. ShellAddedObserver new_shell_observer; - TestNavigationObserver nav_observer(NULL); + TestNavigationObserver nav_observer(nullptr); nav_observer.StartWatchingNewWebContents(); CHECK(ExecuteScript( shell, base::StringPrintf("window.open('%s')", url.spec().c_str())));
diff --git a/content/browser/web_contents/web_contents_delegate_unittest.cc b/content/browser/web_contents/web_contents_delegate_unittest.cc index 90358587..1845a66 100644 --- a/content/browser/web_contents/web_contents_delegate_unittest.cc +++ b/content/browser/web_contents/web_contents_delegate_unittest.cc
@@ -26,8 +26,8 @@ WebContents::Create(WebContents::CreateParams(browser_context())))); std::unique_ptr<WebContentsImpl> contents_b(static_cast<WebContentsImpl*>( WebContents::Create(WebContents::CreateParams(browser_context())))); - EXPECT_EQ(NULL, contents_a->GetDelegate()); - EXPECT_EQ(NULL, contents_b->GetDelegate()); + EXPECT_EQ(nullptr, contents_a->GetDelegate()); + EXPECT_EQ(nullptr, contents_b->GetDelegate()); std::unique_ptr<MockWebContentsDelegate> delegate( new MockWebContentsDelegate()); @@ -35,7 +35,7 @@ // Setting a delegate should work correctly. contents_a->SetDelegate(delegate.get()); EXPECT_EQ(delegate.get(), contents_a->GetDelegate()); - EXPECT_TRUE(contents_b->GetDelegate() == NULL); + EXPECT_TRUE(contents_b->GetDelegate() == nullptr); // A delegate can be a delegate to multiple WebContentsImpl. contents_b->SetDelegate(delegate.get()); @@ -48,18 +48,18 @@ EXPECT_EQ(delegate.get(), contents_b->GetDelegate()); // Setting delegate to NULL should work correctly. - contents_b->SetDelegate(NULL); + contents_b->SetDelegate(nullptr); EXPECT_EQ(delegate.get(), contents_a->GetDelegate()); - EXPECT_TRUE(contents_b->GetDelegate() == NULL); + EXPECT_TRUE(contents_b->GetDelegate() == nullptr); // Destroying the delegate while it is still the delegate for a // WebContentsImpl should unregister it. contents_b->SetDelegate(delegate.get()); EXPECT_EQ(delegate.get(), contents_a->GetDelegate()); EXPECT_EQ(delegate.get(), contents_b->GetDelegate()); - delegate.reset(NULL); - EXPECT_TRUE(contents_a->GetDelegate() == NULL); - EXPECT_TRUE(contents_b->GetDelegate() == NULL); + delegate.reset(nullptr); + EXPECT_TRUE(contents_a->GetDelegate() == nullptr); + EXPECT_TRUE(contents_b->GetDelegate() == nullptr); // Destroy the WebContentses and run the message loop to prevent leaks. contents_a.reset();
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index a535fd1..32d969bd 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -496,9 +496,9 @@ // WebContentsImpl ------------------------------------------------------------- WebContentsImpl::WebContentsImpl(BrowserContext* browser_context) - : delegate_(NULL), + : delegate_(nullptr), controller_(this, browser_context), - render_view_host_delegate_view_(NULL), + render_view_host_delegate_view_(nullptr), created_with_opener_(false), frame_tree_(new NavigatorImpl(&controller_, this), this, @@ -526,7 +526,7 @@ is_being_destroyed_(false), is_notifying_observers_(false), notify_disconnection_(false), - dialog_manager_(NULL), + dialog_manager_(nullptr), is_showing_before_unload_dialog_(false), last_active_time_(base::TimeTicks::Now()), closed_by_user_gesture_(false), @@ -676,7 +676,7 @@ for (auto& observer : observers_) observer.ResetWebContents(); - SetDelegate(NULL); + SetDelegate(nullptr); } WebContentsImpl* WebContentsImpl::CreateWithOpener( @@ -1207,7 +1207,7 @@ // Reload the page if a load is currently in progress to avoid having // different parts of the page loaded using different user agents. NavigationEntry* entry = controller_.GetVisibleEntry(); - if (IsLoading() && entry != NULL && entry->GetIsOverridingUserAgent()) + if (IsLoading() && entry != nullptr && entry->GetIsOverridingUserAgent()) controller_.Reload(ReloadType::BYPASSING_CACHE, true); for (auto& observer : observers_) @@ -2544,7 +2544,7 @@ if (!widget_host_view) return; - RenderWidgetHostView* view = NULL; + RenderWidgetHostView* view = nullptr; if (GetOuterWebContents()) { view = GetOuterWebContents()->GetRenderWidgetHostView(); } else { @@ -2907,7 +2907,7 @@ WebContents* WebContentsImpl::OpenURL(const OpenURLParams& params) { if (!delegate_) - return NULL; + return nullptr; WebContents* new_contents = delegate_->OpenURLFromTab(this, params); @@ -3501,7 +3501,7 @@ } bool WebContentsImpl::HasOpener() const { - return GetOpener() != NULL; + return GetOpener() != nullptr; } RenderFrameHostImpl* WebContentsImpl::GetOpener() const { @@ -3510,7 +3510,7 @@ } bool WebContentsImpl::HasOriginalOpener() const { - return GetOriginalOpener() != NULL; + return GetOriginalOpener() != nullptr; } RenderFrameHostImpl* WebContentsImpl::GetOriginalOpener() const { @@ -4199,9 +4199,9 @@ int color_chooser_id, SkColor color, const std::vector<ColorSuggestion>& suggestions) { - ColorChooser* new_color_chooser = delegate_ ? - delegate_->OpenColorChooser(this, color, suggestions) : - NULL; + ColorChooser* new_color_chooser = + delegate_ ? delegate_->OpenColorChooser(this, color, suggestions) + : nullptr; if (!new_color_chooser) return; if (color_chooser_info_.get())
diff --git a/content/browser/web_contents/web_contents_impl_browsertest.cc b/content/browser/web_contents/web_contents_impl_browsertest.cc index 445ce48..1066147 100644 --- a/content/browser/web_contents/web_contents_impl_browsertest.cc +++ b/content/browser/web_contents/web_contents_impl_browsertest.cc
@@ -88,7 +88,7 @@ : WindowedNotificationObserver(NOTIFICATION_LOAD_STOP, Source<NavigationController>(controller)), session_index_(-1), - controller_(NULL) {} + controller_(nullptr) {} void Observe(int type, const NotificationSource& source, const NotificationDetails& details) override { @@ -420,7 +420,7 @@ class RenderFrameCreatedObserver : public WebContentsObserver { public: explicit RenderFrameCreatedObserver(Shell* shell) - : WebContentsObserver(shell->web_contents()), last_rfh_(NULL) {} + : WebContentsObserver(shell->web_contents()), last_rfh_(nullptr) {} void RenderFrameCreated(RenderFrameHost* render_frame_host) override { last_rfh_ = render_frame_host;
diff --git a/content/browser/web_contents/web_contents_user_data_unittest.cc b/content/browser/web_contents/web_contents_user_data_unittest.cc index c7e908a..81b6502 100644 --- a/content/browser/web_contents/web_contents_user_data_unittest.cc +++ b/content/browser/web_contents/web_contents_user_data_unittest.cc
@@ -42,23 +42,23 @@ WebContents* contents = web_contents(); WebContentsAttachedClass1* class1 = WebContentsAttachedClass1::FromWebContents(contents); - ASSERT_EQ(NULL, class1); + ASSERT_EQ(nullptr, class1); WebContentsAttachedClass2* class2 = WebContentsAttachedClass2::FromWebContents(contents); - ASSERT_EQ(NULL, class2); + ASSERT_EQ(nullptr, class2); WebContentsAttachedClass1::CreateForWebContents(contents); class1 = WebContentsAttachedClass1::FromWebContents(contents); - ASSERT_TRUE(class1 != NULL); + ASSERT_TRUE(class1 != nullptr); class2 = WebContentsAttachedClass2::FromWebContents(contents); - ASSERT_EQ(NULL, class2); + ASSERT_EQ(nullptr, class2); WebContentsAttachedClass2::CreateForWebContents(contents); WebContentsAttachedClass1* class1again = WebContentsAttachedClass1::FromWebContents(contents); - ASSERT_TRUE(class1again != NULL); + ASSERT_TRUE(class1again != nullptr); class2 = WebContentsAttachedClass2::FromWebContents(contents); - ASSERT_TRUE(class2 != NULL); + ASSERT_TRUE(class2 != nullptr); ASSERT_EQ(class1, class1again); ASSERT_NE(static_cast<void*>(class1), static_cast<void*>(class2)); } @@ -66,27 +66,27 @@ TEST_F(WebContentsUserDataTest, TwoInstancesOneAttachment) { WebContents* contents1 = web_contents(); std::unique_ptr<WebContents> contents2( - WebContentsTester::CreateTestWebContents(browser_context(), NULL)); + WebContentsTester::CreateTestWebContents(browser_context(), nullptr)); WebContentsAttachedClass1* one_class = WebContentsAttachedClass1::FromWebContents(contents1); - ASSERT_EQ(NULL, one_class); + ASSERT_EQ(nullptr, one_class); WebContentsAttachedClass1* two_class = WebContentsAttachedClass1::FromWebContents(contents2.get()); - ASSERT_EQ(NULL, two_class); + ASSERT_EQ(nullptr, two_class); WebContentsAttachedClass1::CreateForWebContents(contents1); one_class = WebContentsAttachedClass1::FromWebContents(contents1); - ASSERT_TRUE(one_class != NULL); + ASSERT_TRUE(one_class != nullptr); two_class = WebContentsAttachedClass1::FromWebContents(contents2.get()); - ASSERT_EQ(NULL, two_class); + ASSERT_EQ(nullptr, two_class); WebContentsAttachedClass1::CreateForWebContents(contents2.get()); WebContentsAttachedClass1* one_class_again = WebContentsAttachedClass1::FromWebContents(contents1); - ASSERT_TRUE(one_class_again != NULL); + ASSERT_TRUE(one_class_again != nullptr); two_class = WebContentsAttachedClass1::FromWebContents(contents2.get()); - ASSERT_TRUE(two_class != NULL); + ASSERT_TRUE(two_class != nullptr); ASSERT_EQ(one_class, one_class_again); ASSERT_NE(one_class, two_class); } @@ -95,16 +95,16 @@ WebContents* contents = web_contents(); WebContentsAttachedClass1* clazz = WebContentsAttachedClass1::FromWebContents(contents); - ASSERT_EQ(NULL, clazz); + ASSERT_EQ(nullptr, clazz); WebContentsAttachedClass1::CreateForWebContents(contents); clazz = WebContentsAttachedClass1::FromWebContents(contents); - ASSERT_TRUE(clazz != NULL); + ASSERT_TRUE(clazz != nullptr); WebContentsAttachedClass1::CreateForWebContents(contents); WebContentsAttachedClass1* class_again = WebContentsAttachedClass1::FromWebContents(contents); - ASSERT_TRUE(class_again != NULL); + ASSERT_TRUE(class_again != nullptr); ASSERT_EQ(clazz, class_again); }
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc index af9d1c4..a58c7afe 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -99,14 +99,14 @@ RenderWidgetHostView* view) { if (!view || (RenderViewHostFactory::has_factory() && !RenderViewHostFactory::is_real_render_view_host())) { - return NULL; // Can't cast to RenderWidgetHostViewAura in unit tests. + return nullptr; // Can't cast to RenderWidgetHostViewAura in unit tests. } RenderViewHost* rvh = RenderViewHost::From(view->GetRenderWidgetHost()); WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( - rvh ? WebContents::FromRenderViewHost(rvh) : NULL); + rvh ? WebContents::FromRenderViewHost(rvh) : nullptr); if (BrowserPluginGuest::IsGuest(web_contents)) - return NULL; + return nullptr; return static_cast<RenderWidgetHostViewAura*>(view); } @@ -137,8 +137,8 @@ if (dnd_client && dnd_client->IsDragDropInProgress()) dnd_client->DragCancel(); - window_ = NULL; - contents_ = NULL; + window_ = nullptr; + contents_ = nullptr; } aura::Window* window() const { return window_; } @@ -415,8 +415,7 @@ : public aura::WindowObserver, public aura::WindowTreeHostObserver { public: explicit WindowObserver(WebContentsViewAura* view) - : view_(view), - host_window_(NULL) { + : view_(view), host_window_(nullptr) { view_->window_->AddObserver(this); } @@ -463,7 +462,7 @@ void OnWindowDestroying(aura::Window* window) override { if (window == host_window_) { host_window_->RemoveObserver(this); - host_window_ = NULL; + host_window_ = nullptr; } } @@ -687,7 +686,7 @@ gfx::NativeView WebContentsViewAura::GetContentNativeView() const { RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); - return rwhv ? rwhv->GetNativeView() : NULL; + return rwhv ? rwhv->GetNativeView() : nullptr; } gfx::NativeWindow WebContentsViewAura::GetTopLevelNativeWindow() const { @@ -730,7 +729,7 @@ // Static. void WebContentsView::GetDefaultScreenInfo(ScreenInfo* results) { - GetScreenInfoForWindow(results, NULL); + GetScreenInfoForWindow(results, nullptr); } void WebContentsViewAura::GetScreenInfo(ScreenInfo* screen_info) const { @@ -1115,7 +1114,7 @@ // this window can handle key events. RenderWidgetHostViewAura* view = ToRenderWidgetHostViewAura( web_contents_->GetRenderWidgetHostView()); - if (view != NULL && !view->IsClosing()) + if (view != nullptr && !view->IsClosing()) return true; return false; @@ -1203,7 +1202,7 @@ if (web_contents_->GetDelegate() && !web_contents_->GetDelegate()->CanDragEnter( web_contents_, *current_drop_data_.get(), op)) { - current_drop_data_.reset(NULL); + current_drop_data_.reset(nullptr); return; }
diff --git a/content/browser/web_contents/web_contents_view_aura_browsertest.cc b/content/browser/web_contents/web_contents_view_aura_browsertest.cc index 3a9a79a..c43c8de5 100644 --- a/content/browser/web_contents/web_contents_view_aura_browsertest.cc +++ b/content/browser/web_contents/web_contents_view_aura_browsertest.cc
@@ -70,16 +70,15 @@ public: explicit ScreenshotTracker(NavigationControllerImpl* controller) : NavigationEntryScreenshotManager(controller), - screenshot_taken_for_(NULL), - waiting_for_screenshots_(0) { - } + screenshot_taken_for_(nullptr), + waiting_for_screenshots_(0) {} ~ScreenshotTracker() override {} RenderViewHost* screenshot_taken_for() { return screenshot_taken_for_; } void Reset() { - screenshot_taken_for_ = NULL; + screenshot_taken_for_ = nullptr; screenshot_set_.clear(); } @@ -173,9 +172,7 @@ class WebContentsViewAuraTest : public ContentBrowserTest { public: - WebContentsViewAuraTest() - : screenshot_manager_(NULL) { - } + WebContentsViewAuraTest() : screenshot_manager_(nullptr) {} // Executes the javascript synchronously and makes sure the returned value is // freed properly. @@ -751,7 +748,7 @@ WaitForLoadStop(web_contents); screenshot_manager()->WaitUntilScreenshotIsReady(); - EXPECT_EQ(NULL, screenshot_manager()->screenshot_taken_for()); + EXPECT_EQ(nullptr, screenshot_manager()->screenshot_taken_for()); } // Tests that navigations resulting from reloads, history.replaceState, @@ -797,7 +794,7 @@ DISABLED_ContentWindowReparent) { ASSERT_NO_FATAL_FAILURE(StartTestWithPage("/overscroll_navigation.html")); - std::unique_ptr<aura::Window> window(new aura::Window(NULL)); + std::unique_ptr<aura::Window> window(new aura::Window(nullptr)); window->Init(ui::LAYER_NOT_DRAWN); WebContentsImpl* web_contents = @@ -922,7 +919,7 @@ IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, WebContentsViewReparent) { ASSERT_NO_FATAL_FAILURE(StartTestWithPage("/overscroll_navigation.html")); - std::unique_ptr<aura::Window> window(new aura::Window(NULL)); + std::unique_ptr<aura::Window> window(new aura::Window(nullptr)); window->Init(ui::LAYER_NOT_DRAWN); RenderWidgetHostViewAura* rwhva =
diff --git a/content/browser/web_contents/web_contents_view_guest.cc b/content/browser/web_contents/web_contents_view_guest.cc index 0256869..a05947d 100644 --- a/content/browser/web_contents/web_contents_view_guest.cc +++ b/content/browser/web_contents/web_contents_view_guest.cc
@@ -55,7 +55,7 @@ gfx::NativeView WebContentsViewGuest::GetContentNativeView() const { RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); if (!rwhv) - return NULL; + return nullptr; return rwhv->GetNativeView(); } @@ -200,7 +200,7 @@ DropData* WebContentsViewGuest::GetDropData() const { NOTIMPLEMENTED(); - return NULL; + return nullptr; } void WebContentsViewGuest::UpdateDragCursor(WebDragOperation operation) {
diff --git a/content/browser/webrtc/webrtc_audio_debug_recordings_browsertest.cc b/content/browser/webrtc/webrtc_audio_debug_recordings_browsertest.cc index 4d5a31b..1b0abc10c 100644 --- a/content/browser/webrtc/webrtc_audio_debug_recordings_browsertest.cc +++ b/content/browser/webrtc/webrtc_audio_debug_recordings_browsertest.cc
@@ -128,7 +128,7 @@ // This fakes the behavior of another open tab with webrtc-internals, and // enabling audio debug recordings in that tab. - WebRTCInternals::GetInstance()->FileSelected(base_file_path, -1, NULL); + WebRTCInternals::GetInstance()->FileSelected(base_file_path, -1, nullptr); // Make a call. GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); @@ -213,7 +213,7 @@ // This fakes the behavior of another open tab with webrtc-internals, and // enabling audio debug recordings in that tab, then disabling it. - WebRTCInternals::GetInstance()->FileSelected(base_file_path, -1, NULL); + WebRTCInternals::GetInstance()->FileSelected(base_file_path, -1, nullptr); WebRTCInternals::GetInstance()->DisableAudioDebugRecordings(); // Make a call. @@ -268,7 +268,7 @@ // This fakes the behavior of another open tab with webrtc-internals, and // enabling audio debug recordings in that tab. - WebRTCInternals::GetInstance()->FileSelected(base_file_path, -1, NULL); + WebRTCInternals::GetInstance()->FileSelected(base_file_path, -1, nullptr); // Make the calls. GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html"));
diff --git a/content/browser/webrtc/webrtc_getusermedia_browsertest.cc b/content/browser/webrtc/webrtc_getusermedia_browsertest.cc index c8510b5..1c1ace1 100644 --- a/content/browser/webrtc/webrtc_getusermedia_browsertest.cc +++ b/content/browser/webrtc/webrtc_getusermedia_browsertest.cc
@@ -106,14 +106,14 @@ class WebRtcGetUserMediaBrowserTest : public WebRtcContentBrowserTestBase { public: - WebRtcGetUserMediaBrowserTest() : trace_log_(NULL) { + WebRtcGetUserMediaBrowserTest() : trace_log_(nullptr) { // Automatically grant device permission. AppendUseFakeUIForMediaStreamFlag(); } ~WebRtcGetUserMediaBrowserTest() override {} void StartTracing() { - CHECK(trace_log_ == NULL) << "Can only can start tracing once"; + CHECK(trace_log_ == nullptr) << "Can only can start tracing once"; trace_log_ = base::trace_event::TraceLog::GetInstance(); base::trace_event::TraceConfig trace_config( "video", base::trace_event::RECORD_UNTIL_FULL); @@ -124,7 +124,7 @@ } void StopTracing() { - CHECK(message_loop_runner_.get() == NULL) + CHECK(message_loop_runner_.get() == nullptr) << "Calling StopTracing more than once"; { @@ -238,7 +238,7 @@ devices_as_json, base::JSON_ALLOW_TRAILING_COMMAS, &error_code, &error_message); - ASSERT_TRUE(value.get() != NULL) << error_message; + ASSERT_TRUE(value.get() != nullptr) << error_message; EXPECT_EQ(value->type(), base::Value::Type::LIST); base::ListValue* values;
diff --git a/content/browser/webrtc/webrtc_internals.cc b/content/browser/webrtc/webrtc_internals.cc index f227182..2238407 100644 --- a/content/browser/webrtc/webrtc_internals.cc +++ b/content/browser/webrtc/webrtc_internals.cc
@@ -45,7 +45,7 @@ // Makes sure that |dict| has a ListValue under path "log". base::ListValue* EnsureLogList(base::DictionaryValue* dict) { - base::ListValue* log = NULL; + base::ListValue* log = nullptr; if (!dict->GetList("log", &log)) log = dict->SetList("log", std::make_unique<base::ListValue>()); return log; @@ -165,7 +165,7 @@ base::DictionaryValue* dict = FindRecord(pid, lid, &index); if (dict) { MaybeClosePeerConnection(dict); - peer_connection_data_.Remove(index, NULL); + peer_connection_data_.Remove(index, nullptr); } if (observers_.might_have_observers()) { @@ -297,8 +297,9 @@ select_file_dialog_ = ui::SelectFileDialog::Create(this, nullptr); select_file_dialog_->SelectFile( ui::SelectFileDialog::SELECT_SAVEAS_FILE, base::string16(), - audio_debug_recordings_file_path_, NULL, 0, base::FilePath::StringType(), - web_contents->GetTopLevelNativeWindow(), NULL); + audio_debug_recordings_file_path_, nullptr, 0, + base::FilePath::StringType(), web_contents->GetTopLevelNativeWindow(), + nullptr); #endif #endif } @@ -441,7 +442,7 @@ // Iterates from the end of the list to remove the PeerConnections created // by the exitting renderer. for (int i = peer_connection_data_.GetSize() - 1; i >= 0; --i) { - base::DictionaryValue* record = NULL; + base::DictionaryValue* record = nullptr; peer_connection_data_.GetDictionary(i, &record); int this_rid = 0; @@ -460,7 +461,7 @@ SendUpdate("removePeerConnection", std::move(update)); } MaybeClosePeerConnection(record); - peer_connection_data_.Remove(i, NULL); + peer_connection_data_.Remove(i, nullptr); } } UpdateWakeLock(); @@ -469,14 +470,14 @@ // Iterates from the end of the list to remove the getUserMedia requests // created by the exiting renderer. for (int i = get_user_media_requests_.GetSize() - 1; i >= 0; --i) { - base::DictionaryValue* record = NULL; + base::DictionaryValue* record = nullptr; get_user_media_requests_.GetDictionary(i, &record); int this_rid = 0; record->GetInteger("rid", &this_rid); if (this_rid == render_process_id) { - get_user_media_requests_.Remove(i, NULL); + get_user_media_requests_.Remove(i, nullptr); found_any = true; } }
diff --git a/content/browser/webrtc/webrtc_internals_browsertest.cc b/content/browser/webrtc/webrtc_internals_browsertest.cc index b3f0c1b4..213d360 100644 --- a/content/browser/webrtc/webrtc_internals_browsertest.cc +++ b/content/browser/webrtc/webrtc_internals_browsertest.cc
@@ -246,7 +246,7 @@ EXPECT_EQ(requests.size(), list_request->GetSize()); for (size_t i = 0; i < requests.size(); ++i) { - base::DictionaryValue* dict = NULL; + base::DictionaryValue* dict = nullptr; ASSERT_TRUE(list_request->GetDictionary(i, &dict)); int pid, rid; std::string origin, audio, video; @@ -438,7 +438,7 @@ int peer_connection_number, int update_number, int stats_number) { - EXPECT_NE((base::Value*)NULL, dump); + EXPECT_NE((base::Value*)nullptr, dump); EXPECT_EQ(base::Value::Type::DICTIONARY, dump->type()); base::DictionaryValue* dict_dump = @@ -447,7 +447,7 @@ base::DictionaryValue::Iterator it(*dict_dump); for (; !it.IsAtEnd(); it.Advance()) { - base::Value* value = NULL; + base::Value* value = nullptr; dict_dump->Get(it.key(), &value); EXPECT_EQ(base::Value::Type::DICTIONARY, value->type()); base::DictionaryValue* pc_dump = @@ -476,17 +476,17 @@ const string& report_type, const string& report_id, const StatsUnit& stats) { - EXPECT_NE((base::Value*)NULL, dump); + EXPECT_NE((base::Value*)nullptr, dump); EXPECT_EQ(base::Value::Type::DICTIONARY, dump->type()); base::DictionaryValue* dict_dump = static_cast<base::DictionaryValue*>(dump); - base::Value* value = NULL; + base::Value* value = nullptr; dict_dump->Get(pc.getIdString(), &value); base::DictionaryValue* pc_dump = static_cast<base::DictionaryValue*>(value); // Verifies there is one data series per stats name. - value = NULL; + value = nullptr; pc_dump->Get("stats", &value); EXPECT_EQ(base::Value::Type::DICTIONARY, value->type());
diff --git a/content/browser/webrtc/webrtc_internals_unittest.cc b/content/browser/webrtc/webrtc_internals_unittest.cc index ef2c502..d6f26c1 100644 --- a/content/browser/webrtc/webrtc_internals_unittest.cc +++ b/content/browser/webrtc/webrtc_internals_unittest.cc
@@ -110,7 +110,7 @@ void VerifyList(const base::DictionaryValue* dict, const std::string& key, const base::ListValue& expected) { - const base::ListValue* actual = NULL; + const base::ListValue* actual = nullptr; EXPECT_TRUE(dict->GetList(key, &actual)); EXPECT_TRUE(expected.Equals(actual)); } @@ -121,7 +121,7 @@ const std::string& origin, const std::string& audio, const std::string& video) { - base::DictionaryValue* dict = NULL; + base::DictionaryValue* dict = nullptr; EXPECT_TRUE(actual_data->GetAsDictionary(&dict)); VerifyInt(dict, "rid", rid); @@ -227,7 +227,7 @@ ASSERT_EQ("addPeerConnection", observer.command()); - base::DictionaryValue* dict = NULL; + base::DictionaryValue* dict = nullptr; EXPECT_TRUE(observer.value()->GetAsDictionary(&dict)); VerifyInt(dict, "pid", 1); @@ -253,7 +253,7 @@ ASSERT_EQ("removePeerConnection", observer.command()); - base::DictionaryValue* dict = NULL; + base::DictionaryValue* dict = nullptr; EXPECT_TRUE(observer.value()->GetAsDictionary(&dict)); VerifyInt(dict, "pid", 1); @@ -278,7 +278,7 @@ ASSERT_EQ("updatePeerConnection", observer.command()); - base::DictionaryValue* dict = NULL; + base::DictionaryValue* dict = nullptr; EXPECT_TRUE(observer.value()->GetAsDictionary(&dict)); VerifyInt(dict, "pid", 1); @@ -358,11 +358,11 @@ EXPECT_EQ("updateAllPeerConnections", observer.command()); ASSERT_TRUE(observer.value()); - base::ListValue* list = NULL; + base::ListValue* list = nullptr; EXPECT_TRUE(observer.value()->GetAsList(&list)); EXPECT_EQ(1U, list->GetSize()); - base::DictionaryValue* dict = NULL; + base::DictionaryValue* dict = nullptr; EXPECT_TRUE((*list->begin()).GetAsDictionary(&dict)); VerifyInt(dict, "rid", rid); @@ -372,7 +372,7 @@ VerifyString(dict, "rtcConfiguration", kRtcConfiguration); VerifyString(dict, "constraints", kContraints); - base::ListValue* log = NULL; + base::ListValue* log = nullptr; ASSERT_TRUE(dict->GetList("log", &log)); EXPECT_EQ(1U, log->GetSize()); @@ -403,7 +403,7 @@ EXPECT_EQ("addStats", observer.command()); ASSERT_TRUE(observer.value()); - base::DictionaryValue* dict = NULL; + base::DictionaryValue* dict = nullptr; EXPECT_TRUE(observer.value()->GetAsDictionary(&dict)); VerifyInt(dict, "pid", pid);
diff --git a/content/browser/webui/url_data_manager.cc b/content/browser/webui/url_data_manager.cc index 8ef8418..bdfc5d9 100644 --- a/content/browser/webui/url_data_manager.cc +++ b/content/browser/webui/url_data_manager.cc
@@ -60,7 +60,7 @@ } // namespace // static -URLDataManager::URLDataSources* URLDataManager::data_sources_ = NULL; +URLDataManager::URLDataSources* URLDataManager::data_sources_ = nullptr; URLDataManager::URLDataManager(BrowserContext* browser_context) : browser_context_(browser_context) {
diff --git a/content/browser/webui/web_ui_controller_factory_registry.cc b/content/browser/webui/web_ui_controller_factory_registry.cc index 312a006..14db247 100644 --- a/content/browser/webui/web_ui_controller_factory_registry.cc +++ b/content/browser/webui/web_ui_controller_factory_registry.cc
@@ -48,7 +48,7 @@ if (controller) return controller; } - return NULL; + return nullptr; } WebUI::TypeID WebUIControllerFactoryRegistry::GetWebUIType(
diff --git a/content/browser/webui/web_ui_data_source_unittest.cc b/content/browser/webui/web_ui_data_source_unittest.cc index 08695f0..f2974ff 100644 --- a/content/browser/webui/web_ui_data_source_unittest.cc +++ b/content/browser/webui/web_ui_data_source_unittest.cc
@@ -35,7 +35,7 @@ base::RefCountedMemory* GetDataResourceBytes( int resource_id) const override { - base::RefCountedStaticMemory* bytes = NULL; + base::RefCountedStaticMemory* bytes = nullptr; if (resource_id == kDummyDefaultResourceId) { bytes = new base::RefCountedStaticMemory( kDummyDefaultResource, arraysize(kDummyDefaultResource));
diff --git a/content/browser/webui/web_ui_impl.cc b/content/browser/webui/web_ui_impl.cc index 4194ecb..0b1e7dec 100644 --- a/content/browser/webui/web_ui_impl.cc +++ b/content/browser/webui/web_ui_impl.cc
@@ -56,7 +56,7 @@ WebUIImpl* web_ui_; }; -const WebUI::TypeID WebUI::kNoWebUI = NULL; +const WebUI::TypeID WebUI::kNoWebUI = nullptr; // static base::string16 WebUI::GetJavascriptCall(
diff --git a/content/browser/zygote_host/zygote_communication_linux.cc b/content/browser/zygote_host/zygote_communication_linux.cc index b25afd0..cc81496f 100644 --- a/content/browser/zygote_host/zygote_communication_linux.cc +++ b/content/browser/zygote_host/zygote_communication_linux.cc
@@ -155,7 +155,7 @@ base::Pickle pid_pickle; pid_pickle.WriteInt(kZygoteCommandForkRealPID); pid_pickle.WriteInt(real_pid); - if (!SendMessage(pid_pickle, NULL)) + if (!SendMessage(pid_pickle, nullptr)) return base::kNullProcessHandle; } @@ -215,7 +215,7 @@ pickle.WriteInt(kZygoteCommandReap); pickle.WriteInt(process); - if (!SendMessage(pickle, NULL)) + if (!SendMessage(pickle, nullptr)) LOG(ERROR) << "Failed to send Reap message to zygote"; ZygoteChildDied(process); } @@ -276,7 +276,7 @@ base::Pickle pickle; pickle.WriteInt(kZygoteCommandGetSandboxStatus); - if (!SendMessage(pickle, NULL)) + if (!SendMessage(pickle, nullptr)) LOG(FATAL) << "Cannot communicate with zygote"; init_ = true; @@ -297,7 +297,7 @@ ssize_t len; { base::AutoLock lock(control_lock_); - if (!SendMessage(pickle, NULL)) + if (!SendMessage(pickle, nullptr)) LOG(ERROR) << "Failed to send GetTerminationStatus message to zygote"; len = ReadReply(buf, sizeof(buf)); }
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc index 7ada42c..75fa5d6d 100644 --- a/content/child/blink_platform_impl.cc +++ b/content/child/blink_platform_impl.cc
@@ -575,7 +575,8 @@ if (message_id < 0) return WebString(); return WebString::FromUTF16(base::ReplaceStringPlaceholders( - GetContentClient()->GetLocalizedString(message_id), value.Utf16(), NULL)); + GetContentClient()->GetLocalizedString(message_id), value.Utf16(), + nullptr)); } WebString BlinkPlatformImpl::QueryLocalizedString(WebLocalizedString::Name name, @@ -589,7 +590,7 @@ values.push_back(value1.Utf16()); values.push_back(value2.Utf16()); return WebString::FromUTF16(base::ReplaceStringPlaceholders( - GetContentClient()->GetLocalizedString(message_id), values, NULL)); + GetContentClient()->GetLocalizedString(message_id), values, nullptr)); } std::unique_ptr<blink::WebGestureCurve>
diff --git a/content/child/browser_font_resource_trusted.cc b/content/child/browser_font_resource_trusted.cc index 7fd605b..64f59f57 100644 --- a/content/child/browser_font_resource_trusted.cc +++ b/content/child/browser_font_resource_trusted.cc
@@ -62,8 +62,7 @@ class TextRunCollection { public: explicit TextRunCollection(const PP_BrowserFont_Trusted_TextRun& run) - : bidi_(NULL), - num_runs_(0) { + : bidi_(nullptr), num_runs_(0) { StringVar* text_string = StringVar::FromPPVar(run.text); if (!text_string) return; // Leave num_runs_ = 0 so we'll do nothing. @@ -77,7 +76,8 @@ } else { bidi_ = ubidi_open(); UErrorCode uerror = U_ZERO_ERROR; - ubidi_setPara(bidi_, text_.data(), text_.size(), run.rtl, NULL, &uerror); + ubidi_setPara(bidi_, text_.data(), text_.size(), run.rtl, nullptr, + &uerror); if (U_SUCCESS(uerror)) num_runs_ = ubidi_countRuns(bidi_, &uerror); }
diff --git a/content/child/child_process.cc b/content/child/child_process.cc index b28d6e8..e89636811 100644 --- a/content/child/child_process.cc +++ b/content/child/child_process.cc
@@ -85,7 +85,7 @@ } } - g_lazy_tls.Pointer()->Set(NULL); + g_lazy_tls.Pointer()->Set(nullptr); io_thread_.Stop(); if (initialized_task_scheduler_) {
diff --git a/content/child/child_process_sandbox_support_impl_linux.cc b/content/child/child_process_sandbox_support_impl_linux.cc index 116f797a..5334719 100644 --- a/content/child/child_process_sandbox_support_impl_linux.cc +++ b/content/child/child_process_sandbox_support_impl_linux.cc
@@ -37,7 +37,7 @@ uint8_t buf[512]; const ssize_t n = base::UnixDomainSocket::SendRecvMsg( - GetSandboxFD(), buf, sizeof(buf), NULL, request); + GetSandboxFD(), buf, sizeof(buf), nullptr, request); std::string family_name; std::string filename; @@ -88,7 +88,7 @@ uint8_t buf[512]; const ssize_t n = base::UnixDomainSocket::SendRecvMsg( - GetSandboxFD(), buf, sizeof(buf), NULL, request); + GetSandboxFD(), buf, sizeof(buf), nullptr, request); if (n == -1) return;
diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc index 0a90b60..d5a91f6 100644 --- a/content/child/child_thread_impl.cc +++ b/content/child/child_thread_impl.cc
@@ -617,7 +617,7 @@ // automatically. We used to watch the object handle on Windows to do this, // but it wasn't possible to do so on POSIX. channel_->ClearIPCTaskRunner(); - g_lazy_tls.Pointer()->Set(NULL); + g_lazy_tls.Pointer()->Set(nullptr); } void ChildThreadImpl::Shutdown() {
diff --git a/content/common/content_switches_internal.cc b/content/common/content_switches_internal.cc index fa8feb7..1033dd0 100644 --- a/content/common/content_switches_internal.cc +++ b/content/common/content_switches_internal.cc
@@ -190,7 +190,7 @@ struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = SigUSR1Handler; - sigaction(SIGUSR1, &sa, NULL); + sigaction(SIGUSR1, &sa, nullptr); pause(); #endif // defined(OS_ANDROID)
diff --git a/content/common/cursors/webcursor.cc b/content/common/cursors/webcursor.cc index e34ab18..42584ef 100644 --- a/content/common/cursors/webcursor.cc +++ b/content/common/cursors/webcursor.cc
@@ -121,7 +121,7 @@ pickle->WriteInt(custom_size_.height()); pickle->WriteFloat(custom_scale_); - const char* data = NULL; + const char* data = nullptr; if (!custom_data_.empty()) data = &custom_data_[0]; pickle->WriteData(data, custom_data_.size());
diff --git a/content/common/font_config_ipc_linux.cc b/content/common/font_config_ipc_linux.cc index b1ad7cb..2596c992 100644 --- a/content/common/font_config_ipc_linux.cc +++ b/content/common/font_config_ipc_linux.cc
@@ -81,7 +81,7 @@ uint8_t reply_buf[2048]; const ssize_t r = base::UnixDomainSocket::SendRecvMsg( - fd_, reply_buf, sizeof(reply_buf), NULL, request); + fd_, reply_buf, sizeof(reply_buf), nullptr, request); if (r == -1) return false; @@ -145,7 +145,7 @@ const ssize_t r = base::UnixDomainSocket::SendRecvMsg( fd_, reply_buf, sizeof(reply_buf), &result_fd, request); if (r == -1) - return NULL; + return nullptr; base::Pickle reply(reinterpret_cast<char*>(reply_buf), r); bool result; @@ -153,7 +153,7 @@ if (!iter.ReadBool(&result) || !result) { if (result_fd) CloseFD(result_fd); - return NULL; + return nullptr; } return mapFileDescriptorToStream(result_fd);
diff --git a/content/common/font_list_fontconfig.cc b/content/common/font_list_fontconfig.cc index 3a6062d..a14eae7 100644 --- a/content/common/font_list_fontconfig.cc +++ b/content/common/font_list_fontconfig.cc
@@ -41,7 +41,7 @@ for (size_t i = 0; i < arraysize(allowed_formats); ++i) { auto format_pattern = CreateFormatPattern(allowed_formats[i]); std::unique_ptr<FcFontSet, decltype(&FcFontSetDestroy)> fontset( - FcFontList(0, format_pattern.get(), object_set.get()), + FcFontList(nullptr, format_pattern.get(), object_set.get()), FcFontSetDestroy); for (int j = 0; j < fontset->nfont; ++j) { char* family_string;
diff --git a/content/common/input/input_param_traits.cc b/content/common/input/input_param_traits.cc index 66418e3f..8480dd0 100644 --- a/content/common/input/input_param_traits.cc +++ b/content/common/input/input_param_traits.cc
@@ -28,7 +28,7 @@ base::PickleIterator* iter, param_type* p) { bool valid_web_event = false; - WebInputEventPointer web_event_pointer = NULL; + WebInputEventPointer web_event_pointer = nullptr; if (!ReadParam(m, iter, &valid_web_event) || !valid_web_event || !ReadParam(m, iter, &web_event_pointer) ||
diff --git a/content/common/input/touch_event_stream_validator.cc b/content/common/input/touch_event_stream_validator.cc index b5e7090..aa2d2bb 100644 --- a/content/common/input/touch_event_stream_validator.cc +++ b/content/common/input/touch_event_stream_validator.cc
@@ -23,7 +23,7 @@ if (event.touches[i].id == id) return &event.touches[i]; } - return NULL; + return nullptr; } std::string TouchPointIdsToString(const WebTouchEvent& event) {
diff --git a/content/common/page_state_serialization.cc b/content/common/page_state_serialization.cc index d685314..a2ec09f 100644 --- a/content/common/page_state_serialization.cc +++ b/content/common/page_state_serialization.cc
@@ -247,7 +247,7 @@ *data = tmp; } else { obj->parse_error = true; - *data = NULL; + *data = nullptr; *length = 0; } } @@ -281,7 +281,7 @@ } double ReadReal(SerializeObject* obj) { - const void* tmp = NULL; + const void* tmp = nullptr; int length = 0; double value = 0.0; ReadData(obj, &tmp, &length); @@ -358,16 +358,16 @@ int length_in_bytes; if (!obj->iter.ReadInt(&length_in_bytes)) { obj->parse_error = true; - return NULL; + return nullptr; } if (length_in_bytes < 0) - return NULL; + return nullptr; const char* data; if (!obj->iter.ReadBytes(&data, length_in_bytes)) { obj->parse_error = true; - return NULL; + return nullptr; } if (num_chars)
diff --git a/content/common/quarantine/quarantine_linux_unittest.cc b/content/common/quarantine/quarantine_linux_unittest.cc index 612d93f0..0f87e46 100644 --- a/content/common/quarantine/quarantine_linux_unittest.cc +++ b/content/common/quarantine/quarantine_linux_unittest.cc
@@ -60,7 +60,7 @@ } void GetExtendedAttributeNames(vector<string>* attr_names) const { - ssize_t len = listxattr(test_file().value().c_str(), NULL, 0); + ssize_t len = listxattr(test_file().value().c_str(), nullptr, 0); if (len <= static_cast<ssize_t>(0)) return; char* buffer = new char[len];
diff --git a/content/common/resource_messages.cc b/content/common/resource_messages.cc index dfa30bc1..fb9cc90 100644 --- a/content/common/resource_messages.cc +++ b/content/common/resource_messages.cc
@@ -13,7 +13,7 @@ void ParamTraits<scoped_refptr<net::HttpResponseHeaders>>::Write( base::Pickle* m, const param_type& p) { - WriteParam(m, p.get() != NULL); + WriteParam(m, p.get() != nullptr); if (p.get()) { // Do not disclose Set-Cookie headers over IPC. p->Persist(m, net::HttpResponseHeaders::PERSIST_SANS_COOKIES); @@ -287,7 +287,7 @@ void ParamTraits<scoped_refptr<content::ResourceDevToolsInfo>>::Write( base::Pickle* m, const param_type& p) { - WriteParam(m, p.get() != NULL); + WriteParam(m, p.get() != nullptr); if (p.get()) { WriteParam(m, p->http_status_code); WriteParam(m, p->http_status_text); @@ -424,7 +424,7 @@ void ParamTraits<scoped_refptr<content::ResourceRequestBody>>::Write( base::Pickle* m, const param_type& p) { - WriteParam(m, p.get() != NULL); + WriteParam(m, p.get() != nullptr); if (p.get()) { WriteParam(m, *p->elements()); WriteParam(m, p->identifier()); @@ -466,7 +466,7 @@ void ParamTraits<scoped_refptr<net::ct::SignedCertificateTimestamp>>::Write( base::Pickle* m, const param_type& p) { - WriteParam(m, p.get() != NULL); + WriteParam(m, p.get() != nullptr); if (p.get()) p->Persist(m); }
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc index e67cb43..2b2cc7c 100644 --- a/content/gpu/gpu_main.cc +++ b/content/gpu/gpu_main.cc
@@ -295,7 +295,7 @@ const_cast<base::CommandLine*>(&command_line), gpu_preferences); const bool dead_on_arrival = !init_success; - logging::SetLogMessageHandler(NULL); + logging::SetLogMessageHandler(nullptr); GetContentClient()->SetGpuInfo(gpu_init->gpu_info()); base::ThreadPriority io_thread_priority = base::ThreadPriority::NORMAL;
diff --git a/content/gpu/gpu_sandbox_hook_linux.cc b/content/gpu/gpu_sandbox_hook_linux.cc index 3b2559ae..5d386282 100644 --- a/content/gpu/gpu_sandbox_hook_linux.cc +++ b/content/gpu/gpu_sandbox_hook_linux.cc
@@ -111,7 +111,7 @@ base::CommandLine::StringVector exec = base::CommandLine::ForCurrentProcess()->GetArgs(); base::CommandLine::Reset(); - base::CommandLine::Init(0, NULL); + base::CommandLine::Init(0, nullptr); base::CommandLine::ForCurrentProcess()->InitFromArgv(exec); base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kProcessType, "gpu-broker"); @@ -273,8 +273,8 @@ // inside the sandbox, so preload them now. if (options.vaapi_accelerated_video_encode_enabled || options.accelerated_video_decode_enabled) { - const char* I965DrvVideoPath = NULL; - const char* I965HybridDrvVideoPath = NULL; + const char* I965DrvVideoPath = nullptr; + const char* I965HybridDrvVideoPath = nullptr; if (IsArchitectureX86_64()) { I965DrvVideoPath = "/usr/lib64/va/drivers/i965_drv_video.so"; @@ -348,11 +348,11 @@ // Preload the amdgpu-dependent libraries. errno = 0; - if (NULL == dlopen("libglapi.so", dlopen_flag)) { + if (nullptr == dlopen("libglapi.so", dlopen_flag)) { LOG(ERROR) << "dlopen(libglapi.so) failed with error: " << dlerror(); return false; } - if (NULL == dlopen("/usr/lib64/dri/radeonsi_dri.so", dlopen_flag)) { + if (nullptr == dlopen("/usr/lib64/dri/radeonsi_dri.so", dlopen_flag)) { LOG(ERROR) << "dlopen(radeonsi_dri.so) failed with error: " << dlerror(); return false; }
diff --git a/content/gpu/in_process_gpu_thread.cc b/content/gpu/in_process_gpu_thread.cc index 8a1bdc54..3914597 100644 --- a/content/gpu/in_process_gpu_thread.cc +++ b/content/gpu/in_process_gpu_thread.cc
@@ -33,7 +33,7 @@ const gpu::GpuPreferences& gpu_preferences) : base::Thread("Chrome_InProcGpuThread"), params_(params), - gpu_process_(NULL), + gpu_process_(nullptr), gpu_preferences_(gpu_preferences) {} InProcessGpuThread::~InProcessGpuThread() {
diff --git a/content/ppapi_plugin/broker_process_dispatcher.cc b/content/ppapi_plugin/broker_process_dispatcher.cc index 87babc1..6293949 100644 --- a/content/ppapi_plugin/broker_process_dispatcher.cc +++ b/content/ppapi_plugin/broker_process_dispatcher.cc
@@ -81,9 +81,9 @@ bool peer_is_browser) : ppapi::proxy::BrokerSideDispatcher(connect_instance), get_plugin_interface_(get_plugin_interface), - flash_browser_operations_1_3_(NULL), - flash_browser_operations_1_2_(NULL), - flash_browser_operations_1_0_(NULL), + flash_browser_operations_1_3_(nullptr), + flash_browser_operations_1_2_(nullptr), + flash_browser_operations_1_0_(nullptr), peer_is_browser_(peer_is_browser) { if (get_plugin_interface) { flash_browser_operations_1_0_ = @@ -226,7 +226,7 @@ std::vector<std::string>* site_vector) { std::string data_str = ConvertPluginDataPath(plugin_data_path); if (flash_browser_operations_1_3_) { - char** sites = NULL; + char** sites = nullptr; flash_browser_operations_1_3_->GetSitesWithData(data_str.c_str(), &sites); if (!sites) return; @@ -246,7 +246,8 @@ std::string data_str = ConvertPluginDataPath(plugin_data_path); if (flash_browser_operations_1_3_) { flash_browser_operations_1_3_->ClearSiteData( - data_str.c_str(), site.empty() ? NULL : site.c_str(), flags, max_age); + data_str.c_str(), site.empty() ? nullptr : site.c_str(), flags, + max_age); return true; } @@ -254,13 +255,15 @@ // goes to Stable. if (flash_browser_operations_1_2_) { flash_browser_operations_1_2_->ClearSiteData( - data_str.c_str(), site.empty() ? NULL : site.c_str(), flags, max_age); + data_str.c_str(), site.empty() ? nullptr : site.c_str(), flags, + max_age); return true; } if (flash_browser_operations_1_0_) { flash_browser_operations_1_0_->ClearSiteData( - data_str.c_str(), site.empty() ? NULL : site.c_str(), flags, max_age); + data_str.c_str(), site.empty() ? nullptr : site.c_str(), flags, + max_age); return true; }
diff --git a/content/ppapi_plugin/ppapi_blink_platform_impl.cc b/content/ppapi_plugin/ppapi_blink_platform_impl.cc index 5849e6d..fe4f344 100644 --- a/content/ppapi_plugin/ppapi_blink_platform_impl.cc +++ b/content/ppapi_plugin/ppapi_blink_platform_impl.cc
@@ -144,12 +144,12 @@ blink::WebClipboard* PpapiBlinkPlatformImpl::Clipboard() { NOTREACHED(); - return NULL; + return nullptr; } blink::WebFileUtilities* PpapiBlinkPlatformImpl::GetFileUtilities() { NOTREACHED(); - return NULL; + return nullptr; } blink::WebSandboxSupport* PpapiBlinkPlatformImpl::GetSandboxSupport() { @@ -195,7 +195,7 @@ blink::WebThemeEngine* PpapiBlinkPlatformImpl::ThemeEngine() { NOTREACHED(); - return NULL; + return nullptr; } void PpapiBlinkPlatformImpl::GetPluginList(
diff --git a/content/ppapi_plugin/ppapi_plugin_main.cc b/content/ppapi_plugin/ppapi_plugin_main.cc index 443b1574..7a6e03d 100644 --- a/content/ppapi_plugin/ppapi_plugin_main.cc +++ b/content/ppapi_plugin/ppapi_plugin_main.cc
@@ -57,7 +57,7 @@ #if defined(OS_WIN) sandbox::TargetServices* g_target_services = NULL; #else -void* g_target_services = 0; +void* g_target_services = nullptr; #endif namespace content {
diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc index b05eed02..ef93281 100644 --- a/content/ppapi_plugin/ppapi_thread.cc +++ b/content/ppapi_plugin/ppapi_thread.cc
@@ -105,7 +105,7 @@ PpapiThread::PpapiThread(const base::CommandLine& command_line, bool is_broker) : is_broker_(is_broker), plugin_globals_(GetIOTaskRunner()), - connect_instance_func_(NULL), + connect_instance_func_(nullptr), local_pp_module_(base::RandInt(0, std::numeric_limits<PP_Module>::max())), next_plugin_dispatcher_id_(1) { plugin_globals_.SetPluginProxyDelegate(this); @@ -118,7 +118,7 @@ if (!is_broker_) { scoped_refptr<ppapi::proxy::PluginMessageFilter> plugin_filter( new ppapi::proxy::PluginMessageFilter( - NULL, plugin_globals_.resource_reply_thread_registrar())); + nullptr, plugin_globals_.resource_reply_thread_registrar())); channel()->AddFilter(plugin_filter.get()); plugin_globals_.RegisterResourceMessageFilters(plugin_filter.get()); } @@ -295,7 +295,7 @@ // If the plugin isn't internal then load it from |path|. base::ScopedNativeLibrary library; - if (plugin_entry_points_.initialize_module == NULL) { + if (plugin_entry_points_.initialize_module == nullptr) { // Load the plugin from the specified library. base::NativeLibraryLoadError error; base::TimeDelta load_time; @@ -542,10 +542,10 @@ int renderer_child_id, bool incognito, IPC::ChannelHandle* handle) { - DCHECK(is_broker_ == (connect_instance_func_ != NULL)); + DCHECK(is_broker_ == (connect_instance_func_ != nullptr)); mojo::MessagePipe pipe; - ppapi::proxy::ProxyChannel* dispatcher = NULL; + ppapi::proxy::ProxyChannel* dispatcher = nullptr; bool init_result = false; if (is_broker_) { bool peer_is_browser = renderer_pid == base::kNullProcessId;
diff --git a/content/public/common/content_client.cc b/content/public/common/content_client.cc index 765322bf..3773438 100644 --- a/content/public/common/content_client.cc +++ b/content/public/common/content_client.cc
@@ -60,10 +60,7 @@ ContentClient::Schemes::~Schemes() = default; ContentClient::ContentClient() - : browser_(NULL), - gpu_(NULL), - renderer_(NULL), - utility_(NULL) {} + : browser_(nullptr), gpu_(nullptr), renderer_(nullptr), utility_(nullptr) {} ContentClient::~ContentClient() { }
diff --git a/content/public/common/pepper_plugin_info.cc b/content/public/common/pepper_plugin_info.cc index f0678f6..8e3b911d 100644 --- a/content/public/common/pepper_plugin_info.cc +++ b/content/public/common/pepper_plugin_info.cc
@@ -10,10 +10,9 @@ namespace content { PepperPluginInfo::EntryPoints::EntryPoints() - : get_interface(NULL), - initialize_module(NULL), - shutdown_module(NULL) { -} + : get_interface(nullptr), + initialize_module(nullptr), + shutdown_module(nullptr) {} PepperPluginInfo::PepperPluginInfo() : is_internal(false),
diff --git a/content/public/renderer/render_frame_observer.cc b/content/public/renderer/render_frame_observer.cc index 9e26c91..6b7909b4 100644 --- a/content/public/renderer/render_frame_observer.cc +++ b/content/public/renderer/render_frame_observer.cc
@@ -46,7 +46,7 @@ } void RenderFrameObserver::RenderFrameGone() { - render_frame_ = NULL; + render_frame_ = nullptr; } } // namespace content
diff --git a/content/public/renderer/render_thread.cc b/content/public/renderer/render_thread.cc index 4cc2c50f..b8189ba 100644 --- a/content/public/renderer/render_thread.cc +++ b/content/public/renderer/render_thread.cc
@@ -24,7 +24,7 @@ } RenderThread::~RenderThread() { - lazy_tls.Pointer()->Set(NULL); + lazy_tls.Pointer()->Set(nullptr); } } // namespace content
diff --git a/content/public/renderer/video_encode_accelerator.cc b/content/public/renderer/video_encode_accelerator.cc index 99eebcd..9d75b2a 100644 --- a/content/public/renderer/video_encode_accelerator.cc +++ b/content/public/renderer/video_encode_accelerator.cc
@@ -18,7 +18,7 @@ media::GpuVideoAcceleratorFactories* gpu_factories = RenderThreadImpl::current()->GetGpuFactories(); if (!gpu_factories || !gpu_factories->IsGpuVideoAcceleratorEnabled()) { - callback.Run(NULL, std::unique_ptr<media::VideoEncodeAccelerator>()); + callback.Run(nullptr, std::unique_ptr<media::VideoEncodeAccelerator>()); return; }
diff --git a/content/public/test/browser_side_navigation_test_utils.cc b/content/public/test/browser_side_navigation_test_utils.cc index c1dfb4e..66390340 100644 --- a/content/public/test/browser_side_navigation_test_utils.cc +++ b/content/public/test/browser_side_navigation_test_utils.cc
@@ -62,7 +62,7 @@ GURL url(std::string(url::kBlobScheme) + "://" + base::GenerateGUID()); StreamRegistry* stream_registry = browser_side_navigation_test_utils.Get()->stream_registry(); - scoped_refptr<Stream> stream(new Stream(stream_registry, NULL, url)); + scoped_refptr<Stream> stream(new Stream(stream_registry, nullptr, url)); stream->Finalize(net::OK); return stream->CreateHandle(); }
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc index 8c79f84..18ce4e16 100644 --- a/content/public/test/browser_test_utils.cc +++ b/content/public/test/browser_test_utils.cc
@@ -1632,7 +1632,7 @@ void RenderProcessHostWatcher::RenderProcessHostDestroyed( RenderProcessHost* host) { - render_process_host_ = NULL; + render_process_host_ = nullptr; if (type_ == WATCH_FOR_HOST_DESTRUCTION) message_loop_runner_->Quit(); } @@ -1723,7 +1723,7 @@ : web_contents_created_callback_( base::Bind(&WebContentsAddedObserver::WebContentsCreated, base::Unretained(this))), - web_contents_(NULL) { + web_contents_(nullptr) { WebContentsImpl::FriendWrapper::AddCreatedCallbackForTesting( web_contents_created_callback_); }
diff --git a/content/public/test/content_browser_test.cc b/content/public/test/content_browser_test.cc index 3e49d308..3d81646 100644 --- a/content/public/test/content_browser_test.cc +++ b/content/public/test/content_browser_test.cc
@@ -144,17 +144,13 @@ Shell* ContentBrowserTest::CreateBrowser() { return Shell::CreateNewWindow( ShellContentBrowserClient::Get()->browser_context(), - GURL(url::kAboutBlankURL), - NULL, - gfx::Size()); + GURL(url::kAboutBlankURL), nullptr, gfx::Size()); } Shell* ContentBrowserTest::CreateOffTheRecordBrowser() { return Shell::CreateNewWindow( ShellContentBrowserClient::Get()->off_the_record_browser_context(), - GURL(url::kAboutBlankURL), - NULL, - gfx::Size()); + GURL(url::kAboutBlankURL), nullptr, gfx::Size()); } } // namespace content
diff --git a/content/public/test/content_browser_test_utils.cc b/content/public/test/content_browser_test_utils.cc index 5d0d40a..a360564 100644 --- a/content/public/test/content_browser_test_utils.cc +++ b/content/public/test/content_browser_test_utils.cc
@@ -141,7 +141,7 @@ run_loop.Run(); } -ShellAddedObserver::ShellAddedObserver() : shell_(NULL) { +ShellAddedObserver::ShellAddedObserver() : shell_(nullptr) { Shell::SetShellCreatedCallback( base::Bind(&ShellAddedObserver::ShellCreated, base::Unretained(this))); }
diff --git a/content/public/test/content_test_suite_base.cc b/content/public/test/content_test_suite_base.cc index 82996ff..011b2d1 100644 --- a/content/public/test/content_test_suite_base.cc +++ b/content/public/test/content_test_suite_base.cc
@@ -61,7 +61,7 @@ ContentClient* content_client) { SetContentClient(content_client); content::RegisterContentSchemes(false); - SetContentClient(NULL); + SetContentClient(nullptr); } void ContentTestSuiteBase::RegisterInProcessThreads() {
diff --git a/content/public/test/download_test_observer.cc b/content/public/test/download_test_observer.cc index bcd5aa9..76568bf 100644 --- a/content/public/test/download_test_observer.cc +++ b/content/public/test/download_test_observer.cc
@@ -57,7 +57,7 @@ void DownloadUpdatedObserver::OnDownloadDestroyed(DownloadItem* item) { DCHECK_EQ(item_, item); item_->RemoveObserver(this); - item_ = NULL; + item_ = nullptr; if (waiting_) base::RunLoop::QuitCurrentWhenIdleDeprecated(); } @@ -97,7 +97,7 @@ void DownloadTestObserver::ManagerGoingDown(DownloadManager* manager) { CHECK_EQ(manager, download_manager_); - download_manager_ = NULL; + download_manager_ = nullptr; SignalIfFinished(); } @@ -111,7 +111,8 @@ bool DownloadTestObserver::IsFinished() const { return (finished_downloads_.size() - finished_downloads_at_construction_ >= - wait_count_) || (download_manager_ == NULL); + wait_count_) || + (download_manager_ == nullptr); } void DownloadTestObserver::OnDownloadCreated( @@ -476,7 +477,7 @@ void SavePackageFinishedObserver::OnDownloadDestroyed(DownloadItem* download) { download_->RemoveObserver(this); - download_ = NULL; + download_ = nullptr; } void SavePackageFinishedObserver::OnDownloadCreated(DownloadManager* manager, @@ -487,9 +488,9 @@ void SavePackageFinishedObserver::ManagerGoingDown(DownloadManager* manager) { download_->RemoveObserver(this); - download_ = NULL; + download_ = nullptr; download_manager_->RemoveObserver(this); - download_manager_ = NULL; + download_manager_ = nullptr; } } // namespace content
diff --git a/content/public/test/fake_speech_recognition_manager.cc b/content/public/test/fake_speech_recognition_manager.cc index c73e52e4..0c641b3 100644 --- a/content/public/test/fake_speech_recognition_manager.cc +++ b/content/public/test/fake_speech_recognition_manager.cc
@@ -27,12 +27,11 @@ FakeSpeechRecognitionManager::FakeSpeechRecognitionManager() : session_id_(0), - listener_(NULL), + listener_(nullptr), fake_result_(kTestResult), did_cancel_all_(false), should_send_fake_response_(true), - delegate_(NULL) { -} + delegate_(nullptr) {} void FakeSpeechRecognitionManager::SetDelegate( SpeechRecognitionManagerDelegate* delegate) { @@ -61,7 +60,7 @@ const SpeechRecognitionSessionConfig& config) { VLOG(1) << "FAKE CreateSession invoked."; EXPECT_EQ(0, session_id_); - EXPECT_EQ(NULL, listener_); + EXPECT_EQ(nullptr, listener_); listener_ = config.event_listener.get(); if (config.grammars.size() > 0) grammar_ = config.grammars[0].url; @@ -74,7 +73,7 @@ void FakeSpeechRecognitionManager::StartSession(int session_id) { VLOG(1) << "FAKE StartSession invoked."; EXPECT_EQ(session_id, session_id_); - EXPECT_TRUE(listener_ != NULL); + EXPECT_TRUE(listener_ != nullptr); if (delegate_) delegate_->GetEventListener()->OnRecognitionStart(session_id_); @@ -103,7 +102,7 @@ VLOG(1) << "FAKE AbortSession invoked."; EXPECT_EQ(session_id_, session_id); session_id_ = 0; - listener_ = NULL; + listener_ = nullptr; } void FakeSpeechRecognitionManager::StopAudioCaptureForSession(int session_id) { @@ -159,7 +158,7 @@ listener_->OnRecognitionResults(session_id_, results); listener_->OnRecognitionEnd(session_id_); session_id_ = 0; - listener_ = NULL; + listener_ = nullptr; VLOG(1) << "Finished setting fake recognition result."; }
diff --git a/content/public/test/mock_render_process_host.cc b/content/public/test/mock_render_process_host.cc index becda99c..81f93804 100644 --- a/content/public/test/mock_render_process_host.cc +++ b/content/public/test/mock_render_process_host.cc
@@ -43,7 +43,7 @@ MockRenderProcessHost::MockRenderProcessHost(BrowserContext* browser_context) : bad_msg_count_(0), - factory_(NULL), + factory_(nullptr), id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()), has_connection_(false), browser_context_(browser_context), @@ -127,7 +127,7 @@ } void MockRenderProcessHost::RemoveRoute(int32_t routing_id) { - DCHECK(listeners_.Lookup(routing_id) != NULL); + DCHECK(listeners_.Lookup(routing_id) != nullptr); listeners_.Remove(routing_id); Cleanup(); } @@ -287,7 +287,7 @@ } IPC::ChannelProxy* MockRenderProcessHost::GetChannel() { - return NULL; + return nullptr; } void MockRenderProcessHost::AddFilter(BrowserMessageFilter* filter) {
diff --git a/content/public/test/mock_render_thread.cc b/content/public/test/mock_render_thread.cc index 6d7cfd07..57db0fcd 100644 --- a/content/public/test/mock_render_thread.cc +++ b/content/public/test/mock_render_thread.cc
@@ -125,7 +125,7 @@ } IPC::SyncChannel* MockRenderThread::GetChannel() { - return NULL; + return nullptr; } std::string MockRenderThread::GetLocale() { @@ -133,7 +133,7 @@ } IPC::SyncMessageFilter* MockRenderThread::GetSyncMessageFilter() { - return NULL; + return nullptr; } scoped_refptr<base::SingleThreadTaskRunner> @@ -227,7 +227,7 @@ } base::WaitableEvent* MockRenderThread::GetShutdownEvent() { - return NULL; + return nullptr; } int32_t MockRenderThread::GetClientId() {
diff --git a/content/public/test/mock_resource_context.cc b/content/public/test/mock_resource_context.cc index adbb6b5..9bdf4e0 100644 --- a/content/public/test/mock_resource_context.cc +++ b/content/public/test/mock_resource_context.cc
@@ -8,9 +8,7 @@ namespace content { -MockResourceContext::MockResourceContext() - : test_request_context_(NULL) { -} +MockResourceContext::MockResourceContext() : test_request_context_(nullptr) {} MockResourceContext::MockResourceContext( net::URLRequestContext* test_request_context) @@ -20,7 +18,7 @@ MockResourceContext::~MockResourceContext() {} net::HostResolver* MockResourceContext::GetHostResolver() { - return NULL; + return nullptr; } net::URLRequestContext* MockResourceContext::GetRequestContext() {
diff --git a/content/public/test/render_view_test.cc b/content/public/test/render_view_test.cc index c05c2d0..200e6722 100644 --- a/content/public/test/render_view_test.cc +++ b/content/public/test/render_view_test.cc
@@ -133,7 +133,7 @@ // Get rid of the dependency to the sandbox, which is not available in // RenderViewTest. - blink::WebSandboxSupport* GetSandboxSupport() override { return NULL; } + blink::WebSandboxSupport* GetSandboxSupport() override { return nullptr; } }; RenderViewTest::RendererBlinkPlatformImplTestOverride:: @@ -161,8 +161,7 @@ blink_platform_impl_->Shutdown(); } -RenderViewTest::RenderViewTest() - : view_(NULL) { +RenderViewTest::RenderViewTest() : view_(nullptr) { RenderFrameImpl::InstallCreateHook(&TestRenderFrame::CreateTestRenderFrame); } @@ -304,7 +303,7 @@ // is already initialized. if (!ui::ResourceBundle::HasSharedInstance()) ui::ResourceBundle::InitSharedInstanceWithLocale( - "en-US", NULL, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES); + "en-US", nullptr, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES); compositor_deps_.reset(new FakeCompositorDependencies); mock_process_.reset(new MockRenderProcess); @@ -347,7 +346,7 @@ leak_detector->PrepareForLeakDetection(view_->GetWebView()->MainFrame()); - view_ = NULL; + view_ = nullptr; mock_process_.reset(); RenderThreadImpl::SetRendererBlinkPlatformImplForTesting(nullptr); @@ -437,7 +436,7 @@ std::vector<std::string> params; params.push_back(element_id); std::string script = - base::ReplaceStringPlaceholders(kGetCoordinatesScript, params, NULL); + base::ReplaceStringPlaceholders(kGetCoordinatesScript, params, nullptr); v8::Isolate* isolate = v8::Isolate::GetCurrent(); v8::HandleScope handle_scope(isolate);
diff --git a/content/public/test/test_browser_context.cc b/content/public/test/test_browser_context.cc index 31b876bb..4038acc4 100644 --- a/content/public/test/test_browser_context.cc +++ b/content/public/test/test_browser_context.cc
@@ -91,7 +91,7 @@ } DownloadManagerDelegate* TestBrowserContext::GetDownloadManagerDelegate() { - return NULL; + return nullptr; } ResourceContext* TestBrowserContext::GetResourceContext() { @@ -102,7 +102,7 @@ } BrowserPluginGuestManager* TestBrowserContext::GetGuestManager() { - return NULL; + return nullptr; } storage::SpecialStoragePolicy* TestBrowserContext::GetSpecialStoragePolicy() { @@ -110,7 +110,7 @@ } PushMessagingService* TestBrowserContext::GetPushMessagingService() { - return NULL; + return nullptr; } SSLHostStateDelegate* TestBrowserContext::GetSSLHostStateDelegate() { @@ -159,14 +159,14 @@ } net::URLRequestContextGetter* TestBrowserContext::CreateMediaRequestContext() { - return NULL; + return nullptr; } net::URLRequestContextGetter* TestBrowserContext::CreateMediaRequestContextForStoragePartition( const base::FilePath& partition_path, bool in_memory) { - return NULL; + return nullptr; } } // namespace content
diff --git a/content/public/test/test_content_client_initializer.cc b/content/public/test/test_content_client_initializer.cc index 66bf0335..02c6df2 100644 --- a/content/public/test/test_content_client_initializer.cc +++ b/content/public/test/test_content_client_initializer.cc
@@ -29,7 +29,7 @@ rph_factory_.reset(); notification_service_.reset(); - SetContentClient(NULL); + SetContentClient(nullptr); content_client_.reset(); content_browser_client_.reset();
diff --git a/content/public/test/test_host_resolver.cc b/content/public/test/test_host_resolver.cc index da2bfd0..850f3b2 100644 --- a/content/public/test/test_host_resolver.cc +++ b/content/public/test/test_host_resolver.cc
@@ -22,7 +22,7 @@ // lookup result. class LocalHostResolverProc : public net::HostResolverProc { public: - LocalHostResolverProc() : HostResolverProc(NULL) {} + LocalHostResolverProc() : HostResolverProc(nullptr) {} int Resolve(const std::string& host, net::AddressFamily address_family,
diff --git a/content/public/test/test_renderer_host.cc b/content/public/test/test_renderer_host.cc index 9ef79dc4..4bea424 100644 --- a/content/public/test/test_renderer_host.cc +++ b/content/public/test/test_renderer_host.cc
@@ -193,7 +193,7 @@ } RenderViewHost* RenderViewHostTestHarness::pending_rvh() { - return pending_main_rfh() ? pending_main_rfh()->GetRenderViewHost() : NULL; + return pending_main_rfh() ? pending_main_rfh()->GetRenderViewHost() : nullptr; } RenderViewHost* RenderViewHostTestHarness::active_rvh() { @@ -217,7 +217,7 @@ } void RenderViewHostTestHarness::DeleteContents() { - SetContents(NULL); + SetContents(nullptr); } void RenderViewHostTestHarness::SetContents(WebContents* contents) { @@ -230,7 +230,7 @@ DCHECK(ole_initializer_ != NULL); #endif #if defined(USE_AURA) - DCHECK(aura_test_helper_ != NULL); + DCHECK(aura_test_helper_ != nullptr); #endif scoped_refptr<SiteInstance> instance = @@ -283,7 +283,7 @@ if (IsBrowserSideNavigationEnabled()) BrowserSideNavigationTearDown(); - SetContents(NULL); + SetContents(nullptr); #if defined(USE_AURA) aura_test_helper_->TearDown(); ui::TerminateContextFactoryForTests();
diff --git a/content/public/test/test_utils.cc b/content/public/test/test_utils.cc index a827521..56b541a 100644 --- a/content/public/test/test_utils.cc +++ b/content/public/test/test_utils.cc
@@ -394,7 +394,7 @@ WebContentsDestroyedWatcher::WebContentsDestroyedWatcher( WebContents* web_contents) : WebContentsObserver(web_contents) { - EXPECT_TRUE(web_contents != NULL); + EXPECT_TRUE(web_contents != nullptr); } WebContentsDestroyedWatcher::~WebContentsDestroyedWatcher() {
diff --git a/content/public/utility/utility_thread.cc b/content/public/utility/utility_thread.cc index c75c258..df19292 100644 --- a/content/public/utility/utility_thread.cc +++ b/content/public/utility/utility_thread.cc
@@ -23,7 +23,7 @@ } UtilityThread::~UtilityThread() { - lazy_tls.Pointer()->Set(NULL); + lazy_tls.Pointer()->Set(nullptr); } } // namespace content
diff --git a/content/renderer/cache_storage/cache_storage_dispatcher.cc b/content/renderer/cache_storage/cache_storage_dispatcher.cc index 01966e5f8..7925629 100644 --- a/content/renderer/cache_storage/cache_storage_dispatcher.cc +++ b/content/renderer/cache_storage/cache_storage_dispatcher.cc
@@ -207,7 +207,7 @@ ThreadSafeSender* thread_safe_sender) { if (g_cache_storage_dispatcher_tls.Pointer()->Get() == kHasBeenDeleted) { NOTREACHED() << "Re-instantiating TLS CacheStorageDispatcher."; - g_cache_storage_dispatcher_tls.Pointer()->Set(NULL); + g_cache_storage_dispatcher_tls.Pointer()->Set(nullptr); } if (g_cache_storage_dispatcher_tls.Pointer()->Get()) return g_cache_storage_dispatcher_tls.Pointer()->Get();
diff --git a/content/renderer/child_message_filter.cc b/content/renderer/child_message_filter.cc index b942249c..c212d48 100644 --- a/content/renderer/child_message_filter.cc +++ b/content/renderer/child_message_filter.cc
@@ -48,11 +48,11 @@ base::TaskRunner* ChildMessageFilter::OverrideTaskRunnerForMessage( const IPC::Message& msg) { - return NULL; + return nullptr; } ChildMessageFilter::ChildMessageFilter() - : internal_(NULL), + : internal_(nullptr), thread_safe_sender_(ChildThreadImpl::current()->thread_safe_sender()) {} ChildMessageFilter::~ChildMessageFilter() {}
diff --git a/content/renderer/devtools/devtools_agent.cc b/content/renderer/devtools/devtools_agent.cc index 1fce0d5..24883f13 100644 --- a/content/renderer/devtools/devtools_agent.cc +++ b/content/renderer/devtools/devtools_agent.cc
@@ -194,7 +194,7 @@ if (it != g_agent_for_routing_id.Get().end()) { return it->second; } - return NULL; + return nullptr; } // static
diff --git a/content/renderer/devtools/devtools_agent_filter.cc b/content/renderer/devtools/devtools_agent_filter.cc index 94fd5c68..fef661c 100644 --- a/content/renderer/devtools/devtools_agent_filter.cc +++ b/content/renderer/devtools/devtools_agent_filter.cc
@@ -32,7 +32,7 @@ WebDevToolsAgent* Agent() override { DevToolsAgent* agent = DevToolsAgent::FromRoutingId(routing_id_); if (!agent) - return 0; + return nullptr; return agent->GetWebAgent(); } WebString Message() override { return WebString::FromUTF8(msg_); }
diff --git a/content/renderer/devtools/devtools_cpu_throttler.cc b/content/renderer/devtools/devtools_cpu_throttler.cc index 647ce0e..9769a07 100644 --- a/content/renderer/devtools/devtools_cpu_throttler.cc +++ b/content/renderer/devtools/devtools_cpu_throttler.cc
@@ -111,7 +111,7 @@ void CPUThrottlingThread::RestoreSignalHandler() { if (!signal_handler_installed_) return; - sigaction(SIGUSR2, &old_signal_handler_, 0); + sigaction(SIGUSR2, &old_signal_handler_, nullptr); signal_handler_installed_ = false; }
diff --git a/content/renderer/dom_serializer_browsertest.cc b/content/renderer/dom_serializer_browsertest.cc index 4b970141..5750d1841 100644 --- a/content/renderer/dom_serializer_browsertest.cc +++ b/content/renderer/dom_serializer_browsertest.cc
@@ -166,7 +166,7 @@ void SerializeDomForURL(const GURL& frame_url) { // Find corresponding WebFrame according to frame_url. WebFrame* web_frame = FindSubFrameByURL(frame_url); - ASSERT_TRUE(web_frame != NULL); + ASSERT_TRUE(web_frame != nullptr); WebString file_path = WebString::FromUTF8("c:\\dummy.htm"); SingleLinkRewritingDelegate delegate(frame_url, file_path); // Start serializing DOM. @@ -178,7 +178,7 @@ void SerializeHTMLDOMWithDocTypeOnRenderer(const GURL& file_url) { // Make sure original contents have document type. WebLocalFrame* web_frame = FindSubFrameByURL(file_url); - ASSERT_TRUE(web_frame != NULL); + ASSERT_TRUE(web_frame != nullptr); WebDocument doc = web_frame->GetDocument(); ASSERT_TRUE(HasDocType(doc)); // Do serialization. @@ -196,7 +196,7 @@ void SerializeHTMLDOMWithoutDocTypeOnRenderer(const GURL& file_url) { // Make sure original contents do not have document type. WebLocalFrame* web_frame = FindSubFrameByURL(file_url); - ASSERT_TRUE(web_frame != NULL); + ASSERT_TRUE(web_frame != nullptr); WebDocument doc = web_frame->GetDocument(); ASSERT_TRUE(!HasDocType(doc)); // Do serialization. @@ -242,7 +242,7 @@ const GURL& file_url) { // Make sure there is no META charset declaration in original document. WebLocalFrame* web_frame = FindSubFrameByURL(file_url); - ASSERT_TRUE(web_frame != NULL); + ASSERT_TRUE(web_frame != nullptr); WebDocument doc = web_frame->GetDocument(); ASSERT_TRUE(doc.IsHTMLDocument()); WebElement head_element = doc.Head(); @@ -264,7 +264,7 @@ // Make sure the first child of HEAD element is META which has charset // declaration in serialized contents. web_frame = GetMainFrame(); - ASSERT_TRUE(web_frame != NULL); + ASSERT_TRUE(web_frame != nullptr); doc = web_frame->GetDocument(); ASSERT_TRUE(doc.IsHTMLDocument()); head_element = doc.Head(); @@ -291,7 +291,7 @@ // Make sure there are multiple META charset declarations in original // document. WebLocalFrame* web_frame = FindSubFrameByURL(file_url); - ASSERT_TRUE(web_frame != NULL); + ASSERT_TRUE(web_frame != nullptr); WebDocument doc = web_frame->GetDocument(); ASSERT_TRUE(doc.IsHTMLDocument()); WebElement head_element = doc.Head(); @@ -318,7 +318,7 @@ // Make sure only first child of HEAD element is META which has charset // declaration in serialized contents. web_frame = GetMainFrame(); - ASSERT_TRUE(web_frame != NULL); + ASSERT_TRUE(web_frame != nullptr); doc = web_frame->GetDocument(); ASSERT_TRUE(doc.IsHTMLDocument()); head_element = doc.Head(); @@ -355,7 +355,7 @@ // Get BODY's text content in DOM. WebLocalFrame* web_frame = FindSubFrameByURL(file_url); - ASSERT_TRUE(web_frame != NULL); + ASSERT_TRUE(web_frame != nullptr); WebDocument doc = web_frame->GetDocument(); ASSERT_TRUE(doc.IsHTMLDocument()); WebElement body_ele = doc.Body(); @@ -407,7 +407,7 @@ LoadContents(original_contents, file_url, WebString()); // Get value of BODY's title attribute in DOM. WebLocalFrame* web_frame = FindSubFrameByURL(file_url); - ASSERT_TRUE(web_frame != NULL); + ASSERT_TRUE(web_frame != nullptr); WebDocument doc = web_frame->GetDocument(); ASSERT_TRUE(doc.IsHTMLDocument()); WebElement body_ele = doc.Body(); @@ -473,7 +473,7 @@ // this test file, also all links are relative URLs in this test file, so we // need to check those relative URLs and make sure document has BASE tag. WebLocalFrame* web_frame = FindSubFrameByURL(file_url); - ASSERT_TRUE(web_frame != NULL); + ASSERT_TRUE(web_frame != nullptr); WebDocument doc = web_frame->GetDocument(); ASSERT_TRUE(doc.IsHTMLDocument()); // Go through all descent nodes. @@ -516,7 +516,7 @@ // BASE tags in serialized HTML data. Each of those BASE tags have same base // URL which is as same as URL of current test file. web_frame = GetMainFrame(); - ASSERT_TRUE(web_frame != NULL); + ASSERT_TRUE(web_frame != nullptr); doc = web_frame->GetDocument(); ASSERT_TRUE(doc.IsHTMLDocument()); // Go through all descent nodes. @@ -564,7 +564,7 @@ // Make sure the head tag is empty. WebLocalFrame* web_frame = GetMainFrame(); - ASSERT_TRUE(web_frame != NULL); + ASSERT_TRUE(web_frame != nullptr); WebDocument doc = web_frame->GetDocument(); ASSERT_TRUE(doc.IsHTMLDocument()); WebElement head_element = doc.Head(); @@ -579,7 +579,7 @@ LoadContents(serialized_contents_, file_url, web_frame->GetDocument().Encoding()); web_frame = GetMainFrame(); - ASSERT_TRUE(web_frame != NULL); + ASSERT_TRUE(web_frame != nullptr); doc = web_frame->GetDocument(); ASSERT_TRUE(doc.IsHTMLDocument()); head_element = doc.Head(); @@ -604,7 +604,7 @@ void SubResourceForElementsInNonHTMLNamespaceOnRenderer( const GURL& file_url) { WebLocalFrame* web_frame = FindSubFrameByURL(file_url); - ASSERT_TRUE(web_frame != NULL); + ASSERT_TRUE(web_frame != nullptr); WebDocument doc = web_frame->GetDocument(); WebNode lastNodeInBody = doc.Body().LastChild(); ASSERT_TRUE(lastNodeInBody.IsElementNode());
diff --git a/content/renderer/dom_storage/dom_storage_cached_area.cc b/content/renderer/dom_storage/dom_storage_cached_area.cc index 8721c94..881556c 100644 --- a/content/renderer/dom_storage/dom_storage_cached_area.cc +++ b/content/renderer/dom_storage/dom_storage_cached_area.cc
@@ -202,7 +202,7 @@ } void DOMStorageCachedArea::Reset() { - map_ = NULL; + map_ = nullptr; weak_factory_.InvalidateWeakPtrs(); ignore_key_mutations_.clear(); ignore_all_mutations_ = false;
diff --git a/content/renderer/dom_storage/dom_storage_dispatcher.cc b/content/renderer/dom_storage/dom_storage_dispatcher.cc index 9d2ec453..102f8416 100644 --- a/content/renderer/dom_storage/dom_storage_dispatcher.cc +++ b/content/renderer/dom_storage/dom_storage_dispatcher.cc
@@ -36,7 +36,7 @@ : pending_count_(0), sender_(sender) {} void SendThrottled(IPC::Message* message); - void Shutdown() { sender_ = NULL; } + void Shutdown() { sender_ = nullptr; } private: ~MessageThrottlingFilter() override {} @@ -172,7 +172,7 @@ CachedAreaHolder* GetAreaHolder(const std::string& key) { CachedAreaMap::iterator found = cached_areas_.find(key); if (found == cached_areas_.end()) - return NULL; + return nullptr; return &(found->second); } @@ -220,7 +220,7 @@ std::string key = GetCachedAreaKey(namespace_id, origin); CachedAreaHolder* holder = GetAreaHolder(key); if (!holder) - return NULL; + return nullptr; return holder->area_.get(); } @@ -231,7 +231,7 @@ void DomStorageDispatcher::ProxyImpl::Shutdown() { throttling_filter_->Shutdown(); sender_->RemoveFilter(throttling_filter_.get()); - sender_ = NULL; + sender_ = nullptr; cached_areas_.clear(); pending_callbacks_.clear(); } @@ -315,7 +315,7 @@ void DomStorageDispatcher::OnStorageEvent( const DOMStorageMsg_Event_Params& params) { - WebStorageAreaImpl* originating_area = NULL; + WebStorageAreaImpl* originating_area = nullptr; if (params.connection_id) { originating_area = WebStorageAreaImpl::FromConnectionId( params.connection_id);
diff --git a/content/renderer/dom_storage/local_storage_cached_area.cc b/content/renderer/dom_storage/local_storage_cached_area.cc index aaa1098..ee84f52 100644 --- a/content/renderer/dom_storage/local_storage_cached_area.cc +++ b/content/renderer/dom_storage/local_storage_cached_area.cc
@@ -425,7 +425,7 @@ } void LocalStorageCachedArea::Reset() { - map_ = NULL; + map_ = nullptr; ignore_key_mutations_.clear(); ignore_all_mutations_ = false; weak_factory_.InvalidateWeakPtrs();
diff --git a/content/renderer/dom_storage/webstoragenamespace_impl.cc b/content/renderer/dom_storage/webstoragenamespace_impl.cc index ee2a940..72600b8 100644 --- a/content/renderer/dom_storage/webstoragenamespace_impl.cc +++ b/content/renderer/dom_storage/webstoragenamespace_impl.cc
@@ -39,7 +39,7 @@ // session storage is used. In the WebViewClient::createView, we do the // book-keeping necessary to make it a true copy-on-write despite not doing // anything here, now. - return NULL; + return nullptr; } bool WebStorageNamespaceImpl::IsSameNamespace(
diff --git a/content/renderer/fetchers/resource_fetcher_browsertest.cc b/content/renderer/fetchers/resource_fetcher_browsertest.cc index bc6b169..1ac8fa5 100644 --- a/content/renderer/fetchers/resource_fetcher_browsertest.cc +++ b/content/renderer/fetchers/resource_fetcher_browsertest.cc
@@ -100,7 +100,7 @@ base::Closure quit_task_; }; -FetcherDelegate* FetcherDelegate::instance_ = NULL; +FetcherDelegate* FetcherDelegate::instance_ = nullptr; class EvilFetcherDelegate : public FetcherDelegate { public:
diff --git a/content/renderer/fileapi/webfilesystem_impl.cc b/content/renderer/fileapi/webfilesystem_impl.cc index 210f871..1ec25c92 100644 --- a/content/renderer/fileapi/webfilesystem_impl.cc +++ b/content/renderer/fileapi/webfilesystem_impl.cc
@@ -176,7 +176,7 @@ const base::Callback<void(WebFileSystemCallbacks*)>& callback, CallbacksUnregisterMode callbacks_unregister_mode) { WebFileSystemImpl* filesystem = - WebFileSystemImpl::ThreadSpecificInstance(NULL); + WebFileSystemImpl::ThreadSpecificInstance(nullptr); if (!filesystem) return; WebFileSystemCallbacks callbacks = filesystem->GetCallbacks(callbacks_id); @@ -294,7 +294,7 @@ const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner, const base::File::Info& file_info) { WebFileSystemImpl* filesystem = - WebFileSystemImpl::ThreadSpecificInstance(NULL); + WebFileSystemImpl::ThreadSpecificInstance(nullptr); if (!filesystem) return; @@ -334,7 +334,7 @@ const base::FilePath& platform_path, int request_id) { WebFileSystemImpl* filesystem = - WebFileSystemImpl::ThreadSpecificInstance(NULL); + WebFileSystemImpl::ThreadSpecificInstance(nullptr); if (!filesystem) return; @@ -398,7 +398,7 @@ WebFileSystemImpl::~WebFileSystemImpl() { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - g_webfilesystem_tls.Pointer()->Set(NULL); + g_webfilesystem_tls.Pointer()->Set(nullptr); } void WebFileSystemImpl::WillStopCurrentWorkerThread() { @@ -680,7 +680,7 @@ WaitableCallbackResults* WebFileSystemImpl::MaybeCreateWaitableResults( const WebFileSystemCallbacks& callbacks, int callbacks_id) { if (!callbacks.ShouldBlockUntilCompletion()) - return NULL; + return nullptr; WaitableCallbackResults* results = new WaitableCallbackResults(); waitable_results_[callbacks_id] = results; return results;
diff --git a/content/renderer/fileapi/webfilewriter_base_unittest.cc b/content/renderer/fileapi/webfilewriter_base_unittest.cc index 799bc6a..9fa99582 100644 --- a/content/renderer/fileapi/webfilewriter_base_unittest.cc +++ b/content/renderer/fileapi/webfilewriter_base_unittest.cc
@@ -149,14 +149,14 @@ received_did_write_complete_ = true; if (delete_in_client_callback_) - testable_writer_.reset(NULL); + testable_writer_.reset(nullptr); } void DidTruncate() override { EXPECT_FALSE(received_did_truncate_); received_did_truncate_ = true; if (delete_in_client_callback_) - testable_writer_.reset(NULL); + testable_writer_.reset(nullptr); } void DidFail(blink::WebFileError error) override { @@ -164,7 +164,7 @@ received_did_fail_ = true; fail_error_received_ = error; if (delete_in_client_callback_) - testable_writer_.reset(NULL); + testable_writer_.reset(nullptr); } protected:
diff --git a/content/renderer/fileapi/webfilewriter_impl.cc b/content/renderer/fileapi/webfilewriter_impl.cc index 596f4017..61c646a 100644 --- a/content/renderer/fileapi/webfilewriter_impl.cc +++ b/content/renderer/fileapi/webfilewriter_impl.cc
@@ -16,8 +16,9 @@ namespace { FileSystemDispatcher* GetFileSystemDispatcher() { - return RenderThreadImpl::current() ? - RenderThreadImpl::current()->file_system_dispatcher() : NULL; + return RenderThreadImpl::current() + ? RenderThreadImpl::current()->file_system_dispatcher() + : nullptr; } } // namespace
diff --git a/content/renderer/gamepad_shared_memory_reader.cc b/content/renderer/gamepad_shared_memory_reader.cc index 65a20fb..daee4fe36 100644 --- a/content/renderer/gamepad_shared_memory_reader.cc +++ b/content/renderer/gamepad_shared_memory_reader.cc
@@ -18,7 +18,7 @@ GamepadSharedMemoryReader::GamepadSharedMemoryReader(RenderThread* thread) : RendererGamepadProvider(thread), - gamepad_hardware_buffer_(NULL), + gamepad_hardware_buffer_(nullptr), ever_interacted_with_(false), binding_(this) { if (thread) {
diff --git a/content/renderer/gpu/frame_swap_message_queue.cc b/content/renderer/gpu/frame_swap_message_queue.cc index 86e1415..ba0f87b4 100644 --- a/content/renderer/gpu/frame_swap_message_queue.cc +++ b/content/renderer/gpu/frame_swap_message_queue.cc
@@ -139,7 +139,7 @@ break; } NOTREACHED(); - return NULL; + return nullptr; } void FrameSwapMessageQueue::QueueMessageForFrame(
diff --git a/content/renderer/gpu/frame_swap_message_queue_unittest.cc b/content/renderer/gpu/frame_swap_message_queue_unittest.cc index a5a92b0..10efd719 100644 --- a/content/renderer/gpu/frame_swap_message_queue_unittest.cc +++ b/content/renderer/gpu/frame_swap_message_queue_unittest.cc
@@ -23,7 +23,7 @@ protected: void QueueNextSwapMessage(std::unique_ptr<IPC::Message> msg) { queue_->QueueMessageForFrame(MESSAGE_DELIVERY_POLICY_WITH_NEXT_SWAP, 0, - std::move(msg), NULL); + std::move(msg), nullptr); } void QueueNextSwapMessage(std::unique_ptr<IPC::Message> msg, bool* first) { @@ -34,7 +34,7 @@ void QueueVisualStateMessage(int source_frame_number, std::unique_ptr<IPC::Message> msg) { queue_->QueueMessageForFrame(MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE, - source_frame_number, std::move(msg), NULL); + source_frame_number, std::move(msg), nullptr); } void QueueVisualStateMessage(int source_frame_number, @@ -266,7 +266,7 @@ bool message_deleted = false; QueueNextSwapMessage(std::make_unique<NotifiesDeletionMessage>( &message_deleted, first_message_)); - queue_ = NULL; + queue_ = nullptr; ASSERT_TRUE(message_deleted); } @@ -274,7 +274,7 @@ bool message_deleted = false; QueueVisualStateMessage(1, std::make_unique<NotifiesDeletionMessage>( &message_deleted, first_message_)); - queue_ = NULL; + queue_ = nullptr; ASSERT_TRUE(message_deleted); } @@ -284,7 +284,7 @@ &message_deleted, first_message_)); queue_->DidActivate(1); queue_->DidSwap(1); - queue_ = NULL; + queue_ = nullptr; ASSERT_TRUE(message_deleted); }
diff --git a/content/renderer/gpu/gpu_benchmarking_extension.cc b/content/renderer/gpu/gpu_benchmarking_extension.cc index a65b1d5..f704e54 100644 --- a/content/renderer/gpu/gpu_benchmarking_extension.cc +++ b/content/renderer/gpu/gpu_benchmarking_extension.cc
@@ -241,10 +241,10 @@ class GpuBenchmarkingContext { public: GpuBenchmarkingContext() - : web_frame_(NULL), - web_view_(NULL), - render_view_impl_(NULL), - compositor_(NULL) {} + : web_frame_(nullptr), + web_view_(nullptr), + render_view_impl_(nullptr), + compositor_(nullptr) {} bool Init(bool init_compositor) { web_frame_ = WebLocalFrame::FrameForCurrentContext(); @@ -253,14 +253,14 @@ web_view_ = web_frame_->View(); if (!web_view_) { - web_frame_ = NULL; + web_frame_ = nullptr; return false; } render_view_impl_ = RenderViewImpl::FromWebView(web_view_); if (!render_view_impl_) { - web_frame_ = NULL; - web_view_ = NULL; + web_frame_ = nullptr; + web_view_ = nullptr; return false; } @@ -269,9 +269,9 @@ compositor_ = render_view_impl_->GetWidget()->compositor(); if (!compositor_) { - web_frame_ = NULL; - web_view_ = NULL; - render_view_impl_ = NULL; + web_frame_ = nullptr; + web_view_ = nullptr; + render_view_impl_ = nullptr; return false; } @@ -279,19 +279,19 @@ } WebLocalFrame* web_frame() const { - DCHECK(web_frame_ != NULL); + DCHECK(web_frame_ != nullptr); return web_frame_; } WebView* web_view() const { - DCHECK(web_view_ != NULL); + DCHECK(web_view_ != nullptr); return web_view_; } RenderViewImpl* render_view_impl() const { - DCHECK(render_view_impl_ != NULL); + DCHECK(render_view_impl_ != nullptr); return render_view_impl_; } RenderWidgetCompositor* compositor() const { - DCHECK(compositor_ != NULL); + DCHECK(compositor_ != nullptr); return compositor_; } @@ -330,7 +330,7 @@ WebLocalFrame* frame = WebLocalFrame::FrameForContext(context); if (frame && !callback.IsEmpty()) { frame->CallFunctionEvenIfScriptDisabled(callback, v8::Object::New(isolate), - 0, NULL); + 0, nullptr); } }
diff --git a/content/renderer/idle_user_detector.cc b/content/renderer/idle_user_detector.cc index 4414b96..74799834 100644 --- a/content/renderer/idle_user_detector.cc +++ b/content/renderer/idle_user_detector.cc
@@ -26,7 +26,7 @@ void IdleUserDetector::ActivityDetected() { if (GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { RenderThreadImpl* render_thread = RenderThreadImpl::current(); - if (render_thread != NULL) { + if (render_thread != nullptr) { render_thread->PostponeIdleNotification(); } }
diff --git a/content/renderer/image_downloader/image_downloader_impl.cc b/content/renderer/image_downloader/image_downloader_impl.cc index 3514a92a..6a70cc4 100644 --- a/content/renderer/image_downloader/image_downloader_impl.cc +++ b/content/renderer/image_downloader/image_downloader_impl.cc
@@ -50,7 +50,7 @@ if (max_image_size == 0) max_image_size = std::numeric_limits<uint32_t>::max(); - const SkBitmap* min_image = NULL; + const SkBitmap* min_image = nullptr; uint32_t min_image_size = std::numeric_limits<uint32_t>::max(); // Filter the images by |max_image_size|, and also identify the smallest image // in case all the images are bigger than |max_image_size|.
diff --git a/content/renderer/indexed_db/indexed_db_dispatcher.cc b/content/renderer/indexed_db/indexed_db_dispatcher.cc index 017e2d4..3e2acce 100644 --- a/content/renderer/indexed_db/indexed_db_dispatcher.cc +++ b/content/renderer/indexed_db/indexed_db_dispatcher.cc
@@ -45,7 +45,7 @@ IndexedDBDispatcher* IndexedDBDispatcher::ThreadSpecificInstance() { if (g_idb_dispatcher_tls.Pointer()->Get() == kHasBeenDeleted) { NOTREACHED() << "Re-instantiating TLS IndexedDBDispatcher."; - g_idb_dispatcher_tls.Pointer()->Set(NULL); + g_idb_dispatcher_tls.Pointer()->Set(nullptr); } if (g_idb_dispatcher_tls.Pointer()->Get()) return g_idb_dispatcher_tls.Pointer()->Get();
diff --git a/content/renderer/indexed_db/webidbcursor_impl_unittest.cc b/content/renderer/indexed_db/webidbcursor_impl_unittest.cc index 70ff769f2..b151ad93 100644 --- a/content/renderer/indexed_db/webidbcursor_impl_unittest.cc +++ b/content/renderer/indexed_db/webidbcursor_impl_unittest.cc
@@ -97,8 +97,8 @@ class MockContinueCallbacks : public StrictMock<MockWebIDBCallbacks> { public: - MockContinueCallbacks(IndexedDBKey* key = 0, - WebVector<WebBlobInfo>* webBlobInfo = 0) + MockContinueCallbacks(IndexedDBKey* key = nullptr, + WebVector<WebBlobInfo>* webBlobInfo = nullptr) : key_(key), web_blob_info_(webBlobInfo) {} void OnSuccess(const WebIDBKey& key,
diff --git a/content/renderer/input/input_event_filter.cc b/content/renderer/input/input_event_filter.cc index ec4ff50..a620261a 100644 --- a/content/renderer/input/input_event_filter.cc +++ b/content/renderer/input/input_event_filter.cc
@@ -60,9 +60,9 @@ const scoped_refptr<base::SingleThreadTaskRunner>& target_task_runner) : main_task_runner_(main_task_runner), main_listener_(main_listener), - sender_(NULL), + sender_(nullptr), target_task_runner_(target_task_runner), - input_handler_manager_(NULL) { + input_handler_manager_(nullptr) { DCHECK(target_task_runner_.get()); DCHECK(main_task_runner_->BelongsToCurrentThread()); } @@ -149,11 +149,11 @@ } void InputEventFilter::OnFilterRemoved() { - sender_ = NULL; + sender_ = nullptr; } void InputEventFilter::OnChannelClosing() { - sender_ = NULL; + sender_ = nullptr; } // This function returns true if the IPC message is one that the compositor
diff --git a/content/renderer/internal_document_state_data.cc b/content/renderer/internal_document_state_data.cc index 6750510f..72d99be 100644 --- a/content/renderer/internal_document_state_data.cc +++ b/content/renderer/internal_document_state_data.cc
@@ -35,7 +35,7 @@ InternalDocumentStateData* InternalDocumentStateData::FromDocumentState( DocumentState* ds) { if (!ds) - return NULL; + return nullptr; InternalDocumentStateData* data = static_cast<InternalDocumentStateData*>( ds->GetUserData(&kUserDataKey)); if (!data) {
diff --git a/content/renderer/loader/resource_dispatcher.cc b/content/renderer/loader/resource_dispatcher.cc index 2eecf75..d95bc52 100644 --- a/content/renderer/loader/resource_dispatcher.cc +++ b/content/renderer/loader/resource_dispatcher.cc
@@ -94,7 +94,7 @@ IPC::Sender* sender, scoped_refptr<base::SingleThreadTaskRunner> thread_task_runner) : message_sender_(sender), - delegate_(NULL), + delegate_(nullptr), io_timestamp_(base::TimeTicks()), thread_task_runner_(thread_task_runner), weak_factory_(this) {} @@ -143,7 +143,7 @@ PendingRequestMap::iterator it = pending_requests_.find(request_id); if (it == pending_requests_.end()) { // This might happen for kill()ed requests on the webkit end. - return NULL; + return nullptr; } return it->second.get(); }
diff --git a/content/renderer/loader/resource_dispatcher_unittest.cc b/content/renderer/loader/resource_dispatcher_unittest.cc index 5220774..ae8818d 100644 --- a/content/renderer/loader/resource_dispatcher_unittest.cc +++ b/content/renderer/loader/resource_dispatcher_unittest.cc
@@ -266,7 +266,7 @@ std::unique_ptr<ResourceRequest> request(CreateResourceRequest(false)); TestRequestPeer::Context peer_context; - StartAsync(std::move(request), NULL, &peer_context); + StartAsync(std::move(request), nullptr, &peer_context); int id = ConsumeRequestResource(); EXPECT_EQ(0u, queued_messages()); @@ -297,11 +297,11 @@ std::unique_ptr<ResourceRequest> request1(CreateResourceRequest(false)); TestRequestPeer::Context peer_context1; - StartAsync(std::move(request1), NULL, &peer_context1); + StartAsync(std::move(request1), nullptr, &peer_context1); std::unique_ptr<ResourceRequest> request2(CreateResourceRequest(false)); TestRequestPeer::Context peer_context2; - StartAsync(std::move(request2), NULL, &peer_context2); + StartAsync(std::move(request2), nullptr, &peer_context2); int id1 = ConsumeRequestResource(); int id2 = ConsumeRequestResource(); @@ -338,7 +338,7 @@ TEST_F(ResourceDispatcherTest, Cancel) { std::unique_ptr<ResourceRequest> request(CreateResourceRequest(false)); TestRequestPeer::Context peer_context; - int request_id = StartAsync(std::move(request), NULL, &peer_context); + int request_id = StartAsync(std::move(request), nullptr, &peer_context); int id = ConsumeRequestResource(); EXPECT_EQ(0u, queued_messages()); @@ -363,7 +363,7 @@ TEST_F(ResourceDispatcherTest, CancelDuringCallback) { std::unique_ptr<ResourceRequest> request(CreateResourceRequest(false)); TestRequestPeer::Context peer_context; - StartAsync(std::move(request), NULL, &peer_context); + StartAsync(std::move(request), nullptr, &peer_context); peer_context.cancel_on_receive_response = true; int id = ConsumeRequestResource(); @@ -538,7 +538,7 @@ TEST_F(ResourceDispatcherTest, Redirect) { std::unique_ptr<ResourceRequest> request(CreateResourceRequest(false)); TestRequestPeer::Context peer_context; - StartAsync(std::move(request), NULL, &peer_context); + StartAsync(std::move(request), nullptr, &peer_context); int id = ConsumeRequestResource(); @@ -569,7 +569,7 @@ TEST_F(ResourceDispatcherTest, CancelDuringRedirect) { std::unique_ptr<ResourceRequest> request(CreateResourceRequest(false)); TestRequestPeer::Context peer_context; - StartAsync(std::move(request), NULL, &peer_context); + StartAsync(std::move(request), nullptr, &peer_context); peer_context.follow_redirects = false; int id = ConsumeRequestResource(); @@ -599,7 +599,7 @@ TEST_F(ResourceDispatcherTest, Defer) { std::unique_ptr<ResourceRequest> request(CreateResourceRequest(false)); TestRequestPeer::Context peer_context; - int request_id = StartAsync(std::move(request), NULL, &peer_context); + int request_id = StartAsync(std::move(request), nullptr, &peer_context); int id = ConsumeRequestResource(); EXPECT_EQ(0u, queued_messages()); @@ -633,7 +633,7 @@ TEST_F(ResourceDispatcherTest, DeferOnRedirect) { std::unique_ptr<ResourceRequest> request(CreateResourceRequest(false)); TestRequestPeer::Context peer_context; - int request_id = StartAsync(std::move(request), NULL, &peer_context); + int request_id = StartAsync(std::move(request), nullptr, &peer_context); peer_context.defer_on_redirect = true; int id = ConsumeRequestResource(); @@ -672,7 +672,7 @@ TEST_F(ResourceDispatcherTest, CancelDeferredRequest) { std::unique_ptr<ResourceRequest> request(CreateResourceRequest(false)); TestRequestPeer::Context peer_context; - int request_id = StartAsync(std::move(request), NULL, &peer_context); + int request_id = StartAsync(std::move(request), nullptr, &peer_context); int id = ConsumeRequestResource(); EXPECT_EQ(0u, queued_messages()); @@ -697,7 +697,7 @@ TEST_F(ResourceDispatcherTest, CancelWhileFlushingDeferredRequests) { std::unique_ptr<ResourceRequest> request(CreateResourceRequest(false)); TestRequestPeer::Context peer_context; - int request_id = StartAsync(std::move(request), NULL, &peer_context); + int request_id = StartAsync(std::move(request), nullptr, &peer_context); // Cancel the request when the data message is handled. peer_context.cancel_on_receive_data = true; @@ -742,7 +742,7 @@ CancelWhileFlushingDeferredRequestsFromOnMessageReceived) { std::unique_ptr<ResourceRequest> request(CreateResourceRequest(false)); TestRequestPeer::Context peer_context; - int request_id = StartAsync(std::move(request), NULL, &peer_context); + int request_id = StartAsync(std::move(request), nullptr, &peer_context); // Cancel the request when the data message is handled. peer_context.cancel_on_receive_data = true; @@ -802,7 +802,7 @@ TEST_F(ResourceDispatcherTest, DownloadToFile) { std::unique_ptr<ResourceRequest> request(CreateResourceRequest(true)); TestRequestPeer::Context peer_context; - int request_id = StartAsync(std::move(request), NULL, &peer_context); + int request_id = StartAsync(std::move(request), nullptr, &peer_context); const int kDownloadedIncrement = 100; const int kEncodedIncrement = 50; @@ -843,7 +843,7 @@ TEST_F(ResourceDispatcherTest, CancelDownloadToFile) { std::unique_ptr<ResourceRequest> request(CreateResourceRequest(true)); TestRequestPeer::Context peer_context; - int request_id = StartAsync(std::move(request), NULL, &peer_context); + int request_id = StartAsync(std::move(request), nullptr, &peer_context); int id = ConsumeRequestResource(); EXPECT_EQ(0u, queued_messages()); @@ -876,7 +876,7 @@ void PerformTest(const ResourceResponseHead& response_head) { std::unique_ptr<ResourceRequest> request(CreateResourceRequest(false)); TestRequestPeer::Context peer_context; - StartAsync(std::move(request), NULL, &peer_context); + StartAsync(std::move(request), nullptr, &peer_context); dispatcher()->OnMessageReceived( ResourceMsg_ReceivedResponse(0, response_head));
diff --git a/content/renderer/loader/site_isolation_stats_gatherer.cc b/content/renderer/loader/site_isolation_stats_gatherer.cc index 2bb99cf8..a2f27180 100644 --- a/content/renderer/loader/site_isolation_stats_gatherer.cc +++ b/content/renderer/loader/site_isolation_stats_gatherer.cc
@@ -142,7 +142,7 @@ std::string access_control_origin; // We can use a case-insensitive header name for EnumerateHeader(). - info.headers->EnumerateHeader(NULL, "access-control-allow-origin", + info.headers->EnumerateHeader(nullptr, "access-control-allow-origin", &access_control_origin); if (CrossSiteDocumentClassifier::IsValidCorsHeaderSet( frame_origin, response_url, access_control_origin)) { @@ -151,7 +151,7 @@ // Real XSD data collection starts from here. std::string no_sniff; - info.headers->EnumerateHeader(NULL, "x-content-type-options", &no_sniff); + info.headers->EnumerateHeader(nullptr, "x-content-type-options", &no_sniff); std::unique_ptr<SiteIsolationResponseMetaData> resp_data( new SiteIsolationResponseMetaData);
diff --git a/content/renderer/loader/web_url_loader_impl.cc b/content/renderer/loader/web_url_loader_impl.cc index 5a486f8..bb797da 100644 --- a/content/renderer/loader/web_url_loader_impl.cc +++ b/content/renderer/loader/web_url_loader_impl.cc
@@ -496,7 +496,7 @@ : loader_(loader), use_stream_on_response_(false), report_raw_headers_(false), - client_(NULL), + client_(nullptr), resource_dispatcher_(resource_dispatcher), task_runner_(std::move(task_runner)), keep_alive_handle_( @@ -532,8 +532,8 @@ ftp_listing_delegate_->Cancel(); // Do not make any further calls to the client. - client_ = NULL; - loader_ = NULL; + client_ = nullptr; + loader_ = nullptr; } void WebURLLoaderImpl::Context::SetDefersLoading(bool value) { @@ -788,7 +788,7 @@ } if (info.headers.get() && info.mime_type == "multipart/x-mixed-replace") { std::string content_type; - info.headers->EnumerateHeader(NULL, "content-type", &content_type); + info.headers->EnumerateHeader(nullptr, "content-type", &content_type); std::string mime_type; std::string charset; @@ -908,7 +908,7 @@ if (ftp_listing_delegate_) { ftp_listing_delegate_->OnCompletedRequest(); - ftp_listing_delegate_.reset(NULL); + ftp_listing_delegate_.reset(nullptr); } if (body_stream_writer_ && error_code != net::OK) @@ -949,7 +949,7 @@ // Notify renderer clients that the request is canceled. if (ftp_listing_delegate_) { ftp_listing_delegate_->OnCompletedRequest(); - ftp_listing_delegate_.reset(NULL); + ftp_listing_delegate_.reset(nullptr); } if (body_stream_writer_) { @@ -1005,7 +1005,8 @@ return true; std::string mime_type, unused_charset; - if (net::DataURL::Parse(request.Url(), &mime_type, &unused_charset, NULL) && + if (net::DataURL::Parse(request.Url(), &mime_type, &unused_charset, + nullptr) && blink::IsSupportedMimeType(mime_type)) return true; @@ -1397,7 +1398,7 @@ DCHECK(!context_->client()); context_->set_client(client); - context_->Start(request, NULL); + context_->Start(request, nullptr); } void WebURLLoaderImpl::Cancel() {
diff --git a/content/renderer/loader/web_url_request_util.cc b/content/renderer/loader/web_url_request_util.cc index c574e3a..b4fa6fae 100644 --- a/content/renderer/loader/web_url_request_util.cc +++ b/content/renderer/loader/web_url_request_util.cc
@@ -377,14 +377,6 @@ : -1, element.expected_modification_time().ToDoubleT()); break; - case ResourceRequestBody::Element::TYPE_FILE_FILESYSTEM: - http_body.AppendFileSystemURLRange( - element.filesystem_url(), element.offset(), - (element.length() != std::numeric_limits<uint64_t>::max()) - ? element.length() - : -1, - element.expected_modification_time().ToDoubleT()); - break; case ResourceRequestBody::Element::TYPE_BLOB: http_body.AppendBlob(WebString::FromASCII(element.blob_uuid())); break;
diff --git a/content/renderer/media/aec_dump_message_filter.cc b/content/renderer/media/aec_dump_message_filter.cc index fe63cb66..58be1a56 100644 --- a/content/renderer/media/aec_dump_message_filter.cc +++ b/content/renderer/media/aec_dump_message_filter.cc
@@ -16,12 +16,12 @@ namespace content { -AecDumpMessageFilter* AecDumpMessageFilter::g_filter = NULL; +AecDumpMessageFilter* AecDumpMessageFilter::g_filter = nullptr; AecDumpMessageFilter::AecDumpMessageFilter( const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner) - : sender_(NULL), + : sender_(nullptr), delegate_id_counter_(1), io_task_runner_(io_task_runner), main_task_runner_(main_task_runner) { @@ -31,7 +31,7 @@ AecDumpMessageFilter::~AecDumpMessageFilter() { DCHECK_EQ(g_filter, this); - g_filter = NULL; + g_filter = nullptr; } // static @@ -115,7 +115,7 @@ void AecDumpMessageFilter::OnChannelClosing() { DCHECK(io_task_runner_->BelongsToCurrentThread()); - sender_ = NULL; + sender_ = nullptr; main_task_runner_->PostTask( FROM_HERE, base::BindOnce(&AecDumpMessageFilter::DoChannelClosingOnDelegates, this));
diff --git a/content/renderer/media/audio_device_factory.cc b/content/renderer/media/audio_device_factory.cc index 7f72d25..8e9aac2 100644 --- a/content/renderer/media/audio_device_factory.cc +++ b/content/renderer/media/audio_device_factory.cc
@@ -23,7 +23,7 @@ namespace content { // static -AudioDeviceFactory* AudioDeviceFactory::factory_ = NULL; +AudioDeviceFactory* AudioDeviceFactory::factory_ = nullptr; namespace { #if defined(OS_WIN) || defined(OS_MACOSX) || \ @@ -199,7 +199,7 @@ } AudioDeviceFactory::~AudioDeviceFactory() { - factory_ = NULL; + factory_ = nullptr; } // static
diff --git a/content/renderer/media/audio_input_message_filter.cc b/content/renderer/media/audio_input_message_filter.cc index a67f165..7ddca26 100644 --- a/content/renderer/media/audio_input_message_filter.cc +++ b/content/renderer/media/audio_input_message_filter.cc
@@ -51,18 +51,18 @@ int stream_id_; }; -AudioInputMessageFilter* AudioInputMessageFilter::g_filter = NULL; +AudioInputMessageFilter* AudioInputMessageFilter::g_filter = nullptr; AudioInputMessageFilter::AudioInputMessageFilter( scoped_refptr<base::SingleThreadTaskRunner> io_task_runner) - : sender_(NULL), io_task_runner_(io_task_runner) { + : sender_(nullptr), io_task_runner_(io_task_runner) { DCHECK(!g_filter); g_filter = this; } AudioInputMessageFilter::~AudioInputMessageFilter() { DCHECK_EQ(g_filter, this); - g_filter = NULL; + g_filter = nullptr; } // static @@ -109,7 +109,7 @@ void AudioInputMessageFilter::OnChannelClosing() { DCHECK(io_task_runner_->BelongsToCurrentThread()); - sender_ = NULL; + sender_ = nullptr; DLOG_IF(WARNING, !delegates_.IsEmpty()) << "Not all audio devices have been closed.";
diff --git a/content/renderer/media/audio_message_filter.cc b/content/renderer/media/audio_message_filter.cc index abe24b04..b1f2106 100644 --- a/content/renderer/media/audio_message_filter.cc +++ b/content/renderer/media/audio_message_filter.cc
@@ -43,18 +43,18 @@ bool stream_created_; }; -AudioMessageFilter* AudioMessageFilter::g_filter = NULL; +AudioMessageFilter* AudioMessageFilter::g_filter = nullptr; AudioMessageFilter::AudioMessageFilter( scoped_refptr<base::SingleThreadTaskRunner> io_task_runner) - : sender_(NULL), io_task_runner_(io_task_runner) { + : sender_(nullptr), io_task_runner_(io_task_runner) { DCHECK(!g_filter); g_filter = this; } AudioMessageFilter::~AudioMessageFilter() { DCHECK_EQ(g_filter, this); - g_filter = NULL; + g_filter = nullptr; } // static @@ -168,7 +168,7 @@ void AudioMessageFilter::OnChannelClosing() { DCHECK(io_task_runner_->BelongsToCurrentThread()); - sender_ = NULL; + sender_ = nullptr; DLOG_IF(WARNING, !delegates_.IsEmpty()) << "Not all audio devices have been closed.";
diff --git a/content/renderer/media/audio_message_filter_unittest.cc b/content/renderer/media/audio_message_filter_unittest.cc index 1950724..f38c1ec4 100644 --- a/content/renderer/media/audio_message_filter_unittest.cc +++ b/content/renderer/media/audio_message_filter_unittest.cc
@@ -143,7 +143,7 @@ delegate.Reset(); ipc->CloseStream(); - EXPECT_EQ(static_cast<media::AudioOutputIPCDelegate*>(NULL), + EXPECT_EQ(static_cast<media::AudioOutputIPCDelegate*>(nullptr), filter->delegates_.Lookup(kStreamId)); } @@ -185,9 +185,9 @@ ipc1->CloseStream(); ipc2->CloseStream(); - EXPECT_EQ(static_cast<media::AudioOutputIPCDelegate*>(NULL), + EXPECT_EQ(static_cast<media::AudioOutputIPCDelegate*>(nullptr), filter->delegates_.Lookup(kStreamId1)); - EXPECT_EQ(static_cast<media::AudioOutputIPCDelegate*>(NULL), + EXPECT_EQ(static_cast<media::AudioOutputIPCDelegate*>(nullptr), filter->delegates_.Lookup(kStreamId2)); }
diff --git a/content/renderer/media/cdm/pepper_cdm_wrapper_impl.cc b/content/renderer/media/cdm/pepper_cdm_wrapper_impl.cc index 5cad0ab0..97b5d42 100644 --- a/content/renderer/media/cdm/pepper_cdm_wrapper_impl.cc +++ b/content/renderer/media/cdm/pepper_cdm_wrapper_impl.cc
@@ -85,7 +85,7 @@ PepperCdmWrapperImpl::~PepperCdmWrapperImpl() { // Destroy the nested objects in reverse order. - plugin_instance_ = NULL; + plugin_instance_ = nullptr; helper_plugin_.reset(); }
diff --git a/content/renderer/media/cdm/ppapi_decryptor.cc b/content/renderer/media/cdm/ppapi_decryptor.cc index 7faec01c4..ffcb3e9 100644 --- a/content/renderer/media/cdm/ppapi_decryptor.cc +++ b/content/renderer/media/cdm/ppapi_decryptor.cc
@@ -269,7 +269,7 @@ DVLOG(3) << __func__ << " - stream_type: " << stream_type; if (!CdmDelegate() || !CdmDelegate()->Decrypt(stream_type, encrypted, decrypt_cb)) { - decrypt_cb.Run(kError, NULL); + decrypt_cb.Run(kError, nullptr); } } @@ -366,7 +366,7 @@ DVLOG(3) << __func__; if (!CdmDelegate() || !CdmDelegate()->DecryptAndDecodeVideo(encrypted, video_decode_cb)) { - video_decode_cb.Run(kError, NULL); + video_decode_cb.Run(kError, nullptr); } } @@ -465,7 +465,8 @@ ContentDecryptorDelegate* PpapiDecryptor::CdmDelegate() { DCHECK(render_task_runner_->BelongsToCurrentThread()); - return (pepper_cdm_wrapper_) ? pepper_cdm_wrapper_->GetCdmDelegate() : NULL; + return (pepper_cdm_wrapper_) ? pepper_cdm_wrapper_->GetCdmDelegate() + : nullptr; } } // namespace content
diff --git a/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.cc b/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.cc index 065c829..27f2529 100644 --- a/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.cc +++ b/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.cc
@@ -215,7 +215,7 @@ gles2->TexParameteri(texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); if (texture_target == GL_TEXTURE_2D) { gles2->TexImage2D(texture_target, 0, GL_RGBA, size.width(), size.height(), - 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); } gles2->GenMailboxCHROMIUM(texture_mailboxes->at(i).name); gles2->ProduceTextureCHROMIUM(texture_target,
diff --git a/content/renderer/media/gpu/rtc_video_encoder.cc b/content/renderer/media/gpu/rtc_video_encoder.cc index 41a6de378..aebe2d24 100644 --- a/content/renderer/media/gpu/rtc_video_encoder.cc +++ b/content/renderer/media/gpu/rtc_video_encoder.cc
@@ -606,7 +606,7 @@ // input_next_frame_* state before we hand off the VideoFrame to the VEA. const webrtc::VideoFrame* next_frame = input_next_frame_; const bool next_frame_keyframe = input_next_frame_keyframe_; - input_next_frame_ = NULL; + input_next_frame_ = nullptr; input_next_frame_keyframe_ = false; if (!video_encoder_) { @@ -705,8 +705,8 @@ DCHECK(thread_checker_.CalledOnValidThread()); *async_retval_ = retval; async_waiter_->Signal(); - async_retval_ = NULL; - async_waiter_ = NULL; + async_retval_ = nullptr; + async_waiter_ = nullptr; } bool RTCVideoEncoder::Impl::IsBitrateTooHigh(uint32_t bitrate) { @@ -910,7 +910,7 @@ FROM_HERE, base::BindOnce(&RTCVideoEncoder::Impl::Destroy, impl_, &release_waiter)); release_waiter.Wait(); - impl_ = NULL; + impl_ = nullptr; return WEBRTC_VIDEO_CODEC_OK; }
diff --git a/content/renderer/media/media_stream_audio_processor.cc b/content/renderer/media/media_stream_audio_processor.cc index d2b3671..9514dde6 100644 --- a/content/renderer/media/media_stream_audio_processor.cc +++ b/content/renderer/media/media_stream_audio_processor.cc
@@ -429,7 +429,7 @@ if (aec_dump_message_filter_.get()) { aec_dump_message_filter_->RemoveDelegate(this); - aec_dump_message_filter_ = NULL; + aec_dump_message_filter_ = nullptr; } if (!audio_processing_.get()) @@ -441,7 +441,7 @@ if (playout_data_source_) { playout_data_source_->RemovePlayoutSink(this); - playout_data_source_ = NULL; + playout_data_source_ = nullptr; } if (echo_information_) @@ -513,7 +513,7 @@ void MediaStreamAudioProcessor::OnIpcClosing() { DCHECK(main_thread_runner_->BelongsToCurrentThread()); - aec_dump_message_filter_ = NULL; + aec_dump_message_filter_ = nullptr; } // static
diff --git a/content/renderer/media/media_stream_center.cc b/content/renderer/media/media_stream_center.cc index 7e1f32d..eb4e2a59 100644 --- a/content/renderer/media/media_stream_center.cc +++ b/content/renderer/media/media_stream_center.cc
@@ -60,7 +60,7 @@ } void CreateNativeVideoMediaStreamTrack(blink::WebMediaStreamTrack track) { - DCHECK(track.GetTrackData() == NULL); + DCHECK(track.GetTrackData() == nullptr); blink::WebMediaStreamSource source = track.Source(); DCHECK_EQ(source.GetType(), blink::WebMediaStreamSource::kTypeVideo); MediaStreamVideoSource* native_source =
diff --git a/content/renderer/media/media_stream_renderer_factory_impl.cc b/content/renderer/media/media_stream_renderer_factory_impl.cc index 8c664341..27210034 100644 --- a/content/renderer/media/media_stream_renderer_factory_impl.cc +++ b/content/renderer/media/media_stream_renderer_factory_impl.cc
@@ -74,7 +74,7 @@ web_stream.VideoTracks(video_tracks); if (video_tracks.IsEmpty() || !MediaStreamVideoTrack::GetTrack(video_tracks[0])) { - return NULL; + return nullptr; } return new MediaStreamVideoRendererSink(video_tracks[0], error_cb, repaint_cb,
diff --git a/content/renderer/media/media_stream_video_track.cc b/content/renderer/media/media_stream_video_track.cc index 35996b9..4c4c8d1 100644 --- a/content/renderer/media/media_stream_video_track.cc +++ b/content/renderer/media/media_stream_video_track.cc
@@ -155,7 +155,7 @@ DCHECK(io_task_runner_->BelongsToCurrentThread()); enabled_ = enabled; if (enabled_) - black_frame_ = NULL; + black_frame_ = nullptr; } void MediaStreamVideoTrack::FrameDeliverer::DeliverFrameOnIO( @@ -352,7 +352,7 @@ DCHECK(main_render_thread_checker_.CalledOnValidThread()); if (source_) { source_->RemoveTrack(this); - source_ = NULL; + source_ = nullptr; } OnReadyStateChanged(blink::WebMediaStreamSource::kReadyStateEnded); }
diff --git a/content/renderer/media/mock_peer_connection_impl.cc b/content/renderer/media/mock_peer_connection_impl.cc index cd41551..0b764ba 100644 --- a/content/renderer/media/mock_peer_connection_impl.cc +++ b/content/renderer/media/mock_peer_connection_impl.cc
@@ -36,7 +36,7 @@ if (streams_[i]->label() == label) return streams_[i]; } - return NULL; + return nullptr; } webrtc::MediaStreamTrackInterface* FindAudioTrack( const std::string& id) override { @@ -46,7 +46,7 @@ if (track) return track; } - return NULL; + return nullptr; } webrtc::MediaStreamTrackInterface* FindVideoTrack( const std::string& id) override { @@ -56,7 +56,7 @@ if (track) return track; } - return NULL; + return nullptr; } void AddStream(MediaStreamInterface* stream) { streams_.push_back(stream); @@ -83,14 +83,11 @@ class MockDtmfSender : public DtmfSenderInterface { public: explicit MockDtmfSender(AudioTrackInterface* track) - : track_(track), - observer_(NULL), - duration_(0), - inter_tone_gap_(0) {} + : track_(track), observer_(nullptr), duration_(0), inter_tone_gap_(0) {} void RegisterObserver(DtmfSenderObserverInterface* observer) override { observer_ = observer; } - void UnregisterObserver() override { observer_ = NULL; } + void UnregisterObserver() override { observer_ = nullptr; } bool CanInsertDtmf() override { return true; } bool InsertDtmf(const std::string& tones, int duration, @@ -201,7 +198,7 @@ rtc::scoped_refptr<DtmfSenderInterface> MockPeerConnectionImpl::CreateDtmfSender(AudioTrackInterface* track) { if (!track) { - return NULL; + return nullptr; } return new rtc::RefCountedObject<MockDtmfSender>(track); } @@ -294,7 +291,7 @@ DCHECK(observer); created_sessiondescription_.reset( dependency_factory_->CreateSessionDescription("unknown", kDummyOffer, - NULL)); + nullptr)); } void MockPeerConnectionImpl::CreateAnswer( @@ -303,7 +300,7 @@ DCHECK(observer); created_sessiondescription_.reset( dependency_factory_->CreateSessionDescription("unknown", kDummyAnswer, - NULL)); + nullptr)); } void MockPeerConnectionImpl::SetLocalDescriptionWorker(
diff --git a/content/renderer/media/peer_connection_tracker.cc b/content/renderer/media/peer_connection_tracker.cc index 1a6ae879..1582c65f 100644 --- a/content/renderer/media/peer_connection_tracker.cc +++ b/content/renderer/media/peer_connection_tracker.cc
@@ -254,7 +254,7 @@ static std::unique_ptr<base::DictionaryValue> GetDictValueStats( const StatsReport& report) { if (report.values().empty()) - return NULL; + return nullptr; auto values = std::make_unique<base::ListValue>(); @@ -299,7 +299,7 @@ const StatsReport& report) { std::unique_ptr<base::DictionaryValue> stats = GetDictValueStats(report); if (!stats) - return NULL; + return nullptr; // Note: // The format must be consistent with what webrtc_internals.js expects.
diff --git a/content/renderer/media/pepper_to_video_track_adapter_unittest.cc b/content/renderer/media/pepper_to_video_track_adapter_unittest.cc index cd07ad0..b371a23 100644 --- a/content/renderer/media/pepper_to_video_track_adapter_unittest.cc +++ b/content/renderer/media/pepper_to_video_track_adapter_unittest.cc
@@ -64,7 +64,7 @@ } TEST_F(PepperToVideoTrackAdapterTest, PutFrame) { - FrameWriterInterface* frame_writer = NULL; + FrameWriterInterface* frame_writer = nullptr; EXPECT_TRUE(PepperToVideoTrackAdapter::Open(registry_.get(), kTestStreamUrl, &frame_writer)); ASSERT_TRUE(frame_writer); @@ -78,7 +78,7 @@ // Verify the native video track has been added. MediaStreamVideoTrack* native_track = MediaStreamVideoTrack::GetVideoTrack(video_tracks[0]); - ASSERT_TRUE(native_track != NULL); + ASSERT_TRUE(native_track != nullptr); MockMediaStreamVideoSink sink; native_track->AddSink(&sink, sink.GetDeliverFrameCB(), false);
diff --git a/content/renderer/media/rtc_data_channel_handler.cc b/content/renderer/media/rtc_data_channel_handler.cc index dc82acb..d423b36 100644 --- a/content/renderer/media/rtc_data_channel_handler.cc +++ b/content/renderer/media/rtc_data_channel_handler.cc
@@ -134,7 +134,7 @@ const scoped_refptr<base::SingleThreadTaskRunner>& main_thread, webrtc::DataChannelInterface* channel) : observer_(new Observer(this, main_thread, channel)), - webkit_client_(NULL) { + webkit_client_(nullptr) { DVLOG(1) << "RtcDataChannelHandler " << channel->label(); // Detach from the ctor thread since we can be constructed on either the main
diff --git a/content/renderer/media/rtc_dtmf_sender_handler.cc b/content/renderer/media/rtc_dtmf_sender_handler.cc index 9804fc9..d61b43b 100644 --- a/content/renderer/media/rtc_dtmf_sender_handler.cc +++ b/content/renderer/media/rtc_dtmf_sender_handler.cc
@@ -50,9 +50,7 @@ }; RtcDtmfSenderHandler::RtcDtmfSenderHandler(DtmfSenderInterface* dtmf_sender) - : dtmf_sender_(dtmf_sender), - webkit_client_(NULL), - weak_factory_(this) { + : dtmf_sender_(dtmf_sender), webkit_client_(nullptr), weak_factory_(this) { DVLOG(1) << "::ctor"; observer_ = new Observer(weak_factory_.GetWeakPtr()); dtmf_sender_->RegisterObserver(observer_.get()); @@ -63,7 +61,7 @@ DVLOG(1) << "::dtor"; dtmf_sender_->UnregisterObserver(); // Release |observer| before |weak_factory_| is destroyed. - observer_ = NULL; + observer_ = nullptr; } void RtcDtmfSenderHandler::SetClient(
diff --git a/content/renderer/media/rtc_peer_connection_handler.cc b/content/renderer/media/rtc_peer_connection_handler.cc index f6c0a24e..60d2ee7 100644 --- a/content/renderer/media/rtc_peer_connection_handler.cc +++ b/content/renderer/media/rtc_peer_connection_handler.cc
@@ -476,7 +476,7 @@ base::BindOnce(&SetSessionDescriptionRequest::OnSuccess, this)); return; } - tracker_.TrackOnSuccess(NULL); + tracker_.TrackOnSuccess(nullptr); webkit_request_.RequestSucceeded(); webkit_request_.Reset(); } @@ -1870,7 +1870,7 @@ native_peer_connection_->CreateDataChannel(label.Utf8(), &config)); if (!webrtc_channel) { DLOG(ERROR) << "Could not create native data channel."; - return NULL; + return nullptr; } if (peer_connection_tracker_) { peer_connection_tracker_->TrackCreateDataChannel(
diff --git a/content/renderer/media/rtc_peer_connection_handler_unittest.cc b/content/renderer/media/rtc_peer_connection_handler_unittest.cc index d262b4d..f23c48de 100644 --- a/content/renderer/media/rtc_peer_connection_handler_unittest.cc +++ b/content/renderer/media/rtc_peer_connection_handler_unittest.cc
@@ -134,7 +134,7 @@ if (request_succeeded_called_) { return response_.get(); } else { - return NULL; + return nullptr; } } @@ -260,8 +260,7 @@ class RTCPeerConnectionHandlerTest : public ::testing::Test { public: - RTCPeerConnectionHandlerTest() : mock_peer_connection_(NULL) { - } + RTCPeerConnectionHandlerTest() : mock_peer_connection_(nullptr) {} void SetUp() override { mock_client_.reset(new NiceMock<MockWebRTCPeerConnectionHandlerClient>()); @@ -516,7 +515,7 @@ TEST_F(RTCPeerConnectionHandlerTest, Destruct) { EXPECT_CALL(*mock_tracker_.get(), UnregisterPeerConnection(pc_handler_.get())) .Times(1); - pc_handler_.reset(NULL); + pc_handler_.reset(nullptr); } TEST_F(RTCPeerConnectionHandlerTest, NoCallbacksToClientAfterStop) { @@ -572,9 +571,9 @@ // TODO(perkj): Can blink::WebRTCSessionDescriptionRequest be changed so // the |reqest| requestSucceeded can be tested? Currently the |request| object // can not be initialized from a unit test. - EXPECT_FALSE(mock_peer_connection_->created_session_description() != NULL); + EXPECT_FALSE(mock_peer_connection_->created_session_description() != nullptr); pc_handler_->CreateOffer(request, options); - EXPECT_TRUE(mock_peer_connection_->created_session_description() != NULL); + EXPECT_TRUE(mock_peer_connection_->created_session_description() != nullptr); } TEST_F(RTCPeerConnectionHandlerTest, CreateAnswer) { @@ -584,9 +583,9 @@ // TODO(perkj): Can blink::WebRTCSessionDescriptionRequest be changed so // the |reqest| requestSucceeded can be tested? Currently the |request| object // can not be initialized from a unit test. - EXPECT_FALSE(mock_peer_connection_->created_session_description() != NULL); + EXPECT_FALSE(mock_peer_connection_->created_session_description() != nullptr); pc_handler_->CreateAnswer(request, options); - EXPECT_TRUE(mock_peer_connection_->created_session_description() != NULL); + EXPECT_TRUE(mock_peer_connection_->created_session_description() != nullptr); } TEST_F(RTCPeerConnectionHandlerTest, setLocalDescription) { @@ -608,7 +607,7 @@ EXPECT_EQ(description.Sdp(), pc_handler_->LocalDescription().Sdp()); std::string sdp_string; - ASSERT_TRUE(mock_peer_connection_->local_description() != NULL); + ASSERT_TRUE(mock_peer_connection_->local_description() != nullptr); EXPECT_EQ(kDummySdpType, mock_peer_connection_->local_description()->type()); mock_peer_connection_->local_description()->ToString(&sdp_string); EXPECT_EQ(kDummySdp, sdp_string); @@ -664,7 +663,7 @@ EXPECT_EQ(description.Sdp(), pc_handler_->RemoteDescription().Sdp()); std::string sdp_string; - ASSERT_TRUE(mock_peer_connection_->remote_description() != NULL); + ASSERT_TRUE(mock_peer_connection_->remote_description() != nullptr); EXPECT_EQ(kDummySdpType, mock_peer_connection_->remote_description()->type()); mock_peer_connection_->remote_description()->ToString(&sdp_string); EXPECT_EQ(kDummySdp, sdp_string); @@ -1481,7 +1480,7 @@ PeerConnectionTracker::SOURCE_LOCAL)); std::unique_ptr<blink::WebRTCDataChannelHandler> channel( pc_handler_->CreateDataChannel("d1", blink::WebRTCDataChannelInit())); - EXPECT_TRUE(channel.get() != NULL); + EXPECT_TRUE(channel.get() != nullptr); EXPECT_EQ(label, channel->Label()); channel->SetClient(nullptr); }
diff --git a/content/renderer/media/track_audio_renderer.cc b/content/renderer/media/track_audio_renderer.cc index ba9b28d..cdb4d1ad 100644 --- a/content/renderer/media/track_audio_renderer.cc +++ b/content/renderer/media/track_audio_renderer.cc
@@ -171,7 +171,7 @@ // when the |sink_| is never started. if (sink_) { sink_->Stop(); - sink_ = NULL; + sink_ = nullptr; } if (!sink_started_ && IsLocalRenderer()) {
diff --git a/content/renderer/media/video_track_to_pepper_adapter.cc b/content/renderer/media/video_track_to_pepper_adapter.cc index e1b33fe..92aafa28 100644 --- a/content/renderer/media/video_track_to_pepper_adapter.cc +++ b/content/renderer/media/video_track_to_pepper_adapter.cc
@@ -28,10 +28,7 @@ class PpFrameReceiver : public MediaStreamVideoSink { public: PpFrameReceiver(blink::WebMediaStreamTrack track) - : track_(track), - reader_(NULL), - weak_factory_(this) { - } + : track_(track), reader_(nullptr), weak_factory_(this) {} ~PpFrameReceiver() override {} @@ -137,7 +134,7 @@ } VideoTrackToPepperAdapter::SourceInfo::~SourceInfo() { - receiver_->SetReader(NULL); + receiver_->SetReader(nullptr); } } // namespace content
diff --git a/content/renderer/media/video_track_to_pepper_adapter_unittest.cc b/content/renderer/media/video_track_to_pepper_adapter_unittest.cc index 42dc580..c9e914b 100644 --- a/content/renderer/media/video_track_to_pepper_adapter_unittest.cc +++ b/content/renderer/media/video_track_to_pepper_adapter_unittest.cc
@@ -65,7 +65,7 @@ EXPECT_CALL(*this, GotFrame(captured_frame)); DeliverFrameForTesting(captured_frame); - EXPECT_FALSE(handler_->Close(NULL)); + EXPECT_FALSE(handler_->Close(nullptr)); EXPECT_TRUE(handler_->Close(this)); }
diff --git a/content/renderer/media/webrtc/media_stream_track_metrics_unittest.cc b/content/renderer/media/webrtc/media_stream_track_metrics_unittest.cc index 83a2d22..b93fab8 100644 --- a/content/renderer/media/webrtc/media_stream_track_metrics_unittest.cc +++ b/content/renderer/media/webrtc/media_stream_track_metrics_unittest.cc
@@ -99,7 +99,7 @@ void TearDown() override { signaling_thread_.Stop(); metrics_.reset(); - stream_ = NULL; + stream_ = nullptr; } // Adds an audio track to |stream_| on the signaling thread to simulate how
diff --git a/content/renderer/media/webrtc/media_stream_video_webrtc_sink.cc b/content/renderer/media/webrtc/media_stream_video_webrtc_sink.cc index 53bcefb..4af35d7 100644 --- a/content/renderer/media/webrtc/media_stream_video_webrtc_sink.cc +++ b/content/renderer/media/webrtc/media_stream_video_webrtc_sink.cc
@@ -213,8 +213,8 @@ // thread, it should be released on the render thread. base::AutoLock auto_lock(capture_adapter_stop_lock_); // |video_source| owns |capture_adapter_|. - capture_adapter_ = NULL; - video_source_ = NULL; + capture_adapter_ = nullptr; + video_source_ = nullptr; } void MediaStreamVideoWebRtcSink::WebRtcVideoSourceAdapter::SetContentHint(
diff --git a/content/renderer/media/webrtc/mock_peer_connection_dependency_factory.cc b/content/renderer/media/webrtc/mock_peer_connection_dependency_factory.cc index f885ad6..9e72131 100644 --- a/content/renderer/media/webrtc/mock_peer_connection_dependency_factory.cc +++ b/content/renderer/media/webrtc/mock_peer_connection_dependency_factory.cc
@@ -89,13 +89,13 @@ rtc::scoped_refptr<AudioTrackInterface> MockMediaStream::FindAudioTrack( const std::string& track_id) { AudioTrackVector::iterator it = FindTrack(&audio_track_vector_, track_id); - return it == audio_track_vector_.end() ? NULL : *it; + return it == audio_track_vector_.end() ? nullptr : *it; } rtc::scoped_refptr<VideoTrackInterface> MockMediaStream::FindVideoTrack( const std::string& track_id) { VideoTrackVector::iterator it = FindTrack(&video_track_vector_, track_id); - return it == video_track_vector_.end() ? NULL : *it; + return it == video_track_vector_.end() ? nullptr : *it; } void MockMediaStream::RegisterObserver(ObserverInterface* observer) { @@ -180,7 +180,7 @@ source_(source), enabled_(true), state_(webrtc::MediaStreamTrackInterface::kLive), - sink_(NULL) {} + sink_(nullptr) {} MockWebRtcVideoTrack::~MockWebRtcVideoTrack() {} @@ -199,7 +199,7 @@ void MockWebRtcVideoTrack::RemoveSink( rtc::VideoSinkInterface<webrtc::VideoFrame>* sink) { DCHECK(sink_ == sink); - sink_ = NULL; + sink_ = nullptr; } VideoTrackSourceInterface* MockWebRtcVideoTrack::GetSource() const { @@ -250,11 +250,11 @@ ~MockSessionDescription() override {} cricket::SessionDescription* description() override { NOTIMPLEMENTED(); - return NULL; + return nullptr; } const cricket::SessionDescription* description() const override { NOTIMPLEMENTED(); - return NULL; + return nullptr; } std::string session_id() const override { NOTIMPLEMENTED(); @@ -276,7 +276,7 @@ const IceCandidateCollection* candidates( size_t mediasection_index) const override { NOTIMPLEMENTED(); - return NULL; + return nullptr; } bool ToString(std::string* out) const override { @@ -317,7 +317,7 @@ }; MockPeerConnectionDependencyFactory::MockPeerConnectionDependencyFactory() - : PeerConnectionDependencyFactory(NULL), + : PeerConnectionDependencyFactory(nullptr), signaling_thread_("MockPCFactory WebRtc Signaling Thread") { EnsureWebRtcAudioDeviceImpl(); CHECK(signaling_thread_.Start());
diff --git a/content/renderer/media/webrtc/peer_connection_dependency_factory.cc b/content/renderer/media/webrtc/peer_connection_dependency_factory.cc index d7f57d9a..a2891119 100644 --- a/content/renderer/media/webrtc/peer_connection_dependency_factory.cc +++ b/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
@@ -103,10 +103,10 @@ PeerConnectionDependencyFactory::PeerConnectionDependencyFactory( P2PSocketDispatcher* p2p_socket_dispatcher) - : network_manager_(NULL), + : network_manager_(nullptr), p2p_socket_dispatcher_(p2p_socket_dispatcher), - signaling_thread_(NULL), - worker_thread_(NULL), + signaling_thread_(nullptr), + worker_thread_(nullptr), chrome_signaling_thread_("Chrome_libJingle_Signaling"), chrome_worker_thread_("Chrome_libJingle_WorkerThread") { TryScheduleStunProbeTrial(); @@ -273,7 +273,7 @@ } bool PeerConnectionDependencyFactory::PeerConnectionFactoryCreated() { - return pc_factory_.get() != NULL; + return pc_factory_.get() != nullptr; } scoped_refptr<webrtc::PeerConnectionInterface> @@ -284,7 +284,7 @@ CHECK(web_frame); CHECK(observer); if (!GetPcFactory().get()) - return NULL; + return nullptr; // Copy the flag from Preference associated with this WebLocalFrame. P2PPortAllocator::Config port_config; @@ -513,12 +513,12 @@ void PeerConnectionDependencyFactory::DeleteIpcNetworkManager() { DCHECK(chrome_worker_thread_.task_runner()->BelongsToCurrentThread()); delete network_manager_; - network_manager_ = NULL; + network_manager_ = nullptr; } void PeerConnectionDependencyFactory::CleanupPeerConnectionFactory() { DVLOG(1) << "PeerConnectionDependencyFactory::CleanupPeerConnectionFactory()"; - pc_factory_ = NULL; + pc_factory_ = nullptr; if (network_manager_) { // The network manager needs to free its resources on the thread they were // created, which is the worked thread.
diff --git a/content/renderer/media/webrtc/peer_connection_dependency_factory_unittest.cc b/content/renderer/media/webrtc/peer_connection_dependency_factory_unittest.cc index 1747aec..fa23cf1 100644 --- a/content/renderer/media/webrtc/peer_connection_dependency_factory_unittest.cc +++ b/content/renderer/media/webrtc/peer_connection_dependency_factory_unittest.cc
@@ -25,7 +25,7 @@ MockWebRTCPeerConnectionHandlerClient client_jsep; std::unique_ptr<blink::WebRTCPeerConnectionHandler> pc_handler( dependency_factory_->CreateRTCPeerConnectionHandler(&client_jsep)); - EXPECT_TRUE(pc_handler.get() != NULL); + EXPECT_TRUE(pc_handler.get() != nullptr); } } // namespace content
diff --git a/content/renderer/media/webrtc/webrtc_video_capturer_adapter.cc b/content/renderer/media/webrtc/webrtc_video_capturer_adapter.cc index badad28f..05668d5 100644 --- a/content/renderer/media/webrtc/webrtc_video_capturer_adapter.cc +++ b/content/renderer/media/webrtc/webrtc_video_capturer_adapter.cc
@@ -290,7 +290,7 @@ DVLOG(3) << __func__; DCHECK(running_); running_ = false; - SetCaptureFormat(NULL); + SetCaptureFormat(nullptr); SignalStateChange(this, cricket::CS_STOPPED); }
diff --git a/content/renderer/media/webrtc_audio_device_impl.cc b/content/renderer/media/webrtc_audio_device_impl.cc index 05e1061..faad272 100644 --- a/content/renderer/media/webrtc_audio_device_impl.cc +++ b/content/renderer/media/webrtc_audio_device_impl.cc
@@ -24,7 +24,7 @@ namespace content { WebRtcAudioDeviceImpl::WebRtcAudioDeviceImpl() - : audio_transport_callback_(NULL), + : audio_transport_callback_(nullptr), output_delay_ms_(0), initialized_(false), playing_(false), @@ -115,7 +115,7 @@ (*it)->OnPlayoutDataSourceChanged(); } - renderer_ = NULL; + renderer_ = nullptr; } void WebRtcAudioDeviceImpl::AudioRendererThreadStopped() { @@ -133,7 +133,7 @@ DVLOG(1) << "WebRtcAudioDeviceImpl::RegisterAudioCallback()"; DCHECK(signaling_thread_checker_.CalledOnValidThread()); base::AutoLock lock(lock_); - DCHECK_EQ(audio_transport_callback_ == NULL, audio_callback != NULL); + DCHECK_EQ(audio_transport_callback_ == nullptr, audio_callback != nullptr); audio_transport_callback_ = audio_callback; return 0; }
diff --git a/content/renderer/media/webrtc_audio_renderer.cc b/content/renderer/media/webrtc_audio_renderer.cc index b269e1d..1951725 100644 --- a/content/renderer/media/webrtc_audio_renderer.cc +++ b/content/renderer/media/webrtc_audio_renderer.cc
@@ -173,7 +173,7 @@ session_id_(session_id), signaling_thread_(signaling_thread), media_stream_(media_stream), - source_(NULL), + source_(nullptr), play_ref_count_(0), start_ref_count_(0), sink_params_(kFormat, kChannelLayout, 0, kBitsPerSample, 0), @@ -324,7 +324,7 @@ DVLOG(1) << "Calling RemoveAudioRenderer and Stop()."; source_->RemoveAudioRenderer(this); - source_ = NULL; + source_ = nullptr; state_ = UNINITIALIZED; }
diff --git a/content/renderer/media/webrtc_logging.cc b/content/renderer/media/webrtc_logging.cc index 572c3a05..c2e9057 100644 --- a/content/renderer/media/webrtc_logging.cc +++ b/content/renderer/media/webrtc_logging.cc
@@ -11,7 +11,7 @@ namespace content { // Shall only be set once and never go back to NULL. -WebRtcLogMessageDelegate* g_webrtc_logging_delegate = NULL; +WebRtcLogMessageDelegate* g_webrtc_logging_delegate = nullptr; void InitWebRtcLoggingDelegate(WebRtcLogMessageDelegate* delegate) { CHECK(!g_webrtc_logging_delegate);
diff --git a/content/renderer/media_recorder/vpx_encoder.cc b/content/renderer/media_recorder/vpx_encoder.cc index 6a5db03..dcfcc05 100644 --- a/content/renderer/media_recorder/vpx_encoder.cc +++ b/content/renderer/media_recorder/vpx_encoder.cc
@@ -174,9 +174,9 @@ << " -" << vpx_codec_error_detail(encoder); *keyframe = false; - vpx_codec_iter_t iter = NULL; - const vpx_codec_cx_pkt_t* pkt = NULL; - while ((pkt = vpx_codec_get_cx_data(encoder, &iter)) != NULL) { + vpx_codec_iter_t iter = nullptr; + const vpx_codec_cx_pkt_t* pkt = nullptr; + while ((pkt = vpx_codec_get_cx_data(encoder, &iter)) != nullptr) { if (pkt->kind != VPX_CODEC_CX_FRAME_PKT) continue; output_data->assign(static_cast<char*>(pkt->data.frame.buf),
diff --git a/content/renderer/mouse_lock_dispatcher.cc b/content/renderer/mouse_lock_dispatcher.cc index 5b42b6e..eba09d86 100644 --- a/content/renderer/mouse_lock_dispatcher.cc +++ b/content/renderer/mouse_lock_dispatcher.cc
@@ -9,11 +9,11 @@ namespace content { -MouseLockDispatcher::MouseLockDispatcher() : mouse_locked_(false), - pending_lock_request_(false), - pending_unlock_request_(false), - target_(NULL) { -} +MouseLockDispatcher::MouseLockDispatcher() + : mouse_locked_(false), + pending_lock_request_(false), + pending_unlock_request_(false), + target_(nullptr) {} MouseLockDispatcher::~MouseLockDispatcher() { } @@ -40,7 +40,7 @@ void MouseLockDispatcher::OnLockTargetDestroyed(LockTarget* target) { if (target == target_) { UnlockMouse(target); - target_ = NULL; + target_ = nullptr; } } @@ -69,7 +69,7 @@ LockTarget* last_target = target_; if (!succeeded) - target_ = NULL; + target_ = nullptr; // Callbacks made after all state modification to prevent reentrant errors // such as OnLockMouseACK() synchronously calling LockMouse(). @@ -85,7 +85,7 @@ pending_unlock_request_ = false; LockTarget* last_target = target_; - target_ = NULL; + target_ = nullptr; // Callbacks made after all state modification to prevent reentrant errors // such as OnMouseLockLost() synchronously calling LockMouse().
diff --git a/content/renderer/mouse_lock_dispatcher_browsertest.cc b/content/renderer/mouse_lock_dispatcher_browsertest.cc index 3096394..e2ad5ca 100644 --- a/content/renderer/mouse_lock_dispatcher_browsertest.cc +++ b/content/renderer/mouse_lock_dispatcher_browsertest.cc
@@ -83,7 +83,7 @@ EXPECT_CALL(*target_, OnLockMouseACK(false)); // Start unlocked. - EXPECT_FALSE(dispatcher()->IsMouseLockedTo(NULL)); + EXPECT_FALSE(dispatcher()->IsMouseLockedTo(nullptr)); EXPECT_FALSE(dispatcher()->IsMouseLockedTo(target_)); // Lock. @@ -121,7 +121,7 @@ // Don't receive mouse events or lock lost. dispatcher()->OnLockTargetDestroyed(target_); delete target_; - target_ = NULL; + target_ = nullptr; dispatcher()->WillHandleMouseEvent(blink::WebMouseEvent()); widget()->OnMessageReceived(ViewMsg_MouseLockLost(route_id_)); EXPECT_FALSE(dispatcher()->IsMouseLockedTo(target_)); @@ -139,7 +139,7 @@ // Before receiving response delete the target. dispatcher()->OnLockTargetDestroyed(target_); delete target_; - target_ = NULL; + target_ = nullptr; // Lock response. widget()->OnMessageReceived(ViewMsg_LockMouse_ACK(route_id_, true)); @@ -157,7 +157,7 @@ // Before receiving response delete the target. dispatcher()->OnLockTargetDestroyed(target_); delete target_; - target_ = NULL; + target_ = nullptr; // Lock response. widget()->OnMessageReceived(ViewMsg_LockMouse_ACK(route_id_, false));
diff --git a/content/renderer/p2p/ipc_socket_factory.cc b/content/renderer/p2p/ipc_socket_factory.cc index 4ab9bd3..186ae42 100644 --- a/content/renderer/p2p/ipc_socket_factory.cc +++ b/content/renderer/p2p/ipc_socket_factory.cc
@@ -768,7 +768,7 @@ int opts) { // TODO(sergeyu): Implement SSL support. if (opts & rtc::PacketSocketFactory::OPT_SSLTCP) - return NULL; + return nullptr; P2PSocketType type = (opts & rtc::PacketSocketFactory::OPT_STUN) ? P2P_SOCKET_STUN_TCP_SERVER : P2P_SOCKET_TCP_SERVER; @@ -777,7 +777,7 @@ std::unique_ptr<IpcPacketSocket> socket(new IpcPacketSocket()); if (!socket->Init(type, socket_client, local_address, min_port, max_port, rtc::SocketAddress())) { - return NULL; + return nullptr; } return socket.release(); } @@ -802,7 +802,7 @@ new P2PSocketClientImpl(socket_dispatcher_); std::unique_ptr<IpcPacketSocket> socket(new IpcPacketSocket()); if (!socket->Init(type, socket_client, local_address, 0, 0, remote_address)) - return NULL; + return nullptr; return socket.release(); }
diff --git a/content/renderer/p2p/socket_client_impl.cc b/content/renderer/p2p/socket_client_impl.cc index 6aeeac24..8ad4afe 100644 --- a/content/renderer/p2p/socket_client_impl.cc +++ b/content/renderer/p2p/socket_client_impl.cc
@@ -33,7 +33,7 @@ ipc_task_runner_(dispatcher->task_runner()), delegate_task_runner_(base::ThreadTaskRunnerHandle::Get()), socket_id_(0), - delegate_(NULL), + delegate_(nullptr), state_(STATE_UNINITIALIZED), random_socket_id_(0), next_packet_id_(0) { @@ -122,7 +122,7 @@ void P2PSocketClientImpl::Close() { DCHECK(delegate_task_runner_->BelongsToCurrentThread()); - delegate_ = NULL; + delegate_ = nullptr; ipc_task_runner_->PostTask( FROM_HERE, base::BindOnce(&P2PSocketClientImpl::DoClose, this)); @@ -252,7 +252,7 @@ void P2PSocketClientImpl::Detach() { DCHECK(ipc_task_runner_->BelongsToCurrentThread()); - dispatcher_ = NULL; + dispatcher_ = nullptr; OnError(); }
diff --git a/content/renderer/p2p/socket_dispatcher.cc b/content/renderer/p2p/socket_dispatcher.cc index 27079ac..7459bef4 100644 --- a/content/renderer/p2p/socket_dispatcher.cc +++ b/content/renderer/p2p/socket_dispatcher.cc
@@ -22,8 +22,7 @@ network_notifications_started_(false), network_list_observers_( new base::ObserverListThreadSafe<NetworkListObserver>()), - sender_(NULL) { -} + sender_(nullptr) {} P2PSocketDispatcher::~P2PSocketDispatcher() { network_list_observers_->AssertEmpty(); @@ -77,7 +76,7 @@ } void P2PSocketDispatcher::OnFilterRemoved() { - sender_ = NULL; + sender_ = nullptr; } void P2PSocketDispatcher::OnChannelConnected(int32_t peer_id) { @@ -85,7 +84,7 @@ } void P2PSocketDispatcher::OnChannelClosing() { - sender_ = NULL; + sender_ = nullptr; connected_ = false; } @@ -190,12 +189,12 @@ P2PSocketClientImpl* P2PSocketDispatcher::GetClient(int socket_id) { P2PSocketClientImpl* client = clients_.Lookup(socket_id); - if (client == NULL) { + if (client == nullptr) { // This may happen if the socket was closed, but the browser side // hasn't processed the close message by the time it sends the // message to the renderer. DVLOG(1) << "Received P2P message for socket that doesn't exist."; - return NULL; + return nullptr; } return client;
diff --git a/content/renderer/pepper/content_decryptor_delegate.cc b/content/renderer/pepper/content_decryptor_delegate.cc index 91a34a1..c2bb46b 100644 --- a/content/renderer/pepper/content_decryptor_delegate.cc +++ b/content/renderer/pepper/content_decryptor_delegate.cc
@@ -66,7 +66,7 @@ DCHECK(resource); if (data.empty()) { - resource = NULL; + resource = nullptr; return true; } @@ -592,14 +592,14 @@ // Release the shared memory as it can still be in use by the plugin. // The next Decrypt() call will need to allocate a new shared memory // buffer. - audio_input_resource_ = NULL; + audio_input_resource_ = nullptr; decrypt_cb = audio_decrypt_cb_.ResetAndReturn(); break; case Decryptor::kVideo: // Release the shared memory as it can still be in use by the plugin. // The next Decrypt() call will need to allocate a new shared memory // buffer. - video_input_resource_ = NULL; + video_input_resource_ = nullptr; decrypt_cb = video_decrypt_cb_.ResetAndReturn(); break; default: @@ -608,7 +608,7 @@ } if (!decrypt_cb.is_null()) - decrypt_cb.Run(Decryptor::kSuccess, NULL); + decrypt_cb.Run(Decryptor::kSuccess, nullptr); return true; } @@ -946,19 +946,19 @@ Decryptor::Status status = PpDecryptResultToMediaDecryptorStatus(block_info->result); if (status != Decryptor::kSuccess) { - decrypt_cb.Run(status, NULL); + decrypt_cb.Run(status, nullptr); return; } EnterResourceNoLock<PPB_Buffer_API> enter(decrypted_block, true); if (!enter.succeeded()) { - decrypt_cb.Run(Decryptor::kError, NULL); + decrypt_cb.Run(Decryptor::kError, nullptr); return; } BufferAutoMapper mapper(enter.object()); if (!mapper.data() || !mapper.size() || mapper.size() < block_info->data_size) { - decrypt_cb.Run(Decryptor::kError, NULL); + decrypt_cb.Run(Decryptor::kError, nullptr); return; } @@ -988,16 +988,16 @@ scoped_refptr<PPB_Buffer_Impl>* ppb_buffer) { EnterResourceNoLock<PPB_Buffer_API> enter(resource, true); if (!enter.succeeded()) - return NULL; + return nullptr; uint8_t* mapped_data = static_cast<uint8_t*>(enter.object()->Map()); if (!enter.object()->IsMapped() || !mapped_data) - return NULL; + return nullptr; uint32_t mapped_size = 0; if (!enter.object()->Describe(&mapped_size) || !mapped_size) { enter.object()->Unmap(); - return NULL; + return nullptr; } *ppb_buffer = static_cast<PPB_Buffer_Impl*>(enter.object()); @@ -1029,7 +1029,7 @@ PpDecryptResultToMediaDecryptorStatus(frame_info->result); if (status != Decryptor::kSuccess) { DCHECK(!frame_info->tracking_info.buffer_id); - video_decode_cb.Run(status, NULL); + video_decode_cb.Run(status, nullptr); return; } @@ -1037,7 +1037,7 @@ uint8_t* frame_data = GetMappedBuffer(decrypted_frame, &ppb_buffer); if (!frame_data) { FreeBuffer(frame_info->tracking_info.buffer_id); - video_decode_cb.Run(Decryptor::kError, NULL); + video_decode_cb.Run(Decryptor::kError, nullptr); return; } @@ -1047,7 +1047,7 @@ PpDecryptedFrameFormatToMediaVideoFormat(frame_info->format); if (video_pixel_format == media::PIXEL_FORMAT_UNKNOWN) { FreeBuffer(frame_info->tracking_info.buffer_id); - video_decode_cb.Run(Decryptor::kError, NULL); + video_decode_cb.Run(Decryptor::kError, nullptr); return; } @@ -1064,7 +1064,7 @@ frame_info->tracking_info.timestamp)); if (!decoded_frame) { FreeBuffer(frame_info->tracking_info.buffer_id); - video_decode_cb.Run(Decryptor::kError, NULL); + video_decode_cb.Run(Decryptor::kError, nullptr); return; } decoded_frame->AddDestructionObserver( @@ -1128,7 +1128,7 @@ // Release the shared memory as it can still be in use by the plugin. // The next DecryptAndDecode() call will need to allocate a new shared // memory buffer. - audio_input_resource_ = NULL; + audio_input_resource_ = nullptr; if (!audio_decode_cb_.is_null()) audio_decode_cb_.ResetAndReturn().Run(Decryptor::kSuccess, Decryptor::AudioFrames()); @@ -1137,9 +1137,9 @@ // Release the shared memory as it can still be in use by the plugin. // The next DecryptAndDecode() call will need to allocate a new shared // memory buffer. - video_input_resource_ = NULL; + video_input_resource_ = nullptr; if (!video_decode_cb_.is_null()) - video_decode_cb_.ResetAndReturn().Run(Decryptor::kSuccess, NULL); + video_decode_cb_.ResetAndReturn().Run(Decryptor::kSuccess, nullptr); break; default: NOTREACHED(); @@ -1154,7 +1154,7 @@ // End of stream buffers are represented as null resources. if (buffer->end_of_stream()) { - *resource = NULL; + *resource = nullptr; return true; } @@ -1191,7 +1191,7 @@ BufferAutoMapper mapper(media_resource.get()); if (!mapper.data() || mapper.size() < data_size) { - media_resource = NULL; + media_resource = nullptr; return false; } memcpy(mapper.data(), buffer->data(), data_size); @@ -1294,14 +1294,14 @@ if (!video_decoder_init_cb_.is_null()) video_decoder_init_cb_.ResetAndReturn().Run(false); - audio_input_resource_ = NULL; - video_input_resource_ = NULL; + audio_input_resource_ = nullptr; + video_input_resource_ = nullptr; if (!audio_decrypt_cb_.is_null()) - audio_decrypt_cb_.ResetAndReturn().Run(media::Decryptor::kError, NULL); + audio_decrypt_cb_.ResetAndReturn().Run(media::Decryptor::kError, nullptr); if (!video_decrypt_cb_.is_null()) - video_decrypt_cb_.ResetAndReturn().Run(media::Decryptor::kError, NULL); + video_decrypt_cb_.ResetAndReturn().Run(media::Decryptor::kError, nullptr); if (!audio_decode_cb_.is_null()) { const media::Decryptor::AudioFrames empty_frames; @@ -1310,7 +1310,7 @@ } if (!video_decode_cb_.is_null()) - video_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, NULL); + video_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, nullptr); cdm_promise_adapter_.Clear();
diff --git a/content/renderer/pepper/event_conversion.cc b/content/renderer/pepper/event_conversion.cc index a666241..0bb01694 100644 --- a/content/renderer/pepper/event_conversion.cc +++ b/content/renderer/pepper/event_conversion.cc
@@ -612,7 +612,7 @@ std::unique_ptr<WebInputEvent> web_input_event; switch (event.event_type) { case PP_INPUTEVENT_TYPE_UNDEFINED: - return NULL; + return nullptr; case PP_INPUTEVENT_TYPE_MOUSEDOWN: case PP_INPUTEVENT_TYPE_MOUSEUP: case PP_INPUTEVENT_TYPE_MOUSEMOVE:
diff --git a/content/renderer/pepper/host_array_buffer_var.cc b/content/renderer/pepper/host_array_buffer_var.cc index e1ac407..84cb02ae 100644 --- a/content/renderer/pepper/host_array_buffer_var.cc +++ b/content/renderer/pepper/host_array_buffer_var.cc
@@ -46,7 +46,7 @@ void* HostArrayBufferVar::Map() { if (!valid_) - return NULL; + return nullptr; return buffer_.Data(); }
diff --git a/content/renderer/pepper/host_globals.cc b/content/renderer/pepper/host_globals.cc index 4dd5b74..057ef4f 100644 --- a/content/renderer/pepper/host_globals.cc +++ b/content/renderer/pepper/host_globals.cc
@@ -81,7 +81,7 @@ } // namespace -HostGlobals* HostGlobals::host_globals_ = NULL; +HostGlobals* HostGlobals::host_globals_ = nullptr; HostGlobals::HostGlobals() : ppapi::PpapiGlobals(), @@ -95,7 +95,7 @@ HostGlobals::~HostGlobals() { DCHECK(host_globals_ == this || !host_globals_); - host_globals_ = NULL; + host_globals_ = nullptr; } ppapi::ResourceTracker* HostGlobals::GetResourceTracker() { @@ -108,7 +108,7 @@ PP_Instance instance) { InstanceMap::iterator found = instance_map_.find(instance); if (found == instance_map_.end()) - return NULL; + return nullptr; return found->second->module()->GetCallbackTracker().get(); } @@ -122,7 +122,7 @@ PP_Instance pp_instance) { PepperPluginInstanceImpl* instance = GetInstance(pp_instance); if (!instance) - return NULL; + return nullptr; return &instance->resource_creation(); } @@ -193,7 +193,9 @@ return RenderThreadImpl::current()->GetFileThreadTaskRunner().get(); } -ppapi::MessageLoopShared* HostGlobals::GetCurrentMessageLoop() { return NULL; } +ppapi::MessageLoopShared* HostGlobals::GetCurrentMessageLoop() { + return nullptr; +} PP_Module HostGlobals::AddModule(PluginModule* module) { #ifndef NDEBUG @@ -230,7 +232,7 @@ << module << " is not a PP_Module."; ModuleMap::iterator found = module_map_.find(module); if (found == module_map_.end()) - return NULL; + return nullptr; return found->second; } @@ -271,7 +273,7 @@ << instance << " is not a PP_Instance."; InstanceMap::iterator found = instance_map_.find(instance); if (found == instance_map_.end()) - return NULL; + return nullptr; return found->second; }
diff --git a/content/renderer/pepper/host_var_tracker_unittest.cc b/content/renderer/pepper/host_var_tracker_unittest.cc index 75d0f26..2c28216 100644 --- a/content/renderer/pepper/host_var_tracker_unittest.cc +++ b/content/renderer/pepper/host_var_tracker_unittest.cc
@@ -86,7 +86,7 @@ // Make a second instance (the test harness already creates & manages one). scoped_refptr<PepperPluginInstanceImpl> instance2( - PepperPluginInstanceImpl::Create(NULL, module(), NULL, GURL())); + PepperPluginInstanceImpl::Create(nullptr, module(), nullptr, GURL())); PP_Instance pp_instance2 = instance2->pp_instance(); { @@ -102,7 +102,7 @@ } // Free the instance, this should release the ObjectVar. - instance2 = NULL; + instance2 = nullptr; EXPECT_EQ(0, tracker().GetLiveV8ObjectVarsForTest(pp_instance2)); }
diff --git a/content/renderer/pepper/message_channel.cc b/content/renderer/pepper/message_channel.cc index c109a31..4a9f3a0 100644 --- a/content/renderer/pepper/message_channel.cc +++ b/content/renderer/pepper/message_channel.cc
@@ -98,7 +98,7 @@ void MessageChannel::InstanceDeleted() { UnregisterSyncMessageStatusObserver(); - instance_ = NULL; + instance_ = nullptr; } void MessageChannel::PostMessageToJavaScript(PP_Var message_data) {
diff --git a/content/renderer/pepper/mock_renderer_ppapi_host.cc b/content/renderer/pepper/mock_renderer_ppapi_host.cc index c5cebda..7820b7fe 100644 --- a/content/renderer/pepper/mock_renderer_ppapi_host.cc +++ b/content/renderer/pepper/mock_renderer_ppapi_host.cc
@@ -41,20 +41,20 @@ PP_Instance instance) const { if (instance == pp_instance_) return render_frame_; - return NULL; + return nullptr; } RenderView* MockRendererPpapiHost::GetRenderViewForInstance( PP_Instance instance) const { if (instance == pp_instance_) return render_view_; - return NULL; + return nullptr; } blink::WebPluginContainer* MockRendererPpapiHost::GetContainerForInstance( PP_Instance instance) const { NOTIMPLEMENTED(); - return NULL; + return nullptr; } base::ProcessId MockRendererPpapiHost::GetPluginPID() const {
diff --git a/content/renderer/pepper/pepper_audio_input_host.cc b/content/renderer/pepper/pepper_audio_input_host.cc index 579de161..f25c532d 100644 --- a/content/renderer/pepper/pepper_audio_input_host.cc +++ b/content/renderer/pepper/pepper_audio_input_host.cc
@@ -34,7 +34,7 @@ PP_Resource resource) : ResourceHost(host->GetPpapiHost(), instance, resource), renderer_ppapi_host_(host), - audio_input_(NULL), + audio_input_(nullptr), enumeration_helper_(this, PepperMediaDeviceManager::GetForRenderFrame( host->GetRenderFrameForInstance(pp_instance())), @@ -183,7 +183,7 @@ return; audio_input_->ShutDown(); - audio_input_ = NULL; + audio_input_ = nullptr; if (open_context_.is_valid()) SendOpenReply(PP_ERROR_ABORTED);
diff --git a/content/renderer/pepper/pepper_audio_output_host.cc b/content/renderer/pepper/pepper_audio_output_host.cc index 59674b7..fdde5d0 100644 --- a/content/renderer/pepper/pepper_audio_output_host.cc +++ b/content/renderer/pepper/pepper_audio_output_host.cc
@@ -36,7 +36,7 @@ PP_Resource resource) : ResourceHost(host->GetPpapiHost(), instance, resource), renderer_ppapi_host_(host), - audio_output_(NULL), + audio_output_(nullptr), playback_throttled_(false), enumeration_helper_(this, PepperMediaDeviceManager::GetForRenderFrame( @@ -224,7 +224,7 @@ return; audio_output_->ShutDown(); - audio_output_ = NULL; + audio_output_ = nullptr; if (open_context_.is_valid()) SendOpenReply(PP_ERROR_ABORTED);
diff --git a/content/renderer/pepper/pepper_broker.cc b/content/renderer/pepper/pepper_broker.cc index e201224a..1f5cd9f 100644 --- a/content/renderer/pepper/pepper_broker.cc +++ b/content/renderer/pepper/pepper_broker.cc
@@ -110,8 +110,8 @@ PepperBroker::~PepperBroker() { ReportFailureToClients(PP_ERROR_ABORTED); - plugin_module_->SetBroker(NULL); - plugin_module_ = NULL; + plugin_module_->SetBroker(nullptr); + plugin_module_ = nullptr; } // If the channel is not ready, queue the connection.
diff --git a/content/renderer/pepper/pepper_compositor_host.cc b/content/renderer/pepper/pepper_compositor_host.cc index 79098c1..950a90ed 100644 --- a/content/renderer/pepper/pepper_compositor_host.cc +++ b/content/renderer/pepper/pepper_compositor_host.cc
@@ -149,12 +149,11 @@ PepperCompositorHost::LayerData::~LayerData() {} -PepperCompositorHost::PepperCompositorHost( - RendererPpapiHost* host, - PP_Instance instance, - PP_Resource resource) +PepperCompositorHost::PepperCompositorHost(RendererPpapiHost* host, + PP_Instance instance, + PP_Resource resource) : ResourceHost(host->GetPpapiHost(), instance, resource), - bound_instance_(NULL), + bound_instance_(nullptr), weak_factory_(this) { layer_ = cc::Layer::Create(); // TODO(penghuang): SetMasksToBounds() can be expensive if the layer is @@ -369,7 +368,7 @@ // plugin and keep current layers set by the previous CommitLayers() // unchanged. for (size_t i = 0; i < layers.size(); ++i) { - const ppapi::CompositorLayerData* old_layer = NULL; + const ppapi::CompositorLayerData* old_layer = nullptr; if (!reset && i < layers_.size()) old_layer = &layers_[i].pp_layer; int32_t rv = VerifyCommittedLayer(old_layer, &layers[i], &image_shms[i]); @@ -386,16 +385,16 @@ for (size_t i = 0; i < layers.size(); ++i) { const ppapi::CompositorLayerData* pp_layer = &layers[i]; - LayerData* data = i >= layers_.size() ? NULL : &layers_[i]; + LayerData* data = i >= layers_.size() ? nullptr : &layers_[i]; DCHECK(!data || data->cc_layer.get()); - scoped_refptr<cc::Layer> cc_layer = data ? data->cc_layer : NULL; - ppapi::CompositorLayerData* old_layer = data ? &data->pp_layer : NULL; + scoped_refptr<cc::Layer> cc_layer = data ? data->cc_layer : nullptr; + ppapi::CompositorLayerData* old_layer = data ? &data->pp_layer : nullptr; if (!cc_layer.get()) { if (pp_layer->color) cc_layer = cc::SolidColorLayer::Create(); else if (pp_layer->texture || pp_layer->image) - cc_layer = cc::TextureLayer::CreateForMailbox(NULL); + cc_layer = cc::TextureLayer::CreateForMailbox(nullptr); layer_->AddChild(cc_layer); }
diff --git a/content/renderer/pepper/pepper_device_enumeration_host_helper.cc b/content/renderer/pepper/pepper_device_enumeration_host_helper.cc index 7151e025..02a3158c 100644 --- a/content/renderer/pepper/pepper_device_enumeration_host_helper.cc +++ b/content/renderer/pepper/pepper_device_enumeration_host_helper.cc
@@ -193,7 +193,7 @@ int32_t PepperDeviceEnumerationHostHelper::OnStopMonitoringDeviceChange( HostMessageContext* /* context */) { - monitor_.reset(NULL); + monitor_.reset(nullptr); return PP_OK; } @@ -201,7 +201,7 @@ const std::vector<ppapi::DeviceRefData>& devices) { DCHECK(enumerate_devices_context_.is_valid()); - enumerate_.reset(NULL); + enumerate_.reset(nullptr); enumerate_devices_context_.params.set_result(PP_OK); resource_host_->host()->SendReply(
diff --git a/content/renderer/pepper/pepper_file_chooser_host.cc b/content/renderer/pepper/pepper_file_chooser_host.cc index 1ef25c28..c305400 100644 --- a/content/renderer/pepper/pepper_file_chooser_host.cc +++ b/content/renderer/pepper/pepper_file_chooser_host.cc
@@ -76,7 +76,7 @@ PP_Resource resource) : ResourceHost(host->GetPpapiHost(), instance, resource), renderer_ppapi_host_(host), - handler_(NULL), + handler_(nullptr), weak_factory_(this) {} PepperFileChooserHost::~PepperFileChooserHost() {} @@ -116,7 +116,7 @@ host()->SendReply(reply_context_, PpapiPluginMsg_FileChooser_ShowReply(chosen_files)); reply_context_ = ppapi::host::ReplyMessageContext(); - handler_ = NULL; // Handler deletes itself. + handler_ = nullptr; // Handler deletes itself. } } @@ -157,7 +157,7 @@ if (!render_frame || !render_frame->ScheduleFileChooser(params, handler_)) { delete handler_; - handler_ = NULL; + handler_ = nullptr; return PP_ERROR_NOACCESS; } @@ -188,7 +188,7 @@ host()->SendReply(reply_context_, PpapiPluginMsg_FileChooser_ShowReply(chosen_files)); reply_context_ = ppapi::host::ReplyMessageContext(); - handler_ = NULL; // Handler deletes itself. + handler_ = nullptr; // Handler deletes itself. } } // namespace content
diff --git a/content/renderer/pepper/pepper_graphics_2d_host.cc b/content/renderer/pepper/pepper_graphics_2d_host.cc index b5785dc7..2dcbd12 100644 --- a/content/renderer/pepper/pepper_graphics_2d_host.cc +++ b/content/renderer/pepper/pepper_graphics_2d_host.cc
@@ -170,7 +170,7 @@ PP_ToBool(is_always_opaque), backing_store)) { delete resource_host; - return NULL; + return nullptr; } return resource_host; } @@ -180,7 +180,7 @@ PP_Resource resource) : ResourceHost(host->GetPpapiHost(), instance, resource), renderer_ppapi_host_(host), - bound_instance_(NULL), + bound_instance_(nullptr), need_flush_ack_(false), offscreen_flush_pending_(false), is_always_opaque_(false), @@ -206,7 +206,7 @@ height, true) || !image_data_->Map()) { - image_data_ = NULL; + image_data_ = nullptr; return false; } is_always_opaque_ = is_always_opaque; @@ -406,9 +406,8 @@ QueuedOperation operation(QueuedOperation::PAINT); operation.paint_image = image_resource; - if (!ValidateAndConvertRect(src_rect_specified ? &src_rect : NULL, - image_resource->width(), - image_resource->height(), + if (!ValidateAndConvertRect(src_rect_specified ? &src_rect : nullptr, + image_resource->width(), image_resource->height(), &operation.paint_src_rect)) return PP_ERROR_BADARGUMENT; @@ -437,9 +436,8 @@ const PP_Rect& clip, const PP_Point& amount) { QueuedOperation operation(QueuedOperation::SCROLL); - if (!ValidateAndConvertRect(clip_specified ? &clip : NULL, - image_data_->width(), - image_data_->height(), + if (!ValidateAndConvertRect(clip_specified ? &clip : nullptr, + image_data_->width(), image_data_->height(), &operation.scroll_clip_rect)) return PP_ERROR_BADARGUMENT; @@ -490,7 +488,7 @@ PP_Resource old_image_data = 0; flush_reply_context_ = context->MakeReplyMessageContext(); if (is_running_in_process_) - return Flush(NULL); + return Flush(nullptr); // Reuse image data when running out of process. int32_t result = Flush(&old_image_data); @@ -622,9 +620,9 @@ // reference, if there are more than one ReplaceContents calls queued // the first |old_image_data| will get overwritten and leaked. So we // only supply this for the first call. - ExecuteReplaceContents(operation.replace_image.get(), - &op_rect, - done_replace_contents ? NULL : old_image_data); + ExecuteReplaceContents( + operation.replace_image.get(), &op_rect, + done_replace_contents ? nullptr : old_image_data); done_replace_contents = true; break; }
diff --git a/content/renderer/pepper/pepper_graphics_2d_host_unittest.cc b/content/renderer/pepper/pepper_graphics_2d_host_unittest.cc index 327645fc..5b24e209 100644 --- a/content/renderer/pepper/pepper_graphics_2d_host_unittest.cc +++ b/content/renderer/pepper/pepper_graphics_2d_host_unittest.cc
@@ -29,7 +29,7 @@ return PepperGraphics2DHost::ConvertToLogicalPixels(scale, op_rect, delta); } - PepperGraphics2DHostTest() : renderer_ppapi_host_(NULL, 12345) {} + PepperGraphics2DHostTest() : renderer_ppapi_host_(nullptr, 12345) {} ~PepperGraphics2DHostTest() override { ppapi::ProxyAutoLock proxy_lock; @@ -56,8 +56,8 @@ ppapi::HostResource image_data_resource; image_data_resource.SetHostResource(image_data->pp_instance(), image_data->pp_resource()); - host_->OnHostMsgPaintImageData( - NULL, image_data_resource, PP_Point(), false, PP_Rect()); + host_->OnHostMsgPaintImageData(nullptr, image_data_resource, PP_Point(), + false, PP_Rect()); } void Flush() { @@ -149,7 +149,7 @@ } // Reverse the scale and ensure all the original pixels are still inside // the result. - ConvertToLogicalPixels(1.0f / tests[i].scale, &r1, NULL); + ConvertToLogicalPixels(1.0f / tests[i].scale, &r1, nullptr); EXPECT_TRUE(r1.Contains(orig)); } }
diff --git a/content/renderer/pepper/pepper_in_process_router.cc b/content/renderer/pepper/pepper_in_process_router.cc index ca038bba..be02edb 100644 --- a/content/renderer/pepper/pepper_in_process_router.cc +++ b/content/renderer/pepper/pepper_in_process_router.cc
@@ -132,7 +132,7 @@ DCHECK(result) << "The message was not handled by the host."; pending_message_id_ = 0; - reply_deserializer_.reset(NULL); + reply_deserializer_.reset(nullptr); return reply_result_; }
diff --git a/content/renderer/pepper/pepper_platform_audio_input.cc b/content/renderer/pepper/pepper_platform_audio_input.cc index 8006c1a..07f44c0 100644 --- a/content/renderer/pepper/pepper_platform_audio_input.cc +++ b/content/renderer/pepper/pepper_platform_audio_input.cc
@@ -41,7 +41,7 @@ audio_input->AddRef(); return audio_input.get(); } - return NULL; + return nullptr; } void PepperPlatformAudioInput::StartCapture() { @@ -69,7 +69,7 @@ // Called on the main thread to stop all audio callbacks. We must only change // the client on the main thread, and the delegates from the I/O thread. - client_ = NULL; + client_ = nullptr; io_task_runner_->PostTask( FROM_HERE, base::BindOnce(&PepperPlatformAudioInput::ShutDownOnIOThread, this)); @@ -127,14 +127,13 @@ } PepperPlatformAudioInput::PepperPlatformAudioInput() - : client_(NULL), + : client_(nullptr), main_task_runner_(base::ThreadTaskRunnerHandle::Get()), io_task_runner_(ChildProcess::current()->io_task_runner()), render_frame_id_(MSG_ROUTING_NONE), create_stream_sent_(false), pending_open_device_(false), - pending_open_device_id_(-1) { -} + pending_open_device_id_(-1) {} bool PepperPlatformAudioInput::Initialize( int render_frame_id, @@ -277,8 +276,9 @@ RenderFrameImpl* const render_frame = RenderFrameImpl::FromRoutingID(render_frame_id_); - return render_frame ? - PepperMediaDeviceManager::GetForRenderFrame(render_frame).get() : NULL; + return render_frame + ? PepperMediaDeviceManager::GetForRenderFrame(render_frame).get() + : nullptr; } } // namespace content
diff --git a/content/renderer/pepper/pepper_platform_audio_output.cc b/content/renderer/pepper/pepper_platform_audio_output.cc index 9f06c13..56147c0 100644 --- a/content/renderer/pepper/pepper_platform_audio_output.cc +++ b/content/renderer/pepper/pepper_platform_audio_output.cc
@@ -34,7 +34,7 @@ audio_output->AddRef(); return audio_output.get(); } - return NULL; + return nullptr; } bool PepperPlatformAudioOutput::StartPlayback() { @@ -73,7 +73,7 @@ void PepperPlatformAudioOutput::ShutDown() { // Called on the main thread to stop all audio callbacks. We must only change // the client on the main thread, and the delegates from the I/O thread. - client_ = NULL; + client_ = nullptr; io_task_runner_->PostTask( FROM_HERE, base::BindOnce(&PepperPlatformAudioOutput::ShutDownOnIOThread, this)); @@ -121,10 +121,9 @@ } PepperPlatformAudioOutput::PepperPlatformAudioOutput() - : client_(NULL), + : client_(nullptr), main_task_runner_(base::ThreadTaskRunnerHandle::Get()), - io_task_runner_(ChildProcess::current()->io_task_runner()) { -} + io_task_runner_(ChildProcess::current()->io_task_runner()) {} bool PepperPlatformAudioOutput::Initialize(int sample_rate, int frames_per_buffer,
diff --git a/content/renderer/pepper/pepper_platform_audio_output_dev.cc b/content/renderer/pepper/pepper_platform_audio_output_dev.cc index c22aa19..69cd0f23 100644 --- a/content/renderer/pepper/pepper_platform_audio_output_dev.cc +++ b/content/renderer/pepper/pepper_platform_audio_output_dev.cc
@@ -54,7 +54,7 @@ audio_output->AddRef(); return audio_output.get(); } - return NULL; + return nullptr; } void PepperPlatformAudioOutputDev::RequestDeviceAuthorization() { @@ -103,7 +103,7 @@ void PepperPlatformAudioOutputDev::ShutDown() { // Called on the main thread to stop all audio callbacks. We must only change // the client on the main thread, and the delegates from the I/O thread. - client_ = NULL; + client_ = nullptr; io_task_runner_->PostTask( FROM_HERE, base::BindOnce(&PepperPlatformAudioOutputDev::ShutDownOnIOThread, this)); @@ -233,7 +233,7 @@ const std::string& device_id, const GURL& document_url, base::TimeDelta authorization_timeout) - : client_(NULL), + : client_(nullptr), main_task_runner_(base::ThreadTaskRunnerHandle::Get()), io_task_runner_(ChildProcess::current()->io_task_runner()), render_frame_id_(render_frame_id),
diff --git a/content/renderer/pepper/pepper_platform_camera_device.cc b/content/renderer/pepper/pepper_platform_camera_device.cc index 030135b2..4d07a0c0 100644 --- a/content/renderer/pepper/pepper_platform_camera_device.cc +++ b/content/renderer/pepper/pepper_platform_camera_device.cc
@@ -53,7 +53,7 @@ void PepperPlatformCameraDevice::DetachEventHandler() { DCHECK(thread_checker_.CalledOnValidThread()); - handler_ = NULL; + handler_ = nullptr; if (!release_device_cb_.is_null()) { base::ResetAndReturn(&release_device_cb_).Run(); } @@ -122,7 +122,7 @@ RenderFrameImpl::FromRoutingID(render_frame_id_); return render_frame ? PepperMediaDeviceManager::GetForRenderFrame(render_frame).get() - : NULL; + : nullptr; } } // namespace content
diff --git a/content/renderer/pepper/pepper_platform_video_capture.cc b/content/renderer/pepper/pepper_platform_video_capture.cc index e3fae38..91210951 100644 --- a/content/renderer/pepper/pepper_platform_video_capture.cc +++ b/content/renderer/pepper/pepper_platform_video_capture.cc
@@ -67,7 +67,7 @@ } void PepperPlatformVideoCapture::DetachEventHandler() { - handler_ = NULL; + handler_ = nullptr; StopCapture(); if (!release_device_cb_.is_null()) { release_device_cb_.Run(); @@ -147,8 +147,9 @@ PepperMediaDeviceManager* PepperPlatformVideoCapture::GetMediaDeviceManager() { RenderFrameImpl* const render_frame = RenderFrameImpl::FromRoutingID(render_frame_id_); - return render_frame ? - PepperMediaDeviceManager::GetForRenderFrame(render_frame).get() : NULL; + return render_frame + ? PepperMediaDeviceManager::GetForRenderFrame(render_frame).get() + : nullptr; } } // namespace content
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc index ee4876f..49c5f28 100644 --- a/content/renderer/pepper/pepper_plugin_instance_impl.cc +++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -377,7 +377,7 @@ PPP_Instance_Combined* ppp_instance_combined = PPP_Instance_Combined::Create(get_plugin_interface_func); if (!ppp_instance_combined) - return NULL; + return nullptr; return new PepperPluginInstanceImpl(render_frame, module, @@ -488,29 +488,29 @@ full_frame_(false), viewport_to_dip_scale_(1.0f), sent_initial_did_change_view_(false), - bound_graphics_2d_platform_(NULL), - bound_compositor_(NULL), + bound_graphics_2d_platform_(nullptr), + bound_compositor_(nullptr), has_webkit_focus_(false), has_content_area_focus_(false), find_identifier_(-1), - plugin_find_interface_(NULL), - plugin_input_event_interface_(NULL), - plugin_mouse_lock_interface_(NULL), - plugin_pdf_interface_(NULL), - plugin_private_interface_(NULL), - plugin_textinput_interface_(NULL), + plugin_find_interface_(nullptr), + plugin_input_event_interface_(nullptr), + plugin_mouse_lock_interface_(nullptr), + plugin_pdf_interface_(nullptr), + plugin_private_interface_(nullptr), + plugin_textinput_interface_(nullptr), checked_for_plugin_input_event_interface_(false), checked_for_plugin_pdf_interface_(false), metafile_(nullptr), gamepad_impl_(new GamepadImpl()), - uma_private_impl_(NULL), - plugin_print_interface_(NULL), + uma_private_impl_(nullptr), + plugin_print_interface_(nullptr), always_on_top_(false), - fullscreen_container_(NULL), + fullscreen_container_(nullptr), flash_fullscreen_(false), desired_fullscreen_state_(false), - message_channel_(NULL), - sad_plugin_(NULL), + message_channel_(nullptr), + sad_plugin_(nullptr), input_event_mask_(0), filtered_input_event_mask_(0), text_input_type_(kPluginDefaultTextInputType), @@ -520,7 +520,7 @@ selection_caret_(0), selection_anchor_(0), pending_user_gesture_(0.0), - document_loader_(NULL), + document_loader_(nullptr), external_document_load_(false), isolate_(v8::Isolate::GetCurrent()), is_deleted_(false), @@ -618,7 +618,7 @@ } void PepperPluginInstanceImpl::MessageChannelDestroyed() { - message_channel_ = NULL; + message_channel_ = nullptr; message_channel_object_.Reset(); } @@ -678,14 +678,14 @@ if (fullscreen_container_) { fullscreen_container_->Destroy(); - fullscreen_container_ = NULL; + fullscreen_container_ = nullptr; } // Force-unbind any Graphics. In the case of Graphics2D, if the plugin // leaks the graphics 2D, it may actually get cleaned up after our // destruction, so we need its pointers to be up to date. BindGraphics(pp_instance(), 0); - container_ = NULL; + container_ = nullptr; } bool PepperPluginInstanceImpl::is_deleted() const { return is_deleted_; } @@ -1327,7 +1327,7 @@ } } - UpdateFlashFullscreenState(fullscreen_container_ != NULL); + UpdateFlashFullscreenState(fullscreen_container_ != nullptr); // During plugin initialization, there are often re-layouts. Avoid sending // intermediate sizes the plugin and throttler. @@ -1902,7 +1902,7 @@ // The canvas only has a metafile on it for print preview. printing::PdfMetafileSkia* metafile = printing::MetafileSkiaWrapper::GetMetafileFromCanvas(canvas); - bool save_for_later = (metafile != NULL); + bool save_for_later = (metafile != nullptr); #if defined(OS_MACOSX) save_for_later = save_for_later && cc::IsPreviewMetafile(canvas); #endif // defined(OS_MACOSX) @@ -2011,7 +2011,7 @@ } bool PepperPluginInstanceImpl::FlashIsFullscreenOrPending() { - return fullscreen_container_ != NULL; + return fullscreen_container_ != nullptr; } bool PepperPluginInstanceImpl::IsFullscreenOrPending() { @@ -2150,22 +2150,22 @@ if (texture_layer_ || compositor_layer_) { if (!layer_bound_to_fullscreen_) - container_->SetWebLayer(NULL); + container_->SetWebLayer(nullptr); else if (fullscreen_container_) - fullscreen_container_->SetLayer(NULL); + fullscreen_container_->SetLayer(nullptr); web_layer_.reset(); if (texture_layer_) { texture_layer_->ClearClient(); - texture_layer_ = NULL; + texture_layer_ = nullptr; } - compositor_layer_ = NULL; + compositor_layer_ = nullptr; } if (want_texture_layer) { bool opaque = false; if (want_3d_layer) { DCHECK(bound_graphics_3d_.get()); - texture_layer_ = cc::TextureLayer::CreateForMailbox(NULL); + texture_layer_ = cc::TextureLayer::CreateForMailbox(nullptr); opaque = bound_graphics_3d_->IsOpaque(); PassCommittedTextureToTextureLayer(); @@ -2385,15 +2385,15 @@ scoped_refptr<ppapi::Resource> old_graphics = bound_graphics_3d_.get(); if (bound_graphics_3d_.get()) { bound_graphics_3d_->BindToInstance(false); - bound_graphics_3d_ = NULL; + bound_graphics_3d_ = nullptr; } if (bound_graphics_2d_platform_) { - bound_graphics_2d_platform_->BindToInstance(NULL); - bound_graphics_2d_platform_ = NULL; + bound_graphics_2d_platform_->BindToInstance(nullptr); + bound_graphics_2d_platform_ = nullptr; } if (bound_compositor_) { - bound_compositor_->BindToInstance(NULL); - bound_compositor_ = NULL; + bound_compositor_->BindToInstance(nullptr); + bound_compositor_ = nullptr; } // Special-case clearing the current device. @@ -2412,8 +2412,8 @@ const ppapi::host::PpapiHost* ppapi_host = RendererPpapiHost::GetForPPInstance(instance)->GetPpapiHost(); ppapi::host::ResourceHost* host = ppapi_host->GetResourceHost(device); - PepperGraphics2DHost* graphics_2d = NULL; - PepperCompositorHost* compositor = NULL; + PepperGraphics2DHost* graphics_2d = nullptr; + PepperCompositorHost* compositor = nullptr; if (host) { if (host->IsGraphics2DHost()) { graphics_2d = static_cast<PepperGraphics2DHost*>(host); @@ -2429,7 +2429,7 @@ PPB_Graphics3D_Impl* graphics_3d = enter_3d.succeeded() ? static_cast<PPB_Graphics3D_Impl*>(enter_3d.object()) - : NULL; + : nullptr; if (compositor) { if (compositor->BindToInstance(this)) { @@ -2477,7 +2477,7 @@ if (!container_) return PP_MakeUndefined(); V8VarConverter converter(pp_instance_, V8VarConverter::kAllowObjectVars); - PepperTryCatchVar try_catch(this, &converter, NULL); + PepperTryCatchVar try_catch(this, &converter, nullptr); WebLocalFrame* frame = container_->GetDocument().GetFrame(); if (!frame) { try_catch.SetException("No frame exists for window object."); @@ -2494,7 +2494,7 @@ if (!container_) return PP_MakeUndefined(); V8VarConverter converter(pp_instance_, V8VarConverter::kAllowObjectVars); - PepperTryCatchVar try_catch(this, &converter, NULL); + PepperTryCatchVar try_catch(this, &converter, nullptr); ScopedPPVar result = try_catch.FromV8(container_->V8ObjectForElement()); DCHECK(!try_catch.HasException()); return result.Release(); @@ -2803,7 +2803,7 @@ case ppapi::PDF_SINGLETON_ID: case ppapi::TRUETYPE_FONT_SINGLETON_ID: NOTIMPLEMENTED(); - return NULL; + return nullptr; case ppapi::GAMEPAD_SINGLETON_ID: return gamepad_impl_.get(); case ppapi::UMA_SINGLETON_ID: { @@ -2820,7 +2820,7 @@ } NOTREACHED(); - return NULL; + return nullptr; } int32_t PepperPluginInstanceImpl::RequestInputEvents(PP_Instance instance, @@ -3083,14 +3083,14 @@ instance_interface_.reset(ppp_instance_combined); // Clear all PPP interfaces we may have cached. - plugin_find_interface_ = NULL; - plugin_input_event_interface_ = NULL; + plugin_find_interface_ = nullptr; + plugin_input_event_interface_ = nullptr; checked_for_plugin_input_event_interface_ = false; - plugin_mouse_lock_interface_ = NULL; - plugin_pdf_interface_ = NULL; + plugin_mouse_lock_interface_ = nullptr; + plugin_pdf_interface_ = nullptr; checked_for_plugin_pdf_interface_ = false; - plugin_private_interface_ = NULL; - plugin_textinput_interface_ = NULL; + plugin_private_interface_ = nullptr; + plugin_textinput_interface_ = nullptr; // Re-send the DidCreate event via the proxy. std::unique_ptr<const char* []> argn_array(StringVectorToArgArray(argn_)); @@ -3111,7 +3111,7 @@ DCHECK(external_document_load_); external_document_load_ = false; if (!external_document_response_.IsNull()) { - document_loader_ = NULL; + document_loader_ = nullptr; // Pass the response to the new proxy. HandleDocumentLoad(external_document_response_); external_document_response_ = blink::WebURLResponse(); @@ -3254,7 +3254,7 @@ } else { DCHECK(fullscreen_container_); fullscreen_container_->Destroy(); - fullscreen_container_ = NULL; + fullscreen_container_ = nullptr; UpdateFlashFullscreenState(false); if (!delay_report) { ReportGeometry();
diff --git a/content/renderer/pepper/pepper_plugin_registry.cc b/content/renderer/pepper/pepper_plugin_registry.cc index e90972f..b91ba72 100644 --- a/content/renderer/pepper/pepper_plugin_registry.cc +++ b/content/renderer/pepper/pepper_plugin_registry.cc
@@ -16,7 +16,7 @@ // static PepperPluginRegistry* PepperPluginRegistry::GetInstance() { - static PepperPluginRegistry* registry = NULL; + static PepperPluginRegistry* registry = nullptr; // This object leaks. It is a temporary hack to work around a crash. // http://code.google.com/p/chromium/issues/detail?id=63234 if (!registry) { @@ -48,7 +48,7 @@ PluginModule* PepperPluginRegistry::GetLiveModule(const base::FilePath& path) { NonOwningModuleMap::iterator module_iter = live_modules_.find(path); if (module_iter == live_modules_.end()) - return NULL; + return nullptr; // Check the instances for the module to see if they've all been Delete()d. // We don't want to return a PluginModule in that case, since the plugin may @@ -68,7 +68,7 @@ return module_iter->second; ++instance_iter; } - return NULL; + return nullptr; } void PepperPluginRegistry::AddLiveModule(const base::FilePath& path,
diff --git a/content/renderer/pepper/pepper_url_loader_host.cc b/content/renderer/pepper/pepper_url_loader_host.cc index 42aafc7..5be2310 100644 --- a/content/renderer/pepper/pepper_url_loader_host.cc +++ b/content/renderer/pepper/pepper_url_loader_host.cc
@@ -92,7 +92,7 @@ renderer_ppapi_host_->GetPluginInstanceImpl(pp_instance()); if (instance_object) { DCHECK(instance_object->document_loader() == this); - instance_object->set_document_loader(NULL); + instance_object->set_document_loader(nullptr); } } @@ -383,7 +383,7 @@ static_cast<PepperPluginInstanceImpl*>( renderer_ppapi_host_->GetPluginInstance(pp_instance())); if (!instance_object || instance_object->is_deleted()) - return NULL; + return nullptr; return instance_object->GetContainer()->GetDocument().GetFrame(); }
diff --git a/content/renderer/pepper/pepper_video_capture_host.cc b/content/renderer/pepper/pepper_video_capture_host.cc index 60cc0ea..7e9f8c5 100644 --- a/content/renderer/pepper/pepper_video_capture_host.cc +++ b/content/renderer/pepper/pepper_video_capture_host.cc
@@ -408,8 +408,7 @@ } PepperVideoCaptureHost::BufferInfo::BufferInfo() - : in_use(false), data(NULL), buffer() { -} + : in_use(false), data(nullptr), buffer() {} PepperVideoCaptureHost::BufferInfo::BufferInfo(const BufferInfo& other) = default;
diff --git a/content/renderer/pepper/pepper_video_destination_host.cc b/content/renderer/pepper/pepper_video_destination_host.cc index 3f682db..aa3567d 100644 --- a/content/renderer/pepper/pepper_video_destination_host.cc +++ b/content/renderer/pepper/pepper_video_destination_host.cc
@@ -52,9 +52,9 @@ if (!gurl.is_valid()) return PP_ERROR_BADARGUMENT; - FrameWriterInterface* frame_writer = NULL; - if (!PepperToVideoTrackAdapter::Open( - NULL /* registry */, gurl.spec(), &frame_writer)) + FrameWriterInterface* frame_writer = nullptr; + if (!PepperToVideoTrackAdapter::Open(nullptr /* registry */, gurl.spec(), + &frame_writer)) return PP_ERROR_FAILED; frame_writer_.reset(frame_writer); @@ -101,7 +101,7 @@ int32_t PepperVideoDestinationHost::OnHostMsgClose( HostMessageContext* context) { - frame_writer_.reset(NULL); + frame_writer_.reset(nullptr); return PP_OK; }
diff --git a/content/renderer/pepper/pepper_video_source_host.cc b/content/renderer/pepper/pepper_video_source_host.cc index 0e564b3b..ea38aa9 100644 --- a/content/renderer/pepper/pepper_video_source_host.cc +++ b/content/renderer/pepper/pepper_video_source_host.cc
@@ -176,7 +176,7 @@ dispatcher->ShareSharedMemoryHandleWithRemote(local_shm->handle()); } else { // We need to allocate new shared memory. - shared_image_ = NULL; // Release any previous image. + shared_image_ = nullptr; // Release any previous image. ppapi::ScopedPPResource resource( ppapi::ScopedPPResource::PassRef(), @@ -209,7 +209,7 @@ DCHECK(!shared_image_->IsMapped()); // New memory should not be mapped. if (!shared_image_->Map() || shared_image_->GetMappedBitmap().empty()) { - shared_image_ = NULL; + shared_image_ = nullptr; SendGetFrameErrorReply(PP_ERROR_FAILED); return; } @@ -236,7 +236,7 @@ frame = last_frame_; // Frame resolution doesn't change frequently, so don't keep any unnecessary // buffers around. - scaled_frame_ = NULL; + scaled_frame_ = nullptr; } else { // We need to create an intermediate scaled frame. Make sure we have // allocated one of correct size. @@ -270,7 +270,7 @@ libyuv::kFilterBilinear); frame = scaled_frame_; } - last_frame_ = NULL; + last_frame_ = nullptr; libyuv::I420ToARGB(frame->visible_data(media::VideoFrame::kYPlane), frame->stride(media::VideoFrame::kYPlane), @@ -313,10 +313,10 @@ if (frame_source_.get() && !stream_url_.empty()) frame_source_->Close(frame_receiver_.get()); - frame_source_.reset(NULL); + frame_source_.reset(nullptr); stream_url_.clear(); - shared_image_ = NULL; + shared_image_ = nullptr; } } // namespace content
diff --git a/content/renderer/pepper/plugin_module.cc b/content/renderer/pepper/plugin_module.cc index 1c05507..8f906aa9 100644 --- a/content/renderer/pepper/plugin_module.cc +++ b/content/renderer/pepper/plugin_module.cc
@@ -172,7 +172,7 @@ // TODO(raymes): I'm not sure if it is completely necessary to leak the // HostGlobals. Figure out the shutdown sequence and find a way to do this // more elegantly. -HostGlobals* host_globals = NULL; +HostGlobals* host_globals = nullptr; // Maintains all currently loaded plugin libs for validating PP_Module // identifiers. @@ -430,7 +430,7 @@ if (strcmp(name, PPB_TESTING_PRIVATE_INTERFACE) == 0) return &testing_interface; } - return NULL; + return nullptr; } const void* GetInterface(const char* name) { @@ -499,13 +499,13 @@ : callback_tracker_(new ppapi::CallbackTracker), is_in_destructor_(false), is_crashed_(false), - broker_(NULL), - library_(NULL), + broker_(nullptr), + library_(nullptr), name_(name), version_(version), path_(path), permissions_(ppapi::PpapiPermissions::GetForCommandLine(perms.GetBits())), - reserve_instance_id_(NULL) { + reserve_instance_id_(nullptr) { // Ensure the globals object is created. if (!host_globals) host_globals = new HostGlobals; @@ -568,7 +568,7 @@ } bool PluginModule::InitAsLibrary(const base::FilePath& path) { - base::NativeLibrary library = base::LoadNativeLibrary(path, NULL); + base::NativeLibrary library = base::LoadNativeLibrary(path, nullptr); if (!library) return false; @@ -643,7 +643,7 @@ render_frame, this, container, plugin_url); if (!instance) { LOG(WARNING) << "Plugin doesn't support instance interface, failing."; - return NULL; + return nullptr; } if (host_dispatcher_wrapper_) host_dispatcher_wrapper_->AddInstance(instance->pp_instance()); @@ -663,7 +663,7 @@ // In-process plugins. if (!entry_points_.get_interface) - return NULL; + return nullptr; return entry_points_.get_interface(name); } @@ -756,13 +756,13 @@ // static void PluginModule::ResetHostGlobalsForTest() { delete host_globals; - host_globals = NULL; + host_globals = nullptr; } bool PluginModule::InitializeModule( const PepperPluginInfo::EntryPoints& entry_points) { DCHECK(!host_dispatcher_wrapper_.get()) << "Don't call for proxied modules."; - DCHECK(entry_points.initialize_module != NULL); + DCHECK(entry_points.initialize_module != nullptr); int retval = entry_points.initialize_module(pp_module(), &GetInterface); if (retval != 0) { #if BUILDFLAG(ENABLE_NACL)
diff --git a/content/renderer/pepper/plugin_object.cc b/content/renderer/pepper/plugin_object.cc index 1cc915a..98d8a22 100644 --- a/content/renderer/pepper/plugin_object.cc +++ b/content/renderer/pepper/plugin_object.cc
@@ -67,7 +67,7 @@ gin::ConvertFromV8(isolate, v8_object, &plugin_object)) { return plugin_object; } - return NULL; + return nullptr; } // static @@ -76,7 +76,7 @@ void* ppp_class_data) { V8VarConverter var_converter(instance->pp_instance(), V8VarConverter::kAllowObjectVars); - PepperTryCatchVar try_catch(instance, &var_converter, NULL); + PepperTryCatchVar try_catch(instance, &var_converter, nullptr); // If the V8 context is empty, we may be in the process of tearing down the // frame and may not have a valid isolate (in particular due to re-entrancy). // We shouldn't try to call gin::CreateHandle. @@ -183,7 +183,7 @@ } void PluginObject::InstanceDeleted() { - instance_ = NULL; + instance_ = nullptr; } PluginObject::PluginObject(PepperPluginInstanceImpl* instance,
diff --git a/content/renderer/pepper/plugin_power_saver_helper_browsertest.cc b/content/renderer/pepper/plugin_power_saver_helper_browsertest.cc index b489acb..2475fcf 100644 --- a/content/renderer/pepper/plugin_power_saver_helper_browsertest.cc +++ b/content/renderer/pepper/plugin_power_saver_helper_browsertest.cc
@@ -26,7 +26,7 @@ class PluginPowerSaverHelperTest : public RenderViewTest { public: - PluginPowerSaverHelperTest() : sink_(NULL) {} + PluginPowerSaverHelperTest() : sink_(nullptr) {} void SetUp() override { RenderViewTest::SetUp();
diff --git a/content/renderer/pepper/ppb_audio_impl.cc b/content/renderer/pepper/ppb_audio_impl.cc index 43426b5..21d9392 100644 --- a/content/renderer/pepper/ppb_audio_impl.cc +++ b/content/renderer/pepper/ppb_audio_impl.cc
@@ -31,7 +31,7 @@ PPB_Audio_Impl::PPB_Audio_Impl(PP_Instance instance) : Resource(ppapi::OBJECT_IS_IMPL, instance), - audio_(NULL), + audio_(nullptr), playback_throttled_(false) { PepperPluginInstanceImpl* plugin_instance = static_cast<PepperPluginInstanceImpl*>( @@ -58,7 +58,7 @@ // destructor. if (audio_) { audio_->ShutDown(); - audio_ = NULL; + audio_ = nullptr; } }
diff --git a/content/renderer/pepper/ppb_broker_impl.cc b/content/renderer/pepper/ppb_broker_impl.cc index d80c0611..819fa13 100644 --- a/content/renderer/pepper/ppb_broker_impl.cc +++ b/content/renderer/pepper/ppb_broker_impl.cc
@@ -28,7 +28,7 @@ PPB_Broker_Impl::PPB_Broker_Impl(PP_Instance instance) : Resource(ppapi::OBJECT_IS_IMPL, instance), - broker_(NULL), + broker_(nullptr), connect_callback_(), pipe_handle_(PlatformFileToInt(base::SyncSocket::kInvalidHandle)), routing_id_(RenderThreadImpl::current()->GenerateRoutingID()) { @@ -38,7 +38,7 @@ PPB_Broker_Impl::~PPB_Broker_Impl() { if (broker_) { broker_->Disconnect(this); - broker_ = NULL; + broker_ = nullptr; } // The plugin owns the handle.
diff --git a/content/renderer/pepper/ppb_buffer_impl.cc b/content/renderer/pepper/ppb_buffer_impl.cc index 5bec0da..3da947a 100644 --- a/content/renderer/pepper/ppb_buffer_impl.cc +++ b/content/renderer/pepper/ppb_buffer_impl.cc
@@ -53,7 +53,7 @@ size_ = size; shared_memory_.reset( RenderThread::Get()->HostAllocateSharedMemoryBuffer(size).release()); - return shared_memory_.get() != NULL; + return shared_memory_.get() != nullptr; } PP_Bool PPB_Buffer_Impl::Describe(uint32_t* size_in_bytes) {
diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.cc b/content/renderer/pepper/ppb_graphics_3d_impl.cc index 828a1fc..39ad952ff 100644 --- a/content/renderer/pepper/ppb_graphics_3d_impl.cc +++ b/content/renderer/pepper/ppb_graphics_3d_impl.cc
@@ -70,7 +70,7 @@ gpu::Capabilities* capabilities, base::SharedMemoryHandle* shared_state_handle, gpu::CommandBufferId* command_buffer_id) { - PPB_Graphics3D_API* share_api = NULL; + PPB_Graphics3D_API* share_api = nullptr; if (share_context) { EnterResourceNoLock<PPB_Graphics3D_API> enter(share_context, true); if (enter.failed()) @@ -256,7 +256,7 @@ attrib_helper.should_use_native_gmb_for_backbuffer = use_image_chromium_; attrib_helper.context_type = gpu::gles2::CONTEXT_TYPE_OPENGLES2; - gpu::CommandBufferProxyImpl* share_buffer = NULL; + gpu::CommandBufferProxyImpl* share_buffer = nullptr; if (!plugin_instance->is_flash_plugin()) UMA_HISTOGRAM_BOOLEAN("Pepper.Graphics3DHasShareGroup", !!share_context); if (share_context) {
diff --git a/content/renderer/pepper/ppb_image_data_impl.cc b/content/renderer/pepper/ppb_image_data_impl.cc index 5cb081d..bb355c08 100644 --- a/content/renderer/pepper/ppb_image_data_impl.cc +++ b/content/renderer/pepper/ppb_image_data_impl.cc
@@ -171,7 +171,7 @@ const bool is_opaque = false; mapped_canvas_ = dib_->GetPlatformCanvas(width_, height_, is_opaque); if (!mapped_canvas_) - return NULL; + return nullptr; } SkPixmap pixmap; skia::GetWritablePixels(mapped_canvas_.get(), &pixmap); @@ -234,7 +234,9 @@ bool ImageDataSimpleBackend::IsMapped() const { return map_count_ > 0; } -TransportDIB* ImageDataSimpleBackend::GetTransportDIB() const { return NULL; } +TransportDIB* ImageDataSimpleBackend::GetTransportDIB() const { + return nullptr; +} void* ImageDataSimpleBackend::Map() { DCHECK(shared_memory_.get()); @@ -263,7 +265,7 @@ SkCanvas* ImageDataSimpleBackend::GetCanvas() { if (!IsMapped()) - return NULL; + return nullptr; return skia_canvas_.get(); }
diff --git a/content/renderer/pepper/ppb_var_deprecated_impl.cc b/content/renderer/pepper/ppb_var_deprecated_impl.cc index aa773472..fd73dae 100644 --- a/content/renderer/pepper/ppb_var_deprecated_impl.cc +++ b/content/renderer/pepper/ppb_var_deprecated_impl.cc
@@ -44,7 +44,7 @@ public: ObjectAccessor(PP_Var var) : object_var_(V8ObjectVar::FromPPVar(var).get()), - instance_(object_var_ ? object_var_->instance() : NULL) { + instance_(object_var_ ? object_var_->instance() : nullptr) { if (instance_) { converter_.reset(new V8VarConverter(instance_->pp_instance(), V8VarConverter::kAllowObjectVars)); @@ -151,7 +151,7 @@ PepperTryCatchVar try_catch(accessor.instance(), accessor.converter(), exception); - *properties = NULL; + *properties = nullptr; *property_count = 0; v8::Local<v8::Array> identifiers = accessor.GetObject()->GetPropertyNames(); @@ -261,7 +261,7 @@ } blink::WebPluginContainer* container = accessor.instance()->container(); - blink::WebLocalFrame* frame = NULL; + blink::WebLocalFrame* frame = nullptr; if (container) frame = container->GetDocument().GetFrame();
diff --git a/content/renderer/pepper/ppb_video_decoder_impl.cc b/content/renderer/pepper/ppb_video_decoder_impl.cc index 311ae6f..3437b19 100644 --- a/content/renderer/pepper/ppb_video_decoder_impl.cc +++ b/content/renderer/pepper/ppb_video_decoder_impl.cc
@@ -94,8 +94,7 @@ namespace content { PPB_VideoDecoder_Impl::PPB_VideoDecoder_Impl(PP_Instance instance) - : PPB_VideoDecoder_Shared(instance), ppp_videodecoder_(NULL) { -} + : PPB_VideoDecoder_Shared(instance), ppp_videodecoder_(nullptr) {} PPB_VideoDecoder_Impl::~PPB_VideoDecoder_Impl() { Destroy(); } @@ -235,7 +234,7 @@ FlushCommandBuffer(); decoder_.reset(); - ppp_videodecoder_ = NULL; + ppp_videodecoder_ = nullptr; ::ppapi::PPB_VideoDecoder_Shared::Destroy(); }
diff --git a/content/renderer/pepper/renderer_ppapi_host_impl.cc b/content/renderer/pepper/renderer_ppapi_host_impl.cc index 68d029b..5a2eee6 100644 --- a/content/renderer/pepper/renderer_ppapi_host_impl.cc +++ b/content/renderer/pepper/renderer_ppapi_host_impl.cc
@@ -59,7 +59,7 @@ RendererPpapiHostImpl::RendererPpapiHostImpl( PluginModule* module, const ppapi::PpapiPermissions& permissions) - : module_(module), dispatcher_(NULL), is_external_plugin_host_(false) { + : module_(module), dispatcher_(nullptr), is_external_plugin_host_(false) { // Hook the host up to the in-process router. in_process_router_.reset(new PepperInProcessRouter(this)); ppapi_host_.reset(new ppapi::host::PpapiHost( @@ -111,7 +111,7 @@ PepperPluginInstanceImpl* instance = HostGlobals::Get()->GetInstance(pp_instance); if (!instance) - return NULL; + return nullptr; // All modules created by content will have their embedder state be the // host impl. @@ -142,7 +142,7 @@ PP_Instance instance) const { PepperPluginInstanceImpl* instance_object = GetAndValidateInstance(instance); if (!instance_object) - return NULL; + return nullptr; // Since we're the embedder, we can make assumptions about the helper on // the instance and get back to our RenderFrame. @@ -153,7 +153,7 @@ PP_Instance instance) const { PepperPluginInstanceImpl* instance_object = GetAndValidateInstance(instance); if (!instance_object) - return NULL; + return nullptr; // Since we're the embedder, we can make assumptions about the helper on // the instance and get back to our RenderView. @@ -173,7 +173,7 @@ PP_Instance instance) const { PepperPluginInstanceImpl* instance_object = GetAndValidateInstance(instance); if (!instance_object) - return NULL; + return nullptr; return instance_object->container(); } @@ -292,9 +292,9 @@ PepperPluginInstanceImpl* instance = HostGlobals::Get()->GetInstance(pp_instance); if (!instance) - return NULL; + return nullptr; if (!instance->IsValidInstanceOf(module_)) - return NULL; + return nullptr; return instance; }
diff --git a/content/renderer/pepper/resource_converter.cc b/content/renderer/pepper/resource_converter.cc index fb18349..4c33c05 100644 --- a/content/renderer/pepper/resource_converter.cc +++ b/content/renderer/pepper/resource_converter.cc
@@ -310,7 +310,7 @@ ::ppapi::host::PpapiHost* ppapi_host = renderer_ppapi_host->GetPpapiHost(); ::ppapi::host::ResourceHost* resource_host = ppapi_host->GetResourceHost(resource_id); - if (resource_host == NULL) { + if (resource_host == nullptr) { LOG(ERROR) << "No resource host for resource #" << resource_id; return false; }
diff --git a/content/renderer/pepper/url_request_info_util.cc b/content/renderer/pepper/url_request_info_util.cc index da6e2d9..38efaba9 100644 --- a/content/renderer/pepper/url_request_info_util.cc +++ b/content/renderer/pepper/url_request_info_util.cc
@@ -243,7 +243,7 @@ return data.has_custom_referrer_url || data.has_custom_content_transfer_encoding || data.has_custom_user_agent || - url::FindAndCompareScheme(data.url, url::kJavaScriptScheme, NULL); + url::FindAndCompareScheme(data.url, url::kJavaScriptScheme, nullptr); } } // namespace content
diff --git a/content/renderer/pepper/v8_var_converter_unittest.cc b/content/renderer/pepper/v8_var_converter_unittest.cc index 857a1d69..17c5ed2 100644 --- a/content/renderer/pepper/v8_var_converter_unittest.cc +++ b/content/renderer/pepper/v8_var_converter_unittest.cc
@@ -180,7 +180,7 @@ ProxyLock::Acquire(); v8::HandleScope handle_scope(isolate_); v8::Local<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate_); - context_.Reset(isolate_, v8::Context::New(isolate_, NULL, global)); + context_.Reset(isolate_, v8::Context::New(isolate_, nullptr, global)); } void TearDown() override { context_.Reset();
diff --git a/content/renderer/pepper/v8object_var.cc b/content/renderer/pepper/v8object_var.cc index a95c529c..9e7ee57 100644 --- a/content/renderer/pepper/v8object_var.cc +++ b/content/renderer/pepper/v8object_var.cc
@@ -45,13 +45,13 @@ // This is called by the HostVarTracker which will take care of removing us // from its set. DCHECK(instance_); - instance_ = NULL; + instance_ = nullptr; } // static scoped_refptr<V8ObjectVar> V8ObjectVar::FromPPVar(PP_Var var) { if (var.type != PP_VARTYPE_OBJECT) - return scoped_refptr<V8ObjectVar>(NULL); + return scoped_refptr<V8ObjectVar>(nullptr); scoped_refptr<Var> var_object( PpapiGlobals::Get()->GetVarTracker()->GetVar(var)); if (!var_object.get())
diff --git a/content/renderer/pepper/video_decoder_shim.cc b/content/renderer/pepper/video_decoder_shim.cc index 17508e9d..8efb305 100644 --- a/content/renderer/pepper/video_decoder_shim.cc +++ b/content/renderer/pepper/video_decoder_shim.cc
@@ -160,7 +160,7 @@ // Create texture with default size - will be resized upon first frame. gl_->TexImage2D(GL_TEXTURE_2D, 0, internal_format_, 2, 2, 0, format_, - GL_UNSIGNED_BYTE, NULL); + GL_UNSIGNED_BYTE, nullptr); gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); @@ -177,7 +177,7 @@ const char* code) { GLuint shader = gl_->CreateShader(type); - gl_->ShaderSource(shader, 1, (const GLchar**)&code, NULL); + gl_->ShaderSource(shader, 1, (const GLchar**)&code, nullptr); gl_->CompileShader(shader); #ifndef NDEBUG @@ -362,8 +362,8 @@ void VideoDecoderShim::YUVConverter::Convert( const scoped_refptr<media::VideoFrame>& frame, GLuint tex_out) { - const float* yuv_matrix = 0; - const float* yuv_adjust = 0; + const float* yuv_matrix = nullptr; + const float* yuv_adjust = nullptr; if (video_format_ != frame->format()) { // The constants below were taken from @@ -557,7 +557,7 @@ gl_->BindBuffer(GL_ARRAY_BUFFER, vertex_buffer_); gl_->EnableVertexAttribArray(0); gl_->VertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(GLfloat), - static_cast<const void*>(0)); + static_cast<const void*>(nullptr)); gl_->DrawArrays(GL_TRIANGLE_STRIP, 0, 4);
diff --git a/content/renderer/quota_dispatcher.cc b/content/renderer/quota_dispatcher.cc index 08b6f98..49510e0b 100644 --- a/content/renderer/quota_dispatcher.cc +++ b/content/renderer/quota_dispatcher.cc
@@ -77,7 +77,7 @@ iter.Advance(); } - g_quota_dispatcher_tls.Pointer()->Set(NULL); + g_quota_dispatcher_tls.Pointer()->Set(nullptr); } QuotaDispatcher* QuotaDispatcher::ThreadSpecificInstance(
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 8a3113d..90a6376 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc
@@ -396,7 +396,7 @@ // Returns false unless this is a top-level navigation. bool IsTopLevelNavigation(WebFrame* frame) { - return frame->Parent() == NULL; + return frame->Parent() == nullptr; } WebURLRequest CreateURLRequestForNavigation( @@ -1032,7 +1032,7 @@ g_routing_id_frame_map.Get().find(routing_id); if (iter != g_routing_id_frame_map.Get().end()) return iter->second; - return NULL; + return nullptr; } // static @@ -1196,7 +1196,7 @@ FrameMap::iterator iter = g_frame_map.Get().find(web_frame); if (iter != g_frame_map.Get().end()) return iter->second; - return NULL; + return nullptr; } // static @@ -1249,7 +1249,7 @@ // RenderFrameImpl ---------------------------------------------------------- RenderFrameImpl::RenderFrameImpl(CreateParams params) - : frame_(NULL), + : frame_(nullptr), is_main_frame_(true), unique_name_frame_adapter_(this), unique_name_helper_(&unique_name_frame_adapter_), @@ -1266,13 +1266,13 @@ selection_text_offset_(0), selection_range_(gfx::Range::InvalidRange()), handling_select_range_(false), - web_user_media_client_(NULL), + web_user_media_client_(nullptr), devtools_agent_(nullptr), - presentation_dispatcher_(NULL), - push_messaging_client_(NULL), - screen_orientation_dispatcher_(NULL), - manifest_manager_(NULL), - render_accessibility_(NULL), + presentation_dispatcher_(nullptr), + push_messaging_client_(nullptr), + screen_orientation_dispatcher_(nullptr), + manifest_manager_(nullptr), + render_accessibility_(nullptr), previews_state_(PREVIEWS_UNSPECIFIED), effective_connection_type_( blink::WebEffectiveConnectionType::kTypeUnknown), @@ -1881,7 +1881,7 @@ const FrameReplicationState& replicated_frame_state) { TRACE_EVENT1("navigation,rail", "RenderFrameImpl::OnSwapOut", "id", routing_id_); - RenderFrameProxy* proxy = NULL; + RenderFrameProxy* proxy = nullptr; // Swap this RenderFrame out so the frame can navigate to a page rendered by // a different process. This involves running the unload handler and @@ -2455,7 +2455,7 @@ void RenderFrameImpl::OnPostMessageEvent( const FrameMsg_PostMessage_Params& params) { // Find the source frame if it exists. - WebFrame* source_frame = NULL; + WebFrame* source_frame = nullptr; if (params.source_routing_id != MSG_ROUTING_NONE) { RenderFrameProxy* source_proxy = RenderFrameProxy::FromRoutingID(params.source_routing_id); @@ -3229,7 +3229,7 @@ } return external_popup_menu_.get(); #else - return NULL; + return nullptr; #endif } @@ -4377,13 +4377,13 @@ void RenderFrameImpl::RunModalAlertDialog(const blink::WebString& message) { RunJavaScriptDialog(JAVASCRIPT_DIALOG_TYPE_ALERT, message.Utf16(), - base::string16(), frame_->GetDocument().Url(), NULL); + base::string16(), frame_->GetDocument().Url(), nullptr); } bool RenderFrameImpl::RunModalConfirmDialog(const blink::WebString& message) { return RunJavaScriptDialog(JAVASCRIPT_DIALOG_TYPE_CONFIRM, message.Utf16(), base::string16(), frame_->GetDocument().Url(), - NULL); + nullptr); } bool RenderFrameImpl::RunModalPromptDialog( @@ -4903,7 +4903,7 @@ InternalDocumentStateData* internal_data = document_loader ? InternalDocumentStateData::FromDocumentLoader(document_loader) - : NULL; + : nullptr; if (internal_data && internal_data->is_overriding_user_agent()) return WebString::FromUTF8( render_view_->renderer_preferences_.user_agent_override); @@ -5686,9 +5686,9 @@ render_view_->HistoryForwardListCount() < 1 && // The parent page must have set the child's window.opener to null before // redirecting to the desired URL. - frame_->Opener() == NULL && + frame_->Opener() == nullptr && // Must be a top-level frame. - frame_->Parent() == NULL && + frame_->Parent() == nullptr && // Must not have issued the request from this page. is_content_initiated && // Must be targeted at the current tab.
diff --git a/content/renderer/render_frame_proxy.cc b/content/renderer/render_frame_proxy.cc index 68da79c..3b0e8584 100644 --- a/content/renderer/render_frame_proxy.cc +++ b/content/renderer/render_frame_proxy.cc
@@ -182,7 +182,7 @@ // RenderFrameProxy is already deleted--in which case, it's not safe to touch // |web_frame|. NOTREACHED(); - return NULL; + return nullptr; } RenderFrameProxy::RenderFrameProxy(int routing_id)
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc index 7ac5929..3849ea7b 100644 --- a/content/renderer/render_view_browsertest.cc +++ b/content/renderer/render_view_browsertest.cc
@@ -155,7 +155,7 @@ public: WebUIController* CreateWebUIControllerForURL(WebUI* web_ui, const GURL& url) const override { - return NULL; + return nullptr; } WebUI::TypeID GetWebUIType(BrowserContext* browser_context, const GURL& url) const override { @@ -1146,7 +1146,7 @@ // to activate IMEs. view()->UpdateTextInputState(); const IPC::Message* msg = render_thread_->sink().GetMessageAt(0); - EXPECT_TRUE(msg != NULL); + EXPECT_TRUE(msg != nullptr); EXPECT_EQ(ViewHostMsg_TextInputStateChanged::ID, msg->type()); ViewHostMsg_TextInputStateChanged::Param params; ViewHostMsg_TextInputStateChanged::Read(msg, ¶ms); @@ -1167,7 +1167,7 @@ // to de-activate IMEs. view()->UpdateTextInputState(); msg = render_thread_->sink().GetMessageAt(0); - EXPECT_TRUE(msg != NULL); + EXPECT_TRUE(msg != nullptr); EXPECT_EQ(ViewHostMsg_TextInputStateChanged::ID, msg->type()); ViewHostMsg_TextInputStateChanged::Read(msg, ¶ms); p = std::get<0>(params); @@ -1182,7 +1182,8 @@ test_case->input_id); // Move the input focus to the target <input> element, where we should // activate IMEs. - ExecuteJavaScriptAndReturnIntValue(base::ASCIIToUTF16(javascript), NULL); + ExecuteJavaScriptAndReturnIntValue(base::ASCIIToUTF16(javascript), + nullptr); base::RunLoop().RunUntilIdle(); render_thread_->sink().ClearMessages(); @@ -1191,7 +1192,7 @@ view()->UpdateTextInputState(); base::RunLoop().RunUntilIdle(); const IPC::Message* msg = render_thread_->sink().GetMessageAt(0); - EXPECT_TRUE(msg != NULL); + EXPECT_TRUE(msg != nullptr); EXPECT_EQ(ViewHostMsg_TextInputStateChanged::ID, msg->type()); ViewHostMsg_TextInputStateChanged::Read(msg, ¶ms); p = std::get<0>(params); @@ -1233,9 +1234,9 @@ }; static const ImeMessage kImeMessages[] = { // Scenario 1: input a Chinese word with Microsoft IME. - {IME_INITIALIZE, true, 0, 0, NULL, NULL}, - {IME_SETINPUTMODE, true, 0, 0, NULL, NULL}, - {IME_SETFOCUS, true, 0, 0, NULL, NULL}, + {IME_INITIALIZE, true, 0, 0, nullptr, nullptr}, + {IME_SETINPUTMODE, true, 0, 0, nullptr, nullptr}, + {IME_SETFOCUS, true, 0, 0, nullptr, nullptr}, {IME_SETCOMPOSITION, false, 1, 1, L"n", L"n"}, {IME_SETCOMPOSITION, false, 2, 2, L"ni", L"ni"}, {IME_SETCOMPOSITION, false, 3, 3, L"nih", L"nih"}, @@ -1243,9 +1244,9 @@ {IME_SETCOMPOSITION, false, 5, 5, L"nihao", L"nihao"}, {IME_COMMITTEXT, false, -1, -1, L"\x4F60\x597D", L"\x4F60\x597D"}, // Scenario 2: input a Japanese word with Microsoft IME. - {IME_INITIALIZE, true, 0, 0, NULL, NULL}, - {IME_SETINPUTMODE, true, 0, 0, NULL, NULL}, - {IME_SETFOCUS, true, 0, 0, NULL, NULL}, + {IME_INITIALIZE, true, 0, 0, nullptr, nullptr}, + {IME_SETINPUTMODE, true, 0, 0, nullptr, nullptr}, + {IME_SETFOCUS, true, 0, 0, nullptr, nullptr}, {IME_SETCOMPOSITION, false, 0, 1, L"\xFF4B", L"\xFF4B"}, {IME_SETCOMPOSITION, false, 0, 1, L"\x304B", L"\x304B"}, {IME_SETCOMPOSITION, false, 0, 2, L"\x304B\xFF4E", L"\x304B\xFF4E"}, @@ -1258,9 +1259,9 @@ {IME_FINISHCOMPOSINGTEXT, false, -1, -1, L"", L"\x6F22\x5B57"}, {IME_CANCELCOMPOSITION, false, -1, -1, L"", L"\x6F22\x5B57"}, // Scenario 3: input a Korean word with Microsot IME. - {IME_INITIALIZE, true, 0, 0, NULL, NULL}, - {IME_SETINPUTMODE, true, 0, 0, NULL, NULL}, - {IME_SETFOCUS, true, 0, 0, NULL, NULL}, + {IME_INITIALIZE, true, 0, 0, nullptr, nullptr}, + {IME_SETINPUTMODE, true, 0, 0, nullptr, nullptr}, + {IME_SETFOCUS, true, 0, 0, nullptr, nullptr}, {IME_SETCOMPOSITION, false, 0, 1, L"\x3147", L"\x3147"}, {IME_SETCOMPOSITION, false, 0, 1, L"\xC544", L"\xC544"}, {IME_SETCOMPOSITION, false, 0, 1, L"\xC548", L"\xC548"},
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index da65bb40..60cc78a 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc
@@ -545,7 +545,7 @@ page_zoom_level_(params.page_zoom_level), main_render_frame_(nullptr), frame_widget_(nullptr), - speech_recognition_dispatcher_(NULL), + speech_recognition_dispatcher_(nullptr), #if defined(OS_ANDROID) was_created_by_renderer_(false), #endif @@ -1117,7 +1117,7 @@ // IPC::Listener implementation ---------------------------------------------- bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) { - WebFrame* main_frame = webview() ? webview()->MainFrame() : NULL; + WebFrame* main_frame = webview() ? webview()->MainFrame() : nullptr; if (main_frame && main_frame->IsWebLocalFrame()) GetContentClient()->SetActiveURL( main_frame->ToWebLocalFrame()->GetDocument().Url()); @@ -1435,7 +1435,7 @@ RenderWidget* widget = RenderWidget::CreateForPopup(this, compositor_deps_, popup_type, screen_info_); if (!widget) - return NULL; + return nullptr; if (screen_metrics_emulator_) { widget->SetPopupOriginAdjustmentsForEmulation( screen_metrics_emulator_.get());
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index 51bf480e..200a56e 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc
@@ -517,7 +517,7 @@ default: NOTREACHED(); } - return NULL; + return nullptr; } void RenderWidget::CloseForFrame() { @@ -1080,7 +1080,7 @@ RenderThreadImpl* render_thread = RenderThreadImpl::current(); InputHandlerManager* input_handler_manager = - render_thread ? render_thread->input_handler_manager() : NULL; + render_thread ? render_thread->input_handler_manager() : nullptr; if (input_handler_manager) { input_handler_manager->ObserveGestureEventAndResultOnMainThread( routing_id_, gesture_event, scroll_result);
diff --git a/content/renderer/render_widget_fullscreen_pepper.cc b/content/renderer/render_widget_fullscreen_pepper.cc index 4206136..002c3ac7 100644 --- a/content/renderer/render_widget_fullscreen_pepper.cc +++ b/content/renderer/render_widget_fullscreen_pepper.cc
@@ -283,7 +283,7 @@ std::move(widget_request)), active_url_(active_url), plugin_(plugin), - layer_(NULL), + layer_(nullptr), mouse_lock_dispatcher_(new FullscreenMouseLockDispatcher(this)) {} RenderWidgetFullscreenPepper::~RenderWidgetFullscreenPepper() { @@ -304,12 +304,12 @@ void RenderWidgetFullscreenPepper::Destroy() { // This function is called by the plugin instance as it's going away, so reset // plugin_ to NULL to avoid calling into a dangling pointer e.g. on Close(). - plugin_ = NULL; + plugin_ = nullptr; // After calling Destroy(), the plugin instance assumes that the layer is not // used by us anymore, so it may destroy the layer before this object goes // away. - SetLayer(NULL); + SetLayer(nullptr); Send(new ViewHostMsg_Close(routing_id_)); Release();
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc index 7715e60..e3b789a 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -448,7 +448,7 @@ blink::WebCookieJar* RendererBlinkPlatformImpl::CookieJar() { NOTREACHED() << "Use WebFrameClient::cookieJar() instead!"; - return NULL; + return nullptr; } blink::WebThemeEngine* RendererBlinkPlatformImpl::ThemeEngine() { @@ -1236,7 +1236,7 @@ // hardware changes. In order to make that happen, they will receive a null // thread. if (thread && RenderThreadImpl::current()->layout_test_mode()) - thread = NULL; + thread = nullptr; switch (type) { case blink::kWebPlatformEventTypeDeviceMotion: @@ -1256,7 +1256,7 @@ "unknown type."; } - return NULL; + return nullptr; } void RendererBlinkPlatformImpl::SetPlatformEventObserverForTesting( @@ -1308,16 +1308,16 @@ PlatformEventObserverBase* observer = platform_event_observers_.Lookup(type); CHECK(observer); - void* data = 0; + void* data = nullptr; switch (type) { case blink::kWebPlatformEventTypeDeviceMotion: - if (!(g_test_device_motion_data == 0)) + if (!(g_test_device_motion_data == nullptr)) data = &g_test_device_motion_data.Get(); break; case blink::kWebPlatformEventTypeDeviceOrientation: case blink::kWebPlatformEventTypeDeviceOrientationAbsolute: - if (!(g_test_device_orientation_data == 0)) + if (!(g_test_device_orientation_data == nullptr)) data = &g_test_device_orientation_data.Get(); break; default:
diff --git a/content/renderer/savable_resources.cc b/content/renderer/savable_resources.cc index 24bcdb7..5f83331 100644 --- a/content/renderer/savable_resources.cc +++ b/content/renderer/savable_resources.cc
@@ -125,7 +125,7 @@ } WebString GetSubResourceLinkFromElement(const WebElement& element) { - const char* attribute_name = NULL; + const char* attribute_name = nullptr; if (element.HasHTMLTagName("img") || element.HasHTMLTagName("frame") || element.HasHTMLTagName("iframe") || element.HasHTMLTagName("script")) { attribute_name = "src";
diff --git a/content/renderer/service_worker/service_worker_dispatcher.cc b/content/renderer/service_worker/service_worker_dispatcher.cc index 1de2c5bb..d47090d 100644 --- a/content/renderer/service_worker/service_worker_dispatcher.cc +++ b/content/renderer/service_worker/service_worker_dispatcher.cc
@@ -154,7 +154,7 @@ base::SingleThreadTaskRunner* main_thread_task_runner) { if (g_dispatcher_tls.Pointer()->Get() == kHasBeenDeleted) { NOTREACHED() << "Re-instantiating TLS ServiceWorkerDispatcher."; - g_dispatcher_tls.Pointer()->Set(NULL); + g_dispatcher_tls.Pointer()->Set(nullptr); } if (g_dispatcher_tls.Pointer()->Get()) return static_cast<ServiceWorkerDispatcher*>( @@ -169,7 +169,7 @@ ServiceWorkerDispatcher* ServiceWorkerDispatcher::GetThreadSpecificInstance() { if (g_dispatcher_tls.Pointer()->Get() == kHasBeenDeleted) - return NULL; + return nullptr; return static_cast<ServiceWorkerDispatcher*>( g_dispatcher_tls.Pointer()->Get()); }
diff --git a/content/renderer/shared_memory_seqlock_reader.cc b/content/renderer/shared_memory_seqlock_reader.cc index 894ddbd..0f06c39 100644 --- a/content/renderer/shared_memory_seqlock_reader.cc +++ b/content/renderer/shared_memory_seqlock_reader.cc
@@ -16,13 +16,13 @@ base::SharedMemoryHandle shared_memory_handle, size_t buffer_size) { renderer_shared_memory_handle_ = shared_memory_handle; if (!base::SharedMemory::IsHandleValid(renderer_shared_memory_handle_)) - return 0; + return nullptr; renderer_shared_memory_.reset(new base::SharedMemory( renderer_shared_memory_handle_, true)); return (renderer_shared_memory_->Map(buffer_size)) - ? renderer_shared_memory_->memory() - : 0; + ? renderer_shared_memory_->memory() + : nullptr; } bool SharedMemorySeqLockReaderBase::FetchFromBuffer(
diff --git a/content/renderer/shared_worker/embedded_shared_worker_stub.cc b/content/renderer/shared_worker/embedded_shared_worker_stub.cc index b76cdfa..f71d64c54 100644 --- a/content/renderer/shared_worker/embedded_shared_worker_stub.cc +++ b/content/renderer/shared_worker/embedded_shared_worker_stub.cc
@@ -222,7 +222,7 @@ EmbeddedSharedWorkerStub::NotificationPresenter() { // TODO(horo): delete this method if we have no plan to implement this. NOTREACHED(); - return NULL; + return nullptr; } std::unique_ptr<blink::WebApplicationCacheHost>
diff --git a/content/renderer/skia_benchmarking_extension.cc b/content/renderer/skia_benchmarking_extension.cc index 006985f..eeb18e53 100644 --- a/content/renderer/skia_benchmarking_extension.cc +++ b/content/renderer/skia_benchmarking_extension.cc
@@ -210,12 +210,12 @@ std::unique_ptr<base::Value> params_value = content::V8ValueConverter::Create()->FromV8Value(params, context); - const base::DictionaryValue* params_dict = NULL; + const base::DictionaryValue* params_dict = nullptr; if (params_value.get() && params_value->GetAsDictionary(¶ms_dict)) { params_dict->GetDouble("scale", &scale); params_dict->GetInteger("stop", &stop_index); - const base::Value* clip_value = NULL; + const base::Value* clip_value = nullptr; if (params_dict->Get("clip", &clip_value)) cc::MathUtil::FromValue(clip_value, &clip_rect); }
diff --git a/content/renderer/speech_recognition_dispatcher.cc b/content/renderer/speech_recognition_dispatcher.cc index c846d6d0..5d5000d 100644 --- a/content/renderer/speech_recognition_dispatcher.cc +++ b/content/renderer/speech_recognition_dispatcher.cc
@@ -36,7 +36,7 @@ SpeechRecognitionDispatcher::SpeechRecognitionDispatcher( RenderViewImpl* render_view) : RenderViewObserver(render_view), - recognizer_client_(NULL), + recognizer_client_(nullptr), next_id_(1) {} SpeechRecognitionDispatcher::~SpeechRecognitionDispatcher() {}
diff --git a/content/renderer/stats_collection_controller.cc b/content/renderer/stats_collection_controller.cc index 8abbf2ab..a3462ec6 100644 --- a/content/renderer/stats_collection_controller.cc +++ b/content/renderer/stats_collection_controller.cc
@@ -136,7 +136,7 @@ } std::string StatsCollectionController::GetTabLoadTiming() { - RenderViewImpl *render_view_impl = NULL; + RenderViewImpl* render_view_impl = nullptr; bool result = CurrentRenderViewImpl(&render_view_impl); DCHECK(result);
diff --git a/content/renderer/v8_value_converter_impl.cc b/content/renderer/v8_value_converter_impl.cc index 78979c33..a80d2de 100644 --- a/content/renderer/v8_value_converter_impl.cc +++ b/content/renderer/v8_value_converter_impl.cc
@@ -186,7 +186,7 @@ strip_null_from_objects_(false), convert_negative_zero_to_int_(false), avoid_identity_hash_for_testing_(false), - strategy_(NULL) {} + strategy_(nullptr) {} void V8ValueConverterImpl::SetDateAllowed(bool val) { date_allowed_ = val; @@ -292,7 +292,7 @@ v8::Local<v8::Context> context = isolate->GetCurrentContext(); for (size_t i = 0; i < val->GetSize(); ++i) { - const base::Value* child = NULL; + const base::Value* child = nullptr; CHECK(val->Get(i, &child)); v8::Local<v8::Value> child_v8 =
diff --git a/content/renderer/v8_value_converter_impl_unittest.cc b/content/renderer/v8_value_converter_impl_unittest.cc index b5afcaaf..b1cedff 100644 --- a/content/renderer/v8_value_converter_impl_unittest.cc +++ b/content/renderer/v8_value_converter_impl_unittest.cc
@@ -61,7 +61,7 @@ void SetUp() override { v8::HandleScope handle_scope(isolate_); v8::Local<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate_); - context_.Reset(isolate_, v8::Context::New(isolate_, NULL, global)); + context_.Reset(isolate_, v8::Context::New(isolate_, nullptr, global)); } void TearDown() override { context_.Reset(); } @@ -127,7 +127,7 @@ } bool IsNull(base::DictionaryValue* value, const std::string& key) { - base::Value* child = NULL; + base::Value* child = nullptr; if (!value->Get(key, &child)) { ADD_FAILURE(); return false; @@ -146,7 +146,7 @@ } bool IsNull(base::ListValue* value, uint32_t index) { - base::Value* child = NULL; + base::Value* child = nullptr; if (!value->Get(static_cast<size_t>(index), &child)) { ADD_FAILURE(); return false; @@ -186,7 +186,7 @@ ASSERT_TRUE(dictionary.get()); if (expected_value) { - base::Value* temp = NULL; + base::Value* temp = nullptr; ASSERT_TRUE(dictionary->Get("test", &temp)); EXPECT_EQ(expected_type, temp->type()); EXPECT_TRUE(expected_value->Equals(temp)); @@ -200,14 +200,14 @@ base::ListValue::From(converter.FromV8Value(array, context))); ASSERT_TRUE(list.get()); if (expected_value) { - base::Value* temp = NULL; + base::Value* temp = nullptr; ASSERT_TRUE(list->Get(0, &temp)); EXPECT_EQ(expected_type, temp->type()); EXPECT_TRUE(expected_value->Equals(temp)); } else { // Arrays should preserve their length, and convert unconvertible // types into null. - base::Value* temp = NULL; + base::Value* temp = nullptr; ASSERT_TRUE(list->Get(0, &temp)); EXPECT_EQ(base::Value::Type::NONE, temp->type()); } @@ -942,7 +942,7 @@ base::Value* current = value.get(); for (int i = 1; i < kExpectedDepth; ++i) { - base::DictionaryValue* current_as_object = NULL; + base::DictionaryValue* current_as_object = nullptr; ASSERT_TRUE(current->GetAsDictionary(¤t_as_object)) << i; ASSERT_TRUE(current_as_object->Get(kKey, ¤t)) << i; }
diff --git a/content/shell/browser/layout_test/blink_test_controller.cc b/content/shell/browser/layout_test/blink_test_controller.cc index bdc5114..f89bb3d 100644 --- a/content/shell/browser/layout_test/blink_test_controller.cc +++ b/content/shell/browser/layout_test/blink_test_controller.cc
@@ -303,7 +303,7 @@ // BlinkTestController ------------------------------------------------------- -BlinkTestController* BlinkTestController::instance_ = NULL; +BlinkTestController* BlinkTestController::instance_ = nullptr; // static BlinkTestController* BlinkTestController::Get() { @@ -312,7 +312,7 @@ } BlinkTestController::BlinkTestController() - : main_window_(NULL), + : main_window_(nullptr), secondary_window_(nullptr), devtools_window_(nullptr), test_phase_(BETWEEN_TESTS), @@ -348,7 +348,7 @@ CHECK(test_phase_ == BETWEEN_TESTS); GpuDataManager::GetInstance()->RemoveObserver(this); DiscardMainWindow(); - instance_ = NULL; + instance_ = nullptr; } bool BlinkTestController::PrepareForLayoutTest( @@ -381,11 +381,8 @@ test_url_.spec().find("compositing/") != std::string::npos; initial_size_ = Shell::GetShellDefaultSize(); if (!main_window_) { - main_window_ = content::Shell::CreateNewWindow( - browser_context, - GURL(), - NULL, - initial_size_); + main_window_ = content::Shell::CreateNewWindow(browser_context, GURL(), + nullptr, initial_size_); WebContentsObserver::Observe(main_window_->web_contents()); if (is_devtools_protocol_test) { devtools_protocol_test_bindings_.reset( @@ -692,7 +689,7 @@ // discard the main window. devtools_bindings_.reset(); devtools_protocol_test_bindings_.reset(); - WebContentsObserver::Observe(NULL); + WebContentsObserver::Observe(nullptr); if (test_phase_ != BETWEEN_TESTS) { Shell::CloseAllWindows(); base::ThreadTaskRunnerHandle::Get()->PostTask( @@ -701,7 +698,7 @@ } else if (main_window_) { main_window_->Close(); } - main_window_ = NULL; + main_window_ = nullptr; current_pid_ = base::kNullProcessId; } @@ -951,7 +948,7 @@ ShellBrowserContext* browser_context = ShellContentBrowserClient::Get()->browser_context(); StoragePartition* storage_partition = - BrowserContext::GetStoragePartition(browser_context, NULL); + BrowserContext::GetStoragePartition(browser_context, nullptr); storage_partition->GetDOMStorageContext()->DeleteLocalStorage( content::LayoutTestDevToolsBindings::GetDevToolsPathAsURL("") .GetOrigin());
diff --git a/content/shell/browser/layout_test/layout_test_message_filter.cc b/content/shell/browser/layout_test/layout_test_message_filter.cc index c282c959..c92d858 100644 --- a/content/shell/browser/layout_test/layout_test_message_filter.cc +++ b/content/shell/browser/layout_test/layout_test_message_filter.cc
@@ -103,7 +103,7 @@ ChildProcessSecurityPolicy* policy = ChildProcessSecurityPolicy::GetInstance(); for (size_t i = 0; i < absolute_filenames.size(); ++i) { - files.AddPath(absolute_filenames[i], NULL); + files.AddPath(absolute_filenames[i], nullptr); if (!policy->CanReadFile(render_process_id_, absolute_filenames[i])) policy->GrantReadFile(render_process_id_, absolute_filenames[i]); }
diff --git a/content/shell/browser/layout_test/layout_test_resource_dispatcher_host_delegate.cc b/content/shell/browser/layout_test/layout_test_resource_dispatcher_host_delegate.cc index c96b127..061725c 100644 --- a/content/shell/browser/layout_test/layout_test_resource_dispatcher_host_delegate.cc +++ b/content/shell/browser/layout_test/layout_test_resource_dispatcher_host_delegate.cc
@@ -20,7 +20,7 @@ ResourceDispatcherHostLoginDelegate* LayoutTestResourceDispatcherHostDelegate::CreateLoginDelegate( net::AuthChallengeInfo* auth_info, net::URLRequest* request) { - return NULL; + return nullptr; } } // namespace content
diff --git a/content/shell/browser/shell.cc b/content/shell/browser/shell.cc index e08a7ba..392fe05f 100644 --- a/content/shell/browser/shell.cc +++ b/content/shell/browser/shell.cc
@@ -75,9 +75,9 @@ Shell::Shell(WebContents* web_contents) : WebContentsObserver(web_contents), web_contents_(web_contents), - devtools_frontend_(NULL), + devtools_frontend_(nullptr), is_fullscreen_(false), - window_(NULL), + window_(nullptr), #if defined(OS_MACOSX) url_edit_view_(NULL), #endif @@ -172,7 +172,7 @@ return windows_[i]; } } - return NULL; + return nullptr; } // static @@ -318,12 +318,12 @@ return; devtools_observer_.reset(); devtools_frontend_->Close(); - devtools_frontend_ = NULL; + devtools_frontend_ = nullptr; } gfx::NativeView Shell::GetContentView() { if (!web_contents_) - return NULL; + return nullptr; return web_contents_->GetNativeView(); } @@ -542,7 +542,7 @@ void Shell::OnDevToolsWebContentsDestroyed() { devtools_observer_.reset(); - devtools_frontend_ = NULL; + devtools_frontend_ = nullptr; } } // namespace content
diff --git a/content/shell/browser/shell_browser_context.cc b/content/shell/browser/shell_browser_context.cc index 825f75d..1f68e33 100644 --- a/content/shell/browser/shell_browser_context.cc +++ b/content/shell/browser/shell_browser_context.cc
@@ -35,8 +35,7 @@ namespace content { ShellBrowserContext::ShellResourceContext::ShellResourceContext() - : getter_(NULL) { -} + : getter_(nullptr) {} ShellBrowserContext::ShellResourceContext::~ShellResourceContext() { } @@ -59,7 +58,7 @@ ignore_certificate_errors_(false), off_the_record_(off_the_record), net_log_(net_log), - guest_manager_(NULL) { + guest_manager_(nullptr) { InitWhileIOAllowed(); BrowserContextDependencyManager::GetInstance()-> CreateBrowserContextServices(this); @@ -206,15 +205,15 @@ } storage::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() { - return NULL; + return nullptr; } PushMessagingService* ShellBrowserContext::GetPushMessagingService() { - return NULL; + return nullptr; } SSLHostStateDelegate* ShellBrowserContext::GetSSLHostStateDelegate() { - return NULL; + return nullptr; } PermissionManager* ShellBrowserContext::GetPermissionManager() {
diff --git a/content/shell/browser/shell_browser_main_parts.cc b/content/shell/browser/shell_browser_main_parts.cc index f35cb4f..17c5843 100644 --- a/content/shell/browser/shell_browser_main_parts.cc +++ b/content/shell/browser/shell_browser_main_parts.cc
@@ -147,9 +147,7 @@ void ShellBrowserMainParts::InitializeMessageLoopContext() { ui::MaterialDesignController::Initialize(); - Shell::CreateNewWindow(browser_context_.get(), - GetStartupURL(), - NULL, + Shell::CreateNewWindow(browser_context_.get(), GetStartupURL(), nullptr, gfx::Size()); }
diff --git a/content/shell/browser/shell_content_browser_client.cc b/content/shell/browser/shell_content_browser_client.cc index aeb5d0b..855aca4 100644 --- a/content/shell/browser/shell_content_browser_client.cc +++ b/content/shell/browser/shell_content_browser_client.cc
@@ -103,21 +103,21 @@ command_line.GetSwitchValueASCII(switches::kProcessType); if (process_type == switches::kRendererProcess) { - static breakpad::CrashHandlerHostLinux* crash_handler = NULL; + static breakpad::CrashHandlerHostLinux* crash_handler = nullptr; if (!crash_handler) crash_handler = CreateCrashHandlerHost(process_type); return crash_handler->GetDeathSignalSocket(); } if (process_type == switches::kPpapiPluginProcess) { - static breakpad::CrashHandlerHostLinux* crash_handler = NULL; + static breakpad::CrashHandlerHostLinux* crash_handler = nullptr; if (!crash_handler) crash_handler = CreateCrashHandlerHost(process_type); return crash_handler->GetDeathSignalSocket(); } if (process_type == switches::kGpuProcess) { - static breakpad::CrashHandlerHostLinux* crash_handler = NULL; + static breakpad::CrashHandlerHostLinux* crash_handler = nullptr; if (!crash_handler) crash_handler = CreateCrashHandlerHost(process_type); return crash_handler->GetDeathSignalSocket(); @@ -138,13 +138,13 @@ } ShellContentBrowserClient::ShellContentBrowserClient() - : shell_browser_main_parts_(NULL) { + : shell_browser_main_parts_(nullptr) { DCHECK(!g_browser_client); g_browser_client = this; } ShellContentBrowserClient::~ShellContentBrowserClient() { - g_browser_client = NULL; + g_browser_client = nullptr; } BrowserMainParts* ShellContentBrowserClient::CreateBrowserMainParts(
diff --git a/content/shell/browser/shell_devtools_bindings.cc b/content/shell/browser/shell_devtools_bindings.cc index eefddf4bf..708b73b 100644 --- a/content/shell/browser/shell_devtools_bindings.cc +++ b/content/shell/browser/shell_devtools_bindings.cc
@@ -194,8 +194,8 @@ if (!agent_host_) return; std::string method; - base::ListValue* params = NULL; - base::DictionaryValue* dict = NULL; + base::ListValue* params = nullptr; + base::DictionaryValue* dict = nullptr; std::unique_ptr<base::Value> parsed_message = base::JSONReader::Read(message); if (!parsed_message || !parsed_message->GetAsDictionary(&dict) || !dict->GetString("method", &method)) {
diff --git a/content/shell/browser/shell_devtools_frontend.cc b/content/shell/browser/shell_devtools_frontend.cc index 2662465..b8c258a 100644 --- a/content/shell/browser/shell_devtools_frontend.cc +++ b/content/shell/browser/shell_devtools_frontend.cc
@@ -28,9 +28,7 @@ ShellDevToolsFrontend* ShellDevToolsFrontend::Show( WebContents* inspected_contents) { Shell* shell = Shell::CreateNewWindow(inspected_contents->GetBrowserContext(), - GURL(), - NULL, - gfx::Size()); + GURL(), nullptr, gfx::Size()); ShellDevToolsFrontend* devtools_frontend = new ShellDevToolsFrontend(shell, inspected_contents); shell->LoadURL(GetFrontendURL());
diff --git a/content/shell/browser/shell_download_manager_delegate.cc b/content/shell/browser/shell_download_manager_delegate.cc index 48f79c8..ebefd9c 100644 --- a/content/shell/browser/shell_download_manager_delegate.cc +++ b/content/shell/browser/shell_download_manager_delegate.cc
@@ -35,14 +35,14 @@ namespace content { ShellDownloadManagerDelegate::ShellDownloadManagerDelegate() - : download_manager_(NULL), + : download_manager_(nullptr), suppress_prompting_(false), weak_ptr_factory_(this) {} ShellDownloadManagerDelegate::~ShellDownloadManagerDelegate() { if (download_manager_) { - download_manager_->SetDelegate(NULL); - download_manager_ = NULL; + download_manager_->SetDelegate(nullptr); + download_manager_ = nullptr; } } @@ -56,7 +56,7 @@ // Revoke any pending callbacks. download_manager_ et. al. are no longer safe // to access after this point. weak_ptr_factory_.InvalidateWeakPtrs(); - download_manager_ = NULL; + download_manager_ = nullptr; } bool ShellDownloadManagerDelegate::DetermineDownloadTarget(
diff --git a/content/shell/browser/shell_platform_data_aura.cc b/content/shell/browser/shell_platform_data_aura.cc index 89911a06..be1d936 100644 --- a/content/shell/browser/shell_platform_data_aura.cc +++ b/content/shell/browser/shell_platform_data_aura.cc
@@ -57,7 +57,7 @@ } -ShellPlatformDataAura* Shell::platform_ = NULL; +ShellPlatformDataAura* Shell::platform_ = nullptr; ShellPlatformDataAura::ShellPlatformDataAura(const gfx::Size& initial_size) { CHECK(aura::Env::GetInstance());
diff --git a/content/shell/browser/shell_resource_dispatcher_host_delegate.cc b/content/shell/browser/shell_resource_dispatcher_host_delegate.cc index 101053c..961583f 100644 --- a/content/shell/browser/shell_resource_dispatcher_host_delegate.cc +++ b/content/shell/browser/shell_resource_dispatcher_host_delegate.cc
@@ -23,12 +23,12 @@ if (!login_request_callback_.is_null()) { login_request_callback_.Run(); login_request_callback_.Reset(); - return NULL; + return nullptr; } #if !defined(OS_MACOSX) // TODO: implement ShellLoginDialog for other platforms, drop this #if - return NULL; + return nullptr; #else return new ShellLoginDialog(auth_info, request); #endif
diff --git a/content/shell/browser/shell_speech_recognition_manager_delegate.cc b/content/shell/browser/shell_speech_recognition_manager_delegate.cc index 2d51634..3ff3ac5 100644 --- a/content/shell/browser/shell_speech_recognition_manager_delegate.cc +++ b/content/shell/browser/shell_speech_recognition_manager_delegate.cc
@@ -23,7 +23,7 @@ SpeechRecognitionEventListener* ShellSpeechRecognitionManagerDelegate::GetEventListener() { - return NULL; + return nullptr; } bool ShellSpeechRecognitionManagerDelegate::FilterProfanities(
diff --git a/content/shell/browser/shell_views.cc b/content/shell/browser/shell_views.cc index e18980e..5ed4fb8 100644 --- a/content/shell/browser/shell_views.cc +++ b/content/shell/browser/shell_views.cc
@@ -254,7 +254,7 @@ void WindowClosing() override { if (shell_) { delete shell_; - shell_ = NULL; + shell_ = nullptr; } }
diff --git a/content/shell/renderer/layout_test/layout_test_render_thread_observer.cc b/content/shell/renderer/layout_test/layout_test_render_thread_observer.cc index f2ce224..29fff0ce 100644 --- a/content/shell/renderer/layout_test/layout_test_render_thread_observer.cc +++ b/content/shell/renderer/layout_test/layout_test_render_thread_observer.cc
@@ -17,7 +17,7 @@ namespace content { namespace { -LayoutTestRenderThreadObserver* g_instance = NULL; +LayoutTestRenderThreadObserver* g_instance = nullptr; } // static @@ -38,7 +38,7 @@ LayoutTestRenderThreadObserver::~LayoutTestRenderThreadObserver() { CHECK(g_instance == this); - g_instance = NULL; + g_instance = nullptr; } bool LayoutTestRenderThreadObserver::OnControlMessageReceived(
diff --git a/content/shell/renderer/layout_test/test_media_stream_renderer_factory.cc b/content/shell/renderer/layout_test/test_media_stream_renderer_factory.cc index 53efad0..49e7433 100644 --- a/content/shell/renderer/layout_test/test_media_stream_renderer_factory.cc +++ b/content/shell/renderer/layout_test/test_media_stream_renderer_factory.cc
@@ -49,7 +49,7 @@ const scoped_refptr<base::TaskRunner>& worker_task_runner, media::GpuVideoAcceleratorFactories* gpu_factories) { if (!IsMockMediaStreamWithVideo(web_stream)) - return NULL; + return nullptr; return new TestMediaStreamVideoRenderer( io_task_runner, gfx::Size(kVideoCaptureWidth, kVideoCaptureHeight), @@ -63,7 +63,7 @@ int render_frame_id, const std::string& device_id, const url::Origin& security_origin) { - return NULL; + return nullptr; } } // namespace content
diff --git a/content/shell/test_runner/event_sender.cc b/content/shell/test_runner/event_sender.cc index b5ad2166..a6f966d 100644 --- a/content/shell/test_runner/event_sender.cc +++ b/content/shell/test_runner/event_sender.cc
@@ -425,7 +425,7 @@ static const char* kNonEditableMenuStrings[] = { "Back", "Reload Page", "Open in Dashbaord", "<separator>", "View Source", "Save Page As", - "Print Page", "Inspect Element", 0}; + "Print Page", "Inspect Element", nullptr}; static const char* kEditableMenuStrings[] = {"Cut", "Copy", "<separator>", @@ -436,7 +436,7 @@ "Speech", "Paragraph Direction", "<separator>", - 0}; + nullptr}; // This is possible because mouse events are cancelleable. if (!context_menu)
diff --git a/content/shell/test_runner/mock_screen_orientation_client.cc b/content/shell/test_runner/mock_screen_orientation_client.cc index fe119e1c..ce5be4f7 100644 --- a/content/shell/test_runner/mock_screen_orientation_client.cc +++ b/content/shell/test_runner/mock_screen_orientation_client.cc
@@ -15,7 +15,7 @@ namespace test_runner { MockScreenOrientationClient::MockScreenOrientationClient() - : main_frame_(NULL), + : main_frame_(nullptr), current_lock_(blink::kWebScreenOrientationLockDefault), device_orientation_(blink::kWebScreenOrientationPortraitPrimary), current_orientation_(blink::kWebScreenOrientationPortraitPrimary),
diff --git a/content/shell/test_runner/mock_web_media_stream_center.cc b/content/shell/test_runner/mock_web_media_stream_center.cc index b2fd36b6..d880d83 100644 --- a/content/shell/test_runner/mock_web_media_stream_center.cc +++ b/content/shell/test_runner/mock_web_media_stream_center.cc
@@ -68,7 +68,7 @@ blink::WebAudioSourceProvider* MockWebMediaStreamCenter::CreateWebAudioSourceFromMediaStreamTrack( const blink::WebMediaStreamTrack& track) { - return NULL; + return nullptr; } } // namespace test_runner
diff --git a/content/shell/test_runner/mock_web_speech_recognizer.cc b/content/shell/test_runner/mock_web_speech_recognizer.cc index b8a8b4a4..154d52e 100644 --- a/content/shell/test_runner/mock_web_speech_recognizer.cc +++ b/content/shell/test_runner/mock_web_speech_recognizer.cc
@@ -156,7 +156,7 @@ : client_(nullptr), was_aborted_(false), task_queue_running_(false), - delegate_(0), + delegate_(nullptr), weak_factory_(this) {} MockWebSpeechRecognizer::~MockWebSpeechRecognizer() {
diff --git a/content/shell/test_runner/spell_check_client.cc b/content/shell/test_runner/spell_check_client.cc index a2a5f3c..d87d3c5 100644 --- a/content/shell/test_runner/spell_check_client.cc +++ b/content/shell/test_runner/spell_check_client.cc
@@ -123,7 +123,7 @@ &results); } last_requested_text_checking_completion_->DidFinishCheckingText(results); - last_requested_text_checking_completion_ = 0; + last_requested_text_checking_completion_ = nullptr; RequestResolved(); if (test_runner_->shouldDumpSpellCheckCallbacks())
diff --git a/content/shell/test_runner/test_interfaces.cc b/content/shell/test_runner/test_interfaces.cc index c7f0e08..67d0785 100644 --- a/content/shell/test_runner/test_interfaces.cc +++ b/content/shell/test_runner/test_interfaces.cc
@@ -168,7 +168,7 @@ blink::WebThemeEngine* TestInterfaces::GetThemeEngine() { if (!test_runner_->UseMockTheme()) - return 0; + return nullptr; if (!theme_engine_.get()) theme_engine_.reset(new MockWebThemeEngine()); return theme_engine_.get();
diff --git a/content/shell/test_runner/test_plugin.cc b/content/shell/test_runner/test_plugin.cc index d1deb5e6..308fe51d6 100644 --- a/content/shell/test_runner/test_plugin.cc +++ b/content/shell/test_runner/test_plugin.cc
@@ -203,9 +203,9 @@ if (layer_.get()) layer_->ClearTexture(); if (container_) - container_->SetWebLayer(0); + container_->SetWebLayer(nullptr); web_layer_.reset(); - layer_ = NULL; + layer_ = nullptr; DestroyScene(); gl_ = nullptr; @@ -251,7 +251,7 @@ gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); gl_->TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, rect_.width, rect_.height, 0, - GL_RGBA, GL_UNSIGNED_BYTE, 0); + GL_RGBA, GL_UNSIGNED_BYTE, nullptr); gl_->BindFramebuffer(GL_FRAMEBUFFER, framebuffer_); gl_->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, color_texture_, 0); @@ -468,7 +468,7 @@ const float vertices[] = {0.0f, 0.8f, 0.0f, -0.8f, -0.8f, 0.0f, 0.8f, -0.8f, 0.0f}; gl_->BindBuffer(GL_ARRAY_BUFFER, scene_.vbo); - gl_->BufferData(GL_ARRAY_BUFFER, sizeof(vertices), 0, GL_STATIC_DRAW); + gl_->BufferData(GL_ARRAY_BUFFER, sizeof(vertices), nullptr, GL_STATIC_DRAW); gl_->BufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertices), vertices); return true; } @@ -564,7 +564,7 @@ blink::WebDragOperationsMask mask, const blink::WebPoint& position, const blink::WebPoint& screen_position) { - const char* drag_status_name = 0; + const char* drag_status_name = nullptr; switch (drag_status) { case blink::kWebDragStatusEnter: drag_status_name = "DragEnter";
diff --git a/content/shell/test_runner/test_runner_for_specific_view.cc b/content/shell/test_runner/test_runner_for_specific_view.cc index 55ddb55..84be446 100644 --- a/content/shell/test_runner/test_runner_for_specific_view.cc +++ b/content/shell/test_runner/test_runner_for_specific_view.cc
@@ -655,7 +655,7 @@ WebLocalFrame* frame = GetLocalMainFrame(); const bool find_result = frame->Find(0, WebString::FromUTF8(search_text), - find_options, wrap_around, 0); + find_options, wrap_around, nullptr); frame->StopFinding(WebLocalFrame::kStopFindActionKeepSelection); return find_result; }
diff --git a/content/shell/test_runner/web_ax_object_proxy.cc b/content/shell/test_runner/web_ax_object_proxy.cc index 0f51a6a..f567ae12 100644 --- a/content/shell/test_runner/web_ax_object_proxy.cc +++ b/content/shell/test_runner/web_ax_object_proxy.cc
@@ -1554,7 +1554,7 @@ } bool WebAXObjectProxy::IsEqual(v8::Local<v8::Object> proxy) { - WebAXObjectProxy* unwrapped_proxy = NULL; + WebAXObjectProxy* unwrapped_proxy = nullptr; if (!gin::ConvertFromV8(blink::MainThreadIsolate(), proxy, &unwrapped_proxy)) return false; return unwrapped_proxy->IsEqualToObject(accessibility_object_); @@ -1883,7 +1883,7 @@ v8::HandleScope handle_scope(isolate); size_t elementCount = elements_.Size(); for (size_t i = 0; i < elementCount; i++) { - WebAXObjectProxy* unwrapped_object = NULL; + WebAXObjectProxy* unwrapped_object = nullptr; bool result = gin::ConvertFromV8(isolate, elements_.Get(i), &unwrapped_object); DCHECK(result); @@ -1902,7 +1902,7 @@ size_t elementCount = elements_.Size(); for (size_t i = 0; i < elementCount; i++) { - WebAXObjectProxy* unwrapped_object = NULL; + WebAXObjectProxy* unwrapped_object = nullptr; bool result = gin::ConvertFromV8(isolate, elements_.Get(i), &unwrapped_object); DCHECK(result);
diff --git a/content/shell/test_runner/web_frame_test_client.cc b/content/shell/test_runner/web_frame_test_client.cc index 6157875..c8890fb2 100644 --- a/content/shell/test_runner/web_frame_test_client.cc +++ b/content/shell/test_runner/web_frame_test_client.cc
@@ -239,7 +239,7 @@ if (!test_runner()->TestIsRunning()) return; - const char* event_name = NULL; + const char* event_name = nullptr; switch (event) { case blink::kWebAXEventActiveDescendantChanged: event_name = "ActiveDescendantChanged";
diff --git a/content/test/appcache_test_helper.cc b/content/test/appcache_test_helper.cc index 36ee461..9f6c350 100644 --- a/content/test/appcache_test_helper.cc +++ b/content/test/appcache_test_helper.cc
@@ -16,10 +16,7 @@ namespace content { AppCacheTestHelper::AppCacheTestHelper() - : group_id_(0), - appcache_id_(0), - response_id_(0), - origins_(NULL) {} + : group_id_(0), appcache_id_(0), response_id_(0), origins_(nullptr) {} AppCacheTestHelper::~AppCacheTestHelper() {}
diff --git a/content/test/blink_test_environment.cc b/content/test/blink_test_environment.cc index 6ba2ecd..2532e16 100644 --- a/content/test/blink_test_environment.cc +++ b/content/test/blink_test_environment.cc
@@ -95,7 +95,7 @@ if (RunningOnValgrind()) blink::WebCache::Clear(); delete test_environment; - test_environment = NULL; + test_environment = nullptr; } } // namespace content
diff --git a/content/test/content_test_suite.cc b/content/test/content_test_suite.cc index 51a9b923..2f7519c 100644 --- a/content/test/content_test_suite.cc +++ b/content/test/content_test_suite.cc
@@ -39,8 +39,7 @@ class TestInitializationListener : public testing::EmptyTestEventListener { public: - TestInitializationListener() : test_content_client_initializer_(NULL) { - } + TestInitializationListener() : test_content_client_initializer_(nullptr) {} void OnTestStart(const testing::TestInfo& test_info) override { test_content_client_initializer_ =
diff --git a/content/test/layouttest_support.cc b/content/test/layouttest_support.cc index a56bd05..1eadf3c 100644 --- a/content/test/layouttest_support.cc +++ b/content/test/layouttest_support.cc
@@ -107,7 +107,7 @@ const mojom::CreateViewParams& params) { WebViewTestProxyType* render_view_proxy = new WebViewTestProxyType(compositor_deps, params); - if (g_view_test_proxy_callback == 0) + if (g_view_test_proxy_callback == nullptr) return render_view_proxy; g_view_test_proxy_callback.Get().Run(render_view_proxy, render_view_proxy); return render_view_proxy; @@ -138,7 +138,7 @@ RenderFrameImpl* CreateWebFrameTestProxy(RenderFrameImpl::CreateParams params) { WebFrameTestProxyType* render_frame_proxy = new WebFrameTestProxyType(std::move(params)); - if (g_frame_test_proxy_callback == 0) + if (g_frame_test_proxy_callback == nullptr) return render_frame_proxy; g_frame_test_proxy_callback.Get().Run(render_frame_proxy, render_frame_proxy); return render_frame_proxy;
diff --git a/content/test/ppapi_unittest.cc b/content/test/ppapi_unittest.cc index 2d29083..8e1b23d 100644 --- a/content/test/ppapi_unittest.cc +++ b/content/test/ppapi_unittest.cc
@@ -21,7 +21,7 @@ namespace { -PpapiUnittest* current_unittest = NULL; +PpapiUnittest* current_unittest = nullptr; const void* MockGetInterface(const char* interface_name) { return current_unittest->GetMockInterface(interface_name); @@ -73,7 +73,7 @@ PpapiUnittest::~PpapiUnittest() { DCHECK(current_unittest == this); - current_unittest = NULL; + current_unittest = nullptr; } void PpapiUnittest::SetUp() { @@ -92,26 +92,27 @@ CHECK(module_->renderer_ppapi_host()); // Initialize the mock instance. - instance_ = PepperPluginInstanceImpl::Create(NULL, module(), NULL, GURL()); + instance_ = + PepperPluginInstanceImpl::Create(nullptr, module(), nullptr, GURL()); } void PpapiUnittest::TearDown() { - instance_ = NULL; - module_ = NULL; + instance_ = nullptr; + module_ = nullptr; PluginModule::ResetHostGlobalsForTest(); } const void* PpapiUnittest::GetMockInterface(const char* interface_name) const { if (strcmp(interface_name, PPP_INSTANCE_INTERFACE_1_0) == 0) return &mock_instance_interface; - return NULL; + return nullptr; } void PpapiUnittest::ShutdownModule() { DCHECK(instance_->HasOneRef()); - instance_ = NULL; + instance_ = nullptr; DCHECK(module_->HasOneRef()); - module_ = NULL; + module_ = nullptr; } void PpapiUnittest::SetViewSize(int width, int height) const {
diff --git a/content/test/test_blink_web_unit_test_support.cc b/content/test/test_blink_web_unit_test_support.cc index 895aef1..a6261a6 100644 --- a/content/test/test_blink_web_unit_test_support.cc +++ b/content/test/test_blink_web_unit_test_support.cc
@@ -214,7 +214,7 @@ blink::WebIDBFactory* TestBlinkWebUnitTestSupport::IdbFactory() { NOTREACHED() << "IndexedDB cannot be tested with in-process harnesses."; - return NULL; + return nullptr; } std::unique_ptr<blink::WebURLLoaderFactory>
diff --git a/content/test/test_navigation_url_loader_factory.cc b/content/test/test_navigation_url_loader_factory.cc index cf77eb5b..904c25e0 100644 --- a/content/test/test_navigation_url_loader_factory.cc +++ b/content/test/test_navigation_url_loader_factory.cc
@@ -17,7 +17,7 @@ } TestNavigationURLLoaderFactory::~TestNavigationURLLoaderFactory() { - NavigationURLLoader::SetFactoryForTesting(NULL); + NavigationURLLoader::SetFactoryForTesting(nullptr); } std::unique_ptr<NavigationURLLoader>
diff --git a/content/test/test_render_frame_host.cc b/content/test/test_render_frame_host.cc index 2dfdae69..4522b910 100644 --- a/content/test/test_render_frame_host.cc +++ b/content/test/test_render_frame_host.cc
@@ -37,8 +37,7 @@ TestRenderFrameHostCreationObserver::TestRenderFrameHostCreationObserver( WebContents* web_contents) - : WebContentsObserver(web_contents), last_created_frame_(NULL) { -} + : WebContentsObserver(web_contents), last_created_frame_(nullptr) {} TestRenderFrameHostCreationObserver::~TestRenderFrameHostCreationObserver() { } @@ -94,7 +93,8 @@ widget_routing_id, flags, false), - child_creation_observer_(delegate ? delegate->GetAsWebContents() : NULL), + child_creation_observer_(delegate ? delegate->GetAsWebContents() + : nullptr), contents_mime_type_("text/html"), simulate_history_list_was_cleared_(false), last_commit_was_error_page_(false) {}
diff --git a/content/test/test_render_view_host_factory.cc b/content/test/test_render_view_host_factory.cc index fdb187d..6c034d5 100644 --- a/content/test/test_render_view_host_factory.cc +++ b/content/test/test_render_view_host_factory.cc
@@ -20,7 +20,7 @@ TestRenderViewHostFactory::~TestRenderViewHostFactory() { RenderViewHostFactory::UnregisterFactory(); - RenderProcessHostImpl::set_render_process_host_factory(NULL); + RenderProcessHostImpl::set_render_process_host_factory(nullptr); } void TestRenderViewHostFactory::set_render_process_host_factory(
diff --git a/content/test/test_web_contents.cc b/content/test/test_web_contents.cc index ace913a..3f080a9 100644 --- a/content/test/test_web_contents.cc +++ b/content/test/test_web_contents.cc
@@ -36,10 +36,9 @@ TestWebContents::TestWebContents(BrowserContext* browser_context) : WebContentsImpl(browser_context), - delegate_view_override_(NULL), + delegate_view_override_(nullptr), expect_set_history_offset_and_length_(false), - expect_set_history_offset_and_length_history_length_(0) { -} + expect_set_history_offset_and_length_history_length_(0) {} TestWebContents* TestWebContents::Create(BrowserContext* browser_context, scoped_refptr<SiteInstance> instance) {
diff --git a/content/zygote/zygote_linux.cc b/content/zygote/zygote_linux.cc index 5d9d02f..81c5a3b7 100644 --- a/content/zygote/zygote_linux.cc +++ b/content/zygote/zygote_linux.cc
@@ -85,7 +85,7 @@ // Kill the child process in case it's not already dead, so we can safely // perform a blocking wait. PCHECK(0 == kill(pid, SIGKILL)); - PCHECK(pid == HANDLE_EINTR(waitpid(pid, NULL, 0))); + PCHECK(pid == HANDLE_EINTR(waitpid(pid, nullptr, 0))); } } // namespace @@ -115,7 +115,7 @@ struct sigaction action; memset(&action, 0, sizeof(action)); action.sa_handler = &SIGCHLDHandler; - PCHECK(sigaction(SIGCHLD, &action, NULL) == 0); + PCHECK(sigaction(SIGCHLD, &action, nullptr) == 0); // Block SIGCHLD until a child might be ready to reap. sigset_t sigset; @@ -165,7 +165,7 @@ if (pfd.revents & POLLIN) { // This function call can return multiple times, once per fork(). if (HandleRequestFromBrowser(kZygoteSocketPairFd)) { - PCHECK(sigprocmask(SIG_SETMASK, &orig_sigmask, NULL) == 0); + PCHECK(sigprocmask(SIG_SETMASK, &orig_sigmask, nullptr) == 0); return true; } } @@ -177,7 +177,7 @@ bool Zygote::ReapChild(const base::TimeTicks& now, ZygoteProcessInfo* child) { pid_t pid = child->internal_pid; - pid_t r = HANDLE_EINTR(waitpid(pid, NULL, WNOHANG)); + pid_t r = HANDLE_EINTR(waitpid(pid, nullptr, WNOHANG)); if (r > 0) { if (r != pid) { DLOG(ERROR) << "While waiting for " << pid << " to terminate, " @@ -250,7 +250,7 @@ CHECK(extra_children_.empty()); #endif for (base::ProcessHandle pid : extra_children_) { - PCHECK(pid == HANDLE_EINTR(waitpid(pid, NULL, 0))); + PCHECK(pid == HANDLE_EINTR(waitpid(pid, nullptr, 0))); } _exit(0); return false; @@ -418,7 +418,7 @@ std::string* uma_name, int* uma_sample, int* uma_boundary_value) { - ZygoteForkDelegate* helper = NULL; + ZygoteForkDelegate* helper = nullptr; for (auto i = helpers_.begin(); i != helpers_.end(); ++i) { if ((*i)->CanHelp(process_type, uma_name, uma_sample, uma_boundary_value)) { helper = i->get(); @@ -617,7 +617,7 @@ // Reset the process-wide command line to our new command line. base::CommandLine::Reset(); - base::CommandLine::Init(0, NULL); + base::CommandLine::Init(0, nullptr); base::CommandLine::ForCurrentProcess()->InitFromArgv(args); // Update the process title. The argv was already cached by the call to
diff --git a/content/zygote/zygote_main_linux.cc b/content/zygote/zygote_main_linux.cc index acf3305e..db29f010 100644 --- a/content/zygote/zygote_main_linux.cc +++ b/content/zygote/zygote_main_linux.cc
@@ -159,7 +159,7 @@ uint8_t reply_buf[512]; const ssize_t r = base::UnixDomainSocket::SendRecvMsg( - GetSandboxFD(), reply_buf, sizeof(reply_buf), NULL, request); + GetSandboxFD(), reply_buf, sizeof(reply_buf), nullptr, request); if (r == -1) { return; } @@ -310,7 +310,7 @@ __attribute__ ((__visibility__("default"))) struct tm* localtime_r_override(const time_t* timep, struct tm* result) { if (g_am_zygote_or_renderer && g_use_localtime_override) { - ProxyLocaltimeCallToBrowser(*timep, result, NULL, 0); + ProxyLocaltimeCallToBrowser(*timep, result, nullptr, 0); return result; } @@ -331,7 +331,7 @@ __attribute__ ((__visibility__("default"))) struct tm* localtime64_r_override(const time_t* timep, struct tm* result) { if (g_am_zygote_or_renderer && g_use_localtime_override) { - ProxyLocaltimeCallToBrowser(*timep, result, NULL, 0); + ProxyLocaltimeCallToBrowser(*timep, result, nullptr, 0); return result; }
diff --git a/net/quic/core/quic_stream_sequencer_buffer.cc b/net/quic/core/quic_stream_sequencer_buffer.cc index 3706d388..46defd06 100644 --- a/net/quic/core/quic_stream_sequencer_buffer.cc +++ b/net/quic/core/quic_stream_sequencer_buffer.cc
@@ -102,7 +102,10 @@ ++current_gap; } - DCHECK(current_gap != gaps_.end()); + if (current_gap == gaps_.end()) { + *error_details = "Received stream data outside of maximum range."; + return QUIC_INTERNAL_ERROR; + } // "duplication": might duplicate with data alread filled,but also might // overlap across different QuicStringPiece objects already written. @@ -138,7 +141,8 @@ } // Write beyond the current range this buffer is covering. - if (offset + size > total_bytes_read_ + max_buffer_capacity_bytes_) { + if (offset + size > total_bytes_read_ + max_buffer_capacity_bytes_ || + offset + size < offset) { *error_details = "Received data beyond available range."; return QUIC_INTERNAL_ERROR; }
diff --git a/net/quic/core/quic_stream_sequencer_buffer_test.cc b/net/quic/core/quic_stream_sequencer_buffer_test.cc index 88c9a0c3..344ca583 100644 --- a/net/quic/core/quic_stream_sequencer_buffer_test.cc +++ b/net/quic/core/quic_stream_sequencer_buffer_test.cc
@@ -297,6 +297,21 @@ clock_.ApproximateNow(), &written, &error_details_)); EXPECT_TRUE(helper_->CheckBufferInvariants()); + + // Disallow current_gap != gaps_.end() + EXPECT_EQ(QUIC_INTERNAL_ERROR, + buffer_->OnStreamData(static_cast<QuicStreamOffset>(-1), source, + clock_.ApproximateNow(), &written, + &error_details_)); + EXPECT_TRUE(helper_->CheckBufferInvariants()); + + // Disallow offset + size overflow + source = "bbb"; + EXPECT_EQ(QUIC_INTERNAL_ERROR, + buffer_->OnStreamData(static_cast<QuicStreamOffset>(-2), source, + clock_.ApproximateNow(), &written, + &error_details_)); + EXPECT_TRUE(helper_->CheckBufferInvariants()); EXPECT_EQ(0u, buffer_->BytesBuffered()); }
diff --git a/skia/config/SkUserConfig.h b/skia/config/SkUserConfig.h index ce6f291..b623dc1 100644 --- a/skia/config/SkUserConfig.h +++ b/skia/config/SkUserConfig.h
@@ -216,6 +216,10 @@ #define SK_SUPPORT_LEGACY_SMALLRECT_AA #endif +#ifndef SK_SUPPORT_LEGACY_GRADIENT_COLOR_CONVERSION +#define SK_SUPPORT_LEGACY_GRADIENT_COLOR_CONVERSION +#endif + #ifndef SK_SUPPORT_LEGACY_TILED_BITMAPS #define SK_SUPPORT_LEGACY_TILED_BITMAPS #endif
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 4cec27c..6672cba4 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -1519,9 +1519,6 @@ crbug.com/567419 http/tests/devtools/elements/styles-2/metrics-box-sizing.js [ Skip ] crbug.com/667560 virtual/mojo-loading/http/tests/devtools/elements/styles-2/metrics-box-sizing.js [ Skip ] -crbug.com/457273 [ Mac ] http/tests/websocket/close.html [ Pass Timeout ] -crbug.com/457273 [ Mac ] virtual/mojo-loading/http/tests/websocket/close.html [ Pass Timeout ] - crbug.com/524646 [ Mac10.10 ] fast/dom/shadow/shadowdom-for-button.html [ Failure ] crbug.com/538717 [ Win Mac Linux ] http/tests/permissions/chromium/test-request-multiple-window.html [ Failure Pass Timeout ] @@ -1555,8 +1552,6 @@ crbug.com/453002 [ Win ] fast/text/justify-ideograph-vertical.html [ Failure Pass ] crbug.com/453002 [ Win ] fast/text/orientation-sideways.html [ Failure Pass ] -crbug.com/605525 [ Win ] http/tests/xmlhttprequest/redirect-cross-origin-post.html [ Failure Pass ] - crbug.com/600248 external/wpt/web-animations/interfaces/Animation/oncancel.html [ Pass Failure ] crbug.com/771977 external/wpt/web-animations/interfaces/Animation/onfinish.html [ Failure ] crbug.com/772076 external/wpt/web-animations/interfaces/Animation/finish.html [ Pass Failure ] @@ -1769,8 +1764,6 @@ crbug.com/751952 virtual/mojo-loading/http/tests/devtools/unit/datagrid-editable-longtext.js [ Pass Failure ] crbug.com/751952 virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/webexposed/budget-api-origin-trial-interfaces.html [ Pass Failure ] -crbug.com/771729 [ Win Debug ] external/wpt/html/semantics/scripting-1/the-script-element/execution-timing/039.html [ Pass Failure ] - # ====== New tests from wpt-importer added here ====== crbug.com/626703 [ Linux Mac10.10 Mac10.11 Mac10.12 Retina Win ] external/wpt/css/css-fonts-3/font-synthesis-01.html [ Failure ] crbug.com/626703 [ Linux Mac10.10 Mac10.11 Mac10.12 Retina Win ] external/wpt/css/css-fonts-3/font-synthesis-02.html [ Failure ] @@ -2863,9 +2856,6 @@ crbug.com/733448 http/tests/devtools/extensions/extensions-network.html [ Failure Pass ] crbug.com/733448 virtual/mojo-loading/http/tests/devtools/extensions/extensions-network.html [ Failure Pass ] -# Sheriff failures 2017-06-23 -crbug.com/736548 [ Mac ] css2.1/t040304-c64-uri-00-a-g.html [ Failure Pass ] - crbug.com/737959 http/tests/misc/object-image-load-outlives-gc-without-crashing.html [ Failure Pass ] crbug.com/737959 virtual/mojo-loading/http/tests/misc/object-image-load-outlives-gc-without-crashing.html [ Failure Pass ] @@ -3019,15 +3009,9 @@ crbug.com/746128 [ Win7 Debug ] media/controls/video-enter-exit-fullscreen-without-hovering-doesnt-show-controls.html [ Failure ] crbug.com/746128 [ Win7 Debug ] virtual/new-remote-playback-pipeline/media/controls/video-enter-exit-fullscreen-without-hovering-doesnt-show-controls.html [ Failure ] -crbug.com/626703 [ Win7 ] external/wpt/html/semantics/embedded-content/the-img-element/decode/image-decode-path-changes.html [ Crash Pass ] - # For Skia roll crbug.com/630695 fast/css/transformed-mask.html [ NeedsManualRebaseline ] -# Sheriff failures 2017-07-20 -crbug.com/747163 [ Linux ] imagecapture/MediaStreamTrack-applyConstraints.html [ Pass Crash ] -crbug.com/747163 [ Linux ] imagecapture/MediaStreamTrack-getSettings.html [ Pass Crash ] - crbug.com/v8/4958 virtual/mojo-loading/http/tests/devtools/console/console-eval-scoped.js [ NeedsManualRebaseline ] crbug.com/v8/4958 virtual/mojo-loading/http/tests/devtools/console/console-functions.js [ NeedsManualRebaseline ] crbug.com/v8/4958 virtual/mojo-loading/http/tests/devtools/console/console-log-object-with-getter.js [ NeedsManualRebaseline ] @@ -3068,8 +3052,6 @@ # Sheriff failure 2017-08-07 crbug.com/708499 [ Linux ] virtual/wheelscrolllatching/fast/compositor-wheel-scroll-latching/touchpad-scroll-impl-to-main.html [ Failure Pass ] -crbug.com/752845 [ Win ] http/tests/devtools/sha1.js [ Pass Crash ] -crbug.com/667560 [ Win ] virtual/mojo-loading/http/tests/devtools/sha1.js [ Pass Crash ] # Sheriff failure 2017-08-11 crbug.com/626703 virtual/outofblink-cors/external/wpt/fetch/api/response/response-cancel-stream.html [ Pass Timeout ]
diff --git a/third_party/WebKit/Source/core/frame/FrameConsole.cpp b/third_party/WebKit/Source/core/frame/FrameConsole.cpp index fc56693..794aac9 100644 --- a/third_party/WebKit/Source/core/frame/FrameConsole.cpp +++ b/third_party/WebKit/Source/core/frame/FrameConsole.cpp
@@ -108,13 +108,6 @@ frame_, source, level, message, location->LineNumber(), url, stack_trace); } -void FrameConsole::AddSingletonMessage(ConsoleMessage* console_message) { - if (singleton_messages_.Contains(console_message->Message())) - return; - singleton_messages_.insert(console_message->Message()); - AddMessage(console_message); -} - void FrameConsole::ReportResourceResponseReceived( DocumentLoader* loader, unsigned long request_identifier,
diff --git a/third_party/WebKit/Source/core/frame/FrameConsole.h b/third_party/WebKit/Source/core/frame/FrameConsole.h index c7b5fd31..075cbb1 100644 --- a/third_party/WebKit/Source/core/frame/FrameConsole.h +++ b/third_party/WebKit/Source/core/frame/FrameConsole.h
@@ -57,10 +57,6 @@ void AddMessage(ConsoleMessage*); - // Show the specified ConsoleMessage only if the frame haven't shown a message - // same as ConsoleMessage::messsage(). - void AddSingletonMessage(ConsoleMessage*); - bool AddMessageToStorage(ConsoleMessage*); void ReportMessageToClient(MessageSource, MessageLevel, @@ -79,7 +75,6 @@ explicit FrameConsole(LocalFrame&); Member<LocalFrame> frame_; - HashSet<String> singleton_messages_; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/fetch/FormDataBytesConsumer.cpp b/third_party/WebKit/Source/modules/fetch/FormDataBytesConsumer.cpp index 55e6d2c8..ddf2501 100644 --- a/third_party/WebKit/Source/modules/fetch/FormDataBytesConsumer.cpp +++ b/third_party/WebKit/Source/modules/fetch/FormDataBytesConsumer.cpp
@@ -138,17 +138,6 @@ blob_data->AppendBlob(element.optional_blob_data_handle_, 0, element.optional_blob_data_handle_->size()); break; - case FormDataElement::kEncodedFileSystemURL: - if (element.file_length_ < 0) { - form_data_ = nullptr; - blob_bytes_consumer_ = BytesConsumer::CreateErrored( - Error("Cannot determine a file size")); - return; - } - blob_data->AppendFileSystemURL( - element.file_system_url_, element.file_start_, - element.file_length_, element.expected_file_modification_time_); - break; } } // Here we handle m_formData->boundary() as a C-style string. See
diff --git a/third_party/WebKit/Source/modules/fetch/FormDataBytesConsumerTest.cpp b/third_party/WebKit/Source/modules/fetch/FormDataBytesConsumerTest.cpp index 74caebb3..e14af99 100644 --- a/third_party/WebKit/Source/modules/fetch/FormDataBytesConsumerTest.cpp +++ b/third_party/WebKit/Source/modules/fetch/FormDataBytesConsumerTest.cpp
@@ -33,8 +33,6 @@ data->AppendData("foo", 3); data->AppendFileRange("/foo/bar/baz", 3, 4, 5); - data->AppendFileSystemURLRange(KURL(NullURL(), "file:///foo/bar/baz"), 6, 7, - 8); std::unique_ptr<BlobData> blob_data = BlobData::Create(); blob_data->AppendText("hello", false); auto size = blob_data->length();
diff --git a/third_party/WebKit/Source/platform/exported/WebHTTPBody.cpp b/third_party/WebKit/Source/platform/exported/WebHTTPBody.cpp index 1566515f..c5c4417 100644 --- a/third_party/WebKit/Source/platform/exported/WebHTTPBody.cpp +++ b/third_party/WebKit/Source/platform/exported/WebHTTPBody.cpp
@@ -84,13 +84,6 @@ result.type = Element::kTypeBlob; result.blob_uuid = element.blob_uuid_; break; - case FormDataElement::kEncodedFileSystemURL: - result.type = Element::kTypeFileSystemURL; - result.file_system_url = element.file_system_url_; - result.file_start = element.file_start_; - result.file_length = element.file_length_; - result.modification_time = element.expected_file_modification_time_; - break; default: NOTREACHED(); return false; @@ -124,16 +117,6 @@ modification_time); } -void WebHTTPBody::AppendFileSystemURLRange(const WebURL& url, - long long start, - long long length, - double modification_time) { - // Currently we only support filesystem URL. - DCHECK(KURL(url).ProtocolIs("filesystem")); - EnsureMutable(); - private_->AppendFileSystemURLRange(url, start, length, modification_time); -} - void WebHTTPBody::AppendBlob(const WebString& uuid) { EnsureMutable(); private_->AppendBlob(uuid, nullptr);
diff --git a/third_party/WebKit/Source/platform/network/EncodedFormData.cpp b/third_party/WebKit/Source/platform/network/EncodedFormData.cpp index d13fcd00..ac086a6 100644 --- a/third_party/WebKit/Source/platform/network/EncodedFormData.cpp +++ b/third_party/WebKit/Source/platform/network/EncodedFormData.cpp
@@ -30,8 +30,7 @@ bool FormDataElement::IsSafeToSendToAnotherThread() const { return filename_.IsSafeToSendToAnotherThread() && - blob_uuid_.IsSafeToSendToAnotherThread() && - file_system_url_.IsSafeToSendToAnotherThread(); + blob_uuid_.IsSafeToSendToAnotherThread(); } inline EncodedFormData::EncodedFormData() @@ -97,11 +96,6 @@ form_data->elements_.UncheckedAppend(FormDataElement( e.blob_uuid_.IsolatedCopy(), e.optional_blob_data_handle_)); break; - case FormDataElement::kEncodedFileSystemURL: - form_data->elements_.UncheckedAppend(FormDataElement( - e.file_system_url_.Copy(), e.file_start_, e.file_length_, - e.expected_file_modification_time_)); - break; } } return form_data; @@ -135,20 +129,6 @@ elements_.push_back(FormDataElement(uuid, std::move(optional_handle))); } -void EncodedFormData::AppendFileSystemURL(const KURL& url) { - elements_.push_back( - FormDataElement(url, 0, BlobDataItem::kToEndOfFile, InvalidFileTime())); -} - -void EncodedFormData::AppendFileSystemURLRange( - const KURL& url, - long long start, - long long length, - double expected_modification_time) { - elements_.push_back( - FormDataElement(url, start, length, expected_modification_time)); -} - void EncodedFormData::Flatten(Vector<char>& data) const { // Concatenate all the byte arrays, but omit any files. data.clear(); @@ -183,9 +163,6 @@ if (e.optional_blob_data_handle_) size += e.optional_blob_data_handle_->size(); break; - case FormDataElement::kEncodedFileSystemURL: - size += e.file_length_ - e.file_start_; - break; } } return size;
diff --git a/third_party/WebKit/Source/platform/network/EncodedFormData.h b/third_party/WebKit/Source/platform/network/EncodedFormData.h index c0a060d..d7b866de 100644 --- a/third_party/WebKit/Source/platform/network/EncodedFormData.h +++ b/third_party/WebKit/Source/platform/network/EncodedFormData.h
@@ -54,24 +54,14 @@ : type_(kEncodedBlob), blob_uuid_(blob_uuid), optional_blob_data_handle_(std::move(optional_handle)) {} - FormDataElement(const KURL& file_system_url, - long long start, - long long length, - double expected_file_modification_time) - : type_(kEncodedFileSystemURL), - file_system_url_(file_system_url), - file_start_(start), - file_length_(length), - expected_file_modification_time_(expected_file_modification_time) {} bool IsSafeToSendToAnotherThread() const; - enum Type { kData, kEncodedFile, kEncodedBlob, kEncodedFileSystemURL } type_; + enum Type { kData, kEncodedFile, kEncodedBlob } type_; Vector<char> data_; String filename_; String blob_uuid_; scoped_refptr<BlobDataHandle> optional_blob_data_handle_; - KURL file_system_url_; long long file_start_; long long file_length_; double expected_file_modification_time_; @@ -92,8 +82,6 @@ b.expected_file_modification_time_; if (a.type_ == FormDataElement::kEncodedBlob) return a.blob_uuid_ == b.blob_uuid_; - if (a.type_ == FormDataElement::kEncodedFileSystemURL) - return a.file_system_url_ == b.file_system_url_; return true; } @@ -126,11 +114,6 @@ double expected_modification_time); void AppendBlob(const String& blob_uuid, scoped_refptr<BlobDataHandle> optional_handle); - void AppendFileSystemURL(const KURL&); - void AppendFileSystemURLRange(const KURL&, - long long start, - long long length, - double expected_modification_time); void Flatten(Vector<char>&) const; // omits files String FlattenToString() const; // omits files
diff --git a/third_party/WebKit/Source/platform/network/EncodedFormDataTest.cpp b/third_party/WebKit/Source/platform/network/EncodedFormDataTest.cpp index a469bdc0..6ba4086 100644 --- a/third_party/WebKit/Source/platform/network/EncodedFormDataTest.cpp +++ b/third_party/WebKit/Source/platform/network/EncodedFormDataTest.cpp
@@ -29,7 +29,6 @@ EXPECT_EQ(a, b); CheckDeepCopied(a.filename_, b.filename_); CheckDeepCopied(a.blob_uuid_, b.blob_uuid_); - CheckDeepCopied(a.file_system_url_, b.file_system_url_); } }; @@ -38,8 +37,6 @@ original->AppendData("Foo", 3); original->AppendFileRange("example.txt", 12345, 56789, 9999.0); original->AppendBlob("originalUUID", nullptr); - original->AppendFileSystemURLRange(KURL(NullURL(), "ws://localhost/"), 23456, - 34567, 1111.0); Vector<char> boundary_vector; boundary_vector.Append("----boundaryForTest", 19); @@ -52,7 +49,7 @@ // Check that contents are copied (compare the copy with expected values). const Vector<FormDataElement>& original_elements = original->Elements(); const Vector<FormDataElement>& copy_elements = copy->Elements(); - ASSERT_EQ(4ul, copy_elements.size()); + ASSERT_EQ(3ul, copy_elements.size()); Vector<char> foo_vector; foo_vector.Append("Foo", 3); @@ -69,13 +66,6 @@ EXPECT_EQ(FormDataElement::kEncodedBlob, copy_elements[2].type_); EXPECT_EQ(String("originalUUID"), copy_elements[2].blob_uuid_); - EXPECT_EQ(FormDataElement::kEncodedFileSystemURL, copy_elements[3].type_); - EXPECT_EQ(KURL(NullURL(), String("ws://localhost/")), - copy_elements[3].file_system_url_); - EXPECT_EQ(23456ll, copy_elements[3].file_start_); - EXPECT_EQ(34567ll, copy_elements[3].file_length_); - EXPECT_EQ(1111.0, copy_elements[3].expected_file_modification_time_); - EXPECT_EQ(45678, copy->Identifier()); EXPECT_EQ(boundary_vector, copy->Boundary()); EXPECT_EQ(true, copy->ContainsPasswordData()); @@ -86,7 +76,7 @@ // Check pointers are different, i.e. deep-copied. ASSERT_NE(original.get(), copy.get()); - for (size_t i = 0; i < 4; ++i) { + for (size_t i = 0; i < 3; ++i) { if (copy_elements[i].filename_.Impl()) { EXPECT_NE(original_elements[i].filename_.Impl(), copy_elements[i].filename_.Impl()); @@ -99,15 +89,6 @@ EXPECT_TRUE(copy_elements[i].blob_uuid_.Impl()->HasOneRef()); } - if (copy_elements[i].file_system_url_.GetString().Impl()) { - EXPECT_NE(original_elements[i].file_system_url_.GetString().Impl(), - copy_elements[i].file_system_url_.GetString().Impl()); - EXPECT_TRUE( - copy_elements[i].file_system_url_.GetString().Impl()->HasOneRef()); - } - - EXPECT_EQ(nullptr, copy_elements[i].file_system_url_.InnerURL()); - // m_optionalBlobDataHandle is not checked, because BlobDataHandle is // ThreadSafeRefCounted. }
diff --git a/third_party/WebKit/public/platform/WebHTTPBody.h b/third_party/WebKit/public/platform/WebHTTPBody.h index 141d616c..2d53d99 100644 --- a/third_party/WebKit/public/platform/WebHTTPBody.h +++ b/third_party/WebKit/public/platform/WebHTTPBody.h
@@ -90,12 +90,6 @@ double modification_time); BLINK_PLATFORM_EXPORT void AppendBlob(const WebString& uuid); - // Append a resource which is identified by the FileSystem URL. - BLINK_PLATFORM_EXPORT void AppendFileSystemURLRange(const WebURL&, - long long start, - long long length, - double modification_time); - // Identifies a particular form submission instance. A value of 0 is // used to indicate an unspecified identifier. BLINK_PLATFORM_EXPORT long long Identifier() const;
diff --git a/third_party/libaom/README.chromium b/third_party/libaom/README.chromium index 1b533dd..eadbf01 100644 --- a/third_party/libaom/README.chromium +++ b/third_party/libaom/README.chromium
@@ -2,7 +2,9 @@ Short Name: libaom URL: https://aomedia.googlesource.com/aom/ Version: 0 -Date: 15 September 2017 +Date: Thursday October 26 2017 +Branch: test-20170915 +Commit: 7b06dd5dbf11ee1cd65b974a2e46ec33eab65375 License: BSD License File: source/libaom/LICENSE Security Critical: yes @@ -12,4 +14,15 @@ - creating AV1 bitstreams for storage and transmission. - decoding AV1 bitstreams for display. +Please follow these steps to update libaom source code: + +1. Update the code: + roll_dep.py \ + -r <libaom OWNER> \ + --log-limit 20 \ + --roll-to <libaom hash> \ + src/third_party/libaom/source/libaom + + Use the generated commit message for the roll. + Local Modifications:
diff --git a/tools/perf/chrome_telemetry_build/BUILD.gn b/tools/perf/chrome_telemetry_build/BUILD.gn index d73a58d3..9a6ff760 100644 --- a/tools/perf/chrome_telemetry_build/BUILD.gn +++ b/tools/perf/chrome_telemetry_build/BUILD.gn
@@ -4,7 +4,7 @@ import("//build/config/compiler/compiler.gni") if (is_android) { - import("//build/config/android/config.gni") # For use_unpublished_apis + import("//build/config/android/config.gni") # For public_android_sdk } group("telemetry_chrome_test") { @@ -15,7 +15,7 @@ "//chrome/android:chrome_public_apk", ] - if (!defined(use_unpublished_apis) || !use_unpublished_apis) { + if (public_android_sdk) { data_deps += [ "//android_webview:system_webview_apk", "//android_webview/tools/system_webview_shell:system_webview_shell_apk",