| 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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 | 446 |
| 447 WebLocalFrameBase* web_local_frame = ToWebLocalFrameBase(frame); | 447 WebLocalFrameBase* web_local_frame = ToWebLocalFrameBase(frame); |
| 448 DCHECK(web_local_frame); | 448 DCHECK(web_local_frame); |
| 449 | 449 |
| 450 Document* document = web_local_frame->GetFrame()->GetDocument(); | 450 Document* document = web_local_frame->GetFrame()->GetDocument(); |
| 451 | 451 |
| 452 RefPtr<RawData> buffer = RawData::Create(); | 452 RefPtr<RawData> buffer = RawData::Create(); |
| 453 MHTMLArchive::GenerateMHTMLHeader(boundary, document->title(), | 453 MHTMLArchive::GenerateMHTMLHeader(boundary, document->title(), |
| 454 document->SuggestedMIMEType(), | 454 document->SuggestedMIMEType(), |
| 455 *buffer->MutableData()); | 455 *buffer->MutableData()); |
| 456 return buffer.Release(); | 456 return buffer; |
| 457 } | 457 } |
| 458 | 458 |
| 459 WebThreadSafeData WebFrameSerializer::GenerateMHTMLParts( | 459 WebThreadSafeData WebFrameSerializer::GenerateMHTMLParts( |
| 460 const WebString& boundary, | 460 const WebString& boundary, |
| 461 WebLocalFrame* web_frame, | 461 WebLocalFrame* web_frame, |
| 462 MHTMLPartsGenerationDelegate* web_delegate) { | 462 MHTMLPartsGenerationDelegate* web_delegate) { |
| 463 TRACE_EVENT0("page-serialization", "WebFrameSerializer::generateMHTMLParts"); | 463 TRACE_EVENT0("page-serialization", "WebFrameSerializer::generateMHTMLParts"); |
| 464 DCHECK(web_frame); | 464 DCHECK(web_frame); |
| 465 DCHECK(web_delegate); | 465 DCHECK(web_delegate); |
| 466 | 466 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 boundary, web_delegate->GetContentID(web_frame), encoding_policy, | 509 boundary, web_delegate->GetContentID(web_frame), encoding_policy, |
| 510 resources.TakeFirst(), *output->MutableData()); | 510 resources.TakeFirst(), *output->MutableData()); |
| 511 while (!resources.IsEmpty()) { | 511 while (!resources.IsEmpty()) { |
| 512 TRACE_EVENT0("page-serialization", | 512 TRACE_EVENT0("page-serialization", |
| 513 "WebFrameSerializer::generateMHTMLParts encoding"); | 513 "WebFrameSerializer::generateMHTMLParts encoding"); |
| 514 MHTMLArchive::GenerateMHTMLPart(boundary, String(), encoding_policy, | 514 MHTMLArchive::GenerateMHTMLPart(boundary, String(), encoding_policy, |
| 515 resources.TakeFirst(), | 515 resources.TakeFirst(), |
| 516 *output->MutableData()); | 516 *output->MutableData()); |
| 517 } | 517 } |
| 518 } | 518 } |
| 519 return output.Release(); | 519 return output; |
| 520 } | 520 } |
| 521 | 521 |
| 522 bool WebFrameSerializer::Serialize( | 522 bool WebFrameSerializer::Serialize( |
| 523 WebLocalFrame* frame, | 523 WebLocalFrame* frame, |
| 524 WebFrameSerializerClient* client, | 524 WebFrameSerializerClient* client, |
| 525 WebFrameSerializer::LinkRewritingDelegate* delegate) { | 525 WebFrameSerializer::LinkRewritingDelegate* delegate) { |
| 526 WebFrameSerializerImpl serializer_impl(frame, client, delegate); | 526 WebFrameSerializerImpl serializer_impl(frame, client, delegate); |
| 527 return serializer_impl.Serialize(); | 527 return serializer_impl.Serialize(); |
| 528 } | 528 } |
| 529 | 529 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 549 const WebString& base_target) { | 549 const WebString& base_target) { |
| 550 // TODO(yosin) We should call |FrameSerializer::baseTagDeclarationOf()|. | 550 // TODO(yosin) We should call |FrameSerializer::baseTagDeclarationOf()|. |
| 551 if (base_target.IsEmpty()) | 551 if (base_target.IsEmpty()) |
| 552 return String("<base href=\".\">"); | 552 return String("<base href=\".\">"); |
| 553 String base_string = "<base href=\".\" target=\"" + | 553 String base_string = "<base href=\".\" target=\"" + |
| 554 static_cast<const String&>(base_target) + "\">"; | 554 static_cast<const String&>(base_target) + "\">"; |
| 555 return base_string; | 555 return base_string; |
| 556 } | 556 } |
| 557 | 557 |
| 558 } // namespace blink | 558 } // namespace blink |
| OLD | NEW |