<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>149733</bug_id>
          
          <creation_ts>2015-10-01 17:08:06 -0700</creation_ts>
          <short_desc>Web Inspector: Simplify TimelineRecordBar a bit</short_desc>
          <delta_ts>2015-10-06 12:14:21 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>DoNotImportToRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joseph Pecoraro">joepeck</reporter>
          <assigned_to name="Joseph Pecoraro">joepeck</assigned_to>
          <cc>bburg</cc>
    
    <cc>commit-queue</cc>
    
    <cc>darin</cc>
    
    <cc>graouts</cc>
    
    <cc>joepeck</cc>
    
    <cc>mattbaker</cc>
    
    <cc>nvasilyev</cc>
    
    <cc>timothy</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1130096</commentid>
    <comment_count>0</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-10-01 17:08:06 -0700</bug_when>
    <thetext>Simplify TimelineRecordBar a bit. Its setter is only ever used with multiple records. Require an array instead of dynamically converting inputs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1130098</commentid>
    <comment_count>1</comment_count>
      <attachid>262301</attachid>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-10-01 17:08:45 -0700</bug_when>
    <thetext>Created attachment 262301
[PATCH] Proposed Fix</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1130102</commentid>
    <comment_count>2</comment_count>
      <attachid>262301</attachid>
    <who name="Matt Baker">mattbaker</who>
    <bug_when>2015-10-01 17:17:57 -0700</bug_when>
    <thetext>Comment on attachment 262301
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=262301&amp;action=review

&gt; Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.js:199
&gt; +        console.assert(records instanceof Array, &quot;records should be an array&quot;);

Should we return if !(records instance Array)? What&apos;s our policy toward this style of defensive coding?
Nit: I&apos;d format the assert message as a complete sentence: &quot;Records should be an array.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1130974</commentid>
    <comment_count>3</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2015-10-06 09:16:02 -0700</bug_when>
    <thetext>Joe, are you waiting to set commit-queue+ until you think about Matt’s comment? Surprised this is still not landed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1131046</commentid>
    <comment_count>4</comment_count>
      <attachid>262301</attachid>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-10-06 11:27:59 -0700</bug_when>
    <thetext>Comment on attachment 262301
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=262301&amp;action=review

&gt;&gt; Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.js:199
&gt;&gt; +        console.assert(records instanceof Array, &quot;records should be an array&quot;);
&gt; 
&gt; Should we return if !(records instance Array)? What&apos;s our policy toward this style of defensive coding?
&gt; Nit: I&apos;d format the assert message as a complete sentence: &quot;Records should be an array.&quot;

In this case, our policy should be to use the API correctly. Adding an assert here would just help us catch any possible outliers that I didn&apos;t see on auditing the code. Ideally this assert can be removed entirely.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1131055</commentid>
    <comment_count>5</comment_count>
    <who name="Matt Baker">mattbaker</who>
    <bug_when>2015-10-06 11:42:30 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; Comment on attachment 262301 [details]
&gt; [PATCH] Proposed Fix
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=262301&amp;action=review
&gt; 
&gt; &gt;&gt; Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.js:199
&gt; &gt;&gt; +        console.assert(records instanceof Array, &quot;records should be an array&quot;);
&gt; &gt; 
&gt; &gt; Should we return if !(records instance Array)? What&apos;s our policy toward this style of defensive coding?
&gt; &gt; Nit: I&apos;d format the assert message as a complete sentence: &quot;Records should be an array.&quot;
&gt; 
&gt; In this case, our policy should be to use the API correctly. Adding an
&gt; assert here would just help us catch any possible outliers that I didn&apos;t see
&gt; on auditing the code. Ideally this assert can be removed entirely.

So we&apos;ll continue to assert that inputs are valid to catch improper API use, but not attempt to sanitize invalid input or early return. Sounds reasonable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1131068</commentid>
    <comment_count>6</comment_count>
      <attachid>262301</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2015-10-06 12:14:16 -0700</bug_when>
    <thetext>Comment on attachment 262301
[PATCH] Proposed Fix

Clearing flags on attachment: 262301

