Mark Supplement instead of RefCountedSupplement in NavigatorContentUtils

There is no big reason that NavigatorContentUtils should use RefCountedSupplement. This CL marks the NavigatorContentUtils to use Supplement instead of RefCountedSupplement. Additionally this cl adds a tracing method for supplement.

BUG=none

Review URL: https://codereview.chromium.org/235023003

git-svn-id: svn://svn.chromium.org/blink/trunk@171403 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 53dc1287
......@@ -121,16 +121,16 @@ static bool verifyProtocolHandlerScheme(const String& scheme, const String& meth
NavigatorContentUtils* NavigatorContentUtils::from(Page& page)
{
return static_cast<NavigatorContentUtils*>(RefCountedSupplement<Page, NavigatorContentUtils>::from(page, NavigatorContentUtils::supplementName()));
return static_cast<NavigatorContentUtils*>(Supplement<Page>::from(page, supplementName()));
}
NavigatorContentUtils::~NavigatorContentUtils()
{
}
PassRefPtr<NavigatorContentUtils> NavigatorContentUtils::create(PassOwnPtr<NavigatorContentUtilsClient> client)
PassOwnPtr<NavigatorContentUtils> NavigatorContentUtils::create(PassOwnPtr<NavigatorContentUtilsClient> client)
{
return adoptRef(new NavigatorContentUtils(client));
return adoptPtr(new NavigatorContentUtils(client));
}
void NavigatorContentUtils::registerProtocolHandler(Navigator& navigator, const String& scheme, const String& url, const String& title, ExceptionState& exceptionState)
......@@ -218,7 +218,7 @@ const char* NavigatorContentUtils::supplementName()
void provideNavigatorContentUtilsTo(Page& page, PassOwnPtr<NavigatorContentUtilsClient> client)
{
RefCountedSupplement<Page, NavigatorContentUtils>::provideTo(page, NavigatorContentUtils::supplementName(), NavigatorContentUtils::create(client));
NavigatorContentUtils::provideTo(page, NavigatorContentUtils::supplementName(), NavigatorContentUtils::create(client));
}
} // namespace WebCore
......@@ -38,19 +38,21 @@ class ExceptionState;
class Navigator;
class Page;
class NavigatorContentUtils FINAL : public RefCountedSupplement<Page, NavigatorContentUtils> {
class NavigatorContentUtils FINAL : public Supplement<Page> {
public:
virtual ~NavigatorContentUtils();
static const char* supplementName();
static NavigatorContentUtils* from(Page&);
static const char* supplementName();
static void registerProtocolHandler(Navigator&, const String& scheme, const String& url, const String& title, ExceptionState&);
static String isProtocolHandlerRegistered(Navigator&, const String& scheme, const String& url, ExceptionState&);
static void unregisterProtocolHandler(Navigator&, const String& scheme, const String& url, ExceptionState&);
static PassRefPtr<NavigatorContentUtils> create(PassOwnPtr<NavigatorContentUtilsClient>);
static PassOwnPtr<NavigatorContentUtils> create(PassOwnPtr<NavigatorContentUtilsClient>);
virtual void trace(Visitor*) OVERRIDE { }
private:
explicit NavigatorContentUtils(PassOwnPtr<NavigatorContentUtilsClient> client)
......
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