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

Side by Side Diff: components/page_load_metrics/renderer/metrics_render_frame_observer.cc

Issue 1738553002: [ABANDONED] Move multipart/x-mixed-replace related code to ImageResource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@multipart-cleanup-2
Patch Set: Created 4 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
« no previous file with comments | « chrome/renderer/page_load_histograms.cc ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/page_load_metrics/renderer/metrics_render_frame_observer.h" 5 #include "components/page_load_metrics/renderer/metrics_render_frame_observer.h"
6 6
7 #include "base/time/time.h" 7 #include "base/time/time.h"
8 #include "base/timer/timer.h" 8 #include "base/timer/timer.h"
9 #include "components/page_load_metrics/renderer/page_timing_metrics_sender.h" 9 #include "components/page_load_metrics/renderer/page_timing_metrics_sender.h"
10 #include "content/public/renderer/render_frame.h" 10 #include "content/public/renderer/render_frame.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 if (frame->parent()) 78 if (frame->parent())
79 return false; 79 return false;
80 80
81 const blink::WebDocument& document = frame->document(); 81 const blink::WebDocument& document = frame->document();
82 // Ignore non-HTTP schemes (e.g. chrome://). 82 // Ignore non-HTTP schemes (e.g. chrome://).
83 const GURL& url = document.url(); 83 const GURL& url = document.url();
84 if (!url.SchemeIsHTTPOrHTTPS()) 84 if (!url.SchemeIsHTTPOrHTTPS())
85 return false; 85 return false;
86 86
87 const blink::WebURLResponse& url_response = frame->dataSource()->response(); 87 const blink::WebURLResponse& url_response = frame->dataSource()->response();
88 // Ignore multipart responses (e.g. MHTML).
89 if (url_response.isMultipartPayload())
90 return false;
91
92 // Ignore non-HTML documents (e.g. SVG). Note that images are treated by 88 // Ignore non-HTML documents (e.g. SVG). Note that images are treated by
93 // Blink as HTML documents, so to exclude images, we must perform 89 // Blink as HTML documents, so to exclude images, we must perform
94 // additional mime type checking below. 90 // additional mime type checking below.
95 if (!document.isHTMLDocument() && !document.isXHTMLDocument()) 91 if (!document.isHTMLDocument() && !document.isXHTMLDocument())
96 return false; 92 return false;
97 93
98 // Ignore non-HTML mime types (e.g. images). 94 // Ignore non-HTML mime types (e.g. images).
99 std::string mime_type = url_response.mimeType().utf8(); 95 std::string mime_type = url_response.mimeType().utf8();
100 if (mime_type != "text/html" && mime_type != "application/xhtml+xml") 96 if (mime_type != "text/html" && mime_type != "application/xhtml+xml")
101 return false; 97 return false;
(...skipping 25 matching lines...) Expand all
127 return make_scoped_ptr(new base::OneShotTimer); 123 return make_scoped_ptr(new base::OneShotTimer);
128 } 124 }
129 125
130 bool MetricsRenderFrameObserver::HasNoRenderFrame() const { 126 bool MetricsRenderFrameObserver::HasNoRenderFrame() const {
131 bool no_frame = !render_frame() || !render_frame()->GetWebFrame(); 127 bool no_frame = !render_frame() || !render_frame()->GetWebFrame();
132 DCHECK(!no_frame); 128 DCHECK(!no_frame);
133 return no_frame; 129 return no_frame;
134 } 130 }
135 131
136 } // namespace page_load_metrics 132 } // namespace page_load_metrics
OLDNEW
« no previous file with comments | « chrome/renderer/page_load_histograms.cc ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698