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

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

Issue 1389383003: WIP: Introduce CompressibleString Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase onto crrev.com/1564773002 Created 4 years, 11 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 326
327 v8::MaybeLocal<v8::Script> V8ScriptRunner::compileScript(const ScriptSourceCode& source, v8::Isolate* isolate, AccessControlStatus accessControlStatus, V8CacheO ptions cacheOptions) 327 v8::MaybeLocal<v8::Script> V8ScriptRunner::compileScript(const ScriptSourceCode& source, v8::Isolate* isolate, AccessControlStatus accessControlStatus, V8CacheO ptions cacheOptions)
328 { 328 {
329 if (source.source().length() >= v8::String::kMaxLength) { 329 if (source.source().length() >= v8::String::kMaxLength) {
330 V8ThrowException::throwGeneralError(isolate, "Source file too large."); 330 V8ThrowException::throwGeneralError(isolate, "Source file too large.");
331 return v8::Local<v8::Script>(); 331 return v8::Local<v8::Script>();
332 } 332 }
333 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); 333 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);
334 } 334 }
335 335
336 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) 336 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)
337 { 337 {
338 if (code.length() >= v8::String::kMaxLength) { 338 if (code.length() >= v8::String::kMaxLength) {
339 V8ThrowException::throwGeneralError(isolate, "Source file too large."); 339 V8ThrowException::throwGeneralError(isolate, "Source file too large.");
340 return v8::Local<v8::Script>(); 340 return v8::Local<v8::Script>();
341 } 341 }
342 return compileScript(v8String(isolate, code), fileName, sourceMapUrl, textPo sition, isolate, nullptr, nullptr, cacheMetadataHandler, accessControlStatus, v8 CacheOptions); 342 return compileScript(v8String(isolate, code), fileName, sourceMapUrl, textPo sition, isolate, nullptr, nullptr, cacheMetadataHandler, accessControlStatus, v8 CacheOptions);
343 } 343 }
344 344
345 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, bool isInternalScript) 345 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, bool isInternalScript)
346 { 346 {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 { 493 {
494 return cacheTag(CacheTagParser, cacheHandler); 494 return cacheTag(CacheTagParser, cacheHandler);
495 } 495 }
496 496
497 unsigned V8ScriptRunner::tagForCodeCache(CachedMetadataHandler* cacheHandler) 497 unsigned V8ScriptRunner::tagForCodeCache(CachedMetadataHandler* cacheHandler)
498 { 498 {
499 return cacheTag(CacheTagCode, cacheHandler); 499 return cacheTag(CacheTagCode, cacheHandler);
500 } 500 }
501 501
502 } // namespace blink 502 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698