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

Side by Side Diff: Source/bindings/dart/DartStringCache.h

Issue 185643003: Changes to use the modified dart API for (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/1750/
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/dart/DartEventListener.cpp ('k') | Source/bindings/dart/DartStringCache.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012, Google Inc. 1 // Copyright 2012, Google Inc.
2 // All rights reserved. 2 // 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 return getSlow(stringImpl, autoDartScope); 51 return getSlow(stringImpl, autoDartScope);
52 } 52 }
53 53
54 void clearWeakHandles(); 54 void clearWeakHandles();
55 55
56 // FIXME: implement clearing on GC. 56 // FIXME: implement clearing on GC.
57 57
58 private: 58 private:
59 Dart_WeakPersistentHandle getSlow(StringImpl*, bool autoDartScope); 59 Dart_WeakPersistentHandle getSlow(StringImpl*, bool autoDartScope);
60 static void handleFinalizer(Dart_WeakPersistentHandle, void* peer); 60 static void handleFinalizer(Dart_Isolate, Dart_WeakPersistentHandle, void* p eer);
61 61
62 typedef HashMap<StringImpl*, Dart_WeakPersistentHandle> StringCache; 62 typedef HashMap<StringImpl*, Dart_WeakPersistentHandle> StringCache;
63 StringCache m_stringCache; 63 StringCache m_stringCache;
64 Dart_WeakPersistentHandle m_lastDartString; 64 Dart_WeakPersistentHandle m_lastDartString;
65 // Note: RefPtr is a must as we cache by StringImpl* equality, not identity 65 // Note: RefPtr is a must as we cache by StringImpl* equality, not identity
66 // hence lastStringImpl might be not a key of the cache (in sense of identit y) 66 // hence lastStringImpl might be not a key of the cache (in sense of identit y)
67 // and hence it's not refed on addition. 67 // and hence it's not refed on addition.
68 RefPtr<StringImpl> m_lastStringImpl; 68 RefPtr<StringImpl> m_lastStringImpl;
69 }; 69 };
70 70
71 } 71 }
72 72
73 #endif 73 #endif
OLDNEW
« no previous file with comments | « Source/bindings/dart/DartEventListener.cpp ('k') | Source/bindings/dart/DartStringCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698