Committed r190632: &lt;http://trac.webkit.org/changeset/190632&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1131069</commentid>
    <comment_count>7</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2015-10-06 12:14:21 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>262301</attachid>
            <date>2015-10-01 17:08:45 -0700</date>
            <delta_ts>2015-10-06 12:14:16 -0700</delta_ts>
            <desc>[PATCH] Proposed Fix</desc>
            <filename>simplify-2.patch</filename>
            <type>text/plain</type>
            <size>1342</size>
            <attacher name="Joseph Pecoraro">joepeck</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJJbnNwZWN0b3JVSS9DaGFuZ2VMb2cgYi9Tb3VyY2UvV2Vi
SW5zcGVjdG9yVUkvQ2hhbmdlTG9nCmluZGV4IDc2NmRhM2EuLmZmMDA2NjUgMTAwNjQ0Ci0tLSBh
L1NvdXJjZS9XZWJJbnNwZWN0b3JVSS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYkluc3BlY3Rv
clVJL0NoYW5nZUxvZwpAQCAtMSw1ICsxLDE1IEBACiAyMDE1LTEwLTAxICBKb3NlcGggUGVjb3Jh
cm8gIDxwZWNvcmFyb0BhcHBsZS5jb20+CiAKKyAgICAgICAgV2ViIEluc3BlY3RvcjogU2ltcGxp
ZnkgVGltZWxpbmVSZWNvcmRCYXIgYSBiaXQKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5v
cmcvc2hvd19idWcuY2dpP2lkPTE0OTczMworCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAo
T09QUyEpLgorCisgICAgICAgICogVXNlckludGVyZmFjZS9WaWV3cy9UaW1lbGluZVJlY29yZEJh
ci5qczoKKyAgICAgICAgKFdlYkluc3BlY3Rvci5UaW1lbGluZVJlY29yZEJhci5wcm90b3R5cGUu
c2V0IHJlY29yZHMpOgorCisyMDE1LTEwLTAxICBKb3NlcGggUGVjb3Jhcm8gIDxwZWNvcmFyb0Bh
cHBsZS5jb20+CisKICAgICAgICAgV2ViIEluc3BlY3RvcjogU2ltcGxpZnkgZmlsdGVyYWJsZURh
dGEgcHJvY2Vzc2luZwogICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5j
Z2k/aWQ9MTQ5NzMwCiAKZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJJbnNwZWN0b3JVSS9Vc2VySW50
ZXJmYWNlL1ZpZXdzL1RpbWVsaW5lUmVjb3JkQmFyLmpzIGIvU291cmNlL1dlYkluc3BlY3RvclVJ
L1VzZXJJbnRlcmZhY2UvVmlld3MvVGltZWxpbmVSZWNvcmRCYXIuanMKaW5kZXggZWQ3YjA0OC4u
NTU2MGVhOCAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkluc3BlY3RvclVJL1VzZXJJbnRlcmZhY2Uv
Vmlld3MvVGltZWxpbmVSZWNvcmRCYXIuanMKKysrIGIvU291cmNlL1dlYkluc3BlY3RvclVJL1Vz
ZXJJbnRlcmZhY2UvVmlld3MvVGltZWxpbmVSZWNvcmRCYXIuanMKQEAgLTE5Niw4ICsxOTYsNyBA
QCBXZWJJbnNwZWN0b3IuVGltZWxpbmVSZWNvcmRCYXIgPSBjbGFzcyBUaW1lbGluZVJlY29yZEJh
ciBleHRlbmRzIFdlYkluc3BlY3Rvci5PYgogCiAgICAgICAgIHJlY29yZHMgPSByZWNvcmRzIHx8
IFtdOwogCi0gICAgICAgIGlmICghKHJlY29yZHMgaW5zdGFuY2VvZiBBcnJheSkpCi0gICAgICAg
ICAgICByZWNvcmRzID0gW3JlY29yZHNdOworICAgICAgICBjb25zb2xlLmFzc2VydChyZWNvcmRz
IGluc3RhbmNlb2YgQXJyYXksICJyZWNvcmRzIHNob3VsZCBiZSBhbiBhcnJheSIpOwogCiAgICAg
ICAgIHRoaXMuX3JlY29yZHMgPSByZWNvcmRzOwogCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>