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

Unified Diff: chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc

Issue 1135183002: Ensure EasyUnlockPrivateAPI factory is initialized on start up. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: uncomment Created 5 years, 7 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
Index: chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc
diff --git a/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc b/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc
index 8844619823b4468ed17faca696d2765ca1c0f9d8..c9d40039efabffd5646d9d60c178348c4b54a2a6 100644
--- a/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc
+++ b/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc
@@ -40,7 +40,8 @@
#endif
namespace extensions {
-namespace api {
+
+namespace easy_unlock_private = api::easy_unlock_private;
namespace {
@@ -51,7 +52,7 @@ static base::LazyInstance<BrowserContextKeyedAPIFactory<EasyUnlockPrivateAPI> >
EasyUnlockPrivateCryptoDelegate* GetCryptoDelegate(
content::BrowserContext* context) {
return BrowserContextKeyedAPIFactory<EasyUnlockPrivateAPI>::Get(context)
- ->crypto_delegate();
+ ->GetCryptoDelegate();
}
EasyUnlockScreenlockStateHandler::State ToScreenlockStateHandlerState(
@@ -93,12 +94,17 @@ BrowserContextKeyedAPIFactory<EasyUnlockPrivateAPI>*
return g_factory.Pointer();
}
-EasyUnlockPrivateAPI::EasyUnlockPrivateAPI(content::BrowserContext* context)
- : crypto_delegate_(EasyUnlockPrivateCryptoDelegate::Create()) {
+EasyUnlockPrivateAPI::EasyUnlockPrivateAPI(content::BrowserContext* context) {
}
EasyUnlockPrivateAPI::~EasyUnlockPrivateAPI() {}
+EasyUnlockPrivateCryptoDelegate* EasyUnlockPrivateAPI::GetCryptoDelegate() {
+ if (!crypto_delegate_)
+ crypto_delegate_ = EasyUnlockPrivateCryptoDelegate::Create();
+ return crypto_delegate_.get();
+}
+
EasyUnlockPrivateGetStringsFunction::EasyUnlockPrivateGetStringsFunction() {
}
EasyUnlockPrivateGetStringsFunction::~EasyUnlockPrivateGetStringsFunction() {
@@ -835,5 +841,4 @@ bool EasyUnlockPrivateSetAutoPairingResultFunction::RunSync() {
return true;
}
-} // namespace api
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698