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

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

Issue 2227933002: Revert CompressibleString (and its UMA) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address on Ilya's review Created 4 years, 4 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 344
345 v8::MaybeLocal<v8::Script> V8ScriptRunner::compileScript(const ScriptSourceCode& source, v8::Isolate* isolate, AccessControlStatus accessControlStatus, V8CacheO ptions cacheOptions) 345 v8::MaybeLocal<v8::Script> V8ScriptRunner::compileScript(const ScriptSourceCode& source, v8::Isolate* isolate, AccessControlStatus accessControlStatus, V8CacheO ptions cacheOptions)
346 { 346 {
347 if (source.source().length() >= v8::String::kMaxLength) { 347 if (source.source().length() >= v8::String::kMaxLength) {
348 V8ThrowException::throwGeneralError(isolate, "Source file too large."); 348 V8ThrowException::throwGeneralError(isolate, "Source file too large.");
349 return v8::Local<v8::Script>(); 349 return v8::Local<v8::Script>();
350 } 350 }
351 return compileScript(v8String(isolate, source.source()), source.url(), sourc e.sourceMapUrl(), source.startPosition(), isolate, source.resource(), source.str eamer(), source.resource() ? source.resource()->cacheHandler() : nullptr, access ControlStatus, cacheOptions); 351 return compileScript(v8String(isolate, source.source()), source.url(), sourc e.sourceMapUrl(), source.startPosition(), isolate, source.resource(), source.str eamer(), source.resource() ? source.resource()->cacheHandler() : nullptr, access ControlStatus, cacheOptions);
352 } 352 }
353 353
354 v8::MaybeLocal<v8::Script> V8ScriptRunner::compileScript(const CompressibleStrin g& code, const String& fileName, const String& sourceMapUrl, const TextPosition& textPosition, v8::Isolate* isolate, CachedMetadataHandler* cacheMetadataHandler , AccessControlStatus accessControlStatus, V8CacheOptions v8CacheOptions) 354 v8::MaybeLocal<v8::Script> V8ScriptRunner::compileScript(const String& code, con st String& fileName, const String& sourceMapUrl, const TextPosition& textPositio n, v8::Isolate* isolate, CachedMetadataHandler* cacheMetadataHandler, AccessCont rolStatus accessControlStatus, V8CacheOptions v8CacheOptions)
355 { 355 {
356 if (code.length() >= v8::String::kMaxLength) { 356 if (code.length() >= v8::String::kMaxLength) {
357 V8ThrowException::throwGeneralError(isolate, "Source file too large."); 357 V8ThrowException::throwGeneralError(isolate, "Source file too large.");
358 return v8::Local<v8::Script>(); 358 return v8::Local<v8::Script>();
359 } 359 }
360 return compileScript(v8String(isolate, code), fileName, sourceMapUrl, textPo sition, isolate, nullptr, nullptr, cacheMetadataHandler, accessControlStatus, v8 CacheOptions); 360 return compileScript(v8String(isolate, code), fileName, sourceMapUrl, textPo sition, isolate, nullptr, nullptr, cacheMetadataHandler, accessControlStatus, v8 CacheOptions);
361 } 361 }
362 362
363 v8::MaybeLocal<v8::Script> V8ScriptRunner::compileScript(v8::Local<v8::String> c ode, const String& fileName, const String& sourceMapUrl, const TextPosition& scr iptStartPosition, v8::Isolate* isolate, ScriptResource* resource, ScriptStreamer * streamer, CachedMetadataHandler* cacheHandler, AccessControlStatus accessContr olStatus, V8CacheOptions cacheOptions) 363 v8::MaybeLocal<v8::Script> V8ScriptRunner::compileScript(v8::Local<v8::String> c ode, const String& fileName, const String& sourceMapUrl, const TextPosition& scr iptStartPosition, v8::Isolate* isolate, ScriptResource* resource, ScriptStreamer * streamer, CachedMetadataHandler* cacheHandler, AccessControlStatus accessContr olStatus, V8CacheOptions cacheOptions)
364 { 364 {
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 // Store a timestamp to the cache as hint. 576 // Store a timestamp to the cache as hint.
577 void V8ScriptRunner::setCacheTimeStamp(CachedMetadataHandler* cacheHandler) 577 void V8ScriptRunner::setCacheTimeStamp(CachedMetadataHandler* cacheHandler)
578 { 578 {
579 double now = WTF::currentTime(); 579 double now = WTF::currentTime();
580 unsigned tag = cacheTag(CacheTagTimeStamp, cacheHandler); 580 unsigned tag = cacheTag(CacheTagTimeStamp, cacheHandler);
581 cacheHandler->clearCachedMetadata(CachedMetadataHandler::CacheLocally); 581 cacheHandler->clearCachedMetadata(CachedMetadataHandler::CacheLocally);
582 cacheHandler->setCachedMetadata(tag, reinterpret_cast<char*>(&now), sizeof(n ow), CachedMetadataHandler::SendToPlatform); 582 cacheHandler->setCachedMetadata(tag, reinterpret_cast<char*>(&now), sizeof(n ow), CachedMetadataHandler::SendToPlatform);
583 } 583 }
584 584
585 } // namespace blink 585 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698