• kinaba@chromium.org's avatar
    Rename "CheckWritable" to "PrepareForWritableApp" to reflect the actual behavior. · 07aa825a
    kinaba@chromium.org authored
    The existing implementation in fact does not check whether the file is
    writable or not (see below for the detail.)
    Since the current behavior itself is fine for the use cases,
    this CL renames the relevant functions, and refactors the implementation
    so that the intent is clearer.
    
    Existing implementation tries to open a file with CREATE|READ|WRITE flags
    and verifies that the result is either FILE_OK or ALREADY_EXISTS.
    
    This _succeeds_ when read-only file already existed at the location
    because ALREADY_EXISTS error precedes write failure.
    Considering the fact, it is essentially equivalent to open with OPEN_ALWAYS|READ
    and comparing the result just against FILE_OK.
    
    BUG=367028
    
    Review URL: https://codereview.chromium.org/306073004
    
    git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274485 0039d316-1c4b-4281-b951-d872f2087c98
    07aa825a
launcher.cc 15 KB