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

Side by Side Diff: chrome/browser/password_manager/login_database.cc

Issue 5125579611308032: [sql] Allow restricting database to user read access. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments about posix-specificness. Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/password_manager/login_database_unittest.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) 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 #include "chrome/browser/password_manager/login_database.h" 5 #include "chrome/browser/password_manager/login_database.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 } 89 }
90 90
91 LoginDatabase::~LoginDatabase() { 91 LoginDatabase::~LoginDatabase() {
92 } 92 }
93 93
94 bool LoginDatabase::Init(const base::FilePath& db_path) { 94 bool LoginDatabase::Init(const base::FilePath& db_path) {
95 // Set pragmas for a small, private database (based on WebDatabase). 95 // Set pragmas for a small, private database (based on WebDatabase).
96 db_.set_page_size(2048); 96 db_.set_page_size(2048);
97 db_.set_cache_size(32); 97 db_.set_cache_size(32);
98 db_.set_exclusive_locking(); 98 db_.set_exclusive_locking();
99 db_.set_restrict_to_user();
99 100
100 if (!db_.Open(db_path)) { 101 if (!db_.Open(db_path)) {
101 LOG(WARNING) << "Unable to open the password store database."; 102 LOG(WARNING) << "Unable to open the password store database.";
102 return false; 103 return false;
103 } 104 }
104 105
105 sql::Transaction transaction(&db_); 106 sql::Transaction transaction(&db_);
106 transaction.Begin(); 107 transaction.Begin();
107 108
108 // Check the database version. 109 // Check the database version.
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 std::vector<string16> LoginDatabase::DeserializeVector(const Pickle& p) const { 550 std::vector<string16> LoginDatabase::DeserializeVector(const Pickle& p) const {
550 std::vector<string16> ret; 551 std::vector<string16> ret;
551 string16 str; 552 string16 str;
552 553
553 PickleIterator iterator(p); 554 PickleIterator iterator(p);
554 while (iterator.ReadString16(&str)) { 555 while (iterator.ReadString16(&str)) {
555 ret.push_back(str); 556 ret.push_back(str);
556 } 557 }
557 return ret; 558 return ret;
558 } 559 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/password_manager/login_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698