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 — node/src/async_context_frame.cc at main · trentm/node Expand file tree/ Copy pathasync_context_frame.ccMore file actions 89 lines (73 loc) · 2.5 KB / Copy pathasync_context_frame.ccFile metadata and controls89 lines (73 loc) · 2.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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 #include "async_context_frame.h" // NOLINT(build/include_inline) #include "env-inl.h" #include "node_errors.h" #include "node_external_reference.h" #include "tracing/traced_value.h" #include "util-inl.h" #include "debug_utils-inl.h" #include "v8.h" using v8::Context; using v8::Isolate; using v8::Local; using v8::Object; using v8::String; using v8::Value; namespace node { namespace async_context_frame { // // Scope helper // Scope::Scope(Isolate* isolate, Local<Value> object) : isolate_(isolate) { auto prior = exchange(isolate, object); prior_.Reset(isolate, prior); } Scope::~Scope() { auto value = prior_.Get(isolate_); set(isolate_, value); } Local<Value> current(Isolate* isolate) { return isolate->GetContinuationPreservedEmbedderDataV2().As<Value>(); } void set(Isolate* isolate, Local<Value> value) { auto env = Environment::GetCurrent(isolate); if (!env->options()->async_context_frame) { return; } isolate->SetContinuationPreservedEmbedderDataV2(value); } // NOTE: It's generally recommended to use async_context_frame::Scope // but sometimes (such as enterWith) a direct exchange is needed. Local<Value> exchange(Isolate* isolate, Local<Value> value) { auto prior = current(isolate); set(isolate, value); return prior; } void CreatePerContextProperties(Local<Object> target, Local<Value> unused, Local<Context> context, void* priv) { Environment* env = Environment::GetCurrent(context); Local<String> getContinuationPreservedEmbedderData = FIXED_ONE_BYTE_STRING( env->isolate(), "getContinuationPreservedEmbedderData"); Local<String> setContinuationPreservedEmbedderData = FIXED_ONE_BYTE_STRING( env->isolate(), "setContinuationPreservedEmbedderData"); // Grab the intrinsics from the binding object and expose those to our // binding layer. Local<Object> binding = context->GetExtrasBindingObject(); target ->Set(context, getContinuationPreservedEmbedderData, binding->Get(context, getContinuationPreservedEmbedderData) .ToLocalChecked()) .Check(); target ->Set(context, setContinuationPreservedEmbedderData, binding->Get(context, setContinuationPreservedEmbedderData) .ToLocalChecked()) .Check(); } } // namespace async_context_frame } // namespace node NODE_BINDING_CONTEXT_AWARE_INTERNAL( async_context_frame, node::async_context_frame::CreatePerContextProperties) |
| You are visitor 01402792 — 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. |