OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 databaseSet->add(database); | 106 databaseSet->add(database); |
107 } | 107 } |
108 | 108 |
109 class NotifyDatabaseObserverOnCloseTask final : public ExecutionContextTask { | 109 class NotifyDatabaseObserverOnCloseTask final : public ExecutionContextTask { |
110 public: | 110 public: |
111 static PassOwnPtr<NotifyDatabaseObserverOnCloseTask> create(Database* databa
se) | 111 static PassOwnPtr<NotifyDatabaseObserverOnCloseTask> create(Database* databa
se) |
112 { | 112 { |
113 return adoptPtr(new NotifyDatabaseObserverOnCloseTask(database)); | 113 return adoptPtr(new NotifyDatabaseObserverOnCloseTask(database)); |
114 } | 114 } |
115 | 115 |
116 virtual void performTask(ExecutionContext*) override | 116 void performTask(ExecutionContext*) override |
117 { | 117 { |
118 databaseClosed(m_database.get()); | 118 databaseClosed(m_database.get()); |
119 } | 119 } |
120 | 120 |
121 private: | 121 private: |
122 explicit NotifyDatabaseObserverOnCloseTask(Database* database) | 122 explicit NotifyDatabaseObserverOnCloseTask(Database* database) |
123 : m_database(database) | 123 : m_database(database) |
124 { | 124 { |
125 } | 125 } |
126 | 126 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 return databaseSize + spaceAvailable; | 193 return databaseSize + spaceAvailable; |
194 } | 194 } |
195 | 195 |
196 class DatabaseTracker::CloseOneDatabaseImmediatelyTask final : public ExecutionC
ontextTask { | 196 class DatabaseTracker::CloseOneDatabaseImmediatelyTask final : public ExecutionC
ontextTask { |
197 public: | 197 public: |
198 static PassOwnPtr<CloseOneDatabaseImmediatelyTask> create(const String& orig
inIdentifier, const String& name, Database* database) | 198 static PassOwnPtr<CloseOneDatabaseImmediatelyTask> create(const String& orig
inIdentifier, const String& name, Database* database) |
199 { | 199 { |
200 return adoptPtr(new CloseOneDatabaseImmediatelyTask(originIdentifier, na
me, database)); | 200 return adoptPtr(new CloseOneDatabaseImmediatelyTask(originIdentifier, na
me, database)); |
201 } | 201 } |
202 | 202 |
203 virtual void performTask(ExecutionContext*) override | 203 void performTask(ExecutionContext*) override |
204 { | 204 { |
205 DatabaseTracker::tracker().closeOneDatabaseImmediately(m_originIdentifie
r, m_name, m_database); | 205 DatabaseTracker::tracker().closeOneDatabaseImmediately(m_originIdentifie
r, m_name, m_database); |
206 } | 206 } |
207 | 207 |
208 private: | 208 private: |
209 CloseOneDatabaseImmediatelyTask(const String& originIdentifier, const String
& name, Database* database) | 209 CloseOneDatabaseImmediatelyTask(const String& originIdentifier, const String
& name, Database* database) |
210 : m_originIdentifier(originIdentifier.isolatedCopy()) | 210 : m_originIdentifier(originIdentifier.isolatedCopy()) |
211 , m_name(name.isolatedCopy()) | 211 , m_name(name.isolatedCopy()) |
212 , m_database(database) | 212 , m_database(database) |
213 { | 213 { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 DatabaseSet::iterator found = databaseSet->find(database); | 256 DatabaseSet::iterator found = databaseSet->find(database); |
257 if (found == databaseSet->end()) | 257 if (found == databaseSet->end()) |
258 return; | 258 return; |
259 } | 259 } |
260 | 260 |
261 // And we have to call closeImmediately() without our collection lock being
held. | 261 // And we have to call closeImmediately() without our collection lock being
held. |
262 database->closeImmediately(); | 262 database->closeImmediately(); |
263 } | 263 } |
264 | 264 |
265 } // namespace blink | 265 } // namespace blink |
OLD | NEW |