Migrate ignore_result to std::ignore (see issue #3234)

See https://crbug.com/1285085 for background.
This commit is contained in:
Marshall Greenblatt
2022-01-25 14:40:24 -05:00
parent ebde595370
commit c32f366dfa
12 changed files with 32 additions and 40 deletions

View File

@@ -5,6 +5,7 @@
#include "libcef/browser/alloy/alloy_content_browser_client.h"
#include <algorithm>
#include <tuple>
#include <utility>
#include "include/cef_version.h"
@@ -46,7 +47,6 @@
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/ignore_result.h"
#include "base/json/json_reader.h"
#include "base/path_service.h"
#include "base/stl_util.h"
@@ -846,7 +846,7 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
CefRefPtr<CefCommandLineImpl> commandLinePtr(
new CefCommandLineImpl(command_line, false, false));
handler->OnBeforeChildProcessLaunch(commandLinePtr.get());
ignore_result(commandLinePtr->Detach(nullptr));
std::ignore = commandLinePtr->Detach(nullptr);
}
}
}

View File

@@ -4,6 +4,8 @@
#include "libcef/browser/browser_host_base.h"
#include <tuple>
#include "libcef/browser/browser_info_manager.h"
#include "libcef/browser/browser_platform_delegate.h"
#include "libcef/browser/context.h"
@@ -13,7 +15,6 @@
#include "libcef/common/frame_util.h"
#include "libcef/common/net/url_util.h"
#include "base/ignore_result.h"
#include "base/logging.h"
#include "chrome/browser/spellchecker/spellcheck_factory.h"
#include "chrome/browser/spellchecker/spellcheck_service.h"
@@ -346,7 +347,7 @@ void CefBrowserHostBase::GetNavigationEntries(
CefRefPtr<CefNavigationEntryImpl> entry =
new CefNavigationEntryImpl(controller.GetEntryAtIndex(current));
visitor->Visit(entry.get(), true, current, total);
ignore_result(entry->Detach(nullptr));
std::ignore = entry->Detach(nullptr);
} else {
// Visit all entries.
bool cont = true;
@@ -354,7 +355,7 @@ void CefBrowserHostBase::GetNavigationEntries(
CefRefPtr<CefNavigationEntryImpl> entry =
new CefNavigationEntryImpl(controller.GetEntryAtIndex(i));
cont = visitor->Visit(entry.get(), (i == current), i, total);
ignore_result(entry->Detach(nullptr));
std::ignore = entry->Detach(nullptr);
}
}
}

View File

@@ -5,6 +5,8 @@
#include "libcef/browser/chrome/chrome_content_browser_client_cef.h"
#include <tuple>
#include "libcef/browser/browser_frame.h"
#include "libcef/browser/browser_info_manager.h"
#include "libcef/browser/browser_manager.h"
@@ -24,7 +26,6 @@
#include "libcef/common/command_line_impl.h"
#include "base/command_line.h"
#include "base/ignore_result.h"
#include "base/path_service.h"
#include "chrome/browser/chrome_browser_main.h"
#include "chrome/browser/net/system_network_context_manager.h"
@@ -137,7 +138,7 @@ void ChromeContentBrowserClientCef::AppendExtraCommandLineSwitches(
CefRefPtr<CefCommandLineImpl> commandLinePtr(
new CefCommandLineImpl(command_line, false, false));
handler->OnBeforeChildProcessLaunch(commandLinePtr.get());
ignore_result(commandLinePtr->Detach(nullptr));
std::ignore = commandLinePtr->Detach(nullptr);
}
}
}

View File

@@ -4,6 +4,8 @@
#include "libcef/browser/download_manager_delegate.h"
#include <tuple>
#include "include/cef_download_handler.h"
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
#include "libcef/browser/context.h"
@@ -12,7 +14,6 @@
#include "base/bind.h"
#include "base/files/file_util.h"
#include "base/ignore_result.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/strings/string_util.h"
@@ -296,7 +297,7 @@ void CefDownloadManagerDelegate::OnDownloadUpdated(DownloadItem* download) {
handler->OnDownloadUpdated(browser.get(), download_item.get(), callback);
ignore_result(download_item->Detach(nullptr));
std::ignore = download_item->Detach(nullptr);
}
}
@@ -391,7 +392,7 @@ bool CefDownloadManagerDelegate::DetermineDownloadTarget(
handler->OnBeforeDownload(browser.get(), download_item.get(),
suggested_name.value(), callbackObj);
ignore_result(download_item->Detach(nullptr));
std::ignore = download_item->Detach(nullptr);
}
return true;

View File

@@ -4,6 +4,7 @@
#include "libcef/browser/menu_manager.h"
#include <tuple>
#include <utility>
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
@@ -13,7 +14,6 @@
#include "libcef/common/app_manager.h"
#include "base/compiler_specific.h"
#include "base/ignore_result.h"
#include "base/logging.h"
#include "cef/grit/cef_strings.h"
#include "chrome/grit/generated_resources.h"
@@ -177,7 +177,7 @@ bool CefMenuManager::CreateContextMenu(
}
// Do not keep references to the parameters in the callback.
ignore_result(paramsPtr->Detach(nullptr));
std::ignore = paramsPtr->Detach(nullptr);
DCHECK(paramsPtr->HasOneRef());
DCHECK(model_->VerifyRefCount());
@@ -219,7 +219,7 @@ void CefMenuManager::ExecuteCommand(CefRefPtr<CefMenuModelImpl> source,
event_flags);
// Do not keep references to the parameters in the callback.
ignore_result(paramsPtr->Detach(nullptr));
std::ignore = paramsPtr->Detach(nullptr);
DCHECK(paramsPtr->HasOneRef());
if (handled)

View File

@@ -5,6 +5,8 @@
#include "libcef/browser/net_service/proxy_url_loader_factory.h"
#include <tuple>
#include "libcef/browser/context.h"
#include "libcef/browser/origin_whitelist_impl.h"
#include "libcef/browser/thread_util.h"
@@ -14,7 +16,6 @@
#include "base/barrier_closure.h"
#include "base/command_line.h"
#include "base/ignore_result.h"
#include "base/strings/string_number_conversions.h"
#include "components/safe_browsing/core/common/safebrowsing_constants.h"
#include "content/public/browser/browser_context.h"
@@ -440,7 +441,7 @@ void InterceptedRequest::Restart() {
}
if (header_client_receiver_.is_bound())
ignore_result(header_client_receiver_.Unbind());
std::ignore = header_client_receiver_.Unbind();
current_request_uses_header_client_ =
factory_->url_loader_header_client_receiver_.is_bound();