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

Side by Side Diff: content/browser/indexed_db/indexed_db_blob_info.h

Issue 197023009: Add IndexedDBBlobInfo class, to be used for IDB Blob support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Formatting fix. Created 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
cmumford 2014/03/13 18:28:47 2014
ericu 2014/03/13 19:31:19 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BLOB_INFO_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BLOB_INFO_H_
7
8 #include "base/callback.h"
9 #include "base/files/file_path.h"
10 #include "base/time/time.h"
11 #include "webkit/common/blob/shareable_file_reference.h"
12
13 namespace content {
14
15 class IndexedDBBlobInfo {
16 public:
17 typedef webkit_blob::ShareableFileReference::FinalReleaseCallback
18 ReleaseCallback;
19 IndexedDBBlobInfo();
20 IndexedDBBlobInfo(const std::string& uuid,
jsbell 2014/03/13 00:01:48 Add comments to ctors indicating which produce Fil
ericu 2014/03/13 18:12:39 Done.
21 const base::string16& type,
22 int64 size);
23 IndexedDBBlobInfo(const base::FilePath& file_path,
24 const base::string16& file_name,
25 const base::string16& type);
26 IndexedDBBlobInfo(const base::string16& type, int64 size, int64 key);
27 IndexedDBBlobInfo(int64 key,
28 const base::string16& type,
29 const base::string16& file_name);
30
31 bool is_file() const { return is_file_; }
32 const std::string& uuid() const { return uuid_; }
33 const base::string16& type() const { return type_; }
34 int64 size() const { return size_; }
35 const base::string16& file_name() const { return file_name_; }
36 int64 key() const { return key_; }
37 const base::FilePath& file_path() const { return file_path_; }
38 const base::Time& last_modified() const { return last_modified_; }
39 const base::Closure& mark_used_callback() const {
40 return mark_used_callback_;
41 }
42 const ReleaseCallback& release_callback() const { return release_callback_; }
43
44 void set_size(int64 size);
45 void set_uuid(const std::string& uuid);
46 void set_file_path(const base::FilePath& file_path);
47 void set_last_modified(const base::Time& time);
48 void set_key(int64 key);
49 void set_mark_used_callback(const base::Closure& mark_used_callback);
50 void set_release_callback(const ReleaseCallback& release_callback);
51
52 private:
53 bool is_file_;
54 std::string uuid_; // Always for Blob; sometimes for File.
55 base::string16 type_; // Mime type.
56 int64 size_; // -1 if unknown for File.
57 base::string16 file_name_; // Only for File.
58 base::FilePath file_path_; // Only for File.
59 base::Time last_modified_; // Only for File; valid only if size is.
60
61 // Valid only when this comes out of the database.
62 int64 key_;
63 base::Closure mark_used_callback_;
64 ReleaseCallback release_callback_;
65 };
jsbell 2014/03/13 00:01:48 DISALLOW_COPY_AND_ASSIGN ?
ericu 2014/03/13 18:12:39 Nope; I use vectors of them using the default copy
66
67 } // namespace content
68
69 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BLOB_INFO_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/indexed_db/indexed_db_blob_info.cc » ('j') | content/browser/indexed_db/indexed_db_blob_info.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698