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

Unified Diff: webkit/base/data_element.cc

Issue 10827414: Factor out common Element struct from BlobData and ResourceRequestBody (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: webkit/common -> webkit/base Created 8 years, 4 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
« no previous file with comments | « webkit/base/data_element.h ('k') | webkit/base/webkit_base.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/base/data_element.cc
diff --git a/webkit/base/data_element.cc b/webkit/base/data_element.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2e8fcf354599d530241fe2e122a4ff4f6945c498
--- /dev/null
+++ b/webkit/base/data_element.cc
@@ -0,0 +1,38 @@
+// Copyright (c) 2012 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 "webkit/base/data_element.h"
+
+namespace webkit_base {
+
+DataElement::DataElement()
+ : type_(TYPE_UNKNOWN),
+ bytes_(NULL),
+ offset_(0),
+ length_(kuint64max) {
+}
+
+DataElement::~DataElement() {}
+
+void DataElement::SetToFilePathRange(
+ const FilePath& path,
+ uint64 offset, uint64 length,
+ const base::Time& expected_modification_time) {
+ type_ = TYPE_FILE;
+ path_ = path;
+ offset_ = offset;
+ length_ = length;
+ expected_modification_time_ = expected_modification_time;
+}
+
+void DataElement::SetToBlobUrlRange(
+ const GURL& blob_url,
+ uint64 offset, uint64 length) {
+ type_ = TYPE_BLOB;
+ url_ = blob_url;
+ offset_ = offset;
+ length_ = length;
+}
+
+} // webkit_base
« no previous file with comments | « webkit/base/data_element.h ('k') | webkit/base/webkit_base.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698