diff options
Diffstat (limited to 'Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h')
-rw-r--r-- | Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h b/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h index 7c695fcbb..c8abbe400 100644 --- a/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h +++ b/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,6 +33,7 @@ #include "GenericCallback.h" #include "MessageReceiver.h" #include "OriginAndDatabases.h" +#include "WebContextSupplement.h" #include "WebDatabaseManagerProxyClient.h" #include <wtf/HashMap.h> #include <wtf/PassRefPtr.h> @@ -45,16 +46,13 @@ class WebSecurityOrigin; typedef GenericCallback<WKArrayRef> ArrayCallback; -class WebDatabaseManagerProxy : public APIObject, private CoreIPC::MessageReceiver { +class WebDatabaseManagerProxy : public TypedAPIObject<APIObject::TypeDatabaseManager>, public WebContextSupplement, private CoreIPC::MessageReceiver { public: - static const Type APIType = TypeDatabaseManager; + static const char* supplementName(); static PassRefPtr<WebDatabaseManagerProxy> create(WebContext*); virtual ~WebDatabaseManagerProxy(); - void invalidate(); - void clearContext() { m_webContext = 0; } - void initializeClient(const WKDatabaseManagerClient*); void getDatabasesByOrigin(PassRefPtr<ArrayCallback>); @@ -73,16 +71,21 @@ public: static String databaseDetailsExpectedUsageKey(); static String databaseDetailsCurrentUsageKey(); - bool shouldTerminate(WebProcessProxy*) const; + using APIObject::ref; + using APIObject::deref; private: explicit WebDatabaseManagerProxy(WebContext*); - virtual Type type() const { return APIType; } + // WebContextSupplement + virtual void contextDestroyed() OVERRIDE; + virtual void processDidClose(WebProcessProxy*) OVERRIDE; + virtual bool shouldTerminate(WebProcessProxy*) const OVERRIDE; + virtual void refWebContextSupplement() OVERRIDE; + virtual void derefWebContextSupplement() OVERRIDE; // CoreIPC::MessageReceiver - virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE; - void didReceiveWebDatabaseManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&); + virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) OVERRIDE; // Message handlers. void didGetDatabasesByOrigin(const Vector<OriginAndDatabases>& originAndDatabases, uint64_t callbackID); @@ -90,9 +93,7 @@ private: void didModifyOrigin(const String& originIdentifier); void didModifyDatabase(const String& originIdentifier, const String& databaseIdentifier); - WebContext* m_webContext; - HashMap<uint64_t, RefPtr<ArrayCallback> > m_arrayCallbacks; - + HashMap<uint64_t, RefPtr<ArrayCallback>> m_arrayCallbacks; WebDatabaseManagerProxyClient m_client; }; |