forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1384753 - Add dummy login reputation service in reputationservice…
… component. r=francois Login reputation service is initialized during idle startup. --HG-- extra : rebase_source : 6f851bbc9a1ef7c7821c09d8f739197468ab24df
- Loading branch information
Showing
7 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
/* vim: set ts=2 et sw=2 tw=80: */ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "nsISupports.idl" | ||
|
||
[scriptable, uuid(b527be1e-8fbb-41d9-bee4-267a71236368)] | ||
interface ILoginReputationQueryCallback : nsISupports { | ||
void onQueryComplete(); | ||
}; | ||
|
||
[scriptable, uuid(1b3f1dfe-ce3a-486b-953e-ce5ac863eff9)] | ||
interface ILoginReputationService : nsISupports { | ||
// XXX : Add QueryReputation interface | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "LoginReputation.h" | ||
|
||
using namespace mozilla; | ||
|
||
// MOZ_LOG=LoginReputation:5 | ||
LazyLogModule LoginReputationService::prlog("LoginReputation"); | ||
#define LR_LOG(args) MOZ_LOG(LoginReputationService::prlog, mozilla::LogLevel::Debug, args) | ||
#define LR_LOG_ENABLED() MOZ_LOG_TEST(LoginReputationService::prlog, mozilla::LogLevel::Debug) | ||
|
||
NS_IMPL_ISUPPORTS(LoginReputationService, | ||
ILoginReputationService) | ||
|
||
LoginReputationService* | ||
LoginReputationService::gLoginReputationService = nullptr; | ||
|
||
already_AddRefed<LoginReputationService> | ||
LoginReputationService::GetSingleton() | ||
{ | ||
if (!gLoginReputationService) { | ||
gLoginReputationService = new LoginReputationService(); | ||
} | ||
return do_AddRef(gLoginReputationService); | ||
} | ||
|
||
LoginReputationService::LoginReputationService() | ||
{ | ||
LR_LOG(("Login reputation service starting up")); | ||
} | ||
|
||
LoginReputationService::~LoginReputationService() | ||
{ | ||
LR_LOG(("Login reputation service shutting down")); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#ifndef LoginReputation_h__ | ||
#define LoginReputation_h__ | ||
|
||
#include "ILoginReputation.h" | ||
#include "mozilla/Logging.h" | ||
|
||
class LoginReputationService final : public ILoginReputationService | ||
{ | ||
public: | ||
NS_DECL_ISUPPORTS | ||
NS_DECL_ILOGINREPUTATIONSERVICE | ||
|
||
public: | ||
static already_AddRefed<LoginReputationService> GetSingleton(); | ||
|
||
private: | ||
/** | ||
* Global singleton object for holding this factory service. | ||
*/ | ||
static LoginReputationService* gLoginReputationService; | ||
|
||
/** | ||
* MOZ_LOG=LoginReputation:5 | ||
*/ | ||
static mozilla::LazyLogModule prlog; | ||
|
||
LoginReputationService(); | ||
~LoginReputationService(); | ||
}; | ||
|
||
#endif // LoginReputation_h__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters