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

Unified Diff: content/browser/indexed_db/indexed_db_blob_info.cc

Issue 18023022: Blob support for IDB [Chromium] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge fixes [builds, untested] Created 7 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/indexed_db/indexed_db_blob_info.cc
diff --git a/content/browser/indexed_db/indexed_db_blob_info.cc b/content/browser/indexed_db/indexed_db_blob_info.cc
new file mode 100644
index 0000000000000000000000000000000000000000..355ab6eeb37d59831654d1032cd7e32a7b575dec
--- /dev/null
+++ b/content/browser/indexed_db/indexed_db_blob_info.cc
@@ -0,0 +1,91 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/indexed_db/indexed_db_blob_info.h"
+
+#include "base/logging.h"
+#include "content/browser/indexed_db/indexed_db_leveldb_coding.h"
+
+namespace content {
+
+IndexedDBBlobInfo::IndexedDBBlobInfo() { }
+
+IndexedDBBlobInfo::IndexedDBBlobInfo(
+ const GURL& url,
+ const string16& type,
+ int64 size)
+ : is_file_(false),
+ url_(url),
+ type_(type),
+ size_(size),
+ key_(DatabaseMetaDataKey::kInvalidBlobKey) {
+}
+
+IndexedDBBlobInfo::IndexedDBBlobInfo(
+ const base::FilePath& file_path,
+ const string16& file_name,
+ const string16& type)
+ : is_file_(true),
+ type_(type),
+ size_(-1),
+ file_name_(file_name),
+ file_path_(file_path),
+ key_(DatabaseMetaDataKey::kInvalidBlobKey) {
+}
+
+IndexedDBBlobInfo::IndexedDBBlobInfo(
+ const string16& type, int64 size, int64 key)
+ : is_file_(false),
+ type_(type),
+ size_(size),
+ key_(key) {
+}
+
+IndexedDBBlobInfo::IndexedDBBlobInfo(
+ const string16& type, const string16& file_name, int64 key)
+ : is_file_(true),
+ type_(type),
+ size_(-1),
+ file_name_(file_name),
+ key_(key) {
+}
+
+void IndexedDBBlobInfo::set_size(int64 size) {
+ DCHECK_EQ(-1, size_);
+ size_ = size;
+}
+
+void IndexedDBBlobInfo::set_url(const GURL& url) {
+ DCHECK(url_.is_empty());
+ url_ = url;
+}
+
+void IndexedDBBlobInfo::set_file_path(const base::FilePath& file_path) {
+ DCHECK(file_path_.empty());
+ file_path_ = file_path;
+}
+
+void IndexedDBBlobInfo::set_last_modified(const base::Time& time) {
+ DCHECK(base::Time().is_null());
+ last_modified_ = time;
+}
+
+void IndexedDBBlobInfo::set_key(int64 key) {
+ DCHECK(DatabaseMetaDataKey::kInvalidBlobKey == key_);
+ key_ = key;
+}
+
+void IndexedDBBlobInfo::set_mark_used_callback(
+ const base::Closure& mark_used_callback) {
+ DCHECK(mark_used_callback_.is_null());
+ mark_used_callback_ = mark_used_callback;
+}
+
+void IndexedDBBlobInfo::set_release_callback(
+ const ReleaseCallback& release_callback) {
+ DCHECK(release_callback_.is_null());
+ release_callback_ = release_callback;
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698