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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptController.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: add comments in render_process_messages.h 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) 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2009 Apple Inc. All rights reserved.
4 * Copyright (C) 2014 Opera Software ASA. All rights reserved. 4 * Copyright (C) 2014 Opera Software ASA. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are 7 * modification, are permitted provided that the following conditions are
8 * met: 8 * met:
9 * 9 *
10 * * Redistributions of source code must retain the above copyright 10 * * Redistributions of source code must retain the above copyright
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 v8::Local<v8::Value> ScriptController::executeScriptAndReturnValue(v8::Local<v8: :Context> context, const ScriptSourceCode& source, AccessControlStatus accessCon trolStatus, double* compilationFinishTime) 124 v8::Local<v8::Value> ScriptController::executeScriptAndReturnValue(v8::Local<v8: :Context> context, const ScriptSourceCode& source, AccessControlStatus accessCon trolStatus, double* compilationFinishTime)
125 { 125 {
126 TRACE_EVENT1("devtools.timeline", "EvaluateScript", "data", InspectorEvaluat eScriptEvent::data(frame(), source.url().getString(), source.startPosition())); 126 TRACE_EVENT1("devtools.timeline", "EvaluateScript", "data", InspectorEvaluat eScriptEvent::data(frame(), source.url().getString(), source.startPosition()));
127 InspectorInstrumentation::NativeBreakpoint nativeBreakpoint(frame()->documen t(), "scriptFirstStatement", false); 127 InspectorInstrumentation::NativeBreakpoint nativeBreakpoint(frame()->documen t(), "scriptFirstStatement", false);
128 128
129 v8::Local<v8::Value> result; 129 v8::Local<v8::Value> result;
130 { 130 {
131 V8CacheOptions v8CacheOptions(V8CacheOptionsDefault); 131 V8CacheOptions v8CacheOptions(V8CacheOptionsDefault);
132 if (frame()->settings()) 132 if (frame()->settings())
133 v8CacheOptions = frame()->settings()->v8CacheOptions(); 133 v8CacheOptions = frame()->settings()->v8CacheOptions();
134 if (source.resource() && !source.resource()->response().cacheStorageCach eName().isNull()) {
135 switch (frame()->settings()->v8CacheStrategiesForCacheStorage()) {
136 case V8CacheStrategiesForCacheStorage::Default:
137 case V8CacheStrategiesForCacheStorage::None:
138 v8CacheOptions = V8CacheOptionsNone;
139 break;
140 case V8CacheStrategiesForCacheStorage::Normal:
141 v8CacheOptions = V8CacheOptionsCode;
142 break;
143 case V8CacheStrategiesForCacheStorage::Aggressive:
144 v8CacheOptions = V8CacheOptionsAlways;
145 break;
146 }
147 }
134 148
135 // Isolate exceptions that occur when compiling and executing 149 // Isolate exceptions that occur when compiling and executing
136 // the code. These exceptions should not interfere with 150 // the code. These exceptions should not interfere with
137 // javascript code we might evaluate from C++ when returning 151 // javascript code we might evaluate from C++ when returning
138 // from here. 152 // from here.
139 v8::TryCatch tryCatch(isolate()); 153 v8::TryCatch tryCatch(isolate());
140 tryCatch.SetVerbose(true); 154 tryCatch.SetVerbose(true);
141 155
142 v8::Local<v8::Script> script; 156 v8::Local<v8::Script> script;
143 if (!v8Call(V8ScriptRunner::compileScript(source, isolate(), accessContr olStatus, v8CacheOptions), script, tryCatch)) 157 if (!v8Call(V8ScriptRunner::compileScript(source, isolate(), accessContr olStatus, v8CacheOptions), script, tryCatch))
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 for (size_t i = 0; i < resultArray->Length(); ++i) { 443 for (size_t i = 0; i < resultArray->Length(); ++i) {
430 v8::Local<v8::Value> value; 444 v8::Local<v8::Value> value;
431 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) 445 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value))
432 return; 446 return;
433 results->append(value); 447 results->append(value);
434 } 448 }
435 } 449 }
436 } 450 }
437 451
438 } // namespace blink 452 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698