0

Migrate to NOTREACHED() in extensions/

NOTREACHED() and NOTREACHED_IN_MIGRATION() are both CHECK-fatal now.
The former is [[noreturn]] so this CL also performs dead-code removal
after the NOTREACHED().

This CL does not attempt to do additional rewrites of any surrounding
code, like:

if (!foo) {
  NOTREACHED();
}

to CHECK(foo);

Those transforms take a non-trivial amount of time (and there are
thousands of instances). Cleanup can be left as an exercise for the
reader.

Bug: 40580068
Change-Id: I80696f361f79908132f9a0e3d8654592f2e37c13
Low-Coverage-Reason: OTHER Should-be-unreachable code
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5951563
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: Emilia Paz <emiliapaz@chromium.org>
Reviewed-by: Sam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1371865}
This commit is contained in:
Peter Boström
2024-10-22 06:31:49 +00:00
committed by Chromium LUCI CQ
parent 896122f527
commit 38412897b2
134 changed files with 300 additions and 559 deletions
extensions
browser
activity.cc
api
app_current_window_internal
audio
bluetooth
bluetooth_low_energy
clipboard
content_settings
declarative
declarative_net_request
declarative_webrequest
device_permissions_manager.cc
feedback_private
guest_view
lock_screen_data
management
media_perception_private
messaging
networking_private
power
runtime
serial
socket
sockets_udp
storage
system_display
system_info
usb
web_contents_capture_client.cc
web_request
blocklist_extension_prefs.ccbrowser_frame_context_data.ccembedder_user_script_loader.ccextension_function.ccextension_function_dispatcher.ccextension_icon_placeholder.ccextension_pref_value_map.ccextension_prefs.ccextension_user_script_loader.cc
guest_view
image_loader.ccmock_extension_system.ccpref_names.ccprocess_manager.ccrenderer_startup_helper.ccsandboxed_unpacker.cctest_extensions_browser_client.cc
updater
user_script_manager.ccwarning_set.cc
common
renderer
shell
test

@ -46,8 +46,7 @@ const char* Activity::ToString(Type type) {
case DEBUGGER: case DEBUGGER:
return "DEBUGGER"; return "DEBUGGER";
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return "";
} }
} // namespace extensions } // namespace extensions

@ -57,8 +57,6 @@ const char kRequiresFramelessWindow[] =
const char kAlwaysOnTopPermission[] = const char kAlwaysOnTopPermission[] =
"The \"app.window.alwaysOnTop\" permission is required."; "The \"app.window.alwaysOnTop\" permission is required.";
const char kInvalidParameters[] = "Invalid parameters.";
const int kUnboundedSize = SizeConstraints::kUnboundedSize; const int kUnboundedSize = SizeConstraints::kUnboundedSize;
void GetBoundsFields(const Bounds& bounds_spec, gfx::Rect* bounds) { void GetBoundsFields(const Bounds& bounds_spec, gfx::Rect* bounds) {
@ -206,8 +204,7 @@ AppCurrentWindowInternalSetBoundsFunction::Run() {
bounds::BoundsType bounds_type = bounds::GetBoundsType(params->bounds_type); bounds::BoundsType bounds_type = bounds::GetBoundsType(params->bounds_type);
if (bounds_type == bounds::INVALID_TYPE) { if (bounds_type == bounds::INVALID_TYPE) {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return RespondNow(Error(kInvalidParameters));
} }
// Start with the current bounds, and change any values that are specified in // Start with the current bounds, and change any values that are specified in
@ -245,7 +242,7 @@ AppCurrentWindowInternalSetBoundsFunction::Run() {
break; break;
} }
case bounds::INVALID_TYPE: case bounds::INVALID_TYPE:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
if (original_window_bounds != window_bounds) { if (original_window_bounds != window_bounds) {
@ -276,8 +273,7 @@ AppCurrentWindowInternalSetSizeConstraintsFunction::Run() {
bounds::BoundsType bounds_type = bounds::GetBoundsType(params->bounds_type); bounds::BoundsType bounds_type = bounds::GetBoundsType(params->bounds_type);
if (bounds_type != bounds::INNER_BOUNDS && if (bounds_type != bounds::INNER_BOUNDS &&
bounds_type != bounds::OUTER_BOUNDS) { bounds_type != bounds::OUTER_BOUNDS) {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return RespondNow(Error(kInvalidParameters));
} }
gfx::Size original_min_size = gfx::Size original_min_size =

@ -43,8 +43,7 @@ void AudioDeviceIdCalculator::LoadStableIdMap() {
for (size_t i = 0; i < ids_list.size(); ++i) { for (size_t i = 0; i < ids_list.size(); ++i) {
const std::string* audio_service_stable_id = ids_list[i].GetIfString(); const std::string* audio_service_stable_id = ids_list[i].GetIfString();
if (!audio_service_stable_id) { if (!audio_service_stable_id) {
NOTREACHED_IN_MIGRATION() << "Non string stable device ID."; NOTREACHED() << "Non string stable device ID.";
continue;
} }
stable_id_map_[*audio_service_stable_id] = base::NumberToString(i); stable_id_map_[*audio_service_stable_id] = base::NumberToString(i);
} }

@ -64,8 +64,7 @@ api::audio::DeviceType GetAsAudioApiDeviceType(AudioDeviceType type) {
return api::audio::DeviceType::kOther; return api::audio::DeviceType::kOther;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return api::audio::DeviceType::kOther;
} }
} // namespace } // namespace

@ -18,8 +18,7 @@ api::audio::StreamType ConvertStreamTypeFromMojom(
case crosapi::mojom::StreamType::kOutput: case crosapi::mojom::StreamType::kOutput:
return api::audio::StreamType::kOutput; return api::audio::StreamType::kOutput;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return api::audio::StreamType::kNone;
} }
crosapi::mojom::StreamType ConvertStreamTypeToMojom( crosapi::mojom::StreamType ConvertStreamTypeToMojom(
@ -32,8 +31,7 @@ crosapi::mojom::StreamType ConvertStreamTypeToMojom(
case api::audio::StreamType::kOutput: case api::audio::StreamType::kOutput:
return crosapi::mojom::StreamType::kOutput; return crosapi::mojom::StreamType::kOutput;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return crosapi::mojom::StreamType::kNone;
} }
api::audio::DeviceType ConvertDeviceTypeFromMojom( api::audio::DeviceType ConvertDeviceTypeFromMojom(
@ -74,8 +72,7 @@ api::audio::DeviceType ConvertDeviceTypeFromMojom(
case crosapi::mojom::DeviceType::kOther: case crosapi::mojom::DeviceType::kOther:
return api::audio::DeviceType::kOther; return api::audio::DeviceType::kOther;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return api::audio::DeviceType::kNone;
} }
crosapi::mojom::DeviceType ConvertDeviceTypeToMojom( crosapi::mojom::DeviceType ConvertDeviceTypeToMojom(
@ -116,8 +113,7 @@ crosapi::mojom::DeviceType ConvertDeviceTypeToMojom(
case api::audio::DeviceType::kOther: case api::audio::DeviceType::kOther:
return crosapi::mojom::DeviceType::kOther; return crosapi::mojom::DeviceType::kOther;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return crosapi::mojom::DeviceType::kNone;
} }
std::unique_ptr<api::audio::DeviceFilter> ConvertDeviceFilterFromMojom( std::unique_ptr<api::audio::DeviceFilter> ConvertDeviceFilterFromMojom(

@ -197,7 +197,7 @@ device::BluetoothFilterType ToBluetoothDeviceFilterType(FilterType type) {
case FilterType::kKnown: case FilterType::kKnown:
return device::BluetoothFilterType::KNOWN; return device::BluetoothFilterType::KNOWN;
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
} }
#endif #endif

@ -176,8 +176,7 @@ bt_private::ConnectResultType DeviceConnectErrorToConnectResult(
case device::BluetoothDevice::ERROR_SOCKET: case device::BluetoothDevice::ERROR_SOCKET:
return bt_private::ConnectResultType::kSocketError; return bt_private::ConnectResultType::kSocketError;
case device::BluetoothDevice::NUM_CONNECT_ERROR_CODES: case device::BluetoothDevice::NUM_CONNECT_ERROR_CODES:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
break;
} }
return bt_private::ConnectResultType::kNone; return bt_private::ConnectResultType::kNone;
} }
@ -446,7 +445,7 @@ void BluetoothPrivateSetPairingResponseFunction::DoWork(
device->CancelPairing(); device->CancelPairing();
break; break;
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
} }

@ -139,12 +139,10 @@ std::string StatusToString(BluetoothLowEnergyEventRouter::Status status) {
case BluetoothLowEnergyEventRouter::kStatusErrorWakelock: case BluetoothLowEnergyEventRouter::kStatusErrorWakelock:
return kErrorWakelock; return kErrorWakelock;
case BluetoothLowEnergyEventRouter::kStatusSuccess: case BluetoothLowEnergyEventRouter::kStatusSuccess:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
break;
default: default:
return kErrorOperationFailed; return kErrorOperationFailed;
} }
return "";
} }
extensions::BluetoothLowEnergyEventRouter* GetEventRouter( extensions::BluetoothLowEnergyEventRouter* GetEventRouter(

@ -255,12 +255,9 @@ DeviceConnectErrorCodeToStatus(BluetoothDevice::ConnectErrorCode error_code) {
case device::BluetoothDevice::ConnectErrorCode::ERROR_SOCKET: case device::BluetoothDevice::ConnectErrorCode::ERROR_SOCKET:
return extensions::BluetoothLowEnergyEventRouter::kStatusErrorSocket; return extensions::BluetoothLowEnergyEventRouter::kStatusErrorSocket;
case BluetoothDevice::NUM_CONNECT_ERROR_CODES: case BluetoothDevice::NUM_CONNECT_ERROR_CODES:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return extensions::BluetoothLowEnergyEventRouter::
kStatusErrorInvalidArguments;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return extensions::BluetoothLowEnergyEventRouter::kStatusErrorFailed;
} }
} // namespace } // namespace

@ -102,7 +102,7 @@ bool ClipboardSetImageDataFunction::IsAdditionalItemsParamValid(
has_text_html = true; has_text_html = true;
break; break;
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
// Check maximum length of the string data. // Check maximum length of the string data.
if (item.data.length() > max_item_data_bytes) if (item.data.length() > max_item_data_bytes)

@ -25,8 +25,7 @@ std::string GetDefaultPort(const std::string& scheme) {
return "80"; return "80";
if (scheme == url::kHttpsScheme) if (scheme == url::kHttpsScheme)
return "443"; return "443";
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return std::string();
} }
} // namespace } // namespace

@ -311,8 +311,7 @@ const OriginValueMap* ContentSettingsStore::GetValueMap(
return &entry->settings; return &entry->settings;
case ChromeSettingScope::kRegularOnly: case ChromeSettingScope::kRegularOnly:
// TODO(bauerb): Implement regular-only content settings. // TODO(bauerb): Implement regular-only content settings.
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return nullptr;
case ChromeSettingScope::kIncognitoPersistent: case ChromeSettingScope::kIncognitoPersistent:
return &entry->incognito_persistent_settings; return &entry->incognito_persistent_settings;
case ChromeSettingScope::kIncognitoSessionOnly: case ChromeSettingScope::kIncognitoSessionOnly:
@ -321,8 +320,7 @@ const OriginValueMap* ContentSettingsStore::GetValueMap(
break; break;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return nullptr;
} }
void ContentSettingsStore::ClearContentSettingsForExtension( void ContentSettingsStore::ClearContentSettingsForExtension(

@ -235,8 +235,7 @@ void EventsEventAddRulesFunction::RecordUMA(
type = kDeclarativeWebRequestWebviewAddRules; type = kDeclarativeWebRequestWebviewAddRules;
break; break;
case DeclarativeAPIType::kUnknown: case DeclarativeAPIType::kUnknown:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return;
} }
RecordUMAHelper(type); RecordUMAHelper(type);
} }
@ -276,8 +275,7 @@ void EventsEventRemoveRulesFunction::RecordUMA(
type = kDeclarativeWebRequestWebviewRemoveRules; type = kDeclarativeWebRequestWebviewRemoveRules;
break; break;
case DeclarativeAPIType::kUnknown: case DeclarativeAPIType::kUnknown:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return;
} }
RecordUMAHelper(type); RecordUMAHelper(type);
} }
@ -321,8 +319,7 @@ void EventsEventGetRulesFunction::RecordUMA(
type = kDeclarativeWebRequestWebviewGetRules; type = kDeclarativeWebRequestWebviewGetRules;
break; break;
case DeclarativeAPIType::kUnknown: case DeclarativeAPIType::kUnknown:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return;
} }
RecordUMAHelper(type); RecordUMAHelper(type);
} }

@ -174,7 +174,7 @@ std::optional<RequestAction> ExtensionUrlPatternIndexMatcher::GetActionHelper(
case flat::ActionType_allow_all_requests: case flat::ActionType_allow_all_requests:
case flat::ActionType_modify_headers: case flat::ActionType_modify_headers:
case flat::ActionType_count: case flat::ActionType_count:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
return std::nullopt; return std::nullopt;
@ -230,8 +230,7 @@ ExtensionUrlPatternIndexMatcher::GetMatchersForStage(
return headers_received_matchers_; return headers_received_matchers_;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return before_request_matchers_;
} }
void ExtensionUrlPatternIndexMatcher::SetDisabledRuleIds( void ExtensionUrlPatternIndexMatcher::SetDisabledRuleIds(

@ -161,8 +161,7 @@ UpdateDynamicRulesStatus GetUpdateDynamicRuleStatus(LoadRulesetResult result) {
break; break;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return UpdateDynamicRulesStatus::kSuccess;
} }
// Helper to create the new list of dynamic rules. Returns false on failure and // Helper to create the new list of dynamic rules. Returns false on failure and

@ -471,8 +471,7 @@ FlatRulesetIndexer::GetBuilders(const IndexedRule& indexed_rule) {
case dnr_api::RuleActionType::kNone: case dnr_api::RuleActionType::kNone:
break; break;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return {};
} }
} // namespace extensions::declarative_net_request } // namespace extensions::declarative_net_request

@ -438,8 +438,7 @@ uint8_t GetActionTypePriority(dnr_api::RuleActionType action_type) {
case dnr_api::RuleActionType::kNone: case dnr_api::RuleActionType::kNone:
break; break;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return 0;
} }
void RecordLargeRegexUMA(bool is_large_regex) { void RecordLargeRegexUMA(bool is_large_regex) {

@ -74,7 +74,7 @@ bool ActionTypeAllowsMultipleActions(flat::ActionType action_type) {
case flat::ActionType_modify_headers: case flat::ActionType_modify_headers:
return true; return true;
case flat::ActionType_count: case flat::ActionType_count:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
return true; return true;
} }
@ -356,8 +356,7 @@ std::optional<RequestAction> RegexRulesMatcher::CreateActionFromInfo(
return CreateAllowAllRequestsAction(params, rule); return CreateAllowAllRequestsAction(params, rule);
case flat::ActionType_modify_headers: case flat::ActionType_modify_headers:
case flat::ActionType_count: case flat::ActionType_count:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
break;
} }
return std::nullopt; return std::nullopt;
@ -410,8 +409,7 @@ const RegexRulesMatcher::MatchHelper& RegexRulesMatcher::GetMatcherForStage(
return headers_received_matcher_; return headers_received_matcher_;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return before_request_matcher_;
} }
} // namespace extensions::declarative_net_request } // namespace extensions::declarative_net_request

@ -329,8 +329,7 @@ std::optional<RequestAction> RulesetManager::GetAction(
case RequestAction::Type::ALLOW_ALL_REQUESTS: case RequestAction::Type::ALLOW_ALL_REQUESTS:
return 1; return 1;
case RequestAction::Type::MODIFY_HEADERS: case RequestAction::Type::MODIFY_HEADERS:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return 0;
} }
}; };

@ -372,8 +372,7 @@ size_t RulesetMatcher::GetRulesCount(RulesetMatchingStage stage) const {
regex_matcher_.GetHeadersReceivedRulesCount(); regex_matcher_.GetHeadersReceivedRulesCount();
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return 0u;
} }
size_t RulesetMatcher::GetRegexRulesCount(RulesetMatchingStage stage) const { size_t RulesetMatcher::GetRegexRulesCount(RulesetMatchingStage stage) const {
@ -384,8 +383,7 @@ size_t RulesetMatcher::GetRegexRulesCount(RulesetMatchingStage stage) const {
return regex_matcher_.GetHeadersReceivedRulesCount(); return regex_matcher_.GetHeadersReceivedRulesCount();
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return 0u;
} }
} // namespace extensions::declarative_net_request } // namespace extensions::declarative_net_request

@ -228,8 +228,7 @@ dnr_api::ResourceType GetDNRResourceType(WebRequestResourceType resource_type) {
case WebRequestResourceType::WEBBUNDLE: case WebRequestResourceType::WEBBUNDLE:
return dnr_api::ResourceType::kWebbundle; return dnr_api::ResourceType::kWebbundle;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return dnr_api::ResourceType::kOther;
} }
// Maps dnr_api::ResourceType to WebRequestResourceType. // Maps dnr_api::ResourceType to WebRequestResourceType.
@ -267,11 +266,9 @@ WebRequestResourceType GetWebRequestResourceType(
case dnr_api::ResourceType::kWebbundle: case dnr_api::ResourceType::kWebbundle:
return WebRequestResourceType::WEBBUNDLE; return WebRequestResourceType::WEBBUNDLE;
case dnr_api::ResourceType::kNone: case dnr_api::ResourceType::kNone:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return WebRequestResourceType::OTHER;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return WebRequestResourceType::OTHER;
} }
dnr_api::RequestDetails CreateRequestDetails(const WebRequestInfo& request) { dnr_api::RequestDetails CreateRequestDetails(const WebRequestInfo& request) {
@ -339,8 +336,7 @@ flat::ActionType ConvertToFlatActionType(dnr_api::RuleActionType action_type) {
case dnr_api::RuleActionType::kNone: case dnr_api::RuleActionType::kNone:
break; break;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return flat::ActionType_block;
} }
std::string GetPublicRulesetID(const Extension& extension, std::string GetPublicRulesetID(const Extension& extension,
@ -720,8 +716,7 @@ std::string GetParseError(ParseResult error_reason, int rule_id) {
kErrorResponseHeaderRuleCannotModifyRequestHeaders, kErrorResponseHeaderRuleCannotModifyRequestHeaders,
base::NumberToString(rule_id)); base::NumberToString(rule_id));
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return std::string();
} }
flat_rule::ElementType GetElementType(WebRequestResourceType web_request_type) { flat_rule::ElementType GetElementType(WebRequestResourceType web_request_type) {
@ -757,8 +752,7 @@ flat_rule::ElementType GetElementType(WebRequestResourceType web_request_type) {
case WebRequestResourceType::WEB_TRANSPORT: case WebRequestResourceType::WEB_TRANSPORT:
return flat_rule::ElementType_WEBTRANSPORT; return flat_rule::ElementType_WEBTRANSPORT;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return flat_rule::ElementType_OTHER;
} }
flat_rule::ElementType GetElementType(dnr_api::ResourceType resource_type) { flat_rule::ElementType GetElementType(dnr_api::ResourceType resource_type) {
@ -796,8 +790,7 @@ flat_rule::ElementType GetElementType(dnr_api::ResourceType resource_type) {
case dnr_api::ResourceType::kOther: case dnr_api::ResourceType::kOther:
return flat_rule::ElementType_OTHER; return flat_rule::ElementType_OTHER;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return flat_rule::ElementType_NONE;
} }
// Maps an HTTP request method string to flat_rule::RequestMethod. // Maps an HTTP request method string to flat_rule::RequestMethod.
@ -841,8 +834,7 @@ flat_rule::RequestMethod GetRequestMethod(
dnr_api::RequestMethod request_method) { dnr_api::RequestMethod request_method) {
switch (request_method) { switch (request_method) {
case dnr_api::RequestMethod::kNone: case dnr_api::RequestMethod::kNone:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return flat_rule::RequestMethod_NONE;
case dnr_api::RequestMethod::kConnect: case dnr_api::RequestMethod::kConnect:
return flat_rule::RequestMethod_CONNECT; return flat_rule::RequestMethod_CONNECT;
case dnr_api::RequestMethod::kDelete: case dnr_api::RequestMethod::kDelete:
@ -862,8 +854,7 @@ flat_rule::RequestMethod GetRequestMethod(
case dnr_api::RequestMethod::kPut: case dnr_api::RequestMethod::kPut:
return flat_rule::RequestMethod_PUT; return flat_rule::RequestMethod_PUT;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return flat_rule::RequestMethod_NONE;
} }
flat_rule::RequestMethod GetRequestMethod( flat_rule::RequestMethod GetRequestMethod(

@ -1000,8 +1000,7 @@ std::string WebRequestRequestCookieAction::GetName() const {
case helpers::REMOVE: case helpers::REMOVE:
return keys::kRemoveRequestCookieType; return keys::kRemoveRequestCookieType;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return "";
} }
std::optional<EventResponseDelta> WebRequestRequestCookieAction::CreateDelta( std::optional<EventResponseDelta> WebRequestRequestCookieAction::CreateDelta(
@ -1048,8 +1047,7 @@ std::string WebRequestResponseCookieAction::GetName() const {
case helpers::REMOVE: case helpers::REMOVE:
return keys::kRemoveResponseCookieType; return keys::kRemoveResponseCookieType;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return "";
} }
std::optional<EventResponseDelta> WebRequestResponseCookieAction::CreateDelta( std::optional<EventResponseDelta> WebRequestResponseCookieAction::CreateDelta(

@ -428,8 +428,7 @@ bool HeaderMatcher::StringMatchTest::Matches(
} }
} }
// We never get past the "switch", but the compiler worries about no return. // We never get past the "switch", but the compiler worries about no return.
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return false;
} }
HeaderMatcher::StringMatchTest::StringMatchTest(const std::string& data, HeaderMatcher::StringMatchTest::StringMatchTest(const std::string& data,
@ -480,9 +479,7 @@ HeaderMatcher::HeaderMatchTest::Create(const base::Value::Dict& tests) {
} else if (entry.first == keys::kValueEqualsKey) { } else if (entry.first == keys::kValueEqualsKey) {
match_type = StringMatchTest::kEquals; match_type = StringMatchTest::kEquals;
} else { } else {
NOTREACHED_IN_MIGRATION(); // JSON schema type checking should prevent NOTREACHED(); // JSON schema type checking should prevent this.
// this.
return nullptr;
} }
const base::Value* content = &entry.second; const base::Value* content = &entry.second;
@ -503,9 +500,7 @@ HeaderMatcher::HeaderMatchTest::Create(const base::Value::Dict& tests) {
break; break;
} }
default: { default: {
NOTREACHED_IN_MIGRATION(); // JSON schema type checking should prevent NOTREACHED(); // JSON schema type checking should prevent this.
// this.
return nullptr;
} }
} }
} }
@ -735,8 +730,7 @@ bool ParseListOfStages(const base::Value& value, int* out_stages) {
} else if (stage_name == keys::kOnAuthRequiredEnum) { } else if (stage_name == keys::kOnAuthRequiredEnum) {
stages |= ON_AUTH_REQUIRED; stages |= ON_AUTH_REQUIRED;
} else { } else {
NOTREACHED_IN_MIGRATION(); // JSON schema checks prevent getting here. NOTREACHED(); // JSON schema checks prevent getting here.
return false;
} }
} }

@ -273,8 +273,7 @@ base::Value::Dict GetDictFromArray(
entry->GetList().Append(*value); entry->GetList().Append(*value);
break; break;
default: default:
NOTREACHED_IN_MIGRATION(); // We never put other Values here. NOTREACHED(); // We never put other Values here.
return base::Value::Dict();
} }
} else { } else {
dict.Set(*name, *value); dict.Set(*name, *value);

@ -83,8 +83,7 @@ const char* TypeToString(DevicePermissionEntry::Type type) {
case DevicePermissionEntry::Type::HID: case DevicePermissionEntry::Type::HID:
return kDeviceTypeHid; return kDeviceTypeHid;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return "";
} }
// Persists a DevicePermissionEntry in ExtensionPrefs. // Persists a DevicePermissionEntry in ExtensionPrefs.
@ -603,7 +602,7 @@ void DevicePermissionsManager::RemoveEntry(
} else if (entry->type_ == DevicePermissionEntry::Type::HID) { } else if (entry->type_ == DevicePermissionEntry::Type::HID) {
device_permissions->ephemeral_hid_devices_.erase(entry->device_guid_); device_permissions->ephemeral_hid_devices_.erase(entry->device_guid_);
} else { } else {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
} }

@ -374,9 +374,7 @@ ExtensionFunction::ResponseAction FeedbackPrivateReadLogSourceFunction::Run() {
return RespondLater(); return RespondLater();
#else #else
NOTREACHED_IN_MIGRATION() NOTREACHED() << "API function is not supported on this platform.";
<< "API function is not supported on this platform.";
return RespondNow(Error("API function is not supported on this platform."));
#endif // BUILDFLAG(IS_CHROMEOS) #endif // BUILDFLAG(IS_CHROMEOS)
} }

@ -426,9 +426,8 @@ std::string WebViewInternalCaptureVisibleRegionFunction::GetErrorMessage(
reason_description = "screenshot has been disabled"; reason_description = "screenshot has been disabled";
break; break;
case OK: case OK:
NOTREACHED_IN_MIGRATION() NOTREACHED()
<< "GetErrorMessage should not be called with a successful result"; << "GetErrorMessage should not be called with a successful result";
return "";
} }
return ErrorUtils::FormatErrorMessage("Failed to capture webview: *", return ErrorUtils::FormatErrorMessage("Failed to capture webview: *",
reason_description); reason_description);
@ -534,8 +533,7 @@ bool WebViewInternalExecuteCodeFunction::LoadFileForEmbedder(
switch (host_id().type) { switch (host_id().type) {
case mojom::HostID::HostType::kExtensions: case mojom::HostID::HostType::kExtensions:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return false;
case mojom::HostID::HostType::kControlledFrameEmbedder: case mojom::HostID::HostType::kControlledFrameEmbedder:
url_fetcher_ = std::make_unique<ControlledFrameEmbedderURLFetcher>( url_fetcher_ = std::make_unique<ControlledFrameEmbedderURLFetcher>(
source_process_id(), render_frame_host()->GetRoutingID(), file_url, source_process_id(), render_frame_host()->GetRoutingID(), file_url,
@ -774,7 +772,7 @@ ExtensionFunction::ResponseAction WebViewInternalSetZoomModeFunction::Run() {
zoom_mode = ZoomController::ZOOM_MODE_DISABLED; zoom_mode = ZoomController::ZOOM_MODE_DISABLED;
break; break;
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
GetGuest().SetZoomMode(zoom_mode); GetGuest().SetZoomMode(zoom_mode);
@ -804,7 +802,7 @@ ExtensionFunction::ResponseAction WebViewInternalGetZoomModeFunction::Run() {
zoom_mode = web_view_internal::ZoomMode::kDisabled; zoom_mode = web_view_internal::ZoomMode::kDisabled;
break; break;
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
return RespondNow(WithArguments(web_view_internal::ToString(zoom_mode))); return RespondNow(WithArguments(web_view_internal::ToString(zoom_mode)));
@ -982,7 +980,7 @@ ExtensionFunction::ResponseAction WebViewInternalSetPermissionFunction::Run() {
case api::web_view_internal::SetPermissionAction::kDefault: case api::web_view_internal::SetPermissionAction::kDefault:
break; break;
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
std::string user_input; std::string user_input;

@ -23,8 +23,7 @@ std::string GetErrorString(lock_screen_data::OperationResult result) {
switch (result) { switch (result) {
case lock_screen_data::OperationResult::kSuccess: case lock_screen_data::OperationResult::kSuccess:
case lock_screen_data::OperationResult::kCount: case lock_screen_data::OperationResult::kCount:
NOTREACHED_IN_MIGRATION() << "Expected a failure code."; NOTREACHED() << "Expected a failure code.";
return "Unknown";
case lock_screen_data::OperationResult::kFailed: case lock_screen_data::OperationResult::kFailed:
return "Unknown"; return "Unknown";
case lock_screen_data::OperationResult::kInvalidKey: case lock_screen_data::OperationResult::kInvalidKey:
@ -36,8 +35,7 @@ std::string GetErrorString(lock_screen_data::OperationResult result) {
case lock_screen_data::OperationResult::kUnknownExtension: case lock_screen_data::OperationResult::kUnknownExtension:
return "Not found"; return "Not found";
} }
NOTREACHED_IN_MIGRATION() << "Unknown operation status"; NOTREACHED() << "Unknown operation status";
return "Unknown";
} }
} // namespace } // namespace

@ -308,8 +308,7 @@ bool LockScreenItemStorage::IsContextAllowed(content::BrowserContext* context) {
case SessionLockedState::kNotLocked: case SessionLockedState::kNotLocked:
return context_ == context; return context_ == context;
} }
NOTREACHED_IN_MIGRATION() << "Unknown session locked state"; NOTREACHED() << "Unknown session locked state";
return false;
} }
void LockScreenItemStorage::CreateItemImpl(const ExtensionId& extension_id, void LockScreenItemStorage::CreateItemImpl(const ExtensionId& extension_id,

@ -255,7 +255,7 @@ management::ExtensionInfo CreateExtensionInfo(
break; break;
case LAUNCH_TYPE_INVALID: case LAUNCH_TYPE_INVALID:
case NUM_LAUNCH_TYPES: case NUM_LAUNCH_TYPES:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
info.available_launch_types = GetAvailableLaunchTypes(extension, delegate); info.available_launch_types = GetAvailableLaunchTypes(extension, delegate);
@ -997,7 +997,7 @@ ExtensionFunction::ResponseAction ManagementSetLaunchTypeFunction::Run() {
launch_type = LAUNCH_TYPE_WINDOW; launch_type = LAUNCH_TYPE_WINDOW;
break; break;
case management::LaunchType::kNone: case management::LaunchType::kNone:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
delegate->SetLaunchType(browser_context(), params->id, launch_type); delegate->SetLaunchType(browser_context(), params->id, launch_type);

@ -28,8 +28,7 @@ HotwordType HotwordTypeProtoToIdl(const mri::HotwordDetection::Type& type) {
case mri::HotwordDetection::OK_GOOGLE: case mri::HotwordDetection::OK_GOOGLE:
return HotwordType::kOkGoogle; return HotwordType::kOkGoogle;
} }
NOTREACHED_IN_MIGRATION() << "Unknown hotword type: " << type; NOTREACHED() << "Unknown hotword type: " << type;
return HotwordType::kUnknownType;
} }
Hotword HotwordProtoToIdl(const mri::HotwordDetection::Hotword& hotword) { Hotword HotwordProtoToIdl(const mri::HotwordDetection::Hotword& hotword) {
@ -159,8 +158,7 @@ LightCondition LightConditionProtoToIdl(
case mri::VideoHumanPresenceDetection::BLACK_FRAME: case mri::VideoHumanPresenceDetection::BLACK_FRAME:
return LightCondition::kBlackFrame; return LightCondition::kBlackFrame;
default: default:
NOTREACHED_IN_MIGRATION() << "Unknown light condition: " << condition; NOTREACHED() << "Unknown light condition: " << condition;
return LightCondition::kUnspecified;
} }
} }
@ -262,7 +260,7 @@ DistanceUnits DistanceUnitsProtoToIdl(const mri::Distance& distance) {
case mri::Distance::UNITS_UNSPECIFIED: case mri::Distance::UNITS_UNSPECIFIED:
return DistanceUnits::kUnspecified; return DistanceUnits::kUnspecified;
} }
NOTREACHED_IN_MIGRATION() << "Unknown distance units: " << distance.units(); NOTREACHED() << "Unknown distance units: " << distance.units();
} }
return DistanceUnits::kUnspecified; return DistanceUnits::kUnspecified;
} }
@ -288,8 +286,7 @@ FramePerceptionType FramePerceptionTypeProtoToIdl(int type) {
case mri::FramePerception::MOTION_DETECTION: case mri::FramePerception::MOTION_DETECTION:
return FramePerceptionType::kMotionDetection; return FramePerceptionType::kMotionDetection;
} }
NOTREACHED_IN_MIGRATION() << "Unknown frame perception type: " << type; NOTREACHED() << "Unknown frame perception type: " << type;
return FramePerceptionType::kUnknownType;
} }
EntityType EntityTypeProtoToIdl(const mri::Entity& entity) { EntityType EntityTypeProtoToIdl(const mri::Entity& entity) {
@ -306,7 +303,7 @@ EntityType EntityTypeProtoToIdl(const mri::Entity& entity) {
case mri::Entity::UNSPECIFIED: case mri::Entity::UNSPECIFIED:
return EntityType::kUnspecified; return EntityType::kUnspecified;
} }
NOTREACHED_IN_MIGRATION() << "Unknown entity type: " << entity.type(); NOTREACHED() << "Unknown entity type: " << entity.type();
} }
return EntityType::kUnspecified; return EntityType::kUnspecified;
} }
@ -403,8 +400,7 @@ ImageFormat ImageFormatProtoToIdl(const mri::ImageFrame& image_frame) {
case mri::ImageFrame::FORMAT_UNSPECIFIED: case mri::ImageFrame::FORMAT_UNSPECIFIED:
return ImageFormat::kNone; return ImageFormat::kNone;
} }
NOTREACHED_IN_MIGRATION() NOTREACHED() << "Unknown image format: " << image_frame.format();
<< "Unknown image format: " << image_frame.format();
} }
return ImageFormat::kNone; return ImageFormat::kNone;
} }
@ -474,8 +470,7 @@ Status StateStatusProtoToIdl(const mri::State& state) {
case mri::State::STATUS_UNSPECIFIED: case mri::State::STATUS_UNSPECIFIED:
return Status::kNone; return Status::kNone;
} }
NOTREACHED_IN_MIGRATION() << "Reached status not in switch."; NOTREACHED() << "Reached status not in switch.";
return Status::kNone;
} }
mri::State::Status StateStatusIdlToProto(const State& state) { mri::State::Status StateStatusIdlToProto(const State& state) {
@ -496,8 +491,7 @@ mri::State::Status StateStatusIdlToProto(const State& state) {
case Status::kNone: case Status::kNone:
return mri::State::STATUS_UNSPECIFIED; return mri::State::STATUS_UNSPECIFIED;
} }
NOTREACHED_IN_MIGRATION() << "Reached status not in switch."; NOTREACHED() << "Reached status not in switch.";
return mri::State::STATUS_UNSPECIFIED;
} }
Feature FeatureProtoToIdl(int feature) { Feature FeatureProtoToIdl(int feature) {
@ -515,8 +509,7 @@ Feature FeatureProtoToIdl(int feature) {
case mri::State::FEATURE_UNSET: case mri::State::FEATURE_UNSET:
return Feature::kNone; return Feature::kNone;
} }
NOTREACHED_IN_MIGRATION() << "Reached feature not in switch."; NOTREACHED() << "Reached feature not in switch.";
return Feature::kNone;
} }
mri::State::Feature FeatureIdlToProto(const Feature& feature) { mri::State::Feature FeatureIdlToProto(const Feature& feature) {
@ -534,8 +527,7 @@ mri::State::Feature FeatureIdlToProto(const Feature& feature) {
case Feature::kNone: case Feature::kNone:
return mri::State::FEATURE_UNSET; return mri::State::FEATURE_UNSET;
} }
NOTREACHED_IN_MIGRATION() << "Reached feature not in switch."; NOTREACHED() << "Reached feature not in switch.";
return mri::State::FEATURE_UNSET;
} }
base::Value NamedTemplateArgumentValueProtoToValue( base::Value NamedTemplateArgumentValueProtoToValue(
@ -548,9 +540,8 @@ base::Value NamedTemplateArgumentValueProtoToValue(
case mri::State::NamedTemplateArgument::ValueCase::VALUE_NOT_SET: case mri::State::NamedTemplateArgument::ValueCase::VALUE_NOT_SET:
return base::Value(); return base::Value();
} }
NOTREACHED_IN_MIGRATION() << "Unknown NamedTemplateArgument::ValueCase " NOTREACHED() << "Unknown NamedTemplateArgument::ValueCase "
<< named_template_argument.value_case(); << named_template_argument.value_case();
return base::Value();
} }
bool NamedTemplateArgumentProtoToIdl( bool NamedTemplateArgumentProtoToIdl(
@ -585,9 +576,8 @@ mri::State::NamedTemplateArgument NamedTemplateArgumentIdlToProto(
named_template_argument_proto.set_num( named_template_argument_proto.set_num(
*named_template_argument.value->as_number); *named_template_argument.value->as_number);
} else { } else {
NOTREACHED_IN_MIGRATION() NOTREACHED() << "Failed to convert NamedTemplateARgument::Value IDL to "
<< "Failed to convert NamedTemplateARgument::Value IDL to " "Proto, unkown value type.";
"Proto, unkown value type.";
} }
} }

@ -714,8 +714,7 @@ bool ExtensionMessagePort::IsServiceWorkerActivity(
return is_for_onetime_channel() || should_have_strong_keepalive(); return is_for_onetime_channel() || should_have_strong_keepalive();
default: default:
// Extension message port should not check for other activity types. // Extension message port should not check for other activity types.
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return false;
} }
} }

@ -1077,8 +1077,7 @@ void MessageService::OnOpenChannelAllowed(
auto pending_for_incognito = pending_incognito_channels_.find(channel_id); auto pending_for_incognito = pending_incognito_channels_.find(channel_id);
if (pending_for_incognito == pending_incognito_channels_.end()) { if (pending_for_incognito == pending_incognito_channels_.end()) {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return;
} }
PendingMessagesQueue pending_messages; PendingMessagesQueue pending_messages;
pending_messages.swap(pending_for_incognito->second); pending_messages.swap(pending_for_incognito->second);

@ -18,14 +18,12 @@ NetworkingPrivateDelegate::~NetworkingPrivateDelegate() = default;
void NetworkingPrivateDelegate::AddObserver( void NetworkingPrivateDelegate::AddObserver(
NetworkingPrivateDelegateObserver* observer) { NetworkingPrivateDelegateObserver* observer) {
NOTREACHED_IN_MIGRATION() NOTREACHED() << "Class does not use NetworkingPrivateDelegateObserver";
<< "Class does not use NetworkingPrivateDelegateObserver";
} }
void NetworkingPrivateDelegate::RemoveObserver( void NetworkingPrivateDelegate::RemoveObserver(
NetworkingPrivateDelegateObserver* observer) { NetworkingPrivateDelegateObserver* observer) {
NOTREACHED_IN_MIGRATION() NOTREACHED() << "Class does not use NetworkingPrivateDelegateObserver";
<< "Class does not use NetworkingPrivateDelegateObserver";
} }
void NetworkingPrivateDelegate::StartActivate( void NetworkingPrivateDelegate::StartActivate(

@ -70,15 +70,17 @@ NetworkingPrivateDelegateFactory::BuildServiceInstanceForBrowserContext(
delegate = delegate =
std::make_unique<NetworkingPrivateServiceClient>(std::move(wifi_service)); std::make_unique<NetworkingPrivateServiceClient>(std::move(wifi_service));
#else #else
NOTREACHED_IN_MIGRATION(); NOTREACHED();
delegate = nullptr;
#endif #endif
#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || \
BUILDFLAG(IS_MAC)
if (ui_factory_) { if (ui_factory_) {
delegate->set_ui_delegate(ui_factory_->CreateDelegate()); delegate->set_ui_delegate(ui_factory_->CreateDelegate());
} }
return delegate; return delegate;
#endif
} }
BrowserContext* NetworkingPrivateDelegateFactory::GetBrowserContextToUse( BrowserContext* NetworkingPrivateDelegateFactory::GetBrowserContextToUse(

@ -28,9 +28,7 @@ device::mojom::WakeLockType LevelToWakeLockType(api::power::Level level) {
case api::power::Level::kNone: case api::power::Level::kNone:
return device::mojom::WakeLockType::kPreventDisplaySleep; return device::mojom::WakeLockType::kPreventDisplaySleep;
} }
NOTREACHED_IN_MIGRATION() NOTREACHED() << "Unhandled power level: " << api::power::ToString(level);
<< "Unhandled power level: " << api::power::ToString(level);
return device::mojom::WakeLockType::kPreventDisplaySleep;
} }
base::LazyInstance<BrowserContextKeyedAPIFactory<PowerAPI>>::DestructorAtExit base::LazyInstance<BrowserContextKeyedAPIFactory<PowerAPI>>::DestructorAtExit

@ -92,8 +92,7 @@ class FakeWakeLockManager {
requests_.push_back(UNBLOCK_APP_SUSPENSION); requests_.push_back(UNBLOCK_APP_SUSPENSION);
break; break;
case device::mojom::WakeLockType::kPreventDisplaySleepAllowDimming: case device::mojom::WakeLockType::kPreventDisplaySleepAllowDimming:
NOTREACHED_IN_MIGRATION() << "Unexpected wake lock type " << type; NOTREACHED() << "Unexpected wake lock type " << type;
break;
} }
type_ = type; type_ = type;
@ -110,8 +109,7 @@ class FakeWakeLockManager {
requests_.push_back(BLOCK_DISPLAY_SLEEP); requests_.push_back(BLOCK_DISPLAY_SLEEP);
break; break;
case device::mojom::WakeLockType::kPreventDisplaySleepAllowDimming: case device::mojom::WakeLockType::kPreventDisplaySleepAllowDimming:
NOTREACHED_IN_MIGRATION() << "Unexpected wake lock type " << type; NOTREACHED() << "Unexpected wake lock type " << type;
break;
} }
type_ = type; type_ = type;
@ -130,8 +128,7 @@ class FakeWakeLockManager {
requests_.push_back(UNBLOCK_DISPLAY_SLEEP); requests_.push_back(UNBLOCK_DISPLAY_SLEEP);
break; break;
case device::mojom::WakeLockType::kPreventDisplaySleepAllowDimming: case device::mojom::WakeLockType::kPreventDisplaySleepAllowDimming:
NOTREACHED_IN_MIGRATION() << "Unexpected wake lock type " << type_; NOTREACHED() << "Unexpected wake lock type " << type_;
break;
} }
is_active_ = false; is_active_ = false;
} }

@ -92,7 +92,6 @@ constexpr char kErrorOnlyKioskModeAllowed[] =
"API available only for ChromeOS kiosk mode."; "API available only for ChromeOS kiosk mode.";
constexpr char kErrorOnlyFirstExtensionAllowed[] = constexpr char kErrorOnlyFirstExtensionAllowed[] =
"Not the first extension to call this API."; "Not the first extension to call this API.";
constexpr char kErrorInvalidStatus[] = "Invalid restart request status.";
constexpr char kErrorRequestedTooSoon[] = constexpr char kErrorRequestedTooSoon[] =
"Restart was requested too soon. It was throttled instead."; "Restart was requested too soon. It was throttled instead.";
@ -768,8 +767,7 @@ ExtensionFunction::ResponseAction RuntimeRestartAfterDelayFunction::Run() {
return RespondNow(NoArguments()); return RespondNow(NoArguments());
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return RespondNow(Error(kErrorInvalidStatus));
} }
ExtensionFunction::ResponseAction RuntimeGetPlatformInfoFunction::Run() { ExtensionFunction::ResponseAction RuntimeGetPlatformInfoFunction::Run() {

@ -140,10 +140,10 @@ class FakeSerialPort : public device::mojom::SerialPort {
return; return;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
void Drain(DrainCallback callback) override { NOTREACHED_IN_MIGRATION(); } void Drain(DrainCallback callback) override { NOTREACHED(); }
void GetControlSignals(GetControlSignalsCallback callback) override { void GetControlSignals(GetControlSignalsCallback callback) override {
auto signals = device::mojom::SerialPortControlSignals::New(); auto signals = device::mojom::SerialPortControlSignals::New();
@ -214,7 +214,7 @@ class FakeSerialPort : public device::mojom::SerialPort {
return; return;
} }
// The code should not reach other cases. // The code should not reach other cases.
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
void DoRead(MojoResult result, const mojo::HandleSignalsState& state) { void DoRead(MojoResult result, const mojo::HandleSignalsState& state) {

@ -138,7 +138,7 @@ void AppFirewallHoleManager::Close(AppFirewallHole* hole) {
return; return;
} }
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
void AppFirewallHoleManager::OnAppWindowRemoved(AppWindow* app_window) { void AppFirewallHoleManager::OnAppWindowRemoved(AppWindow* app_window) {

@ -140,10 +140,7 @@ void SocketApiFunction::OpenFirewallHole(const std::string& address,
if (!net::HostStringIsLocalhost(address)) { if (!net::HostStringIsLocalhost(address)) {
net::IPEndPoint local_address; net::IPEndPoint local_address;
if (!socket->GetLocalAddress(&local_address)) { if (!socket->GetLocalAddress(&local_address)) {
NOTREACHED_IN_MIGRATION() NOTREACHED() << "Cannot get address of recently bound socket.";
<< "Cannot get address of recently bound socket.";
Respond(ErrorWithCode(-1, kFirewallFailure));
return;
} }
AppFirewallHoleManager* manager = AppFirewallHoleManager* manager =
@ -318,8 +315,7 @@ ExtensionFunction::ResponseAction SocketCreateFunction::Work() {
break; break;
} }
case extensions::api::socket::SocketType::kNone: case extensions::api::socket::SocketType::kNone:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return RespondNow(NoArguments());
} }
DCHECK(socket); DCHECK(socket);
@ -374,9 +370,7 @@ ExtensionFunction::ResponseAction SocketConnectFunction::Work() {
operation_type = SocketPermissionRequest::UDP_SEND_TO; operation_type = SocketPermissionRequest::UDP_SEND_TO;
break; break;
default: default:
NOTREACHED_IN_MIGRATION() << "Unknown socket type."; NOTREACHED() << "Unknown socket type.";
operation_type = SocketPermissionRequest::NONE;
break;
} }
SocketPermission::CheckParam param(operation_type, hostname_, port_); SocketPermission::CheckParam param(operation_type, hostname_, port_);

@ -70,7 +70,7 @@ class TestUdpEchoServer::Core {
udp_listener_receiver_.BindNewPipeAndPassRemote()); udp_listener_receiver_.BindNewPipeAndPassRemote());
server_socket_.set_disconnect_handler( server_socket_.set_disconnect_handler(
base::BindLambdaForTesting([]() { NOTREACHED_IN_MIGRATION(); })); base::BindLambdaForTesting([]() { NOTREACHED(); }));
net::IPEndPoint server_addr(net::IPAddress::IPv4Localhost(), 0); net::IPEndPoint server_addr(net::IPAddress::IPv4Localhost(), 0);
auto server_helper = auto server_helper =

@ -27,8 +27,7 @@ std::string ToString(Namespace settings_namespace) {
case INVALID: case INVALID:
break; break;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return std::string();
} }
} // namespace settings_namespace } // namespace settings_namespace

@ -96,7 +96,7 @@ scoped_refptr<const Extension> AddExtensionWithIdAndPermissions(
} }
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
std::string error; std::string error;

@ -240,48 +240,32 @@ TEST_F(StorageApiUnittest, GetBytesInUseIntOverflow) {
size_t GetBytesInUse() override { return bytes_in_use_; } size_t GetBytesInUse() override { return bytes_in_use_; }
ReadResult Get(const std::string& key) override { ReadResult Get(const std::string& key) override { NOTREACHED(); }
NOTREACHED_IN_MIGRATION();
return ReadResult(Status());
}
ReadResult Get(const std::vector<std::string>& keys) override { ReadResult Get(const std::vector<std::string>& keys) override {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return ReadResult(Status());
} }
ReadResult Get() override { ReadResult Get() override { NOTREACHED(); }
NOTREACHED_IN_MIGRATION();
return ReadResult(Status());
}
WriteResult Set(WriteOptions options, WriteResult Set(WriteOptions options,
const std::string& key, const std::string& key,
const base::Value& value) override { const base::Value& value) override {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return WriteResult(Status());
} }
WriteResult Set(WriteOptions options, WriteResult Set(WriteOptions options,
const base::Value::Dict& values) override { const base::Value::Dict& values) override {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return WriteResult(Status());
} }
WriteResult Remove(const std::string& key) override { WriteResult Remove(const std::string& key) override { NOTREACHED(); }
NOTREACHED_IN_MIGRATION();
return WriteResult(Status());
}
WriteResult Remove(const std::vector<std::string>& keys) override { WriteResult Remove(const std::vector<std::string>& keys) override {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return WriteResult(Status());
} }
WriteResult Clear() override { WriteResult Clear() override { NOTREACHED(); }
NOTREACHED_IN_MIGRATION();
return WriteResult(Status());
}
private: private:
size_t bytes_in_use_ = 0; size_t bytes_in_use_ = 0;

@ -26,8 +26,7 @@ const char* StorageAreaToString(StorageAreaNamespace storage_area) {
case StorageAreaNamespace::kSession: case StorageAreaNamespace::kSession:
return kSessionString; return kSessionString;
case StorageAreaNamespace::kInvalid: case StorageAreaNamespace::kInvalid:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return "";
} }
} }
@ -43,8 +42,7 @@ settings_namespace::Namespace StorageAreaToSettingsNamespace(
case StorageAreaNamespace::kSession: case StorageAreaNamespace::kSession:
return settings_namespace::INVALID; return settings_namespace::INVALID;
case StorageAreaNamespace::kInvalid: case StorageAreaNamespace::kInvalid:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return settings_namespace::INVALID;
} }
} }

@ -56,8 +56,7 @@ events::HistogramValue StorageAreaToEventHistogram(
case StorageAreaNamespace::kSession: case StorageAreaNamespace::kSession:
return events::STORAGE_SESSION_ON_CHANGE; return events::STORAGE_SESSION_ON_CHANGE;
case StorageAreaNamespace::kInvalid: case StorageAreaNamespace::kInvalid:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return events::UNKNOWN;
} }
} }

@ -36,7 +36,7 @@ base::FilePath GetValueStoreDir(
dir = base::FilePath(kManagedSettingsDirectoryName); dir = base::FilePath(kManagedSettingsDirectoryName);
break; break;
case settings_namespace::INVALID: case settings_namespace::INVALID:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
return dir.AppendASCII(id); return dir.AppendASCII(id);
} }

@ -106,12 +106,12 @@ void DisplayInfoProvider::SetDisplayProperties(
const std::string& display_id, const std::string& display_id,
const api::system_display::DisplayProperties& properties, const api::system_display::DisplayProperties& properties,
ErrorCallback callback) { ErrorCallback callback) {
NOTREACHED_IN_MIGRATION() << "SetDisplayProperties not implemented"; NOTREACHED() << "SetDisplayProperties not implemented";
} }
void DisplayInfoProvider::SetDisplayLayout(const DisplayLayoutList& layouts, void DisplayInfoProvider::SetDisplayLayout(const DisplayLayoutList& layouts,
ErrorCallback callback) { ErrorCallback callback) {
NOTREACHED_IN_MIGRATION() << "SetDisplayLayout not implemented"; NOTREACHED() << "SetDisplayLayout not implemented";
} }
void DisplayInfoProvider::EnableUnifiedDesktop(bool enable) {} void DisplayInfoProvider::EnableUnifiedDesktop(bool enable) {}
@ -148,9 +148,7 @@ void DisplayInfoProvider::GetAllDisplaysInfo(
void DisplayInfoProvider::GetDisplayLayout( void DisplayInfoProvider::GetDisplayLayout(
base::OnceCallback<void(DisplayLayoutList result)> callback) { base::OnceCallback<void(DisplayLayoutList result)> callback) {
NOTREACHED_IN_MIGRATION(); // Implemented on Chrome OS only in override. NOTREACHED(); // Implemented on Chrome OS only in override.
base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
FROM_HERE, base::BindOnce(std::move(callback), DisplayLayoutList()));
} }
void DisplayInfoProvider::StartObserving() { void DisplayInfoProvider::StartObserving() {
@ -181,32 +179,27 @@ bool DisplayInfoProvider::OverscanCalibrationComplete(const std::string& id) {
void DisplayInfoProvider::ShowNativeTouchCalibration(const std::string& id, void DisplayInfoProvider::ShowNativeTouchCalibration(const std::string& id,
ErrorCallback callback) { ErrorCallback callback) {
NOTREACHED_IN_MIGRATION(); // Implemented on Chrome OS only in override. NOTREACHED(); // Implemented on Chrome OS only in override.
} }
bool DisplayInfoProvider::StartCustomTouchCalibration(const std::string& id) { bool DisplayInfoProvider::StartCustomTouchCalibration(const std::string& id) {
NOTREACHED_IN_MIGRATION(); // Implemented on Chrome OS only in override. NOTREACHED(); // Implemented on Chrome OS only in override.
return false;
} }
bool DisplayInfoProvider::CompleteCustomTouchCalibration( bool DisplayInfoProvider::CompleteCustomTouchCalibration(
const api::system_display::TouchCalibrationPairQuad& pairs, const api::system_display::TouchCalibrationPairQuad& pairs,
const api::system_display::Bounds& bounds) { const api::system_display::Bounds& bounds) {
NOTREACHED_IN_MIGRATION(); // Implemented on Chrome OS only in override. NOTREACHED(); // Implemented on Chrome OS only in override.
return false;
} }
bool DisplayInfoProvider::ClearTouchCalibration(const std::string& id) { bool DisplayInfoProvider::ClearTouchCalibration(const std::string& id) {
NOTREACHED_IN_MIGRATION(); // Implemented on Chrome OS only in override. NOTREACHED(); // Implemented on Chrome OS only in override.
return false;
} }
void DisplayInfoProvider::SetMirrorMode( void DisplayInfoProvider::SetMirrorMode(
const api::system_display::MirrorModeInfo& info, const api::system_display::MirrorModeInfo& info,
ErrorCallback callback) { ErrorCallback callback) {
NOTREACHED_IN_MIGRATION(); // Implemented on Chrome OS only in override. NOTREACHED(); // Implemented on Chrome OS only in override.
base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
FROM_HERE, base::BindOnce(std::move(callback), "Not supported"));
} }
void DisplayInfoProvider::DispatchOnDisplayChangedEvent() { void DisplayInfoProvider::DispatchOnDisplayChangedEvent() {

@ -250,7 +250,7 @@ void HandleListenerAddedOrRemoved(content::BrowserContext* context,
return; return;
} }
NOTREACHED_IN_MIGRATION() << "Unknown event name: " << event_name; NOTREACHED() << "Unknown event name: " << event_name;
} }
} // namespace } // namespace

@ -141,8 +141,7 @@ bool ConvertDirectionFromApi(const Direction& input,
*output = UsbTransferDirection::OUTBOUND; *output = UsbTransferDirection::OUTBOUND;
return true; return true;
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return false;
} }
} }
@ -162,8 +161,7 @@ bool ConvertRequestTypeFromApi(const RequestType& input,
*output = UsbControlTransferType::RESERVED; *output = UsbControlTransferType::RESERVED;
return true; return true;
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return false;
} }
} }
@ -183,8 +181,7 @@ bool ConvertRecipientFromApi(const Recipient& input,
*output = UsbControlTransferRecipient::OTHER; *output = UsbControlTransferRecipient::OTHER;
return true; return true;
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return false;
} }
} }
@ -244,8 +241,7 @@ TransferType ConvertTransferTypeToApi(const UsbTransferType& input) {
case UsbTransferType::BULK: case UsbTransferType::BULK:
return usb::TransferType::kBulk; return usb::TransferType::kBulk;
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return usb::TransferType::kNone;
} }
} }
@ -256,8 +252,7 @@ Direction ConvertDirectionToApi(const UsbTransferDirection& input) {
case UsbTransferDirection::OUTBOUND: case UsbTransferDirection::OUTBOUND:
return usb::Direction::kOut; return usb::Direction::kOut;
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return usb::Direction::kNone;
} }
} }
@ -273,8 +268,7 @@ SynchronizationType ConvertSynchronizationTypeToApi(
case UsbSynchronizationType::SYNCHRONOUS: case UsbSynchronizationType::SYNCHRONOUS:
return usb::SynchronizationType::kSynchronous; return usb::SynchronizationType::kSynchronous;
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return usb::SynchronizationType::kNone;
} }
} }
@ -293,8 +287,7 @@ usb::UsageType ConvertUsageTypeToApi(const UsbUsageType& input) {
case UsbUsageType::RESERVED: case UsbUsageType::RESERVED:
return usb::UsageType::kNone; return usb::UsageType::kNone;
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return usb::UsageType::kNone;
} }
} }

@ -94,7 +94,7 @@ std::optional<std::string> WebContentsCaptureClient::EncodeBitmap(
mime_type = kMimeTypePng; mime_type = kMimeTypePng;
break; break;
default: default:
NOTREACHED_IN_MIGRATION() << "Invalid image format."; NOTREACHED() << "Invalid image format.";
} }
if (!data) { if (!data) {

@ -143,9 +143,7 @@ events::HistogramValue GetEventHistogramValue(const std::string& event_name) {
// There is no histogram value for this event name. It should be added to // There is no histogram value for this event name. It should be added to
// either the mapping here, or in guest_view_events. // either the mapping here, or in guest_view_events.
NOTREACHED_IN_MIGRATION() NOTREACHED() << "Event " << event_name << " must have a histogram value";
<< "Event " << event_name << " must have a histogram value";
return events::UNKNOWN;
} }
const char* GetRequestStageAsString(WebRequestEventRouter::EventTypes type) { const char* GetRequestStageAsString(WebRequestEventRouter::EventTypes type) {
@ -171,8 +169,7 @@ const char* GetRequestStageAsString(WebRequestEventRouter::EventTypes type) {
case WebRequestEventRouter::kOnCompleted: case WebRequestEventRouter::kOnCompleted:
return keys::kOnCompleted; return keys::kOnCompleted;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return "Not reached";
} }
void LogRequestAction(RequestAction action) { void LogRequestAction(RequestAction action) {
@ -607,8 +604,7 @@ helpers::EventResponseDelta CalculateDelta(
response->extension_id, response->extension_install_time, response->extension_id, response->extension_install_time,
response->cancel, response->auth_credentials); response->cancel, response->auth_credentials);
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return helpers::EventResponseDelta("", base::Time());
} }
} }
@ -2438,7 +2434,7 @@ int WebRequestEventRouter::ExecuteDeltas(
blocked_request.response_deltas, blocked_request.auth_credentials, blocked_request.response_deltas, blocked_request.auth_credentials,
&ignored_actions); &ignored_actions);
} else { } else {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
SendMessages(browser_context, blocked_request); SendMessages(browser_context, blocked_request);

@ -351,9 +351,7 @@ std::unique_ptr<FormDataParser> FormDataParser::CreateFromContentTypeHeader(
case ERROR_CHOICE: case ERROR_CHOICE:
return nullptr; return nullptr;
} }
NOTREACHED_IN_MIGRATION(); // Some compilers do not believe this is NOTREACHED(); // Some compilers do not believe this is unreachable.
// unreachable.
return nullptr;
} }
FormDataParser::FormDataParser() = default; FormDataParser::FormDataParser() = default;

@ -380,8 +380,7 @@ struct DNRHeaderAction {
case dnr_api::HeaderOperation::kRemove: case dnr_api::HeaderOperation::kRemove:
return true; return true;
case dnr_api::HeaderOperation::kNone: case dnr_api::HeaderOperation::kNone:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return true;
} }
} }
@ -463,7 +462,7 @@ bool ModifyRequestHeadersForAction(
break; break;
} }
case dnr_api::HeaderOperation::kNone: case dnr_api::HeaderOperation::kNone:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
request_headers_modified |= header_modified; request_headers_modified |= header_modified;
@ -561,7 +560,7 @@ bool ModifyResponseHeadersForAction(
break; break;
} }
case dnr_api::HeaderOperation::kNone: case dnr_api::HeaderOperation::kNone:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
response_headers_modified |= header_modified; response_headers_modified |= header_modified;

@ -180,8 +180,7 @@ PermissionsData::PageAccess CanExtensionAccessURLInternal(
: PermissionsData::PageAccess::kDenied; : PermissionsData::PageAccess::kDenied;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return PermissionsData::PageAccess::kDenied;
} }
// Returns true if |request|.url is of the form clients[0-9]*.google.com. // Returns true if |request|.url is of the form clients[0-9]*.google.com.

@ -904,7 +904,7 @@ void WebRequestProxyingURLLoaderFactory::InProgressRequest::
pending_follow_redirect_params_->modified_headers.SetHeader( pending_follow_redirect_params_->modified_headers.SetHeader(
set_header, *header_value); set_header, *header_value);
} else { } else {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
} }
@ -1030,8 +1030,7 @@ void WebRequestProxyingURLLoaderFactory::InProgressRequest::
state_ = State::kRejectedByOnAuthRequired; state_ = State::kRejectedByOnAuthRequired;
break; break;
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return;
} }
auth_credentials_ = std::nullopt; auth_credentials_ = std::nullopt;

@ -486,8 +486,7 @@ void WebRequestProxyingWebSocket::OnAuthRequiredComplete(
break; break;
case WebRequestEventRouter::AuthRequiredResponse:: case WebRequestEventRouter::AuthRequiredResponse::
AUTH_REQUIRED_RESPONSE_IO_PENDING: AUTH_REQUIRED_RESPONSE_IO_PENDING:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
break;
} }
} }

@ -116,8 +116,7 @@ WebRequestResourceType ToWebRequestResourceType(
case network::mojom::RequestDestination::kSpeculationRules: case network::mojom::RequestDestination::kSpeculationRules:
return WebRequestResourceType::OTHER; return WebRequestResourceType::OTHER;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return WebRequestResourceType::OTHER;
} }
const char* WebRequestResourceTypeToString(WebRequestResourceType type) { const char* WebRequestResourceTypeToString(WebRequestResourceType type) {

@ -79,9 +79,7 @@ BitMapBlocklistState BlocklistStateToBitMapBlocklistState(
case BLOCKLISTED_POTENTIALLY_UNWANTED: case BLOCKLISTED_POTENTIALLY_UNWANTED:
return BitMapBlocklistState::BLOCKLISTED_POTENTIALLY_UNWANTED; return BitMapBlocklistState::BLOCKLISTED_POTENTIALLY_UNWANTED;
case BLOCKLISTED_UNKNOWN: case BLOCKLISTED_UNKNOWN:
NOTREACHED_IN_MIGRATION() NOTREACHED() << "The unknown state should not be added into prefs.";
<< "The unknown state should not be added into prefs.";
return BitMapBlocklistState::NOT_BLOCKLISTED;
} }
} }

@ -74,13 +74,11 @@ url::Origin BrowserFrameContextData::GetOrigin() const {
// BrowserFrameContextData::CanAccess is unable to replicate all of the // BrowserFrameContextData::CanAccess is unable to replicate all of the
// WebSecurityOrigin::CanAccess checks, so these methods should not be called. // WebSecurityOrigin::CanAccess checks, so these methods should not be called.
bool BrowserFrameContextData::CanAccess(const url::Origin& target) const { bool BrowserFrameContextData::CanAccess(const url::Origin& target) const {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return true;
} }
bool BrowserFrameContextData::CanAccess(const FrameContextData& target) const { bool BrowserFrameContextData::CanAccess(const FrameContextData& target) const {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return true;
} }
uintptr_t BrowserFrameContextData::GetId() const { uintptr_t BrowserFrameContextData::GetId() const {

@ -151,8 +151,7 @@ void EmbedderUserScriptLoader::CreateEmbedderURLFetchers(
NOTREACHED(); NOTREACHED();
#endif #endif
case extensions::mojom::HostID::HostType::kExtensions: case extensions::mojom::HostID::HostType::kExtensions:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
break;
} }
fetchers_.push_back(std::move(fetcher)); fetchers_.push_back(std::move(fetcher));
} }

@ -611,7 +611,7 @@ bool ExtensionFunction::ShouldKeepWorkerAliveIndefinitely() {
void ExtensionFunction::OnResponseAck() { void ExtensionFunction::OnResponseAck() {
// Derived classes must override this if they require and implement an // Derived classes must override this if they require and implement an
// ACK from the renderer. // ACK from the renderer.
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
ExtensionFunction::ResponseValue ExtensionFunction::NoArguments() { ExtensionFunction::ResponseValue ExtensionFunction::NoArguments() {

@ -111,9 +111,7 @@ const char* ToString(bad_message::BadMessageReason bad_message_code) {
case bad_message::BadMessageReason::EFD_INVALID_EXTENSION_ID_FOR_PROCESS: case bad_message::BadMessageReason::EFD_INVALID_EXTENSION_ID_FOR_PROCESS:
return "LocalFrameHost::Request: renderer never hosted such extension"; return "LocalFrameHost::Request: renderer never hosted such extension";
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return "LocalFrameHost::Request encountered unrecognized validation "
"error.";
} }
} }

@ -36,8 +36,7 @@ ui::ResourceBundle::FontStyle GetFontStyleForIconSize(
case extension_misc::EXTENSION_ICON_GIGANTOR: case extension_misc::EXTENSION_ICON_GIGANTOR:
return ui::ResourceBundle::LargeFont; return ui::ResourceBundle::LargeFont;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return ui::ResourceBundle::MediumFont;
} }
// Returns the background image to use for the given icon |size|. // Returns the background image to use for the given icon |size|.

@ -72,11 +72,10 @@ bool ExtensionPrefValueMap::CanExtensionControlPref(
bool incognito) const { bool incognito) const {
auto ext = entries_.find(extension_id); auto ext = entries_.find(extension_id);
if (ext == entries_.end()) { if (ext == entries_.end()) {
NOTREACHED_IN_MIGRATION() NOTREACHED() << "Extension " << extension_id
<< "Extension " << extension_id << " is not registered but accesses pref " << pref_key
<< " is not registered but accesses pref " << pref_key << " (incognito: " << incognito << ")."
<< " (incognito: " << incognito << ")." << " http://crbug.com/454513"; << " http://crbug.com/454513";
return false;
} }
if (incognito && !ext->second->incognito_enabled) if (incognito && !ext->second->incognito_enabled)
@ -191,8 +190,7 @@ PrefValueMap* ExtensionPrefValueMap::GetExtensionPrefValueMap(
case ChromeSettingScope::kNone: case ChromeSettingScope::kNone:
break; break;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return nullptr;
} }
const PrefValueMap* ExtensionPrefValueMap::GetExtensionPrefValueMap( const PrefValueMap* ExtensionPrefValueMap::GetExtensionPrefValueMap(
@ -212,8 +210,7 @@ const PrefValueMap* ExtensionPrefValueMap::GetExtensionPrefValueMap(
case ChromeSettingScope::kNone: case ChromeSettingScope::kNone:
break; break;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return nullptr;
} }
void ExtensionPrefValueMap::GetExtensionControlledKeys( void ExtensionPrefValueMap::GetExtensionControlledKeys(

@ -467,9 +467,7 @@ void ExtensionPrefs::MakePathsRelative() {
for (const std::string& key : absolute_keys) { for (const std::string& key : absolute_keys) {
std::unique_ptr<prefs::DictionaryValueUpdate> extension_dict; std::unique_ptr<prefs::DictionaryValueUpdate> extension_dict;
if (!update_dict->GetDictionaryWithoutPathExpansion(key, &extension_dict)) { if (!update_dict->GetDictionaryWithoutPathExpansion(key, &extension_dict)) {
NOTREACHED_IN_MIGRATION() NOTREACHED() << "Control should never reach here for extension " << key;
<< "Control should never reach here for extension " << key;
continue;
} }
std::string path_string; std::string path_string;
extension_dict->GetString(kPrefPath, &path_string); extension_dict->GetString(kPrefPath, &path_string);
@ -554,8 +552,7 @@ void ExtensionPrefs::UpdateExtensionPref(
std::string_view key, std::string_view key,
std::optional<base::Value> data_value) { std::optional<base::Value> data_value) {
if (!crx_file::id_util::IdIsValid(extension_id)) { if (!crx_file::id_util::IdIsValid(extension_id)) {
NOTREACHED_IN_MIGRATION() << "Invalid extension_id " << extension_id; NOTREACHED() << "Invalid extension_id " << extension_id;
return;
} }
ScopedExtensionPrefUpdate update(prefs_, extension_id); ScopedExtensionPrefUpdate update(prefs_, extension_id);
if (data_value) { if (data_value) {
@ -1469,8 +1466,7 @@ std::optional<ExtensionInfo> ExtensionPrefs::GetInstalledInfoHelper(
location != ManifestLocation::kComponent && location != ManifestLocation::kComponent &&
!Manifest::IsUnpackedLocation(location) && !Manifest::IsUnpackedLocation(location) &&
!Manifest::IsExternalLocation(location)) { !Manifest::IsExternalLocation(location)) {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return std::nullopt;
} }
const base::Value* manifest = extension.Find(kPrefManifest); const base::Value* manifest = extension.Find(kPrefManifest);
@ -2152,8 +2148,7 @@ bool ExtensionPrefs::GetUserExtensionPrefIntoContainer(
*id_container_out, id_container_out->end()); *id_container_out, id_container_out->end());
for (const auto& entry : user_pref_value->GetList()) { for (const auto& entry : user_pref_value->GetList()) {
if (!entry.is_string()) { if (!entry.is_string()) {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
continue;
} }
insert_iterator = entry.GetString(); insert_iterator = entry.GetString();
} }

@ -318,7 +318,7 @@ void LoadUserScripts(
dynamic_script_length += script_files_length; dynamic_script_length += script_files_length;
break; break;
case UserScript::Source::kWebUIScript: case UserScript::Source::kWebUIScript:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
} }

@ -262,7 +262,7 @@ void AppViewGuest::DidInitialize(const base::Value::Dict& create_params) {
void AppViewGuest::MaybeRecreateGuestContents( void AppViewGuest::MaybeRecreateGuestContents(
content::RenderFrameHost* outer_contents_frame) { content::RenderFrameHost* outer_contents_frame) {
// This situation is not possible for AppView. // This situation is not possible for AppView.
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
const char* AppViewGuest::GetAPINamespace() const { const char* AppViewGuest::GetAPINamespace() const {

@ -115,7 +115,7 @@ void ExtensionOptionsGuest::DidInitialize(
void ExtensionOptionsGuest::MaybeRecreateGuestContents( void ExtensionOptionsGuest::MaybeRecreateGuestContents(
content::RenderFrameHost* outer_contents_frame) { content::RenderFrameHost* outer_contents_frame) {
// This situation is not possible for ExtensionOptions. // This situation is not possible for ExtensionOptions.
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
void ExtensionOptionsGuest::GuestViewDidStopLoading() { void ExtensionOptionsGuest::GuestViewDidStopLoading() {
@ -213,8 +213,7 @@ bool ExtensionOptionsGuest::HandleContextMenu(
bool ExtensionOptionsGuest::ShouldResumeRequestsForCreatedWindow() { bool ExtensionOptionsGuest::ShouldResumeRequestsForCreatedWindow() {
// Not reached due to the use of `CreateCustomWebContents`. // Not reached due to the use of `CreateCustomWebContents`.
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return true;
} }
bool ExtensionOptionsGuest::IsWebContentsCreationOverridden( bool ExtensionOptionsGuest::IsWebContentsCreationOverridden(

@ -227,7 +227,7 @@ void MimeHandlerViewGuest::DidInitialize(
void MimeHandlerViewGuest::MaybeRecreateGuestContents( void MimeHandlerViewGuest::MaybeRecreateGuestContents(
content::RenderFrameHost* outer_contents_frame) { content::RenderFrameHost* outer_contents_frame) {
// This situation is not possible for MimeHandlerView. // This situation is not possible for MimeHandlerView.
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
void MimeHandlerViewGuest::EmbedderFullscreenToggled(bool entered_fullscreen) { void MimeHandlerViewGuest::EmbedderFullscreenToggled(bool entered_fullscreen) {
@ -381,8 +381,7 @@ bool MimeHandlerViewGuest::IsFullscreenForTabOrPending(
bool MimeHandlerViewGuest::ShouldResumeRequestsForCreatedWindow() { bool MimeHandlerViewGuest::ShouldResumeRequestsForCreatedWindow() {
// Not reached due to the use of `CreateCustomWebContents`. // Not reached due to the use of `CreateCustomWebContents`.
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return true;
} }
bool MimeHandlerViewGuest::IsWebContentsCreationOverridden( bool MimeHandlerViewGuest::IsWebContentsCreationOverridden(

@ -29,8 +29,7 @@ std::string JavaScriptDialogTypeToString(
case content::JAVASCRIPT_DIALOG_TYPE_PROMPT: case content::JAVASCRIPT_DIALOG_TYPE_PROMPT:
return "prompt"; return "prompt";
default: default:
NOTREACHED_IN_MIGRATION() << "Unknown JavaScript Message Type."; NOTREACHED() << "Unknown JavaScript Message Type.";
return "unknown";
} }
} }

@ -157,8 +157,7 @@ std::string WindowOpenDispositionToString(
case WindowOpenDisposition::NEW_POPUP: case WindowOpenDisposition::NEW_POPUP:
return "new_popup"; return "new_popup";
default: default:
NOTREACHED_IN_MIGRATION() << "Unknown Window Open Disposition"; NOTREACHED() << "Unknown Window Open Disposition";
return "ignore";
} }
} }
@ -188,8 +187,7 @@ static std::string TerminationStatusToString(base::TerminationStatus status) {
case base::TERMINATION_STATUS_MAX_ENUM: case base::TERMINATION_STATUS_MAX_ENUM:
break; break;
} }
NOTREACHED_IN_MIGRATION() << "Unknown Termination Status."; NOTREACHED() << "Unknown Termination Status.";
return "unknown";
} }
std::string GetStoragePartitionIdFromPartitionConfig( std::string GetStoragePartitionIdFromPartitionConfig(
@ -1049,8 +1047,7 @@ void WebViewGuest::ReportFrameNameChange(const std::string& name) {
void WebViewGuest::PushWebViewStateToIOThread( void WebViewGuest::PushWebViewStateToIOThread(
content::RenderFrameHost* guest_host) { content::RenderFrameHost* guest_host) {
if (!guest_host->GetSiteInstance()->IsGuest()) { if (!guest_host->GetSiteInstance()->IsGuest()) {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return;
} }
auto storage_partition_config = auto storage_partition_config =
guest_host->GetSiteInstance()->GetStoragePartitionConfig(); guest_host->GetSiteInstance()->GetStoragePartitionConfig();

@ -55,8 +55,7 @@ static std::string PermissionTypeToString(WebViewPermissionType type) {
case WEB_VIEW_PERMISSION_TYPE_POINTER_LOCK: case WEB_VIEW_PERMISSION_TYPE_POINTER_LOCK:
return webview::kPermissionTypePointerLock; return webview::kPermissionTypePointerLock;
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return std::string();
} }
} }

@ -51,8 +51,7 @@ bool ShouldResizeImageRepresentation(
case ImageLoader::ImageRepresentation::NEVER_RESIZE: case ImageLoader::ImageRepresentation::NEVER_RESIZE:
return false; return false;
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return false;
} }
} }

@ -86,7 +86,7 @@ void MockExtensionSystem::InstallUpdate(
const base::FilePath& temp_dir, const base::FilePath& temp_dir,
bool install_immediately, bool install_immediately,
InstallUpdateCallback install_update_callback) { InstallUpdateCallback install_update_callback) {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
void MockExtensionSystem::PerformActionBasedOnOmahaAttributes( void MockExtensionSystem::PerformActionBasedOnOmahaAttributes(
@ -96,8 +96,7 @@ void MockExtensionSystem::PerformActionBasedOnOmahaAttributes(
bool MockExtensionSystem::FinishDelayedInstallationIfReady( bool MockExtensionSystem::FinishDelayedInstallationIfReady(
const ExtensionId& extension_id, const ExtensionId& extension_id,
bool install_immediately) { bool install_immediately) {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return false;
} }
} // namespace extensions } // namespace extensions

@ -29,8 +29,7 @@ bool ScopeToPrefName(ChromeSettingScope scope, std::string* result) {
case ChromeSettingScope::kNone: case ChromeSettingScope::kNone:
break; break;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return false;
} }
const char kPrefPreferences[] = "preferences"; const char kPrefPreferences[] = "preferences";

@ -166,8 +166,7 @@ struct ProcessManager::ExtensionRenderFrameData {
case extensions::mojom::ViewType::kExtensionSidePanel: case extensions::mojom::ViewType::kExtensionSidePanel:
return false; return false;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return false;
} }
}; };

@ -294,13 +294,9 @@ void RendererStartupHelper::ActivateExtensionInProcess(
// The extension should have been loaded already. Dump without crashing to // The extension should have been loaded already. Dump without crashing to
// debug crbug.com/528026. // debug crbug.com/528026.
if (!base::Contains(extension_process_map_, extension.id())) { if (!base::Contains(extension_process_map_, extension.id())) {
#if DCHECK_IS_ON() DUMP_WILL_BE_NOTREACHED()
NOTREACHED_IN_MIGRATION()
<< "Extension " << extension.id() << " activated before loading"; << "Extension " << extension.id() << " activated before loading";
#else
base::debug::DumpWithoutCrashing();
return; return;
#endif
} }
if (!util::IsExtensionVisibleToContext(extension, if (!util::IsExtensionVisibleToContext(extension,
@ -576,9 +572,7 @@ void RendererStartupHelper::GetMessageBundle(
const Extension* imported_extension = const Extension* imported_extension =
extension_set.GetByID(import.extension_id); extension_set.GetByID(import.extension_id);
if (!imported_extension) { if (!imported_extension) {
NOTREACHED_IN_MIGRATION() NOTREACHED() << "Missing shared module " << import.extension_id;
<< "Missing shared module " << import.extension_id;
continue;
} }
paths_to_load.push_back(imported_extension->path()); paths_to_load.push_back(imported_extension->path());
} }

@ -669,8 +669,7 @@ void SandboxedUnpacker::OnImageSanitizationDone(
u"ERROR_SAVING_THEME_IMAGE"); u"ERROR_SAVING_THEME_IMAGE");
break; break;
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
break;
} }
ReportFailure(failure_reason, error); ReportFailure(failure_reason, error);
@ -735,8 +734,7 @@ void SandboxedUnpacker::MessageCatalogsSanitized(
u"ERROR_SAVING_CATALOG"); u"ERROR_SAVING_CATALOG");
break; break;
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
break;
} }
ReportFailure(failure_reason, error); ReportFailure(failure_reason, error);
@ -919,8 +917,7 @@ std::u16string SandboxedUnpacker::FailureReasonToString16(
case SandboxedUnpackerFailureReason::DEPRECATED_ERROR_PARSING_DNR_RULESET: case SandboxedUnpackerFailureReason::DEPRECATED_ERROR_PARSING_DNR_RULESET:
case SandboxedUnpackerFailureReason::NUM_FAILURE_REASONS: case SandboxedUnpackerFailureReason::NUM_FAILURE_REASONS:
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return std::u16string();
} }
} }

@ -168,7 +168,7 @@ void TestExtensionsBrowserClient::LoadResourceFromResourceBundle(
scoped_refptr<net::HttpResponseHeaders> headers, scoped_refptr<net::HttpResponseHeaders> headers,
mojo::PendingRemote<network::mojom::URLLoaderClient> client) { mojo::PendingRemote<network::mojom::URLLoaderClient> client) {
// Should not be called because GetBundleResourcePath() returned empty path. // Should not be called because GetBundleResourcePath() returned empty path.
NOTREACHED_IN_MIGRATION() << "Resource is not from a bundle."; NOTREACHED() << "Resource is not from a bundle.";
} }
bool TestExtensionsBrowserClient::AllowCrossRendererResourceLoad( bool TestExtensionsBrowserClient::AllowCrossRendererResourceLoad(

@ -1466,10 +1466,8 @@ bool ExtensionDownloader::IterateFetchCredentialsAfterFailure(
} }
return false; return false;
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
NOTREACHED_IN_MIGRATION();
return false;
} }
void ExtensionDownloader::OnAccessTokenFetchComplete( void ExtensionDownloader::OnAccessTokenFetchComplete(

@ -66,8 +66,7 @@ std::optional<base::FilePath> ExtensionInstaller::GetInstalledFile(
} }
bool ExtensionInstaller::Uninstall() { bool ExtensionInstaller::Uninstall() {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return false;
} }
ExtensionInstaller::~ExtensionInstaller() = default; ExtensionInstaller::~ExtensionInstaller() = default;

@ -91,8 +91,7 @@ std::string ManifestFetchData::GetSimpleLocationString(ManifestLocation loc) {
result = kPolicyLocation; result = kPolicyLocation;
break; break;
case ManifestLocation::kInvalidLocation: case ManifestLocation::kInvalidLocation:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
break;
} }
return result; return result;
@ -147,8 +146,7 @@ bool ManifestFetchData::AddExtension(const std::string& id,
DCHECK(!is_all_external_policy_download_ || DCHECK(!is_all_external_policy_download_ ||
extension_location == ManifestLocation::kExternalPolicyDownload); extension_location == ManifestLocation::kExternalPolicyDownload);
if (base::Contains(extensions_data_, id)) { if (base::Contains(extensions_data_, id)) {
NOTREACHED_IN_MIGRATION() << "Duplicate extension id " << id; NOTREACHED() << "Duplicate extension id " << id;
return false;
} }
if (fetch_priority_ != DownloadFetchPriority::kForeground) { if (fetch_priority_ != DownloadFetchPriority::kForeground) {
@ -280,7 +278,7 @@ bool ManifestFetchData::DidPing(const ExtensionId& extension_id,
else if (type == ACTIVE) else if (type == ACTIVE)
value = i->second.active_days; value = i->second.active_days;
else else
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return value == kNeverPinged || value > 0; return value == kNeverPinged || value > 0;
} }

@ -108,7 +108,7 @@ class FakeUpdateClient : public update_client::UpdateClient {
CrxStateChangeCallback crx_state_change_callback, CrxStateChangeCallback crx_state_change_callback,
bool is_foreground, bool is_foreground,
update_client::Callback callback) override { update_client::Callback callback) override {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
bool GetCrxUpdateState( bool GetCrxUpdateState(

@ -75,8 +75,7 @@ EmbedderUserScriptLoader* UserScriptManager::GetUserScriptLoaderForEmbedder(
case mojom::HostID::HostType::kExtensions: case mojom::HostID::HostType::kExtensions:
break; break;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return nullptr;
} }
void UserScriptManager::SetUserScriptSourceEnabledForExtensions( void UserScriptManager::SetUserScriptSourceEnabledForExtensions(

@ -175,8 +175,7 @@ std::string Warning::GetLocalizedMessage(const ExtensionSet* extensions) const {
return l10n_util::GetStringFUTF8(message_id_, final_parameters[0], return l10n_util::GetStringFUTF8(message_id_, final_parameters[0],
final_parameters[1], final_parameters[2], final_parameters[3]); final_parameters[1], final_parameters[2], final_parameters[3]);
default: default:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return std::string();
} }
} }

@ -45,8 +45,7 @@ const char* ConvertMessagingSourceTypeToString(
case MessagingEndpoint::Type::kNativeApp: case MessagingEndpoint::Type::kNativeApp:
return "NativeApp"; return "NativeApp";
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return "<unrecognized enum value>";
} }
base::debug::ScopedCrashKeyString CreateExtensionIdOrNativeAppNameScopedKey( base::debug::ScopedCrashKeyString CreateExtensionIdOrNativeAppNameScopedKey(
@ -66,10 +65,7 @@ base::debug::ScopedCrashKeyString CreateExtensionIdOrNativeAppNameScopedKey(
endpoint.native_app_name.value_or("<base::nullopt>")); endpoint.native_app_name.value_or("<base::nullopt>"));
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return base::debug::ScopedCrashKeyString(
GetMessagingSourceExtensionIdCrashKey(),
endpoint.extension_id.value_or("<unrecognized MessagingEndpoint::Type>"));
} }
} // namespace } // namespace

@ -162,8 +162,7 @@ std::unique_ptr<UserScript> ParseSerializedUserScript(
serialized_script.id, UserScript::kManifestContentScriptPrefix); serialized_script.id, UserScript::kManifestContentScriptPrefix);
break; break;
case api::scripts_internal::Source::kNone: case api::scripts_internal::Source::kNone:
NOTREACHED_IN_MIGRATION(); // This should have been caught by our NOTREACHED(); // This should have been caught by our parsing.
// parsing.
} }
if (!source_matches_id) { if (!source_matches_id) {

@ -156,9 +156,7 @@ std::set<EventFilter::MatcherID> EventFilter::MatchEvent(
for (const auto& id_key : matching_condition_set_ids) { for (const auto& id_key : matching_condition_set_ids) {
auto matcher_id = condition_set_id_to_event_matcher_id_.find(id_key); auto matcher_id = condition_set_id_to_event_matcher_id_.find(id_key);
if (matcher_id == condition_set_id_to_event_matcher_id_.end()) { if (matcher_id == condition_set_id_to_event_matcher_id_.end()) {
NOTREACHED_IN_MIGRATION() NOTREACHED() << "id not found in condition set map (" << id_key << ")";
<< "id not found in condition set map (" << id_key << ")";
continue;
} }
MatcherID id = matcher_id->second; MatcherID id = matcher_id->second;
auto matcher_entry = matcher_map.find(id); auto matcher_entry = matcher_map.find(id);

@ -177,8 +177,7 @@ bool ComputeExtensionID(const base::Value::Dict& manifest,
// reloading the extension. // reloading the extension.
*extension_id = crx_file::id_util::GenerateIdForPath(path); *extension_id = crx_file::id_util::GenerateIdForPath(path);
if (extension_id->empty()) { if (extension_id->empty()) {
NOTREACHED_IN_MIGRATION() << "Could not create ID from path."; NOTREACHED() << "Could not create ID from path.";
return false;
} }
return true; return true;
} }

@ -457,8 +457,7 @@ bool GetValidLocales(const base::FilePath& locale_path,
while (!(locale_folder = locales.Next()).empty()) { while (!(locale_folder = locales.Next()).empty()) {
std::string locale_name = locale_folder.BaseName().MaybeAsASCII(); std::string locale_name = locale_folder.BaseName().MaybeAsASCII();
if (locale_name.empty()) { if (locale_name.empty()) {
NOTREACHED_IN_MIGRATION(); NOTREACHED(); // Not ASCII.
continue; // Not ASCII.
} }
if (!AddLocale( if (!AddLocale(
chrome_locales, locale_folder, locale_name, valid_locales, error)) { chrome_locales, locale_folder, locale_name, valid_locales, error)) {
@ -549,8 +548,7 @@ bool ShouldSkipValidation(const base::FilePath& locales_path,
// '.svn' directories. // '.svn' directories.
base::FilePath relative_path; base::FilePath relative_path;
if (!locales_path.AppendRelativePath(locale_path, &relative_path)) { if (!locales_path.AppendRelativePath(locale_path, &relative_path)) {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return true;
} }
std::string subdir = relative_path.MaybeAsASCII(); std::string subdir = relative_path.MaybeAsASCII();
if (subdir.empty()) if (subdir.empty())

@ -64,7 +64,7 @@ std::unique_ptr<FeatureProvider> ExtensionsClient::CreateFeatureProvider(
} else if (name == "behavior") { } else if (name == "behavior") {
method = &ExtensionsAPIProvider::AddBehaviorFeatures; method = &ExtensionsAPIProvider::AddBehaviorFeatures;
} else { } else {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
for (const auto& api_provider : api_providers_) for (const auto& api_provider : api_providers_)
((*api_provider).*method)(feature_provider.get()); ((*api_provider).*method)(feature_provider.get());

@ -98,10 +98,9 @@ std::string GetDisplayName(Manifest::Type type) {
case Manifest::TYPE_CHROMEOS_SYSTEM_EXTENSION: case Manifest::TYPE_CHROMEOS_SYSTEM_EXTENSION:
return "chromeos system extension"; return "chromeos system extension";
case Manifest::NUM_LOAD_TYPES: case Manifest::NUM_LOAD_TYPES:
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return "";
} }
// Gets a human-readable name for the given context type, suitable for giving // Gets a human-readable name for the given context type, suitable for giving
@ -135,8 +134,7 @@ std::string GetDisplayName(mojom::ContextType context) {
case mojom::ContextType::kUserScript: case mojom::ContextType::kUserScript:
return "user script"; return "user script";
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return "";
} }
std::string GetDisplayName(mojom::FeatureSessionType session_type) { std::string GetDisplayName(mojom::FeatureSessionType session_type) {
@ -406,8 +404,7 @@ std::string SimpleFeature::GetAvailabilityMessage(
name().c_str()); name().c_str());
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return std::string();
} }
Feature::Availability SimpleFeature::CreateAvailability( Feature::Availability SimpleFeature::CreateAvailability(
@ -515,8 +512,7 @@ bool SimpleFeature::MatchesManifestLocation(
case SimpleFeature::UNPACKED_LOCATION: case SimpleFeature::UNPACKED_LOCATION:
return Manifest::IsUnpackedLocation(manifest_location); return Manifest::IsUnpackedLocation(manifest_location);
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return false;
} }
bool SimpleFeature::MatchesSessionTypes( bool SimpleFeature::MatchesSessionTypes(

@ -27,8 +27,7 @@ struct EnumTraits<extensions::mojom::Channel, version_info::Channel> {
case version_info::Channel::STABLE: case version_info::Channel::STABLE:
return extensions::mojom::Channel::kStable; return extensions::mojom::Channel::kStable;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return extensions::mojom::Channel::kUnknown;
} }
static bool FromMojom(extensions::mojom::Channel input, static bool FromMojom(extensions::mojom::Channel input,
@ -50,9 +49,7 @@ struct EnumTraits<extensions::mojom::Channel, version_info::Channel> {
*out = version_info::Channel::STABLE; *out = version_info::Channel::STABLE;
return true; return true;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
*out = version_info::Channel::UNKNOWN;
return false;
} }
}; };

@ -19,8 +19,7 @@ mojom::RunLocation ConvertRunLocation(api::extension_types::RunAt run_at) {
return mojom::RunLocation::kDocumentStart; return mojom::RunLocation::kDocumentStart;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return mojom::RunLocation::kDocumentIdle;
} }
api::extension_types::RunAt ConvertRunLocationForAPI( api::extension_types::RunAt ConvertRunLocationForAPI(
@ -40,8 +39,7 @@ api::extension_types::RunAt ConvertRunLocationForAPI(
break; break;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return api::extension_types::RunAt::kDocumentIdle;
} }
mojom::ExecutionWorld ConvertExecutionWorld( mojom::ExecutionWorld ConvertExecutionWorld(
@ -72,8 +70,7 @@ api::extension_types::ExecutionWorld ConvertExecutionWorldForAPI(
return api::extension_types::ExecutionWorld::kUserScript; return api::extension_types::ExecutionWorld::kUserScript;
} }
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return api::extension_types::ExecutionWorld::kIsolated;
} }
} // namespace extensions } // namespace extensions

@ -81,23 +81,20 @@ void AppWindowCustomBindings::GetFrame(
void AppWindowCustomBindings::ResumeParser( void AppWindowCustomBindings::ResumeParser(
const v8::FunctionCallbackInfo<v8::Value>& args) { const v8::FunctionCallbackInfo<v8::Value>& args) {
if (args.Length() != 1 || !args[0]->IsString()) { if (args.Length() != 1 || !args[0]->IsString()) {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return;
} }
content::RenderFrame* app_frame = content::RenderFrame* app_frame =
ExtensionFrameHelper::FindFrameFromFrameTokenString(context()->isolate(), ExtensionFrameHelper::FindFrameFromFrameTokenString(context()->isolate(),
args[0]); args[0]);
if (!app_frame) { if (!app_frame) {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return;
} }
blink::WebDocumentLoader* loader = blink::WebDocumentLoader* loader =
app_frame->GetWebFrame()->GetDocumentLoader(); app_frame->GetWebFrame()->GetDocumentLoader();
if (!loader) { if (!loader) {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return;
} }
loader->ResumeParser(); loader->ResumeParser();

@ -87,8 +87,7 @@ api::automation::EventType AXEventToAutomationEventType(
api::automation::EventType automation_event_type = api::automation::EventType automation_event_type =
api::automation::ParseEventType(val); api::automation::ParseEventType(val);
if (automation_event_type == api::automation::EventType::kNone) { if (automation_event_type == api::automation::EventType::kNone) {
NOTREACHED_IN_MIGRATION() NOTREACHED() << "Missing mapping from ax::mojom::Event: " << val;
<< "Missing mapping from ax::mojom::Event: " << val;
} }
enum_map->emplace_back(automation_event_type); enum_map->emplace_back(automation_event_type);
@ -114,8 +113,8 @@ api::automation::EventType AXGeneratedEventToAutomationEventType(
api::automation::EventType automation_event_type = api::automation::EventType automation_event_type =
api::automation::ParseEventType(val); api::automation::ParseEventType(val);
if (automation_event_type == api::automation::EventType::kNone) { if (automation_event_type == api::automation::EventType::kNone) {
NOTREACHED_IN_MIGRATION() NOTREACHED() << "Missing mapping from ui::AXEventGenerator::Event: "
<< "Missing mapping from ui::AXEventGenerator::Event: " << val; << val;
} }
enum_map->emplace_back(automation_event_type); enum_map->emplace_back(automation_event_type);

@ -222,8 +222,7 @@ void DeclarativeContentHooksDelegate::HandleCall(
v8::Local<v8::Object> this_object = info.This(); v8::Local<v8::Object> this_object = info.This();
if (this_object.IsEmpty()) { if (this_object.IsEmpty()) {
// Crazy script (e.g. declarativeContent.Foo.apply(null, args);). // Crazy script (e.g. declarativeContent.Foo.apply(null, args);).
NOTREACHED_IN_MIGRATION(); NOTREACHED();
return;
} }
// TODO(devlin): Find a way to use APISignature here? It's a little awkward // TODO(devlin): Find a way to use APISignature here? It's a little awkward

@ -49,7 +49,7 @@ APIBindingHooks::RequestResult DOMHooksDelegate::HandleRequest(
result.return_value = result.return_value =
OpenOrClosedShadowRoot(script_context, *parse_result.arguments); OpenOrClosedShadowRoot(script_context, *parse_result.arguments);
} else { } else {
NOTREACHED_IN_MIGRATION(); NOTREACHED();
} }
return result; return result;

Some files were not shown because too many files have changed in this diff Show More