| OLD | NEW |
| 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 #ifndef UI_BASE_GTK_G_OBJECT_DESTRUCTOR_FILO_H_ | 5 #ifndef UI_BASE_GTK_G_OBJECT_DESTRUCTOR_FILO_H_ |
| 6 #define UI_BASE_GTK_G_OBJECT_DESTRUCTOR_FILO_H_ | 6 #define UI_BASE_GTK_G_OBJECT_DESTRUCTOR_FILO_H_ |
| 7 | 7 |
| 8 #include <glib.h> | 8 #include <glib.h> |
| 9 #include <list> |
| 9 #include <map> | 10 #include <map> |
| 10 #include <list> | |
| 11 | 11 |
| 12 #include "base/memory/singleton.h" | 12 #include "base/basictypes.h" |
| 13 #include "ui/base/ui_export.h" | 13 #include "ui/base/ui_export.h" |
| 14 | 14 |
| 15 template <typename T> struct DefaultSingletonTraits; |
| 16 |
| 15 typedef struct _GObject GObject; | 17 typedef struct _GObject GObject; |
| 16 | 18 |
| 17 namespace ui { | 19 namespace ui { |
| 18 | 20 |
| 19 // This class hooks calls to g_object_weak_ref()/unref() and executes them in | 21 // This class hooks calls to g_object_weak_ref()/unref() and executes them in |
| 20 // FILO order. This is important if there are several hooks to the single object | 22 // FILO order. This is important if there are several hooks to the single object |
| 21 // (set up at different levels of class hierarchy) and the lowest hook (set up | 23 // (set up at different levels of class hierarchy) and the lowest hook (set up |
| 22 // first) is deleting self - it must be called last (among hooks for the given | 24 // first) is deleting self - it must be called last (among hooks for the given |
| 23 // object). Unfortunately Glib does not provide this guarantee. | 25 // object). Unfortunately Glib does not provide this guarantee. |
| 24 // | 26 // |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 } | 82 } |
| 81 | 83 |
| 82 HandlerMap handler_map_; | 84 HandlerMap handler_map_; |
| 83 | 85 |
| 84 DISALLOW_COPY_AND_ASSIGN(GObjectDestructorFILO); | 86 DISALLOW_COPY_AND_ASSIGN(GObjectDestructorFILO); |
| 85 }; | 87 }; |
| 86 | 88 |
| 87 } // namespace ui | 89 } // namespace ui |
| 88 | 90 |
| 89 #endif // UI_BASE_GTK_G_OBJECT_DESTRUCTOR_FILO_H_ | 91 #endif // UI_BASE_GTK_G_OBJECT_DESTRUCTOR_FILO_H_ |
| OLD | NEW |