Skip to content
  • John Mellor's avatar
    Make Origin & SchemeHostPort moveable · ef62bce2
    John Mellor authored
    Lots of code attempts to move url::Origin objects. Unfortunately, whilst
    Origins had an implicitly-declared copy constructor, they did not have
    an implicitly-declared move constructor since the user-declared
    destructor prevents that. Attempting to move Origin objects compiled
    fine however, since it was just falling through to the copy constructor.
    
    This code adds a default move constructor & move assignment operator
    to Origin and SchemeHostPort, so that they will be moved instead of
    copied when possible. Existing code should become faster :)
    
    (The patch also adds a default copy constructor & copy assignment
    operator, since otherwise adding the user-defined move constructor would
    cause the implicit ones to be deleted).
    
    Bug: none
    Change-Id: Ic250f3c8172c75a386294053719cc1ceb82bbdf5
    Reviewed-on: https://chromium-review.googlesource.com/692022
    
    
    Reviewed-by: default avatarMike West <mkwst@chromium.org>
    Commit-Queue: John Mellor <johnme@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#506366}
    ef62bce2