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

Side by Side Diff: third_party/WebKit/Source/web/WebFrameSerializer.cpp

Issue 2731293004: Move the writing of the MHTML footer to the browser process. (Closed)
Patch Set: Comments and naming changes. Created 3 years, 9 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
OLDNEW
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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 TRACE_EVENT0("page-serialization", 430 TRACE_EVENT0("page-serialization",
431 "WebFrameSerializer::generateMHTMLParts encoding"); 431 "WebFrameSerializer::generateMHTMLParts encoding");
432 MHTMLArchive::generateMHTMLPart(boundary, String(), encodingPolicy, 432 MHTMLArchive::generateMHTMLPart(boundary, String(), encodingPolicy,
433 resources.takeFirst(), 433 resources.takeFirst(),
434 *output->mutableData()); 434 *output->mutableData());
435 } 435 }
436 } 436 }
437 return output.release(); 437 return output.release();
438 } 438 }
439 439
440 WebThreadSafeData WebFrameSerializer::generateMHTMLFooter(
441 const WebString& boundary) {
442 TRACE_EVENT0("page-serialization", "WebFrameSerializer::generateMHTMLFooter");
443 RefPtr<RawData> buffer = RawData::create();
444 MHTMLArchive::generateMHTMLFooter(boundary, *buffer->mutableData());
445 return buffer.release();
446 }
447
448 bool WebFrameSerializer::serialize( 440 bool WebFrameSerializer::serialize(
449 WebLocalFrame* frame, 441 WebLocalFrame* frame,
450 WebFrameSerializerClient* client, 442 WebFrameSerializerClient* client,
451 WebFrameSerializer::LinkRewritingDelegate* delegate) { 443 WebFrameSerializer::LinkRewritingDelegate* delegate) {
452 WebFrameSerializerImpl serializerImpl(frame, client, delegate); 444 WebFrameSerializerImpl serializerImpl(frame, client, delegate);
453 return serializerImpl.serialize(); 445 return serializerImpl.serialize();
454 } 446 }
455 447
456 WebString WebFrameSerializer::generateMetaCharsetDeclaration( 448 WebString WebFrameSerializer::generateMetaCharsetDeclaration(
457 const WebString& charset) { 449 const WebString& charset) {
(...skipping 17 matching lines...) Expand all
475 const WebString& baseTarget) { 467 const WebString& baseTarget) {
476 // TODO(yosin) We should call |FrameSerializer::baseTagDeclarationOf()|. 468 // TODO(yosin) We should call |FrameSerializer::baseTagDeclarationOf()|.
477 if (baseTarget.isEmpty()) 469 if (baseTarget.isEmpty())
478 return String("<base href=\".\">"); 470 return String("<base href=\".\">");
479 String baseString = "<base href=\".\" target=\"" + 471 String baseString = "<base href=\".\" target=\"" +
480 static_cast<const String&>(baseTarget) + "\">"; 472 static_cast<const String&>(baseTarget) + "\">";
481 return baseString; 473 return baseString;
482 } 474 }
483 475
484 } // namespace blink 476 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698