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

Side by Side Diff: Source/core/dom/Microtask.cpp

Issue 219003002: [ABANDONED] Call Microtask::performCheckpoint for each worker task. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 30 matching lines...) Expand all
41 { 41 {
42 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 42 v8::Isolate* isolate = v8::Isolate::GetCurrent();
43 V8PerIsolateData* isolateData = V8PerIsolateData::from(isolate); 43 V8PerIsolateData* isolateData = V8PerIsolateData::from(isolate);
44 ASSERT(isolateData); 44 ASSERT(isolateData);
45 if (isolateData->recursionLevel() || isolateData->performingMicrotaskCheckpo int()) 45 if (isolateData->recursionLevel() || isolateData->performingMicrotaskCheckpo int())
46 return; 46 return;
47 isolateData->setPerformingMicrotaskCheckpoint(true); 47 isolateData->setPerformingMicrotaskCheckpoint(true);
48 48
49 v8::HandleScope handleScope(isolate); 49 v8::HandleScope handleScope(isolate);
50 v8::Local<v8::Context> context = isolateData->ensureDomInJSContext(); 50 v8::Local<v8::Context> context = isolateData->ensureDomInJSContext();
51 if (context.IsEmpty()) {
52 // The script execution has been terminated.
53 return;
54 }
51 v8::Context::Scope scope(context); 55 v8::Context::Scope scope(context);
52 v8::V8::RunMicrotasks(isolate); 56 v8::V8::RunMicrotasks(isolate);
53 57
54 isolateData->setPerformingMicrotaskCheckpoint(false); 58 isolateData->setPerformingMicrotaskCheckpoint(false);
55 } 59 }
56 60
57 COMPILE_ASSERT(sizeof(void*) == sizeof(MicrotaskCallback), VoidPtrAndFunctionPtr AreSameSize); 61 COMPILE_ASSERT(sizeof(void*) == sizeof(MicrotaskCallback), VoidPtrAndFunctionPtr AreSameSize);
58 62
59 static void microtaskFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 63 static void microtaskFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
60 { 64 {
(...skipping 10 matching lines...) Expand all
71 v8::HandleScope handleScope(isolate); 75 v8::HandleScope handleScope(isolate);
72 v8::Local<v8::Context> context = isolateData->ensureDomInJSContext(); 76 v8::Local<v8::Context> context = isolateData->ensureDomInJSContext();
73 v8::Context::Scope scope(context); 77 v8::Context::Scope scope(context);
74 v8::Local<v8::External> handler = 78 v8::Local<v8::External> handler =
75 v8::External::New(isolate, 79 v8::External::New(isolate,
76 reinterpret_cast<void*>(reinterpret_cast<intptr_t>(callback))); 80 reinterpret_cast<void*>(reinterpret_cast<intptr_t>(callback)));
77 v8::V8::EnqueueMicrotask(isolate, v8::Function::New(isolate, &microtaskFunct ionCallback, handler)); 81 v8::V8::EnqueueMicrotask(isolate, v8::Function::New(isolate, &microtaskFunct ionCallback, handler));
78 } 82 }
79 83
80 } // namespace WebCore 84 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698