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

Side by Side Diff: content/browser/indexed_db/leveldb/leveldb_database.cc

Issue 1023773003: IndexedDB: Enable leveldb log reuse on Chrome OS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | third_party/leveldatabase/env_chromium.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #include "content/browser/indexed_db/leveldb/leveldb_database.h" 5 #include "content/browser/indexed_db/leveldb/leveldb_database.h"
6 6
7 #include <cerrno> 7 #include <cerrno>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 leveldb::Env* env, 96 leveldb::Env* env,
97 const base::FilePath& path, 97 const base::FilePath& path,
98 leveldb::DB** db, 98 leveldb::DB** db,
99 scoped_ptr<const leveldb::FilterPolicy>* filter_policy) { 99 scoped_ptr<const leveldb::FilterPolicy>* filter_policy) {
100 filter_policy->reset(leveldb::NewBloomFilterPolicy(10)); 100 filter_policy->reset(leveldb::NewBloomFilterPolicy(10));
101 leveldb::Options options; 101 leveldb::Options options;
102 options.comparator = comparator; 102 options.comparator = comparator;
103 options.create_if_missing = true; 103 options.create_if_missing = true;
104 options.paranoid_checks = true; 104 options.paranoid_checks = true;
105 options.filter_policy = filter_policy->get(); 105 options.filter_policy = filter_policy->get();
106 #if defined(OS_CHROMEOS)
107 // Disabled on CrOS until crbug.com/460568 is fixed.
108 options.reuse_logs = false;
109 #else
110 options.reuse_logs = true; 106 options.reuse_logs = true;
111 #endif
112 options.compression = leveldb::kSnappyCompression; 107 options.compression = leveldb::kSnappyCompression;
113 108
114 // For info about the troubles we've run into with this parameter, see: 109 // For info about the troubles we've run into with this parameter, see:
115 // https://code.google.com/p/chromium/issues/detail?id=227313#c11 110 // https://code.google.com/p/chromium/issues/detail?id=227313#c11
116 options.max_open_files = 80; 111 options.max_open_files = 80;
117 options.env = env; 112 options.env = env;
118 113
119 // ChromiumEnv assumes UTF8, converts back to FilePath before using. 114 // ChromiumEnv assumes UTF8, converts back to FilePath before using.
120 leveldb::Status s = leveldb::DB::Open(options, path.AsUTF8Unsafe(), db); 115 leveldb::Status s = leveldb::DB::Open(options, path.AsUTF8Unsafe(), db);
121 116
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 const leveldb::Slice start_slice = MakeSlice(start); 420 const leveldb::Slice start_slice = MakeSlice(start);
426 const leveldb::Slice stop_slice = MakeSlice(stop); 421 const leveldb::Slice stop_slice = MakeSlice(stop);
427 // NULL batch means just wait for earlier writes to be done 422 // NULL batch means just wait for earlier writes to be done
428 db_->Write(leveldb::WriteOptions(), NULL); 423 db_->Write(leveldb::WriteOptions(), NULL);
429 db_->CompactRange(&start_slice, &stop_slice); 424 db_->CompactRange(&start_slice, &stop_slice);
430 } 425 }
431 426
432 void LevelDBDatabase::CompactAll() { db_->CompactRange(NULL, NULL); } 427 void LevelDBDatabase::CompactAll() { db_->CompactRange(NULL, NULL); }
433 428
434 } // namespace content 429 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/leveldatabase/env_chromium.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698