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

Side by Side Diff: third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.cpp

Issue 2698723002: Add rappor logging for Device Orientation on security origins different from the main frame (Closed)
Patch Set: add DEviceMotion Created 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "modules/device_orientation/DeviceMotionController.h" 5 #include "modules/device_orientation/DeviceMotionController.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/frame/Deprecation.h" 8 #include "core/frame/Deprecation.h"
9 #include "core/frame/HostsUsingFeatures.h" 9 #include "core/frame/HostsUsingFeatures.h"
10 #include "core/frame/Settings.h" 10 #include "core/frame/Settings.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 HostsUsingFeatures::countAnyWorld( 53 HostsUsingFeatures::countAnyWorld(
54 document(), HostsUsingFeatures::Feature::DeviceMotionInsecureHost); 54 document(), HostsUsingFeatures::Feature::DeviceMotionInsecureHost);
55 if (document() 55 if (document()
56 .frame() 56 .frame()
57 ->settings() 57 ->settings()
58 ->getStrictPowerfulFeatureRestrictions()) 58 ->getStrictPowerfulFeatureRestrictions())
59 return; 59 return;
60 } 60 }
61 } 61 }
62 62
63 if (!m_hasEventListener) 63 if (!m_hasEventListener) {
64 Platform::current()->recordRapporURL("DeviceSensors.DeviceMotion", 64 Platform::current()->recordRapporURL("DeviceSensors.DeviceMotion",
65 WebURL(document().url())); 65 WebURL(document().url()));
66 66
67 if (!isSameSecurityOriginAsMainFrame()) {
68 Platform::current()->recordRapporURL(
69 "DeviceSensors.DeviceMotionCrossOrigin", WebURL(document().url()));
70 }
71 }
72
67 DeviceSingleWindowEventController::didAddEventListener(window, eventType); 73 DeviceSingleWindowEventController::didAddEventListener(window, eventType);
68 } 74 }
69 75
70 bool DeviceMotionController::hasLastData() { 76 bool DeviceMotionController::hasLastData() {
71 return DeviceMotionDispatcher::instance().latestDeviceMotionData(); 77 return DeviceMotionDispatcher::instance().latestDeviceMotionData();
72 } 78 }
73 79
74 void DeviceMotionController::registerWithDispatcher() { 80 void DeviceMotionController::registerWithDispatcher() {
75 DeviceMotionDispatcher::instance().addController(this); 81 DeviceMotionDispatcher::instance().addController(this);
76 } 82 }
(...skipping 16 matching lines...) Expand all
93 const AtomicString& DeviceMotionController::eventTypeName() const { 99 const AtomicString& DeviceMotionController::eventTypeName() const {
94 return EventTypeNames::devicemotion; 100 return EventTypeNames::devicemotion;
95 } 101 }
96 102
97 DEFINE_TRACE(DeviceMotionController) { 103 DEFINE_TRACE(DeviceMotionController) {
98 DeviceSingleWindowEventController::trace(visitor); 104 DeviceSingleWindowEventController::trace(visitor);
99 Supplement<Document>::trace(visitor); 105 Supplement<Document>::trace(visitor);
100 } 106 }
101 107
102 } // namespace blink 108 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698