| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2011 Google, Inc. All Rights Reserved. | 3 * Copyright (C) 2011 Google, Inc. All Rights Reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 namespace WebCore { | 35 namespace WebCore { |
| 36 | 36 |
| 37 class Database; | 37 class Database; |
| 38 class DatabaseContext; | 38 class DatabaseContext; |
| 39 class DatabaseTaskSynchronizer; | 39 class DatabaseTaskSynchronizer; |
| 40 class DatabaseThread; | 40 class DatabaseThread; |
| 41 class ExecutionContext; | 41 class ExecutionContext; |
| 42 class SecurityOrigin; | 42 class SecurityOrigin; |
| 43 | 43 |
| 44 class DatabaseContext : public ThreadSafeRefCounted<DatabaseContext>, public Act
iveDOMObject { | 44 class DatabaseContext FINAL : public ThreadSafeRefCounted<DatabaseContext>, publ
ic ActiveDOMObject { |
| 45 public: | 45 public: |
| 46 friend class DatabaseManager; | 46 friend class DatabaseManager; |
| 47 | 47 |
| 48 static PassRefPtr<DatabaseContext> create(ExecutionContext*); | 48 static PassRefPtr<DatabaseContext> create(ExecutionContext*); |
| 49 | 49 |
| 50 virtual ~DatabaseContext(); | 50 virtual ~DatabaseContext(); |
| 51 | 51 |
| 52 // For life-cycle management (inherited from ActiveDOMObject): | 52 // For life-cycle management (inherited from ActiveDOMObject): |
| 53 virtual void contextDestroyed(); | 53 virtual void contextDestroyed() OVERRIDE; |
| 54 virtual void stop(); | 54 virtual void stop() OVERRIDE; |
| 55 | 55 |
| 56 PassRefPtr<DatabaseContext> backend(); | 56 PassRefPtr<DatabaseContext> backend(); |
| 57 DatabaseThread* databaseThread(); | 57 DatabaseThread* databaseThread(); |
| 58 | 58 |
| 59 void setHasOpenDatabases() { m_hasOpenDatabases = true; } | 59 void setHasOpenDatabases() { m_hasOpenDatabases = true; } |
| 60 bool hasOpenDatabases() { return m_hasOpenDatabases; } | 60 bool hasOpenDatabases() { return m_hasOpenDatabases; } |
| 61 | 61 |
| 62 // When the database cleanup is done, cleanupSync will be signalled. | 62 // When the database cleanup is done, cleanupSync will be signalled. |
| 63 bool stopDatabases(DatabaseTaskSynchronizer*); | 63 bool stopDatabases(DatabaseTaskSynchronizer*); |
| 64 | 64 |
| 65 bool allowDatabaseAccess() const; | 65 bool allowDatabaseAccess() const; |
| 66 | 66 |
| 67 SecurityOrigin* securityOrigin() const; | 67 SecurityOrigin* securityOrigin() const; |
| 68 bool isContextThread() const; | 68 bool isContextThread() const; |
| 69 | 69 |
| 70 private: | 70 private: |
| 71 explicit DatabaseContext(ExecutionContext*); | 71 explicit DatabaseContext(ExecutionContext*); |
| 72 | 72 |
| 73 void stopDatabases() { stopDatabases(0); } | 73 void stopDatabases() { stopDatabases(0); } |
| 74 | 74 |
| 75 RefPtr<DatabaseThread> m_databaseThread; | 75 RefPtr<DatabaseThread> m_databaseThread; |
| 76 bool m_hasOpenDatabases; // This never changes back to false, even after the
database thread is closed. | 76 bool m_hasOpenDatabases; // This never changes back to false, even after the
database thread is closed. |
| 77 bool m_isRegistered; | 77 bool m_isRegistered; |
| 78 bool m_hasRequestedTermination; | 78 bool m_hasRequestedTermination; |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 } // namespace WebCore | 81 } // namespace WebCore |
| 82 | 82 |
| 83 #endif // DatabaseContext_h | 83 #endif // DatabaseContext_h |
| OLD | NEW |