[Webkit-unassigned] [Bug 65835] Need a way to selectively use hixie-76 for websocket connections depending on destination and/or origin

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 11 08:58:12 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=65835


Alexey Proskuryakov <ap at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |abarth at webkit.org




--- Comment #12 from Alexey Proskuryakov <ap at webkit.org>  2011-08-11 08:58:11 PST ---
> As for type: if passed as const reference then this method must copy its argument into
> temporary local immediately upon entering method.  It is equivalent to just passing by
> value -- and it is simpler and more straightforward.

Yes, I know this argument. The costs of this approach are:
- frequent changing of function signatures when implementation changes;
- some code bloat, as caller becomes responsible for copying in the value;
- and confusing code - you start changing argument value inside function body, which can be unexpected by readers.

Expanding on the last cost, you lose an opportunity to use a speaking variable name. In this example, you just call both original and stripped url a "url", while you could name the stripped one in a way that explains what exactly remains in it, and/or what's the purpose of stripping.

For WebKit, it's pretty much universal coding style. We just pass strings and kurls by reference, and doing it differently without strong support in the form of performance numbers is frowned upon.

Not a big deal for temporary branch only code. CC'ing Adam, who might suggest a better alternative for stripping an URL like this, and would be a good reviewer for this patch in general.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list