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

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

Issue 7154001: Merge 87911 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/782/
Patch Set: Created 9 years, 6 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 | no next file » | 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 , m_finished(false) 46 , m_finished(false)
47 { 47 {
48 m_tree.abstractor().m_comparator = m_comparator; 48 m_tree.abstractor().m_comparator = m_comparator;
49 } 49 }
50 50
51 void LevelDBTransaction::clearTree() 51 void LevelDBTransaction::clearTree()
52 { 52 {
53 TreeType::Iterator iterator; 53 TreeType::Iterator iterator;
54 iterator.start_iter_least(m_tree); 54 iterator.start_iter_least(m_tree);
55 55
56 Vector<AVLTreeNode*> nodes;
57
56 while (*iterator) { 58 while (*iterator) {
57 delete *iterator; 59 nodes.append(*iterator);
58 ++iterator; 60 ++iterator;
59 } 61 }
60 m_tree.purge(); 62 m_tree.purge();
63
64 for (size_t i = 0; i < nodes.size(); ++i)
65 delete(nodes[i]);
61 } 66 }
62 67
63 LevelDBTransaction::~LevelDBTransaction() 68 LevelDBTransaction::~LevelDBTransaction()
64 { 69 {
65 clearTree(); 70 clearTree();
66 } 71 }
67 72
68 static void initVector(const LevelDBSlice& slice, Vector<char>* vector) 73 static void initVector(const LevelDBSlice& slice, Vector<char>* vector)
69 { 74 {
70 vector->clear(); 75 vector->clear();
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 for (HashSet<TransactionIterator*>::iterator i = m_iterators.begin(); i != m _iterators.end(); ++i) { 471 for (HashSet<TransactionIterator*>::iterator i = m_iterators.begin(); i != m _iterators.end(); ++i) {
467 TransactionIterator* transactionIterator = *i; 472 TransactionIterator* transactionIterator = *i;
468 transactionIterator->treeChanged(); 473 transactionIterator->treeChanged();
469 } 474 }
470 } 475 }
471 476
472 } // namespace WebCore 477 } // namespace WebCore
473 478
474 #endif // ENABLE(LEVELDB) 479 #endif // ENABLE(LEVELDB)
475 #endif // ENABLE(INDEXED_DATABASE) 480 #endif // ENABLE(INDEXED_DATABASE)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698