Changeset 88486 in webkit
- Timestamp:
- Jun 9, 2011 2:45:18 PM (13 years ago)
- Location:
- trunk/Source/WebKit/chromium
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/chromium/ChangeLog
r88466 r88486 1 2011-06-09 Jay Civelli <jcivelli@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 Page serializer APIs now use WebData instead of fetching the entire 6 resource contents. 7 https://bugs.webkit.org/show_bug.cgi?id=61908 8 9 * public/WebData.h: 10 * public/WebPageSerializer.h: 11 * src/WebData.cpp: 12 (WebKit::WebData::getSomeData): 13 * src/WebPageSerializer.cpp: 14 (WebKit::WebPageSerializer::serialize): 15 (WebKit::WebPageSerializer::serializeToMHTML): 16 1 17 2011-06-09 Bill Budge <bbudge@chromium.org> 2 18 -
trunk/Source/WebKit/chromium/public/WebData.h
r50680 r88486 77 77 78 78 WEBKIT_API size_t size() const; 79 80 // Sets |data| to point to the content of the WebData at index |position| 81 // and returns the number of bytes available to be read in |data|. 82 // Return 0 when no more data is left. 83 // Usage: 84 // const char* segment; 85 // size_t position = 0; 86 // while (size_t length = webData.getSomeData(segment, position)) { 87 // // Use the data. for example: decoder->decode(segment, length); 88 // position += length; 89 // } 90 WEBKIT_API size_t getSomeData(const char*& data, size_t position) const; 91 92 // Returns all the data from the SharedBuffer. 93 // Consider using getSomeData() as data() could require flattening the internal buffer 94 // which might be expensive. 79 95 WEBKIT_API const char* data() const; 80 96 -
trunk/Source/WebKit/chromium/public/WebPageSerializer.h
r87958 r88486 34 34 #include "WebCString.h" 35 35 #include "WebCommon.h" 36 #include "WebData.h" 36 37 #include "WebURL.h" 37 38 … … 50 51 WebURL url; 51 52 WebCString mimeType; 52 Web CStringdata;53 WebData data; 53 54 }; 54 55 … … 60 61 61 62 // Serializes the WebView contents to a MHTML representation. 62 WEBKIT_API static Web CStringserializeToMHTML(WebView*);63 WEBKIT_API static WebData serializeToMHTML(WebView*); 63 64 64 65 // IMPORTANT: -
trunk/Source/WebKit/chromium/src/WebData.cpp
r50719 r88486 70 70 } 71 71 72 size_t WebData::getSomeData(const char*& data, size_t position) const 73 { 74 return m_private->getSomeData(data, position); 75 } 76 72 77 const char* WebData::data() const 73 78 { -
trunk/Source/WebKit/chromium/src/WebPageSerializer.cpp
r87958 r88486 194 194 resource.url = iter->url; 195 195 resource.mimeType = iter->mimeType.ascii(); 196 // FIXME: we are copying all the resource data here. Idealy we would have a WebSharedData(). 197 resource.data = WebCString(iter->data->data(), iter->data->size()); 196 resource.data = iter->data; 198 197 result.append(resource); 199 198 } 200 201 199 *resourcesParam = result; 202 200 } 203 201 204 WebCString WebPageSerializer::serializeToMHTML(WebView* view) 205 { 206 RefPtr<SharedBuffer> mhtml = MHTMLArchive::generateMHTMLData(static_cast<WebViewImpl*>(view)->page()); 207 // FIXME: we are copying all the data here. Idealy we would have a WebSharedData(). 208 return WebCString(mhtml->data(), mhtml->size()); 202 WebData WebPageSerializer::serializeToMHTML(WebView* view) 203 { 204 return MHTMLArchive::generateMHTMLData(static_cast<WebViewImpl*>(view)->page()); 209 205 } 210 206
Note: See TracChangeset
for help on using the changeset viewer.