Do you have to take context from wgOut ?
I think the best way is to take it from RequestContext.
Unless i don't know something ?