Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/FileSystemJsObject.cpp

Issue 29367507: Issue #3595 - Add an actual scheduler; use joined threads for file system
Patch Set: Created Dec. 14, 2016, 5:38 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/FileSystemJsObject.cpp
===================================================================
--- a/src/FileSystemJsObject.cpp
+++ b/src/FileSystemJsObject.cpp
@@ -258,7 +258,7 @@
"Second argument to _fileSystem.read must be a function"));
const auto readTask = std::make_shared<ReadTask>(jsEngine, converted[1],
converted[0]->AsString());
- AdblockPlus::Scheduler::StartImmediatelyInSingleUseThread(AdblockPlus::MakeHeapFunction(readTask));
+ jsEngine->Schedule(AdblockPlus::MakeHeapFunction(readTask), AdblockPlus::ImmediateSingleUseThread);
return v8::Undefined();
}
@@ -276,7 +276,7 @@
"Third argument to _fileSystem.write must be a function"));
const auto writeTask = std::make_shared<WriteTask>(jsEngine, converted[2],
converted[0]->AsString(), converted[1]->AsString());
- AdblockPlus::Scheduler::StartImmediatelyInSingleUseThread(AdblockPlus::MakeHeapFunction(writeTask));
+ jsEngine->Schedule(AdblockPlus::MakeHeapFunction(writeTask), AdblockPlus::ImmediateSingleUseThread);
return v8::Undefined();
}
@@ -294,7 +294,7 @@
"Third argument to _fileSystem.move must be a function"));
const auto moveTask = std::make_shared<MoveTask>(jsEngine, converted[2],
converted[0]->AsString(), converted[1]->AsString());
- AdblockPlus::Scheduler::StartImmediatelyInSingleUseThread(AdblockPlus::MakeHeapFunction(moveTask));
+ jsEngine->Schedule(AdblockPlus::MakeHeapFunction(moveTask), AdblockPlus::ImmediateSingleUseThread);
return v8::Undefined();
}
@@ -312,7 +312,7 @@
"Second argument to _fileSystem.remove must be a function"));
const auto removeTask = std::make_shared<RemoveTask>(jsEngine, converted[1],
converted[0]->AsString());
- AdblockPlus::Scheduler::StartImmediatelyInSingleUseThread(AdblockPlus::MakeHeapFunction(removeTask));
+ jsEngine->Schedule(AdblockPlus::MakeHeapFunction(removeTask), AdblockPlus::ImmediateSingleUseThread);
return v8::Undefined();
}
@@ -330,7 +330,7 @@
"Second argument to _fileSystem.stat must be a function"));
const auto statTask = std::make_shared<StatTask>(jsEngine, converted[1],
converted[0]->AsString());
- AdblockPlus::Scheduler::StartImmediatelyInSingleUseThread(AdblockPlus::MakeHeapFunction(statTask));
+ jsEngine->Schedule(AdblockPlus::MakeHeapFunction(statTask), AdblockPlus::ImmediateSingleUseThread);
return v8::Undefined();
}

Powered by Google App Engine
This is Rietveld