Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / modules / webdatabase / DatabaseContext.h
index f8e11ab..62e7a59 100644 (file)
@@ -29,7 +29,8 @@
 #define DatabaseContext_h
 
 #include "core/dom/ActiveDOMObject.h"
-#include "heap/Handle.h"
+#include "core/workers/WorkerGlobalScope.h"
+#include "platform/heap/Handle.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/ThreadSafeRefCounted.h"
 
@@ -38,12 +39,15 @@ namespace WebCore {
 class Database;
 class DatabaseBackendBase;
 class DatabaseContext;
-class DatabaseTaskSynchronizer;
+class TaskSynchronizer;
 class DatabaseThread;
 class ExecutionContext;
 class SecurityOrigin;
 
-class DatabaseContext FINAL : public ThreadSafeRefCountedWillBeGarbageCollectedFinalized<DatabaseContext>, public ActiveDOMObject {
+class DatabaseContext FINAL
+    : public ThreadSafeRefCountedWillBeGarbageCollectedFinalized<DatabaseContext>
+    , public ActiveDOMObject
+    , private WorkerGlobalScope::TerminationObserver {
 public:
     friend class DatabaseManager;
 
@@ -54,7 +58,6 @@ public:
 
     // For life-cycle management (inherited from ActiveDOMObject):
     virtual void contextDestroyed() OVERRIDE;
-    virtual void willStop() OVERRIDE;
     virtual void stop() OVERRIDE;
 
     DatabaseContext* backend();
@@ -74,6 +77,7 @@ public:
 private:
     explicit DatabaseContext(ExecutionContext*);
 
+    virtual void wasRequestedToTerminate() OVERRIDE;
     void stopSyncDatabases();
 
     RefPtrWillBeMember<DatabaseThread> m_databaseThread;