Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1164)

Side by Side Diff: Source/modules/webdatabase/DatabaseContext.h

Issue 214163004: Oilpan: Move database closing task in ~DatabaseBackendSync to a pre-finalization hook with HeapHash… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add a FIXME comment Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 SecurityOrigin* securityOrigin() const; 70 SecurityOrigin* securityOrigin() const;
71 bool isContextThread() const; 71 bool isContextThread() const;
72 72
73 private: 73 private:
74 explicit DatabaseContext(ExecutionContext*); 74 explicit DatabaseContext(ExecutionContext*);
75 75
76 void stopSyncDatabases(); 76 void stopSyncDatabases();
77 77
78 RefPtrWillBePersistent<DatabaseThread> m_databaseThread; 78 RefPtrWillBePersistent<DatabaseThread> m_databaseThread;
79 #if ENABLE(OILPAN)
80 class DatabaseCloser {
81 public:
82 explicit DatabaseCloser(DatabaseBackendBase& database) : m_database(data base) { }
83 ~DatabaseCloser();
84
85 private:
86 DatabaseBackendBase& m_database;
87 };
88 PersistentHeapHashMap<WeakMember<DatabaseBackendBase>, OwnPtr<DatabaseCloser > > m_openSyncDatabases;
89 #else
79 // The contents of m_openSyncDatabases are raw pointers. It's safe because 90 // The contents of m_openSyncDatabases are raw pointers. It's safe because
80 // DatabaseBackendSync is always closed before destruction. 91 // DatabaseBackendSync is always closed before destruction.
81 HashSet<DatabaseBackendBase*> m_openSyncDatabases; 92 HashSet<DatabaseBackendBase*> m_openSyncDatabases;
93 #endif
82 bool m_hasOpenDatabases; // This never changes back to false, even after the database thread is closed. 94 bool m_hasOpenDatabases; // This never changes back to false, even after the database thread is closed.
83 bool m_hasRequestedTermination; 95 bool m_hasRequestedTermination;
84 }; 96 };
85 97
86 } // namespace WebCore 98 } // namespace WebCore
87 99
88 #endif // DatabaseContext_h 100 #endif // DatabaseContext_h
OLDNEW
« no previous file with comments | « Source/modules/webdatabase/DatabaseBackendSync.cpp ('k') | Source/modules/webdatabase/DatabaseContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698