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

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

Issue 1455943002: [Oilpan] Prepare full definition of classes before using Member (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 /* 1 /*
2 * Copyright (C) 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 return; 53 return;
54 54
55 initEvent(type, bubbles, cancelable); 55 initEvent(type, bubbles, cancelable);
56 m_deviceMotionData = deviceMotionData; 56 m_deviceMotionData = deviceMotionData;
57 57
58 m_acceleration.clear(); 58 m_acceleration.clear();
59 m_accelerationIncludingGravity.clear(); 59 m_accelerationIncludingGravity.clear();
60 m_rotationRate.clear(); 60 m_rotationRate.clear();
61 } 61 }
62 62
63 DeviceMotionData* DeviceMotionEvent::deviceMotionData() const
64 {
65 return m_deviceMotionData.get();
66 }
67
63 DeviceAcceleration* DeviceMotionEvent::acceleration() 68 DeviceAcceleration* DeviceMotionEvent::acceleration()
64 { 69 {
65 if (!m_deviceMotionData->acceleration()) 70 if (!m_deviceMotionData->acceleration())
66 return nullptr; 71 return nullptr;
67 72
68 if (!m_acceleration) 73 if (!m_acceleration)
69 m_acceleration = DeviceAcceleration::create(m_deviceMotionData->accelera tion()); 74 m_acceleration = DeviceAcceleration::create(m_deviceMotionData->accelera tion());
70 75
71 return m_acceleration.get(); 76 return m_acceleration.get();
72 } 77 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 DEFINE_TRACE(DeviceMotionEvent) 115 DEFINE_TRACE(DeviceMotionEvent)
111 { 116 {
112 visitor->trace(m_deviceMotionData); 117 visitor->trace(m_deviceMotionData);
113 visitor->trace(m_acceleration); 118 visitor->trace(m_acceleration);
114 visitor->trace(m_accelerationIncludingGravity); 119 visitor->trace(m_accelerationIncludingGravity);
115 visitor->trace(m_rotationRate); 120 visitor->trace(m_rotationRate);
116 Event::trace(visitor); 121 Event::trace(visitor);
117 } 122 }
118 123
119 } // namespace blink 124 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698