| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 EXTENSIONS_RENDERER_GC_CALLBACK_H_ | 5 #ifndef EXTENSIONS_RENDERER_GC_CALLBACK_H_ |
| 6 #define EXTENSIONS_RENDERER_GC_CALLBACK_H_ | 6 #define EXTENSIONS_RENDERER_GC_CALLBACK_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/macros.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "v8/include/v8.h" | 14 #include "v8/include/v8.h" |
| 15 | 15 |
| 16 namespace extensions { | 16 namespace extensions { |
| 17 | 17 |
| 18 class ScriptContext; | 18 class ScriptContext; |
| 19 | 19 |
| 20 // Runs |callback| when v8 garbage collects |object|, or |fallback| if | 20 // Runs |callback| when v8 garbage collects |object|, or |fallback| if |
| 21 // |context| is invalidated first. Exactly one of |callback| or |fallback| will | 21 // |context| is invalidated first. Exactly one of |callback| or |fallback| will |
| 22 // be called, after which it deletes itself. | 22 // be called, after which it deletes itself. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 47 base::Closure fallback_; | 47 base::Closure fallback_; |
| 48 | 48 |
| 49 base::WeakPtrFactory<GCCallback> weak_ptr_factory_; | 49 base::WeakPtrFactory<GCCallback> weak_ptr_factory_; |
| 50 | 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(GCCallback); | 51 DISALLOW_COPY_AND_ASSIGN(GCCallback); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 } // namespace extensions | 54 } // namespace extensions |
| 55 | 55 |
| 56 #endif // EXTENSIONS_RENDERER_GC_CALLBACK_H_ | 56 #endif // EXTENSIONS_RENDERER_GC_CALLBACK_H_ |
| OLD | NEW |