OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 V8_UTILITY_H__ | 5 #ifndef V8_UTILITY_H__ |
6 #define V8_UTILITY_H__ | 6 #define V8_UTILITY_H__ |
7 | 7 |
| 8 #include "V8Utilities.h" |
| 9 |
| 10 // To break a cycle dependency during upstreaming this block of code, |
| 11 // ifdefing it out based on this #define. |
| 12 // |
| 13 // TODO(ajwong): After https://bugs.webkit.org/show_bug.cgi?id=25595 |
| 14 // lands and is rolled down into chromium, migrate all headaers to use |
| 15 // the code in V8Utilities.h directly, and then, remove this code. |
| 16 #ifndef V8UTILITIES_DEFINED |
8 namespace WebCore { | 17 namespace WebCore { |
9 | 18 |
10 class AllowAllocation { | 19 class AllowAllocation { |
11 public: | 20 public: |
12 inline AllowAllocation() { | 21 inline AllowAllocation() { |
13 m_prev = m_current; | 22 m_prev = m_current; |
14 m_current = true; | 23 m_current = true; |
15 } | 24 } |
16 inline ~AllowAllocation() { | 25 inline ~AllowAllocation() { |
17 m_current = m_prev; | 26 m_current = m_prev; |
(...skipping 29 matching lines...) Expand all Loading... |
47 } | 56 } |
48 | 57 |
49 v8::Local<v8::Object> SafeAllocation::NewInstance( | 58 v8::Local<v8::Object> SafeAllocation::NewInstance( |
50 v8::Handle<v8::Function> fun, int argc, v8::Handle<v8::Value> argv[]) { | 59 v8::Handle<v8::Function> fun, int argc, v8::Handle<v8::Value> argv[]) { |
51 if (fun.IsEmpty()) return v8::Local<v8::Object>(); | 60 if (fun.IsEmpty()) return v8::Local<v8::Object>(); |
52 AllowAllocation allow; | 61 AllowAllocation allow; |
53 return fun->NewInstance(argc, argv); | 62 return fun->NewInstance(argc, argv); |
54 } | 63 } |
55 | 64 |
56 } // namespace WebCore | 65 } // namespace WebCore |
| 66 #endif // V8UTILITIES_DEFINED |
57 | 67 |
58 #endif // V8_UTILITY_H__ | 68 #endif // V8_UTILITY_H__ |
OLD | NEW |