Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 143 return ScriptWrappable::getUnsafeWrapperFromObject(object).setReturnValu e(returnValue); | 143 return ScriptWrappable::getUnsafeWrapperFromObject(object).setReturnValu e(returnValue); |
| 144 } | 144 } |
| 145 | 145 |
| 146 protected: | 146 protected: |
| 147 ~ScriptWrappable() | 147 ~ScriptWrappable() |
| 148 { | 148 { |
| 149 ASSERT(m_wrapperOrTypeInfo); // Assert initialization via init() even i f not subsequently wrapped. | 149 ASSERT(m_wrapperOrTypeInfo); // Assert initialization via init() even i f not subsequently wrapped. |
| 150 m_wrapperOrTypeInfo = 0; // Break UAF attempts to wrap. | 150 m_wrapperOrTypeInfo = 0; // Break UAF attempts to wrap. |
| 151 } | 151 } |
| 152 | 152 |
| 153 private: | 153 public://private: |
|
haraken
2013/10/10 06:08:32
Fix this.
kouhei (in TOK)
2013/10/10 06:20:02
Done.
| |
| 154 // For calling unsafePersistent and getWrapperFromObject. | 154 // For calling unsafePersistent and getWrapperFromObject. |
| 155 friend class MinorGCWrapperVisitor; | 155 friend class MinorGCWrapperVisitor; |
| 156 friend class DOMDataStore; | 156 friend class DOMDataStore; |
| 157 | 157 |
| 158 UnsafePersistent<v8::Object> unsafePersistent() const | 158 UnsafePersistent<v8::Object> unsafePersistent() const |
| 159 { | 159 { |
| 160 v8::Object* object = containsWrapper() ? reinterpret_cast<v8::Object*>(m _wrapperOrTypeInfo & ~1) : 0; | 160 v8::Object* object = containsWrapper() ? reinterpret_cast<v8::Object*>(m _wrapperOrTypeInfo & ~1) : 0; |
| 161 return UnsafePersistent<v8::Object>(object); | 161 return UnsafePersistent<v8::Object>(object); |
| 162 } | 162 } |
| 163 | 163 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 201 // FIXME: I noticed that 50%~ of minor GC cycle times can be consumed | 201 // FIXME: I noticed that 50%~ of minor GC cycle times can be consumed |
| 202 // inside key->deref(), which causes Node destructions. We should | 202 // inside key->deref(), which causes Node destructions. We should |
| 203 // make Node destructions incremental. | 203 // make Node destructions incremental. |
| 204 info->derefObject(object); | 204 info->derefObject(object); |
| 205 } | 205 } |
| 206 }; | 206 }; |
| 207 | 207 |
| 208 } // namespace WebCore | 208 } // namespace WebCore |
| 209 | 209 |
| 210 #endif // ScriptWrappable_h | 210 #endif // ScriptWrappable_h |
| OLD | NEW |