💄 get_uv_env() => uv_env().

This commit is contained in:
Cheng Zhao 2014-01-10 16:29:38 +08:00
parent a1a091d805
commit 3747048218
3 changed files with 4 additions and 4 deletions

View file

@ -199,7 +199,7 @@ void NodeBindings::UvRunOnce() {
// Enter node context while dealing with uv events, by default the global
// env would be used unless user specified another one (this happens for
// renderer process, which wraps the uv loop with web page context).
node::Environment* env = get_uv_env() ? get_uv_env() : global_env;
node::Environment* env = uv_env() ? uv_env() : global_env;
v8::Context::Scope context_scope(env->context());
// Deal with uv events.

View file

@ -40,7 +40,7 @@ class NodeBindings {
// Gets/sets the environment to wrap uv loop.
void set_uv_env(node::Environment* env) { uv_env_ = env; }
node::Environment* get_uv_env() const { return uv_env_; }
node::Environment* uv_env() const { return uv_env_; }
protected:
explicit NodeBindings(bool is_browser);

View file

@ -62,7 +62,7 @@ void AtomRendererClient::DidCreateScriptContext(WebKit::WebFrame* frame,
web_page_envs_.push_back(env);
// Make uv loop being wrapped by window context.
if (node_bindings_->get_uv_env() == NULL)
if (node_bindings_->uv_env() == NULL)
node_bindings_->set_uv_env(env);
}
@ -91,7 +91,7 @@ void AtomRendererClient::WillReleaseScriptContext(
// env->Dispose();
// Wrap the uv loop with another environment.
if (env == node_bindings_->get_uv_env()) {
if (env == node_bindings_->uv_env()) {
node::Environment* env = web_page_envs_.size() > 0 ? web_page_envs_[0] :
NULL;
node_bindings_->set_uv_env(env);