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

Unified Diff: net/proxy/proxy_resolver_v8.cc

Issue 2833051: Re-enable use of external string resources in ProxyResolverV8.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_resolver_v8.cc
===================================================================
--- net/proxy/proxy_resolver_v8.cc (revision 51464)
+++ net/proxy/proxy_resolver_v8.cc (working copy)
@@ -141,8 +141,7 @@
// For small strings it is better to just make a copy, whereas for large
// strings there are savings by sharing the storage. This number identifies
// the cutoff length for when to start wrapping rather than creating copies.
-// TODO(eroman): This is disabled because of crbug.com/48145.
-const size_t kMaxStringBytesForCopy = static_cast<size_t>(-1);
+const size_t kMaxStringBytesForCopy = 256;
// Converts a V8 String to a UTF16 string16.
string16 V8StringToUTF16(v8::Handle<v8::String> s) {
@@ -246,6 +245,12 @@
v8_this_.Dispose();
v8_context_.Dispose();
+
+ // Run the V8 garbage collector. We do this to be sure the
+ // ExternalStringResource objects we allocated get properly disposed.
+ // Otherwise when running the unit-tests they may get leaked.
+ // See crbug.com/48145.
+ PurgeMemory();
}
int ResolveProxy(const GURL& query_url, ProxyInfo* results) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698