| Index: content/renderer/render_frame_impl.cc
|
| diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
| index 6fba0086fafb042e8b701137e7d0f786e313bdb7..e722fa67973109dad1ddf2aa17201c6a4f32adde 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"
|
| @@ -5167,6 +5167,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 =
|
| @@ -5182,9 +5183,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() ||
|
| @@ -5197,11 +5200,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;
|
| @@ -5210,6 +5217,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;
|
|
|