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

Side by Side Diff: Source/WebCore/platform/leveldb/LevelDBDatabase.cpp

Issue 7457026: Merge 91721 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 4 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
« no previous file with comments | « no previous file | Source/WebCore/storage/IDBLevelDBBackingStore.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 private: 86 private:
87 const LevelDBComparator* m_comparator; 87 const LevelDBComparator* m_comparator;
88 }; 88 };
89 89
90 LevelDBDatabase::LevelDBDatabase() 90 LevelDBDatabase::LevelDBDatabase()
91 { 91 {
92 } 92 }
93 93
94 LevelDBDatabase::~LevelDBDatabase() 94 LevelDBDatabase::~LevelDBDatabase()
95 { 95 {
96 // m_db's destructor uses m_comparatorAdapter; order of deletion is importan t.
97 m_db.clear();
98 m_comparatorAdapter.clear();
96 } 99 }
97 100
98 PassOwnPtr<LevelDBDatabase> LevelDBDatabase::open(const String& fileName, const LevelDBComparator* comparator) 101 PassOwnPtr<LevelDBDatabase> LevelDBDatabase::open(const String& fileName, const LevelDBComparator* comparator)
99 { 102 {
100 OwnPtr<ComparatorAdapter> comparatorAdapter = adoptPtr(new ComparatorAdapter (comparator)); 103 OwnPtr<ComparatorAdapter> comparatorAdapter = adoptPtr(new ComparatorAdapter (comparator));
101 104
102 leveldb::Options options; 105 leveldb::Options options;
103 options.comparator = comparatorAdapter.get(); 106 options.comparator = comparatorAdapter.get();
104 options.create_if_missing = true; 107 options.create_if_missing = true;
105 options.paranoid_checks = true; 108 options.paranoid_checks = true;
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 } 265 }
263 266
264 const LevelDBComparator* LevelDBDatabase::comparator() const 267 const LevelDBComparator* LevelDBDatabase::comparator() const
265 { 268 {
266 return m_comparator; 269 return m_comparator;
267 } 270 }
268 271
269 } 272 }
270 273
271 #endif 274 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/WebCore/storage/IDBLevelDBBackingStore.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698