| Index: content/renderer/render_frame_impl.cc
|
| diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
| index 48f0183ed0ba72e1ae632028c1a41d224b87eec7..090c59382f5197682a32e55d09630500ab8f04da 100644
|
| --- a/content/renderer/render_frame_impl.cc
|
| +++ b/content/renderer/render_frame_impl.cc
|
| @@ -30,7 +30,7 @@
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "base/threading/thread_task_runner_handle.h"
|
| #include "base/time/time.h"
|
| -#include "base/trace_event/trace_event_argument.h"
|
| +#include "base/trace_event/trace_event.h"
|
| #include "build/build_config.h"
|
| #include "cc/base/switches.h"
|
| #include "content/child/appcache/appcache_dispatcher.h"
|
| @@ -5176,6 +5176,7 @@ void RenderFrameImpl::OnGetSerializedHtmlWithLocalLinks(
|
|
|
| void RenderFrameImpl::OnSerializeAsMHTML(
|
| const FrameMsg_SerializeAsMHTML_Params& params) {
|
| + TRACE_EVENT0("page-serialization", "RenderFrameImpl::OnSerializeAsMHTML");
|
| // Unpack IPC payload.
|
| base::File file = IPC::PlatformFileForTransitToFile(params.destination_file);
|
| const WebString mhtml_boundary =
|
| @@ -5191,9 +5192,11 @@ void RenderFrameImpl::OnSerializeAsMHTML(
|
|
|
| // Generate MHTML header if needed.
|
| if (IsMainFrame()) {
|
| + TRACE_EVENT0("page-serialization",
|
| + "RenderFrameImpl::OnSerializeAsMHTML header");
|
| // |data| can be empty if the main frame should be skipped. If the main
|
| - // frame is
|
| - // skipped, then the whole archive is bad, so bail to the error condition.
|
| + // frame is skipped, then the whole archive is bad, so bail to the error
|
| + // condition.
|
| WebData data = WebFrameSerializer::generateMHTMLHeader(
|
| mhtml_boundary, GetWebFrame(), &delegate);
|
| if (data.isEmpty() ||
|
| @@ -5206,11 +5209,15 @@ void RenderFrameImpl::OnSerializeAsMHTML(
|
| // skipping the whole parts generation step is not an error - it simply
|
| // results in an omitted resource in the final file.
|
| if (success) {
|
| + TRACE_EVENT0("page-serialization",
|
| + "RenderFrameImpl::OnSerializeAsMHTML parts serialization");
|
| // |data| can be empty if the frame should be skipped, but this is OK.
|
| data = WebFrameSerializer::generateMHTMLParts(mhtml_boundary, GetWebFrame(),
|
| &delegate);
|
| // TODO(jcivelli): write the chunks in deferred tasks to give a chance to
|
| // the message loop to process other events.
|
| + TRACE_EVENT0("page-serialization",
|
| + "RenderFrameImpl::OnSerializeAsMHTML parts file writing");
|
| if (!data.isEmpty() &&
|
| file.WriteAtCurrentPos(data.data(), data.size()) < 0) {
|
| success = false;
|
| @@ -5219,6 +5226,8 @@ void RenderFrameImpl::OnSerializeAsMHTML(
|
|
|
| // Generate MHTML footer if needed.
|
| if (success && params.is_last_frame) {
|
| + TRACE_EVENT0("page-serialization",
|
| + "RenderFrameImpl::OnSerializeAsMHTML footer");
|
| data = WebFrameSerializer::generateMHTMLFooter(mhtml_boundary);
|
| if (file.WriteAtCurrentPos(data.data(), data.size()) < 0) {
|
| success = false;
|
|
|