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

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

Issue 2124183003: Remove constructor from remaining functions that aren't constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 v8::Local<v8::Value> throwStackOverflowExceptionIfNeeded(v8::Isolate* isolate) 117 v8::Local<v8::Value> throwStackOverflowExceptionIfNeeded(v8::Isolate* isolate)
118 { 118 {
119 if (V8PerIsolateData::from(isolate)->isHandlingRecursionLevelError()) { 119 if (V8PerIsolateData::from(isolate)->isHandlingRecursionLevelError()) {
120 // If we are already handling a recursion level error, we should 120 // If we are already handling a recursion level error, we should
121 // not invoke v8::Function::Call. 121 // not invoke v8::Function::Call.
122 return v8::Undefined(isolate); 122 return v8::Undefined(isolate);
123 } 123 }
124 v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kDoNotRunM icrotasks); 124 v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kDoNotRunM icrotasks);
125 V8PerIsolateData::from(isolate)->setIsHandlingRecursionLevelError(true); 125 V8PerIsolateData::from(isolate)->setIsHandlingRecursionLevelError(true);
126 v8::Local<v8::Value> result = v8::Function::New(isolate, throwStackOverflowE xception)->Call(v8::Undefined(isolate), 0, 0); 126 v8::Local<v8::Value> result = v8::Function::New(isolate->GetCurrentContext() , throwStackOverflowException, v8::Local<v8::Value>(), 0, v8::ConstructorBehavio r::kThrow).ToLocalChecked()->Call(v8::Undefined(isolate), 0, 0);
haraken 2016/07/07 11:14:09 Yeah, in reality we want to just crash when V8 API
jochen (gone - plz use gerrit) 2016/07/07 11:25:11 well, I'm just changing one thing in this CL, and
127 V8PerIsolateData::from(isolate)->setIsHandlingRecursionLevelError(false); 127 V8PerIsolateData::from(isolate)->setIsHandlingRecursionLevelError(false);
128 return result; 128 return result;
129 } 129 }
130 130
131 // Compile a script without any caching or compile options. 131 // Compile a script without any caching or compile options.
132 v8::MaybeLocal<v8::Script> compileWithoutOptions(V8CompileHistogram::Cacheabilit y cacheability, v8::Isolate* isolate, v8::Local<v8::String> code, v8::ScriptOrig in origin) 132 v8::MaybeLocal<v8::Script> compileWithoutOptions(V8CompileHistogram::Cacheabilit y cacheability, v8::Isolate* isolate, v8::Local<v8::String> code, v8::ScriptOrig in origin)
133 { 133 {
134 V8CompileHistogram histogramScope(cacheability); 134 V8CompileHistogram histogramScope(cacheability);
135 v8::ScriptCompiler::Source source(code, origin); 135 v8::ScriptCompiler::Source source(code, origin);
136 return v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &source, v8 ::ScriptCompiler::kNoCompileOptions); 136 return v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &source, v8 ::ScriptCompiler::kNoCompileOptions);
(...skipping 439 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