| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 } | 169 } |
| 170 | 170 |
| 171 *resourcesParam = result; | 171 *resourcesParam = result; |
| 172 } | 172 } |
| 173 | 173 |
| 174 static PassRefPtr<SharedBuffer> serializePageToMHTML(Page* page, MHTMLArchive::E
ncodingPolicy encodingPolicy) | 174 static PassRefPtr<SharedBuffer> serializePageToMHTML(Page* page, MHTMLArchive::E
ncodingPolicy encodingPolicy) |
| 175 { | 175 { |
| 176 Vector<SerializedResource> resources; | 176 Vector<SerializedResource> resources; |
| 177 PageSerializer serializer(&resources); | 177 PageSerializer serializer(&resources); |
| 178 serializer.serialize(page); | 178 serializer.serialize(page); |
| 179 Document* document = page->mainFrame()->document(); | 179 Document* document = page->deprecatedLocalMainFrame()->document(); |
| 180 return MHTMLArchive::generateMHTMLData(resources, encodingPolicy, document->
title(), document->suggestedMIMEType()); | 180 return MHTMLArchive::generateMHTMLData(resources, encodingPolicy, document->
title(), document->suggestedMIMEType()); |
| 181 } | 181 } |
| 182 | 182 |
| 183 WebCString WebPageSerializer::serializeToMHTML(WebView* view) | 183 WebCString WebPageSerializer::serializeToMHTML(WebView* view) |
| 184 { | 184 { |
| 185 RefPtr<SharedBuffer> mhtml = serializePageToMHTML(toWebViewImpl(view)->page(
), MHTMLArchive::UseDefaultEncoding); | 185 RefPtr<SharedBuffer> mhtml = serializePageToMHTML(toWebViewImpl(view)->page(
), MHTMLArchive::UseDefaultEncoding); |
| 186 // FIXME: we are copying all the data here. Idealy we would have a WebShared
Data(). | 186 // FIXME: we are copying all the data here. Idealy we would have a WebShared
Data(). |
| 187 return WebCString(mhtml->data(), mhtml->size()); | 187 return WebCString(mhtml->data(), mhtml->size()); |
| 188 } | 188 } |
| 189 | 189 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 263 |
| 264 WebString WebPageSerializer::generateBaseTagDeclaration(const WebString& baseTar
get) | 264 WebString WebPageSerializer::generateBaseTagDeclaration(const WebString& baseTar
get) |
| 265 { | 265 { |
| 266 if (baseTarget.isEmpty()) | 266 if (baseTarget.isEmpty()) |
| 267 return String("<base href=\".\">"); | 267 return String("<base href=\".\">"); |
| 268 String baseString = "<base href=\".\" target=\"" + static_cast<const String&
>(baseTarget) + "\">"; | 268 String baseString = "<base href=\".\" target=\"" + static_cast<const String&
>(baseTarget) + "\">"; |
| 269 return baseString; | 269 return baseString; |
| 270 } | 270 } |
| 271 | 271 |
| 272 } // namespace blink | 272 } // namespace blink |
| OLD | NEW |