⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 242852 in webkit


Ignore:
Timestamp:
Mar 13, 2019, 1:24:23 AM (7 years ago)
Author:
bshafiei@apple.com
Message:

Cherry-pick r241615. rdar://problem/48839366

SamplingProfiler::stackTracesAsJSON() should escape strings.
https://bugs.webkit.org/show_bug.cgi?id=194649
<rdar://problem/48072386>

Reviewed by Saam Barati.

JSTests:

  • stress/sampling-profiler-stack-trace-with-double-quote-in-function-name.js: Added.
  • stress/type-profiler-with-double-quote-in-constructor-name.js: Added.
  • stress/type-profiler-with-double-quote-in-field-name.js: Added.
  • stress/type-profiler-with-double-quote-in-optional-field-name.js: Added.

Source/JavaScriptCore:

Ditto for TypeSet::toJSONString() and TypeSet::toJSONString().

  • runtime/SamplingProfiler.cpp: (JSC::SamplingProfiler::stackTracesAsJSON):
  • runtime/TypeSet.cpp: (JSC::TypeSet::toJSONString const): (JSC::StructureShape::toJSONString const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241615 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-607-branch
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-607-branch/JSTests/ChangeLog

    r241885 r242852  
     12019-03-13  Babak Shafiei  <bshafiei@apple.com>
     2
     3        Cherry-pick r241615. rdar://problem/48839366
     4
     5    SamplingProfiler::stackTracesAsJSON() should escape strings.
     6    https://bugs.webkit.org/show_bug.cgi?id=194649
     7    <rdar://problem/48072386>
     8   
     9    Reviewed by Saam Barati.
     10   
     11    JSTests:
     12   
     13    * stress/sampling-profiler-stack-trace-with-double-quote-in-function-name.js: Added.
     14    * stress/type-profiler-with-double-quote-in-constructor-name.js: Added.
     15    * stress/type-profiler-with-double-quote-in-field-name.js: Added.
     16    * stress/type-profiler-with-double-quote-in-optional-field-name.js: Added.
     17   
     18    Source/JavaScriptCore:
     19   
     20    Ditto for TypeSet::toJSONString() and TypeSet::toJSONString().
     21   
     22    * runtime/SamplingProfiler.cpp:
     23    (JSC::SamplingProfiler::stackTracesAsJSON):
     24    * runtime/TypeSet.cpp:
     25    (JSC::TypeSet::toJSONString const):
     26    (JSC::StructureShape::toJSONString const):
     27   
     28   
     29   
     30    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241615 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     31
     32    2019-02-15  Mark Lam  <mark.lam@apple.com>
     33
     34            SamplingProfiler::stackTracesAsJSON() should escape strings.
     35            https://bugs.webkit.org/show_bug.cgi?id=194649
     36            <rdar://problem/48072386>
     37
     38            Reviewed by Saam Barati.
     39
     40            * stress/sampling-profiler-stack-trace-with-double-quote-in-function-name.js: Added.
     41            * stress/type-profiler-with-double-quote-in-constructor-name.js: Added.
     42            * stress/type-profiler-with-double-quote-in-field-name.js: Added.
     43            * stress/type-profiler-with-double-quote-in-optional-field-name.js: Added.
     44
    1452019-02-20  Alan Coon  <alancoon@apple.com>
    246
  • branches/safari-607-branch/Source/JavaScriptCore/ChangeLog

    r242200 r242852  
     12019-03-13  Babak Shafiei  <bshafiei@apple.com>
     2
     3        Cherry-pick r241615. rdar://problem/48839366
     4
     5    SamplingProfiler::stackTracesAsJSON() should escape strings.
     6    https://bugs.webkit.org/show_bug.cgi?id=194649
     7    <rdar://problem/48072386>
     8   
     9    Reviewed by Saam Barati.
     10   
     11    JSTests:
     12   
     13    * stress/sampling-profiler-stack-trace-with-double-quote-in-function-name.js: Added.
     14    * stress/type-profiler-with-double-quote-in-constructor-name.js: Added.
     15    * stress/type-profiler-with-double-quote-in-field-name.js: Added.
     16    * stress/type-profiler-with-double-quote-in-optional-field-name.js: Added.
     17   
     18    Source/JavaScriptCore:
     19   
     20    Ditto for TypeSet::toJSONString() and TypeSet::toJSONString().
     21   
     22    * runtime/SamplingProfiler.cpp:
     23    (JSC::SamplingProfiler::stackTracesAsJSON):
     24    * runtime/TypeSet.cpp:
     25    (JSC::TypeSet::toJSONString const):
     26    (JSC::StructureShape::toJSONString const):
     27   
     28   
     29   
     30    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241615 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     31
     32    2019-02-15  Mark Lam  <mark.lam@apple.com>
     33
     34            SamplingProfiler::stackTracesAsJSON() should escape strings.
     35            https://bugs.webkit.org/show_bug.cgi?id=194649
     36            <rdar://problem/48072386>
     37
     38            Reviewed by Saam Barati.
     39
     40            Ditto for TypeSet::toJSONString() and TypeSet::toJSONString().
     41
     42            * runtime/SamplingProfiler.cpp:
     43            (JSC::SamplingProfiler::stackTracesAsJSON):
     44            * runtime/TypeSet.cpp:
     45            (JSC::TypeSet::toJSONString const):
     46            (JSC::StructureShape::toJSONString const):
     47
    1482019-02-28  Andy Estes  <aestes@apple.com>
    249
  • branches/safari-607-branch/Source/JavaScriptCore/runtime/SamplingProfiler.cpp

    r239427 r242852  
    11/*
    2  * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    904904        for (StackFrame& stackFrame : stackTrace.frames) {
    905905            comma();
    906             json.append('"');
    907             json.append(stackFrame.displayNameForJSONTests(m_vm));
    908             json.append('"');
     906            json.appendQuotedJSONString(stackFrame.displayNameForJSONTests(m_vm));
    909907            loopedOnce = true;
    910908        }
  • branches/safari-607-branch/Source/JavaScriptCore/runtime/TypeSet.cpp

    r233122 r242852  
    11/*
    2  * Copyright (C) 2014, 2015 Apple Inc. All Rights Reserved.
     2 * Copyright (C) 2014-2019 Apple Inc. All Rights Reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    254254
    255255    json.appendLiteral("\"displayTypeName\":");
    256     json.append('"');
    257     json.append(displayName());
    258     json.append('"');
     256    json.appendQuotedJSONString(displayName());
    259257    json.append(',');
    260258
     
    443441
    444442    json.appendLiteral("\"constructorName\":");
    445     json.append('"');
    446     json.append(m_constructorName);
    447     json.append('"');
     443    json.appendQuotedJSONString(m_constructorName);
    448444    json.append(',');
    449445
     
    464460
    465461        String fieldName((*it).get());
    466         json.append('"');
    467         json.append(fieldName);
    468         json.append('"');
     462        json.appendQuotedJSONString(fieldName);
    469463    }
    470464    json.append(']');
     
    480474
    481475        String fieldName((*it).get());
    482         json.append('"');
    483         json.append(fieldName);
    484         json.append('"');
     476        json.appendQuotedJSONString(fieldName);
    485477    }
    486478    json.append(']');
Note: See TracChangeset for help on using the changeset viewer.