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

Side by Side Diff: chrome/renderer/page_load_metrics/renderer_page_track_decider.cc

Issue 2699213002: Adding MHTML support into Page Load Metrics (Closed)
Patch Set: Only observe MHTML for previews observer Created 3 years, 10 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/renderer/page_load_metrics/renderer_page_track_decider.h" 5 #include "chrome/renderer/page_load_metrics/renderer_page_track_decider.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "chrome/renderer/searchbox/search_bouncer.h" 9 #include "chrome/renderer/searchbox/search_bouncer.h"
10 #include "third_party/WebKit/public/platform/WebURLResponse.h" 10 #include "third_party/WebKit/public/platform/WebURLResponse.h"
(...skipping 27 matching lines...) Expand all
38 return data_source_->hasUnreachableURL(); 38 return data_source_->hasUnreachableURL();
39 } 39 }
40 40
41 int RendererPageTrackDecider::GetHttpStatusCode() { 41 int RendererPageTrackDecider::GetHttpStatusCode() {
42 return data_source_->response().httpStatusCode(); 42 return data_source_->response().httpStatusCode();
43 } 43 }
44 44
45 bool RendererPageTrackDecider::IsHtmlOrXhtmlPage() { 45 bool RendererPageTrackDecider::IsHtmlOrXhtmlPage() {
46 // Ignore non-HTML documents (e.g. SVG). Note that images are treated by 46 // Ignore non-HTML documents (e.g. SVG). Note that images are treated by
47 // Blink as HTML documents, so to exclude images, we must perform 47 // Blink as HTML documents, so to exclude images, we must perform
48 // additional mime type checking below. 48 // additional mime type checking below. MHTML is tracked as HTML in blink.
49 if (!document_->isHTMLDocument() && !document_->isXHTMLDocument()) 49 if (!document_->isHTMLDocument() && !document_->isXHTMLDocument())
50 return false; 50 return false;
51 51
52 // Ignore non-HTML mime types (e.g. images). 52 // Ignore non-HTML mime types (e.g. images).
53 blink::WebString mime_type = data_source_->response().mimeType(); 53 blink::WebString mime_type = data_source_->response().mimeType();
54 return mime_type == "text/html" || mime_type == "application/xhtml+xml"; 54 return mime_type == "text/html" || mime_type == "application/xhtml+xml" ||
55 mime_type == "multipart/related";
55 } 56 }
56 57
57 } // namespace page_load_metrics 58 } // namespace page_load_metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698