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

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

Issue 1125573003: Update deprecation messages for powerful features on insecure origins (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update -expected.txt Created 5 years, 7 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 "config.h" 5 #include "config.h"
6 #include "modules/device_orientation/DeviceMotionController.h" 6 #include "modules/device_orientation/DeviceMotionController.h"
7 7
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/frame/UseCounter.h" 10 #include "core/frame/UseCounter.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 void DeviceMotionController::didAddEventListener(LocalDOMWindow* window, const A tomicString& eventType) 47 void DeviceMotionController::didAddEventListener(LocalDOMWindow* window, const A tomicString& eventType)
48 { 48 {
49 if (eventType != eventTypeName()) 49 if (eventType != eventTypeName())
50 return; 50 return;
51 51
52 if (document().frame()) { 52 if (document().frame()) {
53 String errorMessage; 53 String errorMessage;
54 if (document().isPrivilegedContext(errorMessage)) { 54 if (document().isPrivilegedContext(errorMessage)) {
55 UseCounter::count(document().frame(), UseCounter::DeviceMotionSecure Origin); 55 UseCounter::count(document().frame(), UseCounter::DeviceMotionSecure Origin);
56 } else { 56 } else {
57 UseCounter::countDeprecation(document().frame(), UseCounter::DeviceM otionInsecureOrigin); 57 UseCounter::count(document().frame(), UseCounter::DeviceMotionInsecu reOrigin);
58 if (document().frame()->settings()->strictPowerfulFeatureRestriction s()) 58 if (document().frame()->settings()->strictPowerfulFeatureRestriction s())
59 return; 59 return;
60 } 60 }
61 } 61 }
62 62
63 if (!m_hasEventListener) 63 if (!m_hasEventListener)
64 Platform::current()->recordRapporURL("DeviceSensors.DeviceMotion", WebUR L(document().url())); 64 Platform::current()->recordRapporURL("DeviceSensors.DeviceMotion", WebUR L(document().url()));
65 65
66 DeviceSingleWindowEventController::didAddEventListener(window, eventType); 66 DeviceSingleWindowEventController::didAddEventListener(window, eventType);
67 } 67 }
(...skipping 29 matching lines...) Expand all
97 return EventTypeNames::devicemotion; 97 return EventTypeNames::devicemotion;
98 } 98 }
99 99
100 DEFINE_TRACE(DeviceMotionController) 100 DEFINE_TRACE(DeviceMotionController)
101 { 101 {
102 DeviceSingleWindowEventController::trace(visitor); 102 DeviceSingleWindowEventController::trace(visitor);
103 WillBeHeapSupplement<Document>::trace(visitor); 103 WillBeHeapSupplement<Document>::trace(visitor);
104 } 104 }
105 105
106 } // namespace blink 106 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/UseCounter.cpp ('k') | Source/modules/device_orientation/DeviceOrientationController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698