OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/blob/blob_data.h" | 5 #include "webkit/blob/blob_data.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBlobData.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBlobData.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCString.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCString.h" |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebData.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebData.h" |
12 #include "webkit/glue/webkit_glue.h" | 12 #include "webkit/glue/webkit_glue.h" |
13 | 13 |
14 using WebKit::WebBlobData; | 14 using WebKit::WebBlobData; |
15 using WebKit::WebData; | 15 using WebKit::WebData; |
16 using WebKit::WebString; | 16 using WebKit::WebString; |
17 | 17 |
18 namespace webkit_blob { | 18 namespace webkit_blob { |
19 | 19 |
20 BlobData::Item::Item() | 20 BlobData::Item::Item() |
21 : type_(TYPE_DATA), | 21 : type(TYPE_DATA), |
22 offset_(0), | 22 data_external(NULL), |
23 length_(0) { | 23 offset(0), |
| 24 length(0) { |
24 } | 25 } |
25 | 26 |
26 BlobData::Item::~Item() {} | 27 BlobData::Item::~Item() {} |
27 | 28 |
28 BlobData::BlobData() {} | 29 BlobData::BlobData() {} |
29 | 30 |
30 BlobData::BlobData(const WebBlobData& data) { | 31 BlobData::BlobData(const WebBlobData& data) { |
31 size_t i = 0; | 32 size_t i = 0; |
32 WebBlobData::Item item; | 33 WebBlobData::Item item; |
33 while (data.itemAt(i++, item)) { | 34 while (data.itemAt(i++, item)) { |
(...skipping 24 matching lines...) Expand all Loading... |
58 NOTREACHED(); | 59 NOTREACHED(); |
59 } | 60 } |
60 } | 61 } |
61 content_type_= data.contentType().utf8().data(); | 62 content_type_= data.contentType().utf8().data(); |
62 content_disposition_ = data.contentDisposition().utf8().data(); | 63 content_disposition_ = data.contentDisposition().utf8().data(); |
63 } | 64 } |
64 | 65 |
65 BlobData::~BlobData() {} | 66 BlobData::~BlobData() {} |
66 | 67 |
67 } // namespace webkit_blob | 68 } // namespace webkit_blob |
OLD | NEW |