OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SQL_CONNECTION_H_ | 5 #ifndef SQL_CONNECTION_H_ |
6 #define SQL_CONNECTION_H_ | 6 #define SQL_CONNECTION_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // value for SQLITE_MAX_PAGE_SIZE is 32768." | 100 // value for SQLITE_MAX_PAGE_SIZE is 32768." |
101 void set_page_size(int page_size) { page_size_ = page_size; } | 101 void set_page_size(int page_size) { page_size_ = page_size; } |
102 | 102 |
103 // Sets the number of pages that will be cached in memory by sqlite. The | 103 // Sets the number of pages that will be cached in memory by sqlite. The |
104 // total cache size in bytes will be page_size * cache_size. This must be | 104 // total cache size in bytes will be page_size * cache_size. This must be |
105 // called before Open() to have an effect. | 105 // called before Open() to have an effect. |
106 void set_cache_size(int cache_size) { cache_size_ = cache_size; } | 106 void set_cache_size(int cache_size) { cache_size_ = cache_size; } |
107 | 107 |
108 // Call to put the database in exclusive locking mode. There is no "back to | 108 // Call to put the database in exclusive locking mode. There is no "back to |
109 // normal" flag because of some additional requirements sqlite puts on this | 109 // normal" flag because of some additional requirements sqlite puts on this |
110 // transaition (requires another access to the DB) and because we don't | 110 // transaction (requires another access to the DB) and because we don't |
111 // actually need it. | 111 // actually need it. |
112 // | 112 // |
113 // Exclusive mode means that the database is not unlocked at the end of each | 113 // Exclusive mode means that the database is not unlocked at the end of each |
114 // transaction, which means there may be less time spent initializing the | 114 // transaction, which means there may be less time spent initializing the |
115 // next transaction because it doesn't have to re-aquire locks. | 115 // next transaction because it doesn't have to re-aquire locks. |
116 // | 116 // |
117 // This must be called before Open() to have an effect. | 117 // This must be called before Open() to have an effect. |
118 void set_exclusive_locking() { exclusive_locking_ = true; } | 118 void set_exclusive_locking() { exclusive_locking_ = true; } |
119 | 119 |
120 // Call to cause Open() to restrict access permissions of the | 120 // Call to cause Open() to restrict access permissions of the |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 | 592 |
593 // Tag for auxiliary histograms. | 593 // Tag for auxiliary histograms. |
594 std::string histogram_tag_; | 594 std::string histogram_tag_; |
595 | 595 |
596 DISALLOW_COPY_AND_ASSIGN(Connection); | 596 DISALLOW_COPY_AND_ASSIGN(Connection); |
597 }; | 597 }; |
598 | 598 |
599 } // namespace sql | 599 } // namespace sql |
600 | 600 |
601 #endif // SQL_CONNECTION_H_ | 601 #endif // SQL_CONNECTION_H_ |
OLD | NEW |