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

Side by Side Diff: content/browser/gamepad/data_fetcher_win.cc

Issue 8869005: Revert EnableClose() removal and related crash fixes. I don't understand the crashes here, and th... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/base/testing_profile.cc ('k') | ui/aura_shell/toplevel_frame_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/browser/gamepad/data_fetcher_win.h" 5 #include "content/browser/gamepad/data_fetcher_win.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "content/common/gamepad_messages.h" 8 #include "content/common/gamepad_messages.h"
9 #include "content/common/gamepad_hardware_buffer.h" 9 #include "content/common/gamepad_hardware_buffer.h"
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 break; 59 break;
60 default: 60 default:
61 // Exception is not related to delay loading. 61 // Exception is not related to delay loading.
62 disposition = EXCEPTION_CONTINUE_SEARCH; 62 disposition = EXCEPTION_CONTINUE_SEARCH;
63 break; 63 break;
64 } 64 }
65 return disposition; 65 return disposition;
66 } 66 }
67 67
68 bool EnableXInput() { 68 bool EnableXInput() {
69 /*
sky 2011/12/08 00:04:22 Is this intentional?
69 // We have specified DELAYLOAD for xinput1_3.dll. If the DLL is not 70 // We have specified DELAYLOAD for xinput1_3.dll. If the DLL is not
70 // installed (XP w/o DirectX redist installed), we disable functionality. 71 // installed (XP w/o DirectX redist installed), we disable functionality.
71 __try { 72 __try {
72 XInputEnable(true); 73 XInputEnable(true);
73 } __except(DelayLoadDllExceptionFilter(GetExceptionInformation())) { 74 } __except(DelayLoadDllExceptionFilter(GetExceptionInformation())) {
74 return false; 75 return false;
75 } 76 }
76 return true; 77 return true;
78 */
79 return false;
77 } 80 }
78 81
79 } 82 }
80 83
81 GamepadDataFetcherWindows::GamepadDataFetcherWindows() 84 GamepadDataFetcherWindows::GamepadDataFetcherWindows()
82 : xinput_available_(EnableXInput()) { 85 : xinput_available_(EnableXInput()) {
83 } 86 }
84 87
85 void GamepadDataFetcherWindows::GetGamepadData(WebGamepads* pads, 88 void GamepadDataFetcherWindows::GetGamepadData(WebGamepads* pads,
86 bool devices_changed_hint) { 89 bool devices_changed_hint) {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 pad.axes[pad.axesLength++] = -state.Gamepad.sThumbLY / 32767.0; 167 pad.axes[pad.axesLength++] = -state.Gamepad.sThumbLY / 32767.0;
165 pad.axes[pad.axesLength++] = state.Gamepad.sThumbRX / 32767.0; 168 pad.axes[pad.axesLength++] = state.Gamepad.sThumbRX / 32767.0;
166 pad.axes[pad.axesLength++] = -state.Gamepad.sThumbRY / 32767.0; 169 pad.axes[pad.axesLength++] = -state.Gamepad.sThumbRY / 32767.0;
167 } else { 170 } else {
168 pad.connected = false; 171 pad.connected = false;
169 } 172 }
170 } 173 }
171 } 174 }
172 175
173 } // namespace content 176 } // namespace content
OLDNEW
« no previous file with comments | « chrome/test/base/testing_profile.cc ('k') | ui/aura_shell/toplevel_frame_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698