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

Unified Diff: Source/bindings/dart/DartController.cpp

Issue 26397003: Disable spawnFunction from dom enabled isolates (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Address comments Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/dart/DartController.cpp
diff --git a/Source/bindings/dart/DartController.cpp b/Source/bindings/dart/DartController.cpp
index 116e9890bfe80de7c3f1f805ea3aaf50407fe161..7a024139b73b78377f55ba480a17e704e28f2baf 100644
--- a/Source/bindings/dart/DartController.cpp
+++ b/Source/bindings/dart/DartController.cpp
@@ -350,10 +350,11 @@ private:
Dart_Isolate DartController::createPureIsolateCallback(const char* scriptURL, const char* entryPoint, void* data, char** errorMsg)
{
- bool needAsyncLoader = false;
+ bool isSpawnUri = false;
{
DartApiScope apiScope;
+ // FIXME: http://dartbug.com/13920
// Hacky way to find out if it's spawnFunction or spawnUri.
Dart_Handle parentIsolateRootLibrary = Dart_RootLibrary();
if (Dart_IsError(parentIsolateRootLibrary)) {
@@ -372,11 +373,17 @@ Dart_Isolate DartController::createPureIsolateCallback(const char* scriptURL, co
return 0;
}
- needAsyncLoader = strcmp(scriptURL, parentIsolateURL);
+ isSpawnUri = strcmp(scriptURL, parentIsolateURL);
}
DartDOMData* parentDOMData = static_cast<DartDOMData*>(data);
ScriptExecutionContext* context = parentDOMData->scriptExecutionContext();
+
+ if (parentDOMData->isDOMEnabled() && !isSpawnUri) {
+ // spawnFunction is not allowed from a DOM enabled isolate
+ DartUtilities::reportProblem(context, "spawnFunction is not supported from a dom-enabled isolate. Please use spawnUri instead.");
ricow1 2013/10/11 11:08:37 Why don't we throw an exception here? This is mess
+ }
+
ASSERT(context->isDocument());
Document* document = static_cast<Document*>(context);
@@ -384,7 +391,7 @@ Dart_Isolate DartController::createPureIsolateCallback(const char* scriptURL, co
if (!isolate)
return 0;
- if (needAsyncLoader) {
+ if (isSpawnUri) {
// We need to request the sources asynchronously.
RefPtr<DartSpawnLoadCallback> callback = adoptRef(new DartSpawnLoadCallback(isolate, scriptURL, document));
// A DartAsyncLoader will delete itself once all resources are fetched.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698