Skip to content

Commit

Permalink
Use NOTREACHED_IN_MIGRATION() in the rest of src/
Browse files Browse the repository at this point in the history
This was generated by replacing "  NOTREACHED()" with
"  NOTREACHED_IN_MIGRATION()" and running git cl format.

This prepares for making NOTREACHED() [[noreturn]] alongside
NotReachedIsFatal migration of existing inventory.

third_party/crashpad is still excluded, needs to be changed upstream.

Bug: 40580068
Change-Id: Ia5dbaddf53dba2fedefb67f1d428e8b24e9edffe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5545021
Commit-Queue: Peter Boström <[email protected]>
Auto-Submit: Peter Boström <[email protected]>
Commit-Queue: Lei Zhang <[email protected]>
Reviewed-by: Lei Zhang <[email protected]>
Owners-Override: Lei Zhang <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1302314}
  • Loading branch information
pbos authored and Chromium LUCI CQ committed May 16, 2024
1 parent 47dc17d commit 7843eba
Show file tree
Hide file tree
Showing 284 changed files with 566 additions and 537 deletions.
6 changes: 4 additions & 2 deletions android_webview/browser/aw_browser_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ void MigrateProfileData(base::FilePath cache_path,
base::FilePath BuildCachePath(const base::FilePath& relative_path) {
FilePath cache_path;
if (!base::PathService::Get(base::DIR_CACHE, &cache_path)) {
NOTREACHED() << "Failed to get app cache directory for Android WebView";
NOTREACHED_IN_MIGRATION()
<< "Failed to get app cache directory for Android WebView";
}
return cache_path.Append(relative_path);
}
Expand Down Expand Up @@ -686,7 +687,8 @@ base::FilePath AwBrowserContext::BuildStoragePath(
const base::FilePath& relative_path) {
base::FilePath user_data_dir;
if (!base::PathService::Get(base::DIR_ANDROID_APP_DATA, &user_data_dir)) {
NOTREACHED() << "Failed to get app data directory for Android WebView";
NOTREACHED_IN_MIGRATION()
<< "Failed to get app data directory for Android WebView";
}
return user_data_dir.Append(relative_path);
}
Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/aw_browser_main_parts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ int AwBrowserMainParts::PreMainMessageLoopRun() {

void AwBrowserMainParts::WillRunMainMessageLoop(
std::unique_ptr<base::RunLoop>& run_loop) {
NOTREACHED();
NOTREACHED_IN_MIGRATION();
}

void AwBrowserMainParts::PostCreateThreads() {
Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/aw_browser_terminator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void OnRenderProcessGone(
<< " killing application.";
kill(getpid(), SIGKILL);
}
NOTREACHED();
NOTREACHED_IN_MIGRATION();
break;
case AwRenderProcessGoneDelegate::RenderProcessGoneResult::kHandled:
// Don't log UMA yet. This WebView may be handled, but we need to wait
Expand Down
9 changes: 5 additions & 4 deletions android_webview/browser/aw_content_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,8 @@ base::FilePath AwContentBrowserClient::GetDefaultDownloadDirectory() {
}

std::string AwContentBrowserClient::GetDefaultDownloadName() {
NOTREACHED() << "Android WebView does not use chromium downloads";
NOTREACHED_IN_MIGRATION()
<< "Android WebView does not use chromium downloads";
return std::string();
}

Expand All @@ -535,22 +536,22 @@ AwContentBrowserClient::GetLocalTracesDirectory() {

void AwContentBrowserClient::DidCreatePpapiPlugin(
content::BrowserPpapiHost* browser_host) {
NOTREACHED() << "Android WebView does not support plugins";
NOTREACHED_IN_MIGRATION() << "Android WebView does not support plugins";
}

bool AwContentBrowserClient::AllowPepperSocketAPI(
content::BrowserContext* browser_context,
const GURL& url,
bool private_api,
const content::SocketPermissionRequest* params) {
NOTREACHED() << "Android WebView does not support plugins";
NOTREACHED_IN_MIGRATION() << "Android WebView does not support plugins";
return false;
}

bool AwContentBrowserClient::IsPepperVpnProviderAPIAllowed(
content::BrowserContext* browser_context,
const GURL& url) {
NOTREACHED() << "Android WebView does not support plugins";
NOTREACHED_IN_MIGRATION() << "Android WebView does not support plugins";
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/aw_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,7 @@ jint AwContents::GetEffectivePriority(JNIEnv* env) {
case content::ChildProcessImportance::IMPORTANT:
return static_cast<jint>(RendererPriority::HIGH);
}
NOTREACHED();
NOTREACHED_IN_MIGRATION();
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/aw_contents_client_bridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ void AwContentsClientBridge::RunJavaScriptDialog(
break;
}
default:
NOTREACHED();
NOTREACHED_IN_MIGRATION();
}
}

Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/aw_field_trials.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void AwFieldTrials::OnVariationsSetupComplete() {
if (base::PathService::Get(base::DIR_ANDROID_APP_DATA, &metrics_dir)) {
InstantiatePersistentHistogramsWithFeaturesAndCleanup(metrics_dir);
} else {
NOTREACHED();
NOTREACHED_IN_MIGRATION();
}
}

Expand Down
19 changes: 11 additions & 8 deletions android_webview/browser/aw_permission_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ class LastRequestResultCache {
}

if (!requesting_origin.is_valid()) {
NOTREACHED() << requesting_origin.possibly_invalid_spec();
NOTREACHED_IN_MIGRATION() << requesting_origin.possibly_invalid_spec();
return;
}
if (!embedding_origin.is_valid()) {
NOTREACHED() << embedding_origin.possibly_invalid_spec();
NOTREACHED_IN_MIGRATION() << embedding_origin.possibly_invalid_spec();
return;
}

Expand All @@ -68,7 +68,7 @@ class LastRequestResultCache {

std::string key = GetCacheKey(requesting_origin, embedding_origin);
if (key.empty()) {
NOTREACHED();
NOTREACHED_IN_MIGRATION();
// Never store an empty key because it could inadvertently be used for
// another combination.
return;
Expand All @@ -90,7 +90,8 @@ class LastRequestResultCache {
<< embedding_origin.possibly_invalid_spec();

if (permission != PermissionType::PROTECTED_MEDIA_IDENTIFIER) {
NOTREACHED() << "Results are only cached for PROTECTED_MEDIA_IDENTIFIER";
NOTREACHED_IN_MIGRATION()
<< "Results are only cached for PROTECTED_MEDIA_IDENTIFIER";
return PermissionStatus::ASK;
}

Expand Down Expand Up @@ -169,7 +170,7 @@ class AwPermissionManager::PendingRequest {
void SetPermissionStatus(PermissionType type, PermissionStatus status) {
auto result = permission_index_map_.find(type);
if (result == permission_index_map_.end()) {
NOTREACHED();
NOTREACHED_IN_MIGRATION();
return;
}
DCHECK(!IsCompleted());
Expand All @@ -191,7 +192,7 @@ class AwPermissionManager::PendingRequest {
PermissionStatus GetPermissionStatus(PermissionType type) {
auto result = permission_index_map_.find(type);
if (result == permission_index_map_.end()) {
NOTREACHED();
NOTREACHED_IN_MIGRATION();
return PermissionStatus::DENIED;
}
return results[result->second];
Expand Down Expand Up @@ -369,7 +370,8 @@ void AwPermissionManager::RequestPermissions(
PermissionStatus::DENIED);
break;
case PermissionType::NUM:
NOTREACHED() << "PermissionType::NUM was not expected here.";
NOTREACHED_IN_MIGRATION()
<< "PermissionType::NUM was not expected here.";
pending_request_raw->SetPermissionStatus(permissions[i],
PermissionStatus::DENIED);
break;
Expand Down Expand Up @@ -612,7 +614,8 @@ void AwPermissionManager::CancelPermissionRequest(int request_id) {
// There is nothing to cancel so this is simply ignored.
break;
case PermissionType::NUM:
NOTREACHED() << "PermissionType::NUM was not expected here.";
NOTREACHED_IN_MIGRATION()
<< "PermissionType::NUM was not expected here.";
break;
}
pending_request->SetPermissionStatus(permission, PermissionStatus::DENIED);
Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/aw_permission_manager_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class AwBrowserPermissionRequestDelegateForTesting final
request_.erase(it);
return;
}
NOTREACHED();
NOTREACHED_IN_MIGRATION();
}

private:
Expand Down
4 changes: 2 additions & 2 deletions android_webview/browser/aw_print_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void AwPrintManager::DidPrintDocument(

const printing::mojom::DidPrintContentParams& content = *params->content;
if (!content.metafile_data_region.IsValid()) {
NOTREACHED() << "invalid memory handle";
NOTREACHED_IN_MIGRATION() << "invalid memory handle";
web_contents()->Stop();
PdfWritingDone(0);
std::move(callback).Run(false);
Expand All @@ -146,7 +146,7 @@ void AwPrintManager::DidPrintDocument(
auto data = base::RefCountedSharedMemoryMapping::CreateFromWholeRegion(
content.metafile_data_region);
if (!data) {
NOTREACHED() << "couldn't map";
NOTREACHED_IN_MIGRATION() << "couldn't map";
web_contents()->Stop();
PdfWritingDone(0);
std::move(callback).Run(false);
Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/aw_quota_manager_bridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void GetStorageKeysTask::CheckDone() {
content::GetUIThreadTaskRunner({})->PostTask(
FROM_HERE, base::BindOnce(&GetStorageKeysTask::DoneOnUIThread, this));
} else if (num_callbacks_received_ > num_callbacks_to_wait_) {
NOTREACHED();
NOTREACHED_IN_MIGRATION();
}
}

Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/aw_web_contents_view_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ AwWebContentsViewDelegate::~AwWebContentsViewDelegate() {}
content::WebDragDestDelegate* AwWebContentsViewDelegate::GetDragDestDelegate() {
// GetDragDestDelegate is a pure virtual method from WebContentsViewDelegate
// and must have an implementation although android doesn't use it.
NOTREACHED();
NOTREACHED_IN_MIGRATION();
return NULL;
}

Expand Down
3 changes: 2 additions & 1 deletion android_webview/browser/cookie_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ namespace {
base::FilePath GetPathInAppDirectory(std::string path) {
base::FilePath result;
if (!base::PathService::Get(base::DIR_ANDROID_APP_DATA, &result)) {
NOTREACHED() << "Failed to get app data directory for Android WebView";
NOTREACHED_IN_MIGRATION()
<< "Failed to get app data directory for Android WebView";
}
result = result.Append(FILE_PATH_LITERAL(path));
return result;
Expand Down
4 changes: 2 additions & 2 deletions android_webview/browser/find_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ void FindHelper::NotifyResults(int active_ordinal,

// Safeguard in case of errors to prevent reporting -1 to the API listeners.
if (match_count == -1) {
NOTREACHED();
NOTREACHED_IN_MIGRATION();
match_count = 0;
}

if (active_ordinal == -1) {
NOTREACHED();
NOTREACHED_IN_MIGRATION();
active_ordinal = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/gfx/aw_draw_fn_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ OverlaysParams::Mode GetOverlaysMode(AwDrawFnOverlaysMode mode) {
case AW_DRAW_FN_OVERLAYS_MODE_ENABLED:
return OverlaysParams::Mode::Enabled;
default:
NOTREACHED();
NOTREACHED_IN_MIGRATION();
return OverlaysParams::Mode::Disabled;
}
}
Expand Down
4 changes: 2 additions & 2 deletions android_webview/browser/gfx/display_scheduler_webview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ DisplaySchedulerWebView::~DisplaySchedulerWebView() {

void DisplaySchedulerWebView::ForceImmediateSwapIfPossible() {
// We can't swap immediately
NOTREACHED();
NOTREACHED_IN_MIGRATION();
}
void DisplaySchedulerWebView::SetNeedsOneBeginFrame(bool needs_draw) {
NOTREACHED();
NOTREACHED_IN_MIGRATION();
}
void DisplaySchedulerWebView::DidSwapBuffers() {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ SkiaOutputSurfaceDependencyWebView::CreateGLSurface(

base::ScopedClosureRunner SkiaOutputSurfaceDependencyWebView::CachePresenter(
gl::Presenter* presenter) {
NOTREACHED();
NOTREACHED_IN_MIGRATION();
return base::ScopedClosureRunner();
}

base::ScopedClosureRunner SkiaOutputSurfaceDependencyWebView::CacheGLSurface(
gl::GLSurface* surface) {
NOTREACHED();
NOTREACHED_IN_MIGRATION();
return base::ScopedClosureRunner();
}

Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/gfx/task_forwarding_sequence.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void TaskForwardingSequence::ScheduleOrRetainTask(
// Should not be called because tasks aren't reposted to wait for sync tokens,
// or for yielding execution since ShouldYield() returns false.
void TaskForwardingSequence::ContinueTask(base::OnceClosure task) {
NOTREACHED();
NOTREACHED_IN_MIGRATION();
}

// Method to wrap scheduled task with the order number processing required for
Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/icon_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void IconHelper::DidUpdateFaviconURL(
// Silently ignore it. Only trigger a callback on valid icons.
break;
default:
NOTREACHED();
NOTREACHED_IN_MIGRATION();
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const char* SchemeEnumToString(VisibilityMetricsLogger::Scheme scheme) {
case VisibilityMetricsLogger::Scheme::kIntent:
return "intent";
default:
NOTREACHED();
NOTREACHED_IN_MIGRATION();
}
return "";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void AwProxyConfigMonitor::OnProxyConfigChanged(
net::ProxyConfigWithAnnotation::CreateDirect());
break;
case net::ProxyConfigService::CONFIG_PENDING:
NOTREACHED();
NOTREACHED_IN_MIGRATION();
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ void InterceptedRequest::InterceptResponseReceived(
committed_mode = CommittedRequestedWithHeaderMode::kConstantWebview;
break;
default:
NOTREACHED()
NOTREACHED_IN_MIGRATION()
<< "Invalid enum value for AwSettings:RequestedWithHeaderMode: "
<< requested_with_header_mode;
}
Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/renderer_host/auto_login_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ bool MatchRealm(const std::string& realm, RealmRestriction restriction) {
case ALLOW_ANY_REALM:
return true;
default:
NOTREACHED();
NOTREACHED_IN_MIGRATION();
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void AwUrlCheckerDelegateImpl::
StartObservingInteractionsForDelayedBlockingPageHelper(
const security_interstitials::UnsafeResource& resource,
bool is_main_frame) {
NOTREACHED() << "Delayed warnings not implemented for WebView";
NOTREACHED_IN_MIGRATION() << "Delayed warnings not implemented for WebView";
}

bool AwUrlCheckerDelegateImpl::IsUrlAllowlisted(const GURL& url) {
Expand Down Expand Up @@ -274,7 +274,7 @@ void AwUrlCheckerDelegateImpl::DoApplicationResponse(
proceed = false;
break;
default:
NOTREACHED();
NOTREACHED_IN_MIGRATION();
}

if (!proceed) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ bool g_enabled;

void EnableCrashReporter(const std::string& process_type) {
if (g_enabled) {
NOTREACHED() << "EnableCrashReporter called more than once";
NOTREACHED_IN_MIGRATION() << "EnableCrashReporter called more than once";
return;
}

Expand Down
2 changes: 1 addition & 1 deletion android_webview/lib/webview_entry_point.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ bool NativeInit(base::android::LibraryProcessType library_process_type) {
LOG(FATAL) << "WebView cannot be started with a browser process type.";

default:
NOTREACHED();
NOTREACHED_IN_MIGRATION();
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ AwComponentInstallerPolicy::AwComponentInstallerPolicy() = default;

void AwComponentInstallerPolicy::OnCustomUninstall() {
// Uninstallation isn't supported in WebView.
NOTREACHED();
NOTREACHED_IN_MIGRATION();
}

// Copy the components file from `install_dir` to the serving directory of the
Expand Down
2 changes: 1 addition & 1 deletion android_webview/test/shell/src/draw_fn/allocator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ AwDrawFnRenderMode QueryRenderMode() {
}

int CreateFunctor(void* data, AwDrawFnFunctorCallbacks* functor_callbacks) {
NOTREACHED();
NOTREACHED_IN_MIGRATION();
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion apps/launcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ void LaunchPlatformAppWithCommandLineAndLaunchId(
if (!in_kiosk_mode) {
LOG(ERROR) << "App with 'kiosk_only' attribute must be run in "
<< " ChromeOS kiosk mode.";
NOTREACHED();
NOTREACHED_IN_MIGRATION();
return;
}
}
Expand Down
Loading

0 comments on commit 7843eba

Please sign in to comment.