OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 m_lastV8String = UnsafePersistent<v8::String>(wrapper); | 99 m_lastV8String = UnsafePersistent<v8::String>(wrapper); |
100 m_lastStringImpl = stringImpl; | 100 m_lastStringImpl = stringImpl; |
101 m_stringCache.set(stringImpl, m_lastV8String); | 101 m_stringCache.set(stringImpl, m_lastV8String); |
102 | 102 |
103 return newString; | 103 return newString; |
104 } | 104 } |
105 | 105 |
106 void StringCache::setWeakCallback(const v8::WeakCallbackData<v8::String, StringI
mpl>& data) | 106 void StringCache::setWeakCallback(const v8::WeakCallbackData<v8::String, StringI
mpl>& data) |
107 { | 107 { |
108 StringCache* stringCache = V8PerIsolateData::from(data.GetIsolate())->string
Cache(); | 108 StringCache* stringCache = V8PerIsolateData::from(data.GetIsolate())->string
Cache(); |
109 stringCache->m_lastStringImpl = 0; | 109 stringCache->m_lastStringImpl = nullptr; |
110 stringCache->m_lastV8String.clear(); | 110 stringCache->m_lastV8String.clear(); |
111 ASSERT(stringCache->m_stringCache.contains(data.GetParameter())); | 111 ASSERT(stringCache->m_stringCache.contains(data.GetParameter())); |
112 stringCache->m_stringCache.get(data.GetParameter()).dispose(); | 112 stringCache->m_stringCache.get(data.GetParameter()).dispose(); |
113 stringCache->m_stringCache.remove(data.GetParameter()); | 113 stringCache->m_stringCache.remove(data.GetParameter()); |
114 data.GetParameter()->deref(); | 114 data.GetParameter()->deref(); |
115 } | 115 } |
116 | 116 |
117 } // namespace WebCore | 117 } // namespace WebCore |
OLD | NEW |