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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <map> | 10 #include <map> |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // | 142 // |
143 // This must be called before Open() to have an effect. | 143 // This must be called before Open() to have an effect. |
144 void set_exclusive_locking() { exclusive_locking_ = true; } | 144 void set_exclusive_locking() { exclusive_locking_ = true; } |
145 | 145 |
146 // Call to cause Open() to restrict access permissions of the | 146 // Call to cause Open() to restrict access permissions of the |
147 // database file to only the owner. | 147 // database file to only the owner. |
148 // TODO(shess): Currently only supported on OS_POSIX, is a noop on | 148 // TODO(shess): Currently only supported on OS_POSIX, is a noop on |
149 // other platforms. | 149 // other platforms. |
150 void set_restrict_to_user() { restrict_to_user_ = true; } | 150 void set_restrict_to_user() { restrict_to_user_ = true; } |
151 | 151 |
152 // Call to opt out of memory-mapped file I/O on per connection basis. | 152 // Call to opt out of memory-mapped file I/O. |
153 void set_mmap_disabled() { mmap_disabled_ = true; } | 153 void set_mmap_disabled() { mmap_disabled_ = true; } |
154 | 154 |
155 // Call to opt out of memory-mapped file I/O on all connections. | |
156 static void set_mmap_disabled_by_default(); | |
157 | |
158 // Set an error-handling callback. On errors, the error number (and | 155 // Set an error-handling callback. On errors, the error number (and |
159 // statement, if available) will be passed to the callback. | 156 // statement, if available) will be passed to the callback. |
160 // | 157 // |
161 // If no callback is set, the default action is to crash in debug | 158 // If no callback is set, the default action is to crash in debug |
162 // mode or return failure in release mode. | 159 // mode or return failure in release mode. |
163 typedef base::Callback<void(int, Statement*)> ErrorCallback; | 160 typedef base::Callback<void(int, Statement*)> ErrorCallback; |
164 void set_error_callback(const ErrorCallback& callback) { | 161 void set_error_callback(const ErrorCallback& callback) { |
165 error_callback_ = callback; | 162 error_callback_ = callback; |
166 } | 163 } |
167 bool has_error_callback() const { | 164 bool has_error_callback() const { |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 | 793 |
797 // Stores the dump provider object when db is open. | 794 // Stores the dump provider object when db is open. |
798 std::unique_ptr<ConnectionMemoryDumpProvider> memory_dump_provider_; | 795 std::unique_ptr<ConnectionMemoryDumpProvider> memory_dump_provider_; |
799 | 796 |
800 DISALLOW_COPY_AND_ASSIGN(Connection); | 797 DISALLOW_COPY_AND_ASSIGN(Connection); |
801 }; | 798 }; |
802 | 799 |
803 } // namespace sql | 800 } // namespace sql |
804 | 801 |
805 #endif // SQL_CONNECTION_H_ | 802 #endif // SQL_CONNECTION_H_ |
OLD | NEW |