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

Unified Diff: chrome/browser/chromeos/cros/cros_library.cc

Issue 7891021: Use stub impl when libcros fails to load (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase with power library changes Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/cros/burn_library.cc ('k') | chrome/browser/chromeos/cros/cryptohome_library.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/cros/cros_library.cc
diff --git a/chrome/browser/chromeos/cros/cros_library.cc b/chrome/browser/chromeos/cros/cros_library.cc
index a3a748d1413e021de684b8b028b262d832fd7cd4..9e4596ffed5cba627b9eb3e9ee0f2e1378a88b52 100644
--- a/chrome/browser/chromeos/cros/cros_library.cc
+++ b/chrome/browser/chromeos/cros/cros_library.cc
@@ -18,9 +18,12 @@
#include "chrome/browser/chromeos/cros/update_library.h"
#include "third_party/cros/chromeos_cros_api.h"
+// Pass !libcros_loaded_ to GetDefaultImpl instead of use_stub_impl_ so that
+// we load the stub impl regardless of whether use_stub was specified or the
+// library failed to load.
#define DEFINE_GET_LIBRARY_METHOD(class_prefix, var_prefix) \
class_prefix##Library* CrosLibrary::Get##class_prefix##Library() { \
- return var_prefix##_lib_.GetDefaultImpl(use_stub_impl_); \
+ return var_prefix##_lib_.GetDefaultImpl(!libcros_loaded_); \
}
#define DEFINE_SET_LIBRARY_METHOD(class_prefix, var_prefix) \
@@ -57,10 +60,12 @@ void CrosLibrary::Initialize(bool use_stub) {
}
// Attempt to load libcros here, so that we can log, show warnings, and
// set load_error_string_ immediately.
- if (g_cros_library->LoadLibcros())
+ if (g_cros_library->LoadLibcros()) {
VLOG(1) << "CrosLibrary Initialized, version = " << kCrosAPIVersion;
- else
- LOG(WARNING) << "CrosLibrary failed to Initialize.";
+ } else {
+ LOG(WARNING) << "CrosLibrary failed to Initialize."
+ << " Will use stub implementations.";
+ }
}
// static
« no previous file with comments | « chrome/browser/chromeos/cros/burn_library.cc ('k') | chrome/browser/chromeos/cros/cryptohome_library.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698