| 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 "core/frame/HostsUsingFeatures.h" | 5 #include "core/frame/HostsUsingFeatures.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptState.h" | 7 #include "bindings/core/v8/ScriptState.h" |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/frame/LocalDOMWindow.h" | 9 #include "core/frame/LocalDOMWindow.h" |
| 10 #include "core/page/Page.h" | 10 #include "core/page/Page.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 void HostsUsingFeatures::documentDetached(Document& document) { | 77 void HostsUsingFeatures::documentDetached(Document& document) { |
| 78 HostsUsingFeatures::Value counter = document.HostsUsingFeaturesValue(); | 78 HostsUsingFeatures::Value counter = document.HostsUsingFeaturesValue(); |
| 79 if (counter.isEmpty()) | 79 if (counter.isEmpty()) |
| 80 return; | 80 return; |
| 81 | 81 |
| 82 const KURL& url = document.url(); | 82 const KURL& url = document.url(); |
| 83 if (!url.protocolIsInHTTPFamily()) | 83 if (!url.protocolIsInHTTPFamily()) |
| 84 return; | 84 return; |
| 85 | 85 |
| 86 m_urlAndValues.append(std::make_pair(url, counter)); | 86 m_urlAndValues.push_back(std::make_pair(url, counter)); |
| 87 document.HostsUsingFeaturesValue().clear(); | 87 document.HostsUsingFeaturesValue().clear(); |
| 88 DCHECK(document.HostsUsingFeaturesValue().isEmpty()); | 88 DCHECK(document.HostsUsingFeaturesValue().isEmpty()); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void HostsUsingFeatures::updateMeasurementsAndClear() { | 91 void HostsUsingFeatures::updateMeasurementsAndClear() { |
| 92 if (!m_urlAndValues.isEmpty()) { | 92 if (!m_urlAndValues.isEmpty()) { |
| 93 recordHostToRappor(); | 93 recordHostToRappor(); |
| 94 recordETLDPlus1ToRappor(); | 94 recordETLDPlus1ToRappor(); |
| 95 m_urlAndValues.clear(); | 95 m_urlAndValues.clear(); |
| 96 } | 96 } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 WebURL(url)); | 198 WebURL(url)); |
| 199 if (get(Feature::RTCPeerConnectionVideo)) | 199 if (get(Feature::RTCPeerConnectionVideo)) |
| 200 Platform::current()->recordRapporURL("RTCPeerConnection.Video", | 200 Platform::current()->recordRapporURL("RTCPeerConnection.Video", |
| 201 WebURL(url)); | 201 WebURL(url)); |
| 202 if (get(Feature::RTCPeerConnectionDataChannel)) | 202 if (get(Feature::RTCPeerConnectionDataChannel)) |
| 203 Platform::current()->recordRapporURL("RTCPeerConnection.DataChannel", | 203 Platform::current()->recordRapporURL("RTCPeerConnection.DataChannel", |
| 204 WebURL(url)); | 204 WebURL(url)); |
| 205 } | 205 } |
| 206 | 206 |
| 207 } // namespace blink | 207 } // namespace blink |
| OLD | NEW |