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

Issue 7891021: Use stub impl when libcros fails to load (Closed)

Created:
9 years, 3 months ago by stevenjb
Modified:
9 years, 3 months ago
Reviewers:
satorux1, DaveMoore
CC:
chromium-reviews, davemoore+watch_chromium.org
Visibility:
Public.

Description

Use stub impl when libcros fails to load Previous behavior would either: a. Successfully load libcros. CrosLibrary::EnsureLoaded() returns true. Calls to libcros succeed. b. Fail to load libcros. CrosLibrary::EnsureLoaded() returns false. Login is blocked. Calls to libcros fail (crash) if not protected and login is skipped for debugging. c. Load a stub implementation if --stub-cros is specified. CrosLibrary::EnsureLoaded() returns true. Calls to libcros fail (crash). Problems with this behavior: 1. CrosLibrary::EnsureLoaded() would be used incorrectly to protect calls to libcros outside of CrosLibrary non-stub implementations. 2. CrosLibrary non-stub implementations would still be called if libcros failed to load, so all calls to libcros in the non-stub implementations needed to be protected. New behavior: a. Successfully load libcros. CrosLibrary::libcros_loaded() returns true. Calls to libcros succeed. b. Fail to load libcros. CrosLibrary::libcros_loaded() returns false. Stub implementation is used instead. load_error_string() specifies an error and login is blocked. c. Load a stub implementation if --stub-cros is specified. CrosLibrary::libcros_loaded() returns false. Stub implementation is used. BUG=chromium-os:20350 TEST=Test chrome for chromeos on linux and chromeos, with and without --stub-cros Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=101876

Patch Set 1 #

Patch Set 2 : Fix power manager stub impl #

Total comments: 11

Patch Set 3 : Fixes from feedback. #

Patch Set 4 : Rebase with power library changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+270 lines, -297 lines) Patch
M chrome/browser/chromeos/cros/brightness_library.cc View 1 2 2 chunks +6 lines, -9 lines 0 comments Download
M chrome/browser/chromeos/cros/burn_library.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/cros/burn_library.cc View 5 chunks +9 lines, -9 lines 0 comments Download
M chrome/browser/chromeos/cros/cros_library.cc View 1 2 3 2 chunks +9 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/cros/cryptohome_library.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/cros/cryptohome_library.cc View 13 chunks +112 lines, -97 lines 0 comments Download
M chrome/browser/chromeos/cros/login_library.h View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/cros/login_library.cc View 1 2 3 5 chunks +43 lines, -32 lines 0 comments Download
M chrome/browser/chromeos/cros/mock_cryptohome_library.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/cros/mock_login_library.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/cros/mock_mount_library.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/cros/mount_library.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/cros/mount_library.cc View 1 2 9 chunks +42 lines, -78 lines 0 comments Download
M chrome/browser/chromeos/cros/network_library.cc View 1 2 3 1 chunk +0 lines, -7 lines 0 comments Download
M chrome/browser/chromeos/cros/power_library.cc View 1 2 3 3 chunks +7 lines, -13 lines 0 comments Download
M chrome/browser/chromeos/cros/screen_lock_library.cc View 1 chunk +3 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/cros/speech_synthesis_library.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/cros/update_library.cc View 2 chunks +9 lines, -16 lines 0 comments Download
M chrome/browser/chromeos/status/power_menu_button.cc View 1 2 3 3 chunks +15 lines, -26 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
stevenjb
This isn't as bad as it looks, most of the changes are small. Dave, please ...
9 years, 3 months ago (2011-09-15 23:13:08 UTC) #1
satorux1
9 years, 3 months ago (2011-09-16 19:51:30 UTC) #2
satorux1
Thank you for doing this! I'm very happy to see EnsureLoaded() to be gone. I ...
9 years, 3 months ago (2011-09-16 20:05:55 UTC) #3
stevenjb
http://codereview.chromium.org/7891021/diff/2001/chrome/browser/chromeos/cros/brightness_library.cc File chrome/browser/chromeos/cros/brightness_library.cc (right): http://codereview.chromium.org/7891021/diff/2001/chrome/browser/chromeos/cros/brightness_library.cc#newcode50 chrome/browser/chromeos/cros/brightness_library.cc:50: chromeos::IncreaseScreenBrightness(); On 2011/09/16 20:05:55, satorux1 wrote: > Indentation is ...
9 years, 3 months ago (2011-09-16 21:44:24 UTC) #4
satorux1
LGTM, but one question below: http://codereview.chromium.org/7891021/diff/2001/chrome/browser/chromeos/cros/cros_library.cc File chrome/browser/chromeos/cros/cros_library.cc (right): http://codereview.chromium.org/7891021/diff/2001/chrome/browser/chromeos/cros/cros_library.cc#newcode68 chrome/browser/chromeos/cros/cros_library.cc:68: << " Will use ...
9 years, 3 months ago (2011-09-16 21:59:43 UTC) #5
stevenjb
There is a mechanism for that in the login code. I think that the code ...
9 years, 3 months ago (2011-09-17 00:31:33 UTC) #6
stevenjb
PTAL Rebased with the power_library changes from http://codereview.chromium.org/7920019/. Only power_library.cc and power_menu_button.cc have non rebase ...
9 years, 3 months ago (2011-09-19 18:56:24 UTC) #7
satorux1
9 years, 3 months ago (2011-09-19 19:29:29 UTC) #8
LGTM.

The patch description looks a bit too brief. Would be nice to add some comment
about why we are doing this and what we are archiving from this?

Powered by Google App Engine
This is Rietveld 408576698