OLD | NEW |
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 "content/child/site_isolation_stats_gatherer.h" | 5 #include "content/child/site_isolation_stats_gatherer.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram_macros.h" |
12 #include "base/strings/string_piece.h" | 12 #include "base/strings/string_piece.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "content/public/common/resource_response_info.h" | 14 #include "content/public/common/resource_response_info.h" |
15 #include "net/http/http_response_headers.h" | 15 #include "net/http/http_response_headers.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 // The gathering of UMA stats for site isolation is deactivated by default, and | 21 // The gathering of UMA stats for site isolation is deactivated by default, and |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 } | 252 } |
253 | 253 |
254 bool SiteIsolationStatsGatherer::SniffForJS(base::StringPiece data) { | 254 bool SiteIsolationStatsGatherer::SniffForJS(base::StringPiece data) { |
255 // The purpose of this function is to try to see if there's any possibility | 255 // The purpose of this function is to try to see if there's any possibility |
256 // that this data can be JavaScript (superset of JS). Search for "var " for JS | 256 // that this data can be JavaScript (superset of JS). Search for "var " for JS |
257 // detection. This is a real hack and should only be used for stats gathering. | 257 // detection. This is a real hack and should only be used for stats gathering. |
258 return data.find("var ") != base::StringPiece::npos; | 258 return data.find("var ") != base::StringPiece::npos; |
259 } | 259 } |
260 | 260 |
261 } // namespace content | 261 } // namespace content |
OLD | NEW |