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

Side by Side Diff: third_party/WebKit/Source/platform/bindings/V8ValueCache.h

Issue 2851563004: Add documentation for platform/bindings (Closed)
Patch Set: Created 3 years, 7 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
OLDNEW
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } 67 }
68 68
69 static void OnWeakCallback(const v8::WeakCallbackInfo<WeakCallbackDataType>&); 69 static void OnWeakCallback(const v8::WeakCallbackInfo<WeakCallbackDataType>&);
70 70
71 static void Dispose(v8::Isolate*, 71 static void Dispose(v8::Isolate*,
72 v8::Global<v8::String> value, 72 v8::Global<v8::String> value,
73 StringImpl* key); 73 StringImpl* key);
74 static void DisposeWeak(const v8::WeakCallbackInfo<WeakCallbackDataType>&); 74 static void DisposeWeak(const v8::WeakCallbackInfo<WeakCallbackDataType>&);
75 }; 75 };
76 76
77 // This class creates and caches v8::String objects. StringCache is held and can
jbroman 2017/04/28 19:07:03 nit: Maybe expand slightly to clarify that it cach
adithyas 2017/04/28 20:19:43 Ok updated, WDYT?
78 // be retrieved from V8PerIsolateData.
77 class PLATFORM_EXPORT StringCache { 79 class PLATFORM_EXPORT StringCache {
78 USING_FAST_MALLOC(StringCache); 80 USING_FAST_MALLOC(StringCache);
79 WTF_MAKE_NONCOPYABLE(StringCache); 81 WTF_MAKE_NONCOPYABLE(StringCache);
80 82
81 public: 83 public:
82 explicit StringCache(v8::Isolate* isolate) : string_cache_(isolate) {} 84 explicit StringCache(v8::Isolate* isolate) : string_cache_(isolate) {}
83 85
84 v8::Local<v8::String> V8ExternalString(v8::Isolate* isolate, 86 v8::Local<v8::String> V8ExternalString(v8::Isolate* isolate,
85 StringImpl* string_impl) { 87 StringImpl* string_impl) {
86 DCHECK(string_impl); 88 DCHECK(string_impl);
(...skipping 27 matching lines...) Expand all
114 116
115 // Note: RefPtr is a must as we cache by StringImpl* equality, not identity 117 // Note: RefPtr is a must as we cache by StringImpl* equality, not identity
116 // hence lastStringImpl might be not a key of the cache (in sense of identity) 118 // hence lastStringImpl might be not a key of the cache (in sense of identity)
117 // and hence it's not refed on addition. 119 // and hence it's not refed on addition.
118 RefPtr<StringImpl> last_string_impl_; 120 RefPtr<StringImpl> last_string_impl_;
119 }; 121 };
120 122
121 } // namespace blink 123 } // namespace blink
122 124
123 #endif // V8ValueCache_h 125 #endif // V8ValueCache_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698