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/OriginsUsingFeatures.h" | 5 #include "core/frame/OriginsUsingFeatures.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/page/Page.h" | 9 #include "core/page/Page.h" |
10 #include "public/platform/Platform.h" | 10 #include "public/platform/Platform.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 void OriginsUsingFeatures::countMainWorldOnly(const ScriptState* scriptState, Do
cument& document, Feature feature) | 29 void OriginsUsingFeatures::countMainWorldOnly(const ScriptState* scriptState, Do
cument& document, Feature feature) |
30 { | 30 { |
31 if (!scriptState || !scriptState->world().isMainWorld()) | 31 if (!scriptState || !scriptState->world().isMainWorld()) |
32 return; | 32 return; |
33 countAnyWorld(document, feature); | 33 countAnyWorld(document, feature); |
34 } | 34 } |
35 | 35 |
36 static Document* documentFromEventTarget(EventTarget& target) | 36 static Document* documentFromEventTarget(EventTarget& target) |
37 { | 37 { |
38 ExecutionContext* executionContext = target.executionContext(); | 38 ExecutionContext* executionContext = target.getExecutionContext(); |
39 if (!executionContext) | 39 if (!executionContext) |
40 return nullptr; | 40 return nullptr; |
41 if (executionContext->isDocument()) | 41 if (executionContext->isDocument()) |
42 return toDocument(executionContext); | 42 return toDocument(executionContext); |
43 if (LocalDOMWindow* executingWindow = executionContext->executingWindow()) | 43 if (LocalDOMWindow* executingWindow = executionContext->executingWindow()) |
44 return executingWindow->document(); | 44 return executingWindow->document(); |
45 return nullptr; | 45 return nullptr; |
46 } | 46 } |
47 | 47 |
48 void OriginsUsingFeatures::countOriginOrIsolatedWorldHumanReadableName(const Scr
iptState* scriptState, EventTarget& target, Feature feature) | 48 void OriginsUsingFeatures::countOriginOrIsolatedWorldHumanReadableName(const Scr
iptState* scriptState, EventTarget& target, Feature feature) |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 Platform::current()->recordRappor("PowerfulFeatureUse.Host.ApplicationCa
cheAPI.Insecure", origin); | 164 Platform::current()->recordRappor("PowerfulFeatureUse.Host.ApplicationCa
cheAPI.Insecure", origin); |
165 } | 165 } |
166 | 166 |
167 void OriginsUsingFeatures::Value::recordNameToRappor(const String& name) | 167 void OriginsUsingFeatures::Value::recordNameToRappor(const String& name) |
168 { | 168 { |
169 if (get(Feature::EventPath)) | 169 if (get(Feature::EventPath)) |
170 Platform::current()->recordRappor("WebComponents.EventPath.Extensions",
name); | 170 Platform::current()->recordRappor("WebComponents.EventPath.Extensions",
name); |
171 } | 171 } |
172 | 172 |
173 } // namespace blink | 173 } // namespace blink |
OLD | NEW |