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

Side by Side Diff: webkit/fileapi/file_system_origin_database.h

Issue 7057032: Integrated obfuscation with quota; all unit tests now pass (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Eliminated a vector copy Created 9 years, 7 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 | « webkit/fileapi/file_system_context.cc ('k') | webkit/fileapi/file_system_origin_database.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 WEBKIT_FILEAPI_FILE_SYSTEM_ORIGIN_DATABASE_H_ 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_ORIGIN_DATABASE_H_
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_ORIGIN_DATABASE_H_ 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_ORIGIN_DATABASE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/file_path.h" 12 #include "base/file_path.h"
13 #include "base/scoped_ptr.h" 13 #include "base/scoped_ptr.h"
14 #include "third_party/leveldb/include/leveldb/db.h" 14 #include "third_party/leveldb/include/leveldb/db.h"
15 15
16 namespace fileapi { 16 namespace fileapi {
17 17
18 // All methods of this class other than the constructor may be used only from 18 // All methods of this class other than the constructor may be used only from
19 // the browser's FILE thread. The constructor may be used on any thread. 19 // the browser's FILE thread. The constructor may be used on any thread.
20 class FileSystemOriginDatabase { 20 class FileSystemOriginDatabase {
21 public: 21 public:
22 typedef std::pair<std::string, FilePath> OriginRecord; 22 struct OriginRecord {
23 std::string origin;
24 FilePath path;
25
26 OriginRecord();
27 OriginRecord(const std::string& origin, const FilePath& path);
28 ~OriginRecord();
29 };
23 30
24 // Only one instance of FileSystemOriginDatabase should exist for a given path 31 // Only one instance of FileSystemOriginDatabase should exist for a given path
25 // at a given time. 32 // at a given time.
26 FileSystemOriginDatabase(const FilePath& path); 33 FileSystemOriginDatabase(const FilePath& path);
27 ~FileSystemOriginDatabase(); 34 ~FileSystemOriginDatabase();
28 35
29 bool HasOriginPath(const std::string& origin); 36 bool HasOriginPath(const std::string& origin);
30 37
31 // This will produce a unique path and add it to its database, if it's not 38 // This will produce a unique path and add it to its database, if it's not
32 // already present. 39 // already present.
(...skipping 13 matching lines...) Expand all
46 bool GetLastPathNumber(int* number); 53 bool GetLastPathNumber(int* number);
47 54
48 std::string path_; 55 std::string path_;
49 scoped_ptr<leveldb::DB> db_; 56 scoped_ptr<leveldb::DB> db_;
50 DISALLOW_COPY_AND_ASSIGN(FileSystemOriginDatabase); 57 DISALLOW_COPY_AND_ASSIGN(FileSystemOriginDatabase);
51 }; 58 };
52 59
53 } // namespace fileapi 60 } // namespace fileapi
54 61
55 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_ORIGIN_DATABASE_H_ 62 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_ORIGIN_DATABASE_H_
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_context.cc ('k') | webkit/fileapi/file_system_origin_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698