Changeset 243204 in webkit


Ignore:
Timestamp:
Mar 20, 2019 9:13:30 AM (5 years ago)
Author:
Chris Dumez
Message:

Remove copyRef() calls added in r243163
https://bugs.webkit.org/show_bug.cgi?id=195962

Patch by Michael Catanzaro <Michael Catanzaro> on 2019-03-20
Reviewed by Chris Dumez.

Source/JavaScriptCore:

As best I can tell, may be a GCC 9 bug. It shouldn't warn about this case because the return
value is noncopyable and the WTFMove() is absolutely required. We can avoid the warning
without refcount churn by introducing an intermediate variable.

  • inspector/scripts/codegen/cpp_generator_templates.py:

Source/WebCore:

The first two cases here can just directly return the RefPtr.

In the third case, we have to work around a GCC 6 bug because GCC 6 is unable to pick the
right constructor to use, unlike modern compilers.

  • Modules/fetch/FetchBody.cpp:

(WebCore::FetchBody::bodyAsFormData const):
(WebCore::FetchBody::take):

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r243200 r243204  
     12019-03-20  Michael Catanzaro  <mcatanzaro@igalia.com>
     2
     3        Remove copyRef() calls added in r243163
     4        https://bugs.webkit.org/show_bug.cgi?id=195962
     5
     6        Reviewed by Chris Dumez.
     7
     8        As best I can tell, may be a GCC 9 bug. It shouldn't warn about this case because the return
     9        value is noncopyable and the WTFMove() is absolutely required. We can avoid the warning
     10        without refcount churn by introducing an intermediate variable.
     11
     12        * inspector/scripts/codegen/cpp_generator_templates.py:
     13
    1142019-03-20  Carlos Garcia Campos  <cgarcia@igalia.com>
    215
  • trunk/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator_templates.py

    r243163 r243204  
    231231            COMPILE_ASSERT(sizeof(${objectType}) == sizeof(JSON::Object), cannot_cast);
    232232
    233             Ref<JSON::Object> result = m_result.releaseNonNull();
    234             return reinterpret_cast<Ref<${objectType}>*>(&result)->copyRef();
     233            Ref<JSON::Object> jsonResult = m_result.releaseNonNull();
     234            auto result = WTFMove(*reinterpret_cast<Ref<${objectType}>*>(&jsonResult));
     235            return result;
    235236        }
    236237    };
  • trunk/Source/WebCore/ChangeLog

    r243199 r243204  
     12019-03-20  Michael Catanzaro  <mcatanzaro@igalia.com>
     2
     3        Remove copyRef() calls added in r243163
     4        https://bugs.webkit.org/show_bug.cgi?id=195962
     5
     6        Reviewed by Chris Dumez.
     7
     8        The first two cases here can just directly return the RefPtr.
     9
     10        In the third case, we have to work around a GCC 6 bug because GCC 6 is unable to pick the
     11        right constructor to use, unlike modern compilers.
     12
     13        * Modules/fetch/FetchBody.cpp:
     14        (WebCore::FetchBody::bodyAsFormData const):
     15        (WebCore::FetchBody::take):
     16
    1172019-03-20  Alicia Boya García  <aboya@igalia.com>
    218
  • trunk/Source/WebCore/Modules/fetch/FetchBody.cpp

    r243163 r243204  
    244244        auto body = FormData::create();
    245245        body->appendBlob(blobBody().url());
    246         return body.copyRef();
     246        return body;
    247247    }
    248248    if (isArrayBuffer())
     
    254254        auto body = makeRef(const_cast<FormData&>(formDataBody()));
    255255        body->generateFiles(&downcast<Document>(context));
    256         return body.copyRef();
     256        return body;
    257257    }
    258258    if (auto* data = m_consumer.data())
     
    275275        auto body = FormData::create();
    276276        body->appendBlob(blobBody().url());
    277         return body.copyRef();
     277        return TakenData { WTFMove(body) };
    278278    }
    279279
Note: See TracChangeset for help on using the changeset viewer.