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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp

Issue 1915833002: Introduce Platform::cacheMetadataInCacheStorage() to store V8 code cache in CacheStorage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 break; 295 break;
296 296
297 case V8CacheOptionsDefault: 297 case V8CacheOptionsDefault:
298 case V8CacheOptionsCode: { 298 case V8CacheOptionsCode: {
299 // Use code caching for recently seen resources. 299 // Use code caching for recently seen resources.
300 // Use compression depending on the cache option. 300 // Use compression depending on the cache option.
301 unsigned codeCacheTag = cacheTag(CacheTagCode, cacheHandler); 301 unsigned codeCacheTag = cacheTag(CacheTagCode, cacheHandler);
302 CachedMetadata* codeCache = cacheHandler->cachedMetadata(codeCacheTag); 302 CachedMetadata* codeCache = cacheHandler->cachedMetadata(codeCacheTag);
303 if (codeCache) 303 if (codeCache)
304 return bind(compileAndConsumeCache, cacheHandler, codeCacheTag, v8:: ScriptCompiler::kConsumeCodeCache); 304 return bind(compileAndConsumeCache, cacheHandler, codeCacheTag, v8:: ScriptCompiler::kConsumeCodeCache);
305 if (!isResourceHotForCaching(cacheHandler, hotHours)) { 305 if (!cacheHandler->shouldAggressivelyCache() && !isResourceHotForCaching (cacheHandler, hotHours)) {
306 V8ScriptRunner::setCacheTimeStamp(cacheHandler); 306 V8ScriptRunner::setCacheTimeStamp(cacheHandler);
307 return bind(compileWithoutOptions, V8CompileHistogram::Cacheable); 307 return bind(compileWithoutOptions, V8CompileHistogram::Cacheable);
308 } 308 }
309 return bind(compileAndProduceCache, cacheHandler, codeCacheTag, v8::Scri ptCompiler::kProduceCodeCache, CachedMetadataHandler::SendToPlatform); 309 return bind(compileAndProduceCache, cacheHandler, codeCacheTag, v8::Scri ptCompiler::kProduceCodeCache, CachedMetadataHandler::SendToPlatform);
310 break; 310 break;
311 } 311 }
312 312
313 case V8CacheOptionsNone: 313 case V8CacheOptionsNone:
314 // Shouldn't happen, as this is handled above. 314 // Shouldn't happen, as this is handled above.
315 // Case is here so that compiler can check all cases are handled. 315 // Case is here so that compiler can check all cases are handled.
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 // Store a timestamp to the cache as hint. 523 // Store a timestamp to the cache as hint.
524 void V8ScriptRunner::setCacheTimeStamp(CachedMetadataHandler* cacheHandler) 524 void V8ScriptRunner::setCacheTimeStamp(CachedMetadataHandler* cacheHandler)
525 { 525 {
526 double now = WTF::currentTime(); 526 double now = WTF::currentTime();
527 unsigned tag = cacheTag(CacheTagTimeStamp, cacheHandler); 527 unsigned tag = cacheTag(CacheTagTimeStamp, cacheHandler);
528 cacheHandler->clearCachedMetadata(CachedMetadataHandler::CacheLocally); 528 cacheHandler->clearCachedMetadata(CachedMetadataHandler::CacheLocally);
529 cacheHandler->setCachedMetadata(tag, reinterpret_cast<char*>(&now), sizeof(n ow), CachedMetadataHandler::SendToPlatform); 529 cacheHandler->setCachedMetadata(tag, reinterpret_cast<char*>(&now), sizeof(n ow), CachedMetadataHandler::SendToPlatform);
530 } 530 }
531 531
532 } // namespace blink 532 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698