Commit 9fdb31c5 authored by Stuart Langley's avatar Stuart Langley Committed by Commit Bot

Run modernize-use-nullptr on chrome/browser/chromeos/extensions/file_manager

Steps I followed:

autoninja -C out/Default chrome

tools/clang/scripts/generate_compdb.py -p out/Default > compile_commands.json

cd out/Default

/usr/local/google/code/llvm/tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \
-p ../.. \
-clang-tidy-binary /usr/local/google/code/build/bin/clang-tidy \
-clang-apply-replacements-binary /usr/local/google/code/build/bin/clang-apply-replacements \
-checks=-*,modernize-use-nullptr \
-header-filter=chrome/browser/chromeos/extensions/file_manager/* \
-fix chrome/browser/chromeos/extensions/file_manager

git cl format

Bug: 841659
Change-Id: I61747c05ca97127ad190de3e11337b0045128fea
Reviewed-on: https://chromium-review.googlesource.com/1106578Reviewed-by: default avatarJoel Hockey <joelhockey@chromium.org>
Commit-Queue: Stuart Langley <slangley@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568547}
parent baa25704
......@@ -478,7 +478,7 @@ void EventRouter::Shutdown() {
chromeos::DBusThreadManager::Get()->GetPowerManagerClient();
power_manager_client->RemoveObserver(device_event_router_.get());
profile_ = NULL;
profile_ = nullptr;
}
void EventRouter::ObserveEvents() {
......@@ -575,7 +575,7 @@ void EventRouter::AddFileWatch(const base::FilePath& local_path,
watch_path,
base::Bind(&EventRouter::HandleFileWatchNotification,
weak_factory_.GetWeakPtr(),
static_cast<drive::FileChange*>(NULL)),
static_cast<drive::FileChange*>(nullptr)),
callback);
}
......@@ -675,7 +675,7 @@ void EventRouter::OnWatcherManagerNotification(
std::vector<std::string> extension_ids;
extension_ids.push_back(extension_id);
DispatchDirectoryChangeEvent(file_system_url.virtual_path(), NULL,
DispatchDirectoryChangeEvent(file_system_url.virtual_path(), nullptr,
false /* error */, extension_ids);
}
......@@ -709,7 +709,7 @@ void EventRouter::OnFileManagerPrefsChanged() {
}
void EventRouter::OnDirectoryChanged(const base::FilePath& drive_path) {
HandleFileWatchNotification(NULL, drive_path, false);
HandleFileWatchNotification(nullptr, drive_path, false);
}
void EventRouter::OnFileChanged(const drive::FileChange& changed_files) {
......@@ -837,7 +837,7 @@ void EventRouter::HandleFileWatchNotification(const drive::FileChange* list,
// kDirectoryChangeEventMaxDetailInfoSize, since passing large list
// and processing it may cause more itme.
// This will be invoked full-refresh in the Files app.
list = NULL;
list = nullptr;
}
DispatchDirectoryChangeEvent(iter->second->virtual_path(),
......
......@@ -186,7 +186,7 @@ void FileSelectorImpl::SelectFile(
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::BindOnce(&FileSelectorImpl::FileSelectionCanceled,
base::Unretained(this), static_cast<void*>(NULL)));
base::Unretained(this), static_cast<void*>(nullptr)));
}
}
......@@ -215,13 +215,11 @@ bool FileSelectorImpl::StartSelectFile(
allowed_file_info.allowed_paths =
ui::SelectFileDialog::FileTypeInfo::ANY_PATH;
dialog_->SelectFile(ui::SelectFileDialog::SELECT_SAVEAS_FILE,
base::string16() /* dialog title*/,
suggested_name,
&allowed_file_info,
0 /* file type index */,
std::string() /* default file extension */,
browser->window()->GetNativeWindow(), NULL /* params */);
dialog_->SelectFile(
ui::SelectFileDialog::SELECT_SAVEAS_FILE,
base::string16() /* dialog title*/, suggested_name, &allowed_file_info,
0 /* file type index */, std::string() /* default file extension */,
browser->window()->GetNativeWindow(), nullptr /* params */);
return dialog_->IsRunning(browser->window()->GetNativeWindow());
}
......@@ -252,7 +250,7 @@ void FileSelectorImpl::SendResponse(bool success,
// We don't want to send multiple responses.
if (function_.get())
function_->OnFilePathSelected(success, selected_path);
function_ = NULL;
function_ = nullptr;
}
// FileSelectorFactory implementation.
......
......@@ -232,7 +232,7 @@ class FileBrowserHandlerExtensionTest : public extensions::ExtensionApiTest {
};
const std::vector<TestCase>* FileBrowserHandlerExtensionTest::test_cases_ =
NULL;
nullptr;
size_t FileBrowserHandlerExtensionTest::current_test_case_ = 0;
// End to end test that verifies that fileBrowserHandler.selectFile works as
......@@ -303,7 +303,7 @@ IN_PROC_BROWSER_TEST_F(FileBrowserHandlerExtensionTest, EndToEnd) {
run_loop.Run();
EXPECT_EQ(kExpectedContents, contents);
SetTestCases(NULL);
SetTestCases(nullptr);
}
// Tests that verifies the fileBrowserHandlerInternal.selectFile function fails
......
......@@ -277,7 +277,7 @@ class SingleEntryPropertiesGetterForDrive {
local_path_(local_path),
running_profile_(profile),
properties_(new EntryProperties),
file_owner_profile_(NULL),
file_owner_profile_(nullptr),
weak_ptr_factory_(this) {
DCHECK(!callback_.is_null());
DCHECK(profile);
......
......@@ -100,7 +100,7 @@ file_manager::EventRouter* GetEventRouterByProfileId(void* profile_id) {
// |profile_id| needs to be checked with ProfileManager::IsValidProfile
// before using it.
if (!g_browser_process->profile_manager()->IsValidProfile(profile_id))
return NULL;
return nullptr;
Profile* profile = reinterpret_cast<Profile*>(profile_id);
return file_manager::EventRouterFactory::GetForProfile(profile);
......
......@@ -402,7 +402,7 @@ void SetupProfileFileAccessPermissions(int render_view_process_id,
drive::EventLogger* GetLogger(Profile* profile) {
drive::DriveIntegrationService* service =
drive::DriveIntegrationServiceFactory::FindForProfile(profile);
return service ? service->event_logger() : NULL;
return service ? service->event_logger() : nullptr;
}
} // namespace util
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment