|
Always use arc::InstanceHolder<T>::GetInstanceForMethod
Previously, both arc::InstanceHolder<T>::instance() with some manual
version checks (or without any version checks by mistake) and
arc::InstanceHolder<T>::GetInstanceForMethod() are used for getting
an instance pointer. This CL removes the former so that the relatively
unsafe code won't be used as a template in the future.
Details:
* Use GetInstanceForMethod() even for Init (because it is not always
true that Init is with MinVersion=0). Add missing version checks
so that such code won't be copied when adding a new ARC service.
* Add nullptr checks to all OnInstanceReady functions for consistency.
* Change the return type of instance() from T* to bool and rename it
to HasInstance() because all remaining instance() usages are inside
if statement.
* Remove version() to prevent developers from using the unary version
of GetInstanceForMethod() and version().
* Change the log level for the version mismatch log in
GetInstanceForMethod() from VLOG(2) to LOG(ERROR) because most of
the existing code I removed in favor of GetInstanceForMethod's
logging used LOG(ERROR).
* Use uint32_t for min versions.
* Add #includes to remove IWYU lint warnings
BUG= 647853
TEST=try
TEST=ARC still starts without any unexpected error logs.
TBR=dmazzoni@chromium.org
Committed: https://crrev.com/34ceeb456810e5f24f2f233e30d98423385cb614
Cr-Commit-Position: refs/heads/master@{#421113}
Total comments: 5
Total comments: 17
Total comments: 4
Total comments: 7
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+265 lines, -235 lines) |
Patch |
 |
M |
chrome/browser/chromeos/arc/arc_auth_service.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/chromeos/arc/arc_downloads_watcher_service.cc
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/chromeos/arc/arc_enterprise_reporting_service.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+5 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/chromeos/arc/arc_external_protocol_dialog.cc
|
View
|
1
2
3
4
5
6
7
|
7 chunks |
+15 lines, -14 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/chromeos/arc/arc_navigation_throttle.cc
|
View
|
1
2
3
4
5
6
7
|
6 chunks |
+22 lines, -14 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/chromeos/arc/arc_policy_bridge.cc
|
View
|
1
2
3
4
5
|
3 chunks |
+8 lines, -8 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/chromeos/arc/arc_print_service.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+2 lines, -6 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/chromeos/arc/arc_process_service.cc
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/chromeos/arc/arc_settings_service.cc
|
View
|
|
2 chunks |
+8 lines, -9 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/chromeos/arc/arc_tts_service.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+3 lines, -6 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/chromeos/arc/arc_wallpaper_service.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+2 lines, -6 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/chromeos/arc/gpu_arc_video_service_host.cc
|
View
|
1
2
3
4
5
|
2 chunks |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/chromeos/file_manager/arc_file_tasks.cc
|
View
|
1
2
3
4
5
6
7
|
5 chunks |
+12 lines, -6 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/memory/tab_manager_delegate_chromeos.h
|
View
|
|
3 chunks |
+3 lines, -14 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/memory/tab_manager_delegate_chromeos.cc
|
View
|
|
6 chunks |
+12 lines, -25 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/speech/tts_chromeos.cc
|
View
|
1
2
3
4
|
4 chunks |
+13 lines, -5 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/test/integration/sync_arc_package_helper.cc
|
View
|
1
2
|
3 chunks |
+6 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
|
View
|
1
2
3
4
5
6
|
5 chunks |
+17 lines, -8 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.cc
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc
|
View
|
1
2
3
4
5
6
|
3 chunks |
+19 lines, -5 lines |
0 comments
|
Download
|
 |
M |
components/arc/audio/arc_audio_bridge.cc
|
View
|
1
2
3
4
5
|
3 chunks |
+12 lines, -11 lines |
0 comments
|
Download
|
 |
M |
components/arc/bluetooth/arc_bluetooth_bridge.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+3 lines, -7 lines |
0 comments
|
Download
|
 |
M |
components/arc/boot_phase_monitor/arc_boot_phase_monitor_bridge.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
M |
components/arc/clipboard/arc_clipboard_bridge.cc
|
View
|
1
2
3
4
5
|
2 chunks |
+6 lines, -7 lines |
0 comments
|
Download
|
 |
M |
components/arc/crash_collector/arc_crash_collector_bridge.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
M |
components/arc/ime/arc_ime_bridge_impl.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
components/arc/instance_holder.h
|
View
|
1
2
3
4
|
4 chunks |
+13 lines, -12 lines |
0 comments
|
Download
|
 |
M |
components/arc/intent_helper/activity_icon_loader.cc
|
View
|
1
2
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
components/arc/intent_helper/arc_intent_helper_bridge.h
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
M |
components/arc/intent_helper/arc_intent_helper_bridge.cc
|
View
|
1
2
3
4
5
6
7
|
3 chunks |
+17 lines, -13 lines |
0 comments
|
Download
|
 |
M |
components/arc/intent_helper/link_handler_model_impl.cc
|
View
|
1
2
3
4
5
6
7
|
3 chunks |
+8 lines, -9 lines |
0 comments
|
Download
|
 |
M |
components/arc/metrics/arc_metrics_service.cc
|
View
|
|
3 chunks |
+7 lines, -9 lines |
0 comments
|
Download
|
 |
M |
components/arc/net/arc_net_host_impl.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
components/arc/obb_mounter/arc_obb_mounter_bridge.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
components/arc/power/arc_power_bridge.cc
|
View
|
1
2
3
4
5
|
3 chunks |
+11 lines, -10 lines |
0 comments
|
Download
|
 |
M |
ui/arc/notification/arc_notification_manager.cc
|
View
|
1
2
3
4
5
|
4 chunks |
+8 lines, -8 lines |
0 comments
|
Download
|
Total messages: 59 (38 generated)
|