Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Issue 2777063003: Stop passing raw pointers to base::Value API in c/b/chromeos and c/b/extensions (Closed)

Created:
3 years, 8 months ago by vabr (Chromium)
Modified:
3 years, 8 months ago
CC:
chromium-reviews, devtools-reviews_chromium.org, extensions-reviews_chromium.org, tfarina, yamaguchi+watch_chromium.org, oka+watch_chromium.org, rginda+watch_chromium.org, pam+watch_chromium.org, pfeldman, oshima+watch_chromium.org, fukino+watch_chromium.org, chromium-apps-reviews_chromium.org, davemoore+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Stop passing raw pointers to base::Value API in c/b/chromeos and c/b/extensions Passing ownership of base::Value into API methods DictionaryValue::Set, DictionaryValue::SetWithoutPathExpansion, and ListValue::Set through raw pointers is deprecated, can hide bugs and should be done via unique_ptr instead. Therefore, this CL migrates c/b/chromeos, c/b/extensions and a bunch of related files to use the unique_ptr-based API. BUG=697817 TBR=cpu@chromium.org Review-Url: https://codereview.chromium.org/2777063003 Cr-Commit-Position: refs/heads/master@{#463189} Committed: https://chromium.googlesource.com/chromium/src/+/4b0c49ec412c02103e092593041c99cb69f17191

Patch Set 1 #

Patch Set 2 : SetWithoutPathExpansion #

Patch Set 3 : Fix SupervisedUserWhitelistInstaller #

Total comments: 102

Patch Set 4 : Comments #

Patch Set 5 : Just rebased #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+601 lines, -464 lines) Patch
M chrome/browser/background/background_application_list_model_unittest.cc View 1 2 3 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/background/background_contents_service.cc View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/file_manager/file_tasks.cc View 1 3 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/file_manager/url_util.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/file_system_provider/operations/read_file_unittest.cc View 1 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/provided_file_system_unittest.cc View 1 1 chunk +4 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/registry.cc View 1 2 3 4 chunks +19 lines, -15 lines 0 comments Download
M chrome/browser/chromeos/file_system_provider/registry_unittest.cc View 1 2 3 3 chunks +14 lines, -11 lines 0 comments Download
M chrome/browser/chromeos/login/supervised/supervised_user_authentication.cc View 1 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/login/users/avatar/user_image_manager_impl.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/login/users/supervised_user_manager_impl.cc View 1 2 chunks +7 lines, -6 lines 0 comments Download
M chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc View 1 2 3 4 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/options/vpn_config_view.cc View 1 3 chunks +7 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/options/wifi_config_view.cc View 1 2 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/platform_keys/key_permissions.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/component_updater/supervised_user_whitelist_installer.cc View 1 2 2 chunks +14 lines, -12 lines 0 comments Download
M chrome/browser/component_updater/supervised_user_whitelist_installer_unittest.cc View 1 2 3 3 chunks +6 lines, -4 lines 0 comments Download
M chrome/browser/content_settings/content_settings_pref_provider_unittest.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/content_settings/host_content_settings_map_unittest.cc View 1 3 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/custom_handlers/protocol_handler_registry.cc View 1 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/devtools/devtools_protocol.cc View 1 2 3 4 4 chunks +9 lines, -5 lines 0 comments Download
M chrome/browser/devtools/devtools_targets_ui.cc View 1 2 3 5 chunks +14 lines, -13 lines 0 comments Download
M chrome/browser/devtools/devtools_ui_bindings.cc View 1 2 3 3 chunks +9 lines, -11 lines 0 comments Download
M chrome/browser/devtools/devtools_window.cc View 1 2 3 4 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/extensions/activity_log/activity_log.cc View 1 2 3 4 chunks +9 lines, -6 lines 0 comments Download
M chrome/browser/extensions/activity_log/counting_policy_unittest.cc View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/activity_log_private/activity_log_private_api_unittest.cc View 1 2 3 3 chunks +6 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/autotest_private/autotest_private_api.cc View 1 2 3 5 chunks +8 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_apitest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.cc View 1 2 3 2 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/bookmarks/bookmark_apitest.cc View 1 2 3 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/browsing_data/browsing_data_api.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/commands/command_service.cc View 1 2 3 6 chunks +7 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/commands/command_service_browsertest.cc View 1 2 3 2 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/cookies/cookies_api.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/cookies/cookies_helpers.h View 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/cookies/cookies_helpers.cc View 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/cookies/cookies_unittest.cc View 1 4 chunks +8 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/debugger/debugger_api.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc View 1 2 3 4 4 chunks +14 lines, -10 lines 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/font_settings/font_settings_api.cc View 1 2 3 4 chunks +6 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.cc View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/log_private/log_private_api_chromeos.cc View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/mdns/mdns_api_unittest.cc View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/media_galleries/media_galleries_api.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/messaging/native_messaging_test_util.cc View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/omnibox/omnibox_api.cc View 1 2 3 4 chunks +10 lines, -7 lines 0 comments Download
M chrome/browser/extensions/api/permissions/permissions_api_helpers_unittest.cc View 1 2 3 8 chunks +15 lines, -12 lines 0 comments Download
M chrome/browser/extensions/api/platform_keys/platform_keys_apitest_nss.cc View 1 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/preference/chrome_direct_setting.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/preference/chrome_direct_setting_api.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/preference/preference_api.h View 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/preference/preference_api.cc View 1 6 chunks +31 lines, -25 lines 0 comments Download
M chrome/browser/extensions/api/proxy/proxy_api.h View 1 chunk +6 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/proxy/proxy_api.cc View 1 5 chunks +8 lines, -9 lines 1 comment Download
M chrome/browser/extensions/api/proxy/proxy_api_helpers.cc View 1 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc View 1 8 chunks +23 lines, -20 lines 0 comments Download
M chrome/browser/extensions/api/storage/policy_value_store.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/storage/settings_sync_unittest.cc View 1 2 3 20 chunks +46 lines, -45 lines 0 comments Download
M chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/sync_file_system/sync_file_system_api_helpers.h View 1 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/sync_file_system/sync_file_system_api_helpers.cc View 1 2 3 3 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/tabs/app_window_controller.cc View 1 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/tabs/tabs_event_router.cc View 1 7 chunks +27 lines, -19 lines 0 comments Download
M chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc View 1 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/convert_user_script.cc View 1 2 3 5 chunks +15 lines, -14 lines 0 comments Download
M chrome/browser/extensions/convert_web_app.cc View 1 2 3 3 chunks +6 lines, -4 lines 0 comments Download
M chrome/browser/extensions/extension_assets_manager_chromeos.cc View 1 2 3 3 chunks +13 lines, -8 lines 0 comments Download
M chrome/browser/extensions/extension_garbage_collector_chromeos_unittest.cc View 1 2 chunks +16 lines, -11 lines 0 comments Download
M chrome/browser/extensions/extension_gcm_app_handler_unittest.cc View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_management_test_util.cc View 1 2 chunks +9 lines, -7 lines 0 comments Download
M chrome/browser/extensions/extension_override_apitest.cc View 1 2 3 3 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_prefs_unittest.cc View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_protocols_unittest.cc View 1 2 3 4 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_service_unittest.cc View 1 2 3 4 8 chunks +11 lines, -10 lines 0 comments Download
M chrome/browser/extensions/extension_special_storage_policy_unittest.cc View 1 2 3 3 chunks +9 lines, -6 lines 0 comments Download
M chrome/browser/extensions/extension_web_ui.cc View 1 2 3 4 2 chunks +8 lines, -5 lines 0 comments Download
M chrome/browser/extensions/external_pref_loader.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/install_signer.cc View 1 3 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/extensions/menu_manager.cc View 1 2 3 4 1 chunk +3 lines, -4 lines 0 comments Download
M chrome/browser/extensions/menu_manager_unittest.cc View 1 2 3 4 4 chunks +12 lines, -15 lines 0 comments Download
M chrome/browser/extensions/permissions_based_management_policy_provider_unittest.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/webstore_inline_installer_unittest.cc View 1 2 3 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/prefs/profile_pref_store_manager_unittest.cc View 1 2 3 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/prefs/session_startup_pref.cc View 1 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/prefs/session_startup_pref_unittest.cc View 1 2 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/prefs/tracked/pref_hash_browsertest.cc View 1 2 3 3 chunks +4 lines, -2 lines 0 comments Download
M chrome/common/extensions/sync_type_unittest.cc View 1 2 3 2 chunks +6 lines, -3 lines 0 comments Download

Messages

Total messages: 40 (22 generated)
vabr (Chromium)
Hello reviewers. This is a mostly mechanical change. Please review as follows: jdoerrie@ -- please ...
3 years, 8 months ago (2017-04-06 13:11:48 UTC) #11
Andrew T Wilson (Slow)
background/ LGTM
3 years, 8 months ago (2017-04-06 13:13:44 UTC) #12
jdoerrie
Thanks a lot vabr@! Vast majority of comments are just nits, only chrome/browser/devtools/devtools_targets_ui.cc really requires ...
3 years, 8 months ago (2017-04-06 14:25:51 UTC) #13
Daniel Erat
thanks! lgtm for c/b/chromeos/ https://codereview.chromium.org/2777063003/diff/40001/chrome/browser/chromeos/file_manager/url_util.cc File chrome/browser/chromeos/file_manager/url_util.cc (left): https://codereview.chromium.org/2777063003/diff/40001/chrome/browser/chromeos/file_manager/url_util.cc#oldcode97 chrome/browser/chromeos/file_manager/url_util.cc:97: dict->Set("extensions", std::move(extensions_list)); hmm, this old ...
3 years, 8 months ago (2017-04-06 15:03:43 UTC) #14
Bernhard Bauer
content settings and prefs LGTM
3 years, 8 months ago (2017-04-06 15:21:50 UTC) #15
Finnur
Extensions rubberstamp LGTM
3 years, 8 months ago (2017-04-06 15:33:03 UTC) #16
dgozman
https://codereview.chromium.org/2777063003/diff/40001/chrome/browser/devtools/devtools_ui_bindings.cc File chrome/browser/devtools/devtools_ui_bindings.cc (right): https://codereview.chromium.org/2777063003/diff/40001/chrome/browser/devtools/devtools_ui_bindings.cc#newcode1274 chrome/browser/devtools/devtools_ui_bindings.cc:1274: extension_info->Set( nit: let's use SetString here to avoid MakeUnique ...
3 years, 8 months ago (2017-04-06 15:43:47 UTC) #17
benwells
custom protocol handlers lgtm I haven't looked at the extensions stuff at all.
3 years, 8 months ago (2017-04-07 01:58:01 UTC) #18
vabr (Chromium)
Thanks everyone for the amazingly fast reviews! And in particular, to jdoerrie@ for the detailed ...
3 years, 8 months ago (2017-04-07 20:40:41 UTC) #21
dgozman
devtools lgtm, thank you!
3 years, 8 months ago (2017-04-07 20:59:27 UTC) #24
jdoerrie
LGTM, thanks!
3 years, 8 months ago (2017-04-10 06:48:08 UTC) #25
vabr (Chromium)
Thanks! I'm putting cpu@ in TBR for c/b/component_updater and sending this to the CQ. Cheers, ...
3 years, 8 months ago (2017-04-10 06:51:53 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2777063003/60001
3 years, 8 months ago (2017-04-10 06:52:15 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/401313) linux_chromium_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, ...
3 years, 8 months ago (2017-04-10 06:56:05 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2777063003/80001
3 years, 8 months ago (2017-04-10 07:16:26 UTC) #35
commit-bot: I haz the power
Committed patchset #5 (id:80001) as https://chromium.googlesource.com/chromium/src/+/4b0c49ec412c02103e092593041c99cb69f17191
3 years, 8 months ago (2017-04-10 08:08:37 UTC) #38
findit-for-me
A revert of this CL (patchset #5 id:80001) has been created in https://codereview.chromium.org/2806283002/ by findit-for-me@appspot.gserviceaccount.com. ...
3 years, 8 months ago (2017-04-10 09:01:27 UTC) #39
jdoerrie
3 years, 8 months ago (2017-04-10 10:39:23 UTC) #40
Message was sent while issue was closed.
https://codereview.chromium.org/2777063003/diff/80001/chrome/browser/extensio...
File chrome/browser/extensions/api/proxy/proxy_api.cc (right):

https://codereview.chromium.org/2777063003/diff/80001/chrome/browser/extensio...
chrome/browser/extensions/api/proxy/proxy_api.cc:192: return extension_pref;
return std::move(extension_pref); should fix the compilation error for
ChromiumOS x86-generic

Powered by Google App Engine
This is Rietveld 408576698