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

Side by Side Diff: sql/connection.h

Issue 2297243004: [WIP] histroy: Adjust cache size OnMemoryStateChange() (Closed)
Patch Set: Created 4 years, 3 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
OLDNEW
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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 // if the data isn't actually used soon then preloading just slows down 281 // if the data isn't actually used soon then preloading just slows down
282 // everything else. 282 // everything else.
283 void Preload(); 283 void Preload();
284 284
285 // Try to trim the cache memory used by the database. If |aggressively| is 285 // Try to trim the cache memory used by the database. If |aggressively| is
286 // true, this function will try to free all of the cache memory it can. If 286 // true, this function will try to free all of the cache memory it can. If
287 // |aggressively| is false, this function will try to cut cache memory 287 // |aggressively| is false, this function will try to cut cache memory
288 // usage by half. 288 // usage by half.
289 void TrimMemory(bool aggressively); 289 void TrimMemory(bool aggressively);
290 290
291 // Update the cache size. Unlike set_cache_size(), this will have an effect
292 // even after initialization. Returns true if cache size is successfully
293 // updated. The total cache size in bytes will be page_size * new_cache_size.
294 bool UpdateCacheSize(int new_cache_size);
Scott Hess - ex-Googler 2016/09/01 18:29:09 I want to complain that this should be called Set
295
291 // Raze the database to the ground. This approximates creating a 296 // Raze the database to the ground. This approximates creating a
292 // fresh database from scratch, within the constraints of SQLite's 297 // fresh database from scratch, within the constraints of SQLite's
293 // locking protocol (locks and open handles can make doing this with 298 // locking protocol (locks and open handles can make doing this with
294 // filesystem operations problematic). Returns true if the database 299 // filesystem operations problematic). Returns true if the database
295 // was razed. 300 // was razed.
296 // 301 //
297 // false is returned if the database is locked by some other 302 // false is returned if the database is locked by some other
298 // process. RazeWithTimeout() may be used if appropriate. 303 // process. RazeWithTimeout() may be used if appropriate.
299 // 304 //
300 // NOTE(shess): Raze() will DCHECK in the following situations: 305 // NOTE(shess): Raze() will DCHECK in the following situations:
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 806
802 // Stores the dump provider object when db is open. 807 // Stores the dump provider object when db is open.
803 std::unique_ptr<ConnectionMemoryDumpProvider> memory_dump_provider_; 808 std::unique_ptr<ConnectionMemoryDumpProvider> memory_dump_provider_;
804 809
805 DISALLOW_COPY_AND_ASSIGN(Connection); 810 DISALLOW_COPY_AND_ASSIGN(Connection);
806 }; 811 };
807 812
808 } // namespace sql 813 } // namespace sql
809 814
810 #endif // SQL_CONNECTION_H_ 815 #endif // SQL_CONNECTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698