• Matthieu Martin's avatar
    Avoid set/onset calls while shallow copying RequestContext · bd450a65
    Matthieu Martin authored
    Summary:
    Per title
    I found that it was easier to bypass setContext (and not extend RequestContextScopeGuard) to achieve this result.
    
    setShallowCopyContext now directly set the copy as current
    the new unsetShallowCopyContext exclusively calls set/onset for the context data that was overriden. This assumes that cost will be fine because the callbackData_ sets are small or empty.
    Similar reason they were split from requestData_ in the first place, for RequestContextScopeGuard efficiency.
    
    (Note: this ignores all push blocking failures!)
    
    Reviewed By: andriigrynenko
    
    Differential Revision: D8943668
    
    fbshipit-source-id: ad99177429de6b7b65bf95fa0e94334d73c3750d
    bd450a65
Request.cpp 6.74 KB