GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — ios/NativeScript/runtime/PromiseProxy.cpp at main · NativeScript/ios Expand file tree/ Copy pathPromiseProxy.cppMore file actions 46 lines (36 loc) · 1.5 KB / Copy pathPromiseProxy.cppFile metadata and controls46 lines (36 loc) · 1.5 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 #include "PromiseProxy.h" #include <CoreFoundation/CoreFoundation.h> #include "BuiltinLoader.h" #include "Helpers.h" #include "Runtime.h" using namespace v8; namespace tns { // Reports whether the calling thread runs the isolate's runtime loop. That loop // is where timers fire and is always being pumped, so a promise resolution is // marshaled back to its creating thread only when that thread is the runtime // loop; a promise created elsewhere settles on whichever thread resolves it. static void IsRuntimeRunloopCallback(const FunctionCallbackInfo<Value>& args) { Runtime* runtime = Runtime::GetRuntime(args.GetIsolate()); bool isRuntimeLoop = runtime != nullptr && CFRunLoopGetCurrent() == runtime->RuntimeLoop(); args.GetReturnValue().Set(isRuntimeLoop); } void PromiseProxy::Init(v8::Local<v8::Context> context) { Isolate* isolate = v8::Isolate::GetCurrent(); Local<v8::Function> isRuntimeRunloop; bool success = v8::Function::New(context, IsRuntimeRunloopCallback) .ToLocal(&isRuntimeRunloop); tns::Assert(success, isolate); Local<Object> binding = Object::New(isolate); success = binding ->Set(context, tns::ToV8String(isolate, "isRuntimeRunloop"), isRuntimeRunloop) .FromMaybe(false); tns::Assert(success, isolate); Local<Value> result; success = BuiltinLoader::RunBuiltin(context, BuiltinId::kPromiseProxy, binding) .ToLocal(&result); tns::Assert(success, isolate); } } // namespace tns |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |