Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: Source/bindings/v8/ScriptWrappable.h

Issue 40433002: Make wrapperTypeInfo static member const in bindings classes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/bindings/v8/NPV8Object.cpp ('k') | Source/bindings/v8/V8DOMConfiguration.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 // If the bottom bit it set, then this contains a pointer to a wrapper obj ect in the remainging bits. 187 // If the bottom bit it set, then this contains a pointer to a wrapper obj ect in the remainging bits.
188 // If the bottom bit is clear, then this contains a pointer to the wrapper type info in the remaining bits. 188 // If the bottom bit is clear, then this contains a pointer to the wrapper type info in the remaining bits.
189 uintptr_t m_wrapperOrTypeInfo; 189 uintptr_t m_wrapperOrTypeInfo;
190 190
191 static void makeWeakCallback(v8::Isolate* isolate, v8::Persistent<v8::Object >* wrapper, ScriptWrappable* key) 191 static void makeWeakCallback(v8::Isolate* isolate, v8::Persistent<v8::Object >* wrapper, ScriptWrappable* key)
192 { 192 {
193 ASSERT(*(key->unsafePersistent().persistent()) == *wrapper); 193 ASSERT(*(key->unsafePersistent().persistent()) == *wrapper);
194 194
195 // Note: |object| might not be equal to |key|, e.g., if ScriptWrappable isn't a left-most base class. 195 // Note: |object| might not be equal to |key|, e.g., if ScriptWrappable isn't a left-most base class.
196 void* object = toNative(*wrapper); 196 void* object = toNative(*wrapper);
197 WrapperTypeInfo* info = toWrapperTypeInfo(*wrapper); 197 const WrapperTypeInfo* info = toWrapperTypeInfo(*wrapper);
198 ASSERT(info->derefObjectFunction); 198 ASSERT(info->derefObjectFunction);
199 199
200 key->disposeWrapper(wrapper, info); 200 key->disposeWrapper(wrapper, info);
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
OLDNEW
« no previous file with comments | « Source/bindings/v8/NPV8Object.cpp ('k') | Source/bindings/v8/V8DOMConfiguration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698