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

Side by Side Diff: Source/web/WebBlobData.cpp

Issue 23703003: Couple of minor changes to the WebKitAPI. This is a small step in a larger work-in-progress. See th… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « Source/core/platform/chromium/support/WebHTTPBody.cpp ('k') | public/platform/WebBlobData.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 { 61 {
62 ASSERT(!isNull()); 62 ASSERT(!isNull());
63 63
64 if (index >= m_private->items().size()) 64 if (index >= m_private->items().size())
65 return false; 65 return false;
66 66
67 const BlobDataItem& item = m_private->items()[index]; 67 const BlobDataItem& item = m_private->items()[index];
68 result.data.reset(); 68 result.data.reset();
69 result.filePath.reset(); 69 result.filePath.reset();
70 result.blobURL = KURL(); 70 result.blobURL = KURL();
71 result.blobUUID.reset();
71 result.offset = item.offset; 72 result.offset = item.offset;
72 result.length = item.length; 73 result.length = item.length;
73 result.expectedModificationTime = item.expectedModificationTime; 74 result.expectedModificationTime = item.expectedModificationTime;
74 75
75 switch (item.type) { 76 switch (item.type) {
76 case BlobDataItem::Data: 77 case BlobDataItem::Data:
77 result.type = Item::TypeData; 78 result.type = Item::TypeData;
78 result.data = item.data; 79 result.data = item.data;
79 return true; 80 return true;
80 case BlobDataItem::File: 81 case BlobDataItem::File:
81 result.type = Item::TypeFile; 82 result.type = Item::TypeFile;
82 result.filePath = item.path; 83 result.filePath = item.path;
83 return true; 84 return true;
84 case BlobDataItem::Blob: 85 case BlobDataItem::Blob:
85 result.type = Item::TypeBlob; 86 result.type = Item::TypeBlob;
86 result.blobURL = item.url; // FIXME: deprecate this. 87 result.blobURL = item.url; // FIXME: deprecate this.
87 result.url = item.url; 88 result.url = item.url; // DEPRECATED, should be able to remove after htt ps://codereview.chromium.org/23223003/ lands
88 return true; 89 return true;
89 case BlobDataItem::URL: 90 case BlobDataItem::URL:
90 result.type = Item::TypeURL; 91 result.type = Item::TypeFileSystemURL;
91 result.url = item.url; 92 result.url = item.url; // DEPRECATED
93 result.fileSystemURL = item.url;
92 return true; 94 return true;
93 } 95 }
94 ASSERT_NOT_REACHED(); 96 ASSERT_NOT_REACHED();
95 return false; 97 return false;
96 } 98 }
97 99
98 WebString WebBlobData::contentType() const 100 WebString WebBlobData::contentType() const
99 { 101 {
100 ASSERT(!isNull()); 102 ASSERT(!isNull());
101 return m_private->contentType(); 103 return m_private->contentType();
(...skipping 25 matching lines...) Expand all
127 } 129 }
128 130
129 void WebBlobData::assign(const PassOwnPtr<BlobData>& data) 131 void WebBlobData::assign(const PassOwnPtr<BlobData>& data)
130 { 132 {
131 if (m_private) 133 if (m_private)
132 delete m_private; 134 delete m_private;
133 m_private = static_cast<WebBlobDataPrivate*>(data.leakPtr()); 135 m_private = static_cast<WebBlobDataPrivate*>(data.leakPtr());
134 } 136 }
135 137
136 } // namespace WebKit 138 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/core/platform/chromium/support/WebHTTPBody.cpp ('k') | public/platform/WebBlobData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698