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

Unified Diff: samples/process.cc

Issue 1209403005: Let the second pass phantom callbacks run in a separate task on the foreground thread. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Run second pass callbacks synchronously when GC is forced. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8-util.h ('k') | samples/shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/process.cc
diff --git a/samples/process.cc b/samples/process.cc
index a62950a76ab4b7885771cf4f56bcd6693410f898..c18fb414283c02620913c96bf833b0b750a64a55 100644
--- a/samples/process.cc
+++ b/samples/process.cc
@@ -666,11 +666,13 @@ StringHttpRequest kSampleRequests[kSampleSize] = {
};
-bool ProcessEntries(HttpRequestProcessor* processor, int count,
- StringHttpRequest* reqs) {
+bool ProcessEntries(v8::Platform* platform, HttpRequestProcessor* processor,
+ int count, StringHttpRequest* reqs) {
for (int i = 0; i < count; i++) {
- if (!processor->Process(&reqs[i]))
- return false;
+ bool result = processor->Process(&reqs[i]);
+ while (v8::platform::PumpMessageLoop(platform, Isolate::GetCurrent()))
+ continue;
+ if (!result) return false;
}
return true;
}
@@ -713,7 +715,7 @@ int main(int argc, char* argv[]) {
fprintf(stderr, "Error initializing processor.\n");
return 1;
}
- if (!ProcessEntries(&processor, kSampleSize, kSampleRequests))
+ if (!ProcessEntries(platform, &processor, kSampleSize, kSampleRequests))
return 1;
PrintMap(&output);
}
« no previous file with comments | « include/v8-util.h ('k') | samples/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698