Commit e2c4789d authored by rwlbuis@webkit.org's avatar rwlbuis@webkit.org

[BlackBerry] Simplify AuthenticationChallengeManager::instance

https://bugs.webkit.org/show_bug.cgi?id=100614

Reviewed by Yong Li.
Internally reviewed by Lyon Chen.

Source/WebCore:

Use a standard Singleton pattern here, this makes sure we create lazily.

* platform/blackberry/AuthenticationChallengeManager.cpp:
(WebCore):
* platform/blackberry/AuthenticationChallengeManager.h:
(AuthenticationChallengeManager):

Source/WebKit/blackberry:

No need to call AuthenticationChallengeManager::init anymore.

* Api/BlackBerryGlobal.cpp:
(BlackBerry::WebKit::globalInitialize):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132851 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 14a1d790
2012-10-29 Rob Buis <rbuis@rim.com>
[BlackBerry] Simplify AuthenticationChallengeManager::instance
https://bugs.webkit.org/show_bug.cgi?id=100614
Reviewed by Yong Li.
Internally reviewed by Lyon Chen.
Use a standard Singleton pattern here, this makes sure we create lazily.
* platform/blackberry/AuthenticationChallengeManager.cpp:
(WebCore):
* platform/blackberry/AuthenticationChallengeManager.h:
(AuthenticationChallengeManager):
2012-10-29 Adam Barth <abarth@webkit.org>
Block SVG external references pending a security review
......@@ -28,6 +28,7 @@
#include <BlackBerryPlatformLog.h>
#include <wtf/Assertions.h>
#include <wtf/HashMap.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/Vector.h>
#include <wtf/text/CString.h>
......@@ -101,6 +102,8 @@ bool AuthenticationChallengeManagerPrivate::pageExists(PageClientBlackBerry* cli
return m_pageVisibilityMap.find(client) != m_pageVisibilityMap.end();
}
SINGLETON_INITIALIZER_THREADUNSAFE(AuthenticationChallengeManager)
AuthenticationChallengeManager::AuthenticationChallengeManager()
: d(adoptPtr(new AuthenticationChallengeManagerPrivate))
{
......@@ -223,21 +226,4 @@ void AuthenticationChallengeManager::notifyChallengeResult(const KURL& url, cons
d->startAuthenticationChallenge(next);
}
// Keep following code at the end of this file!!!
static AuthenticationChallengeManager* s_manager = 0;
AuthenticationChallengeManager* AuthenticationChallengeManager::instance()
{
ASSERT(s_manager);
return s_manager;
}
void AuthenticationChallengeManager::init()
{
ASSERT(!s_manager);
s_manager = new AuthenticationChallengeManager();
}
// No more code after this line, all new code should come before s_manager declaration!!!
} // namespace WebCore
......@@ -19,6 +19,7 @@
#ifndef AuthenticationChallengeManager_h
#define AuthenticationChallengeManager_h
#include "BlackBerryPlatformSingleton.h"
#include <wtf/OwnPtr.h>
class PageClientBlackBerry;
......@@ -40,11 +41,9 @@ public:
virtual void notifyChallengeResult(const KURL&, const ProtectionSpace&, AuthenticationChallengeResult, const Credential&) = 0;
};
class AuthenticationChallengeManager {
class AuthenticationChallengeManager : public BlackBerry::Platform::ThreadUnsafeSingleton<AuthenticationChallengeManager> {
SINGLETON_DEFINITION_THREADUNSAFE(AuthenticationChallengeManager)
public:
static void init();
static AuthenticationChallengeManager* instance();
void pageCreated(PageClientBlackBerry*);
void pageDeleted(PageClientBlackBerry*);
void pageVisibilityChanged(PageClientBlackBerry*, bool visible);
......
......@@ -20,7 +20,6 @@
#include "BlackBerryGlobal.h"
#include "ApplicationCacheStorage.h"
#include "AuthenticationChallengeManager.h"
#include "CacheClientBlackBerry.h"
#include "CookieManager.h"
#include "CrossOriginPreflightResultCache.h"
......@@ -81,8 +80,6 @@ void globalInitialize()
BlackBerry::Platform::Settings* settings = BlackBerry::Platform::Settings::instance();
ImageSource::setMaxPixelsPerDecodedImage(settings->maxPixelsPerDecodedImage());
AuthenticationChallengeManager::init();
}
void collectJavascriptGarbageNow()
......
2012-10-29 Rob Buis <rbuis@rim.com>
[BlackBerry] Simplify AuthenticationChallengeManager::instance
https://bugs.webkit.org/show_bug.cgi?id=100614
Reviewed by Yong Li.
Internally reviewed by Lyon Chen.
No need to call AuthenticationChallengeManager::init anymore.
* Api/BlackBerryGlobal.cpp:
(BlackBerry::WebKit::globalInitialize):
2012-10-29 Mike Lattanzio <mlattanzio@rim.com>
[BlackBerry] Typo in WebPagePrivate::postponeDocumentRecalcStyle()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment