| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 | 32 |
| 33 #ifndef O3D_PLUGIN_WIN_UPDATE_LOCK_H_ | 33 #ifndef O3D_PLUGIN_WIN_UPDATE_LOCK_H_ |
| 34 #define O3D_PLUGIN_WIN_UPDATE_LOCK_H_ | 34 #define O3D_PLUGIN_WIN_UPDATE_LOCK_H_ |
| 35 | 35 |
| 36 #if !defined(O3D_INTERNAL_PLUGIN) |
| 37 |
| 36 #include <windows.h> | 38 #include <windows.h> |
| 37 #include "base/basictypes.h" | 39 #include "base/basictypes.h" |
| 38 | 40 |
| 39 namespace update_lock { | 41 namespace update_lock { |
| 40 | 42 |
| 41 const TCHAR kRunningEventName[] = | 43 const TCHAR kRunningEventName[] = |
| 42 L"Global\\{AA4817F6-5DB2-482f-92E9-6BD2FF9F3B14}"; | 44 L"Global\\{AA4817F6-5DB2-482f-92E9-6BD2FF9F3B14}"; |
| 43 | 45 |
| 44 class HandleWrapper { | 46 class HandleWrapper { |
| 45 public: | 47 public: |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 } | 91 } |
| 90 } | 92 } |
| 91 // An event is used to lock out updates since events are closed by the OS | 93 // An event is used to lock out updates since events are closed by the OS |
| 92 // if their process dies. So, updates can still happen if an O3D executable | 94 // if their process dies. So, updates can still happen if an O3D executable |
| 93 // crashes (as long as all instances of the running event are closed, either | 95 // crashes (as long as all instances of the running event are closed, either |
| 94 // properly or due to a crash). | 96 // properly or due to a crash). |
| 95 return CreateEvent(security_attributes, FALSE, FALSE, kRunningEventName); | 97 return CreateEvent(security_attributes, FALSE, FALSE, kRunningEventName); |
| 96 } | 98 } |
| 97 } // namespace update_lock | 99 } // namespace update_lock |
| 98 | 100 |
| 101 #endif // O3D_INTERNAL_PLUGIN |
| 102 |
| 99 #endif // O3D_PLUGIN_WIN_UPDATE_LOCK_H_ | 103 #endif // O3D_PLUGIN_WIN_UPDATE_LOCK_H_ |
| 100 | 104 |
| OLD | NEW |