<?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>56259</bug_id>
          
          <creation_ts>2011-03-12 20:20:46 -0800</creation_ts>
          <short_desc>StorageTracker constructor shouldn&apos;t have initialization code and isMainThread() assertion</short_desc>
          <delta_ts>2011-03-13 12:08:14 -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>WebKit Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anton D&apos;Auria">adauria</reporter>
          <assigned_to name="Anton D&apos;Auria">adauria</assigned_to>
          <cc>alice.barraclough</cc>
    
    <cc>beidson</cc>
    
    <cc>commit-queue</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>366652</commentid>
    <comment_count>0</comment_count>
    <who name="Anton D&apos;Auria">adauria</who>
    <bug_when>2011-03-12 20:20:46 -0800</bug_when>
    <thetext>All initialization code should be in StorageTracker::initializeTracker(). This removes the requirement that StorageTracker constructor must be called on the main thread.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>366653</commentid>
    <comment_count>1</comment_count>
      <attachid>85605</attachid>
    <who name="Anton D&apos;Auria">adauria</who>
    <bug_when>2011-03-12 20:27:11 -0800</bug_when>
    <thetext>Created attachment 85605
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>366662</commentid>
    <comment_count>2</comment_count>
    <who name="Alice Liu">alice.barraclough</who>
    <bug_when>2011-03-12 22:46:31 -0800</bug_when>
    <thetext>I have just a couple questions.  Pardon my lack of understanding of when and where StorageTracker is supposed to exist, but it seems that your patch does not address StorageTracker constructor running on non-main threads, but instead moves the assertion that it&apos;s running on the main thread to the initialization of StorageTracker. This seems to me that it doesn&apos;t prevent all the non-main threadsfrom creating a StorageTracker instance that doesn&apos;t do anything.  Maybe i just need a brief overview of StorageTracker ...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>366684</commentid>
    <comment_count>3</comment_count>
    <who name="Anton D&apos;Auria">adauria</who>
    <bug_when>2011-03-13 00:21:40 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; I have just a couple questions.  Pardon my lack of understanding of when and where StorageTracker is supposed to exist, but it seems that your patch does not address StorageTracker constructor running on non-main threads, but instead moves the assertion that it&apos;s running on the main thread to the initialization of StorageTracker. This seems to me that it doesn&apos;t prevent all the non-main threadsfrom creating a StorageTracker instance that doesn&apos;t do anything.  Maybe i just need a brief overview of StorageTracker ...

The constructor started the LocalStorageTask thread. In LocalStorageTask, thread creation isn&apos;t protected by a mutex, so it must happen on the main thread. I moved this code out of the constructor to the initialization function, which now must run on the main thread, and so I removed the assert in this patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>366686</commentid>
    <comment_count>4</comment_count>
    <who name="Anton D&apos;Auria">adauria</who>
    <bug_when>2011-03-13 00:22:56 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; I have just a couple questions.  Pardon my lack of understanding of when and where StorageTracker is supposed to exist, but it seems that your patch does not address StorageTracker constructor running on non-main threads, but instead moves the assertion that it&apos;s running on the main thread to the initialization of StorageTracker. This seems to me that it doesn&apos;t prevent all the non-main threadsfrom creating a StorageTracker instance that doesn&apos;t do anything.  Maybe i just need a brief overview of StorageTracker ...
&gt; 
&gt; The constructor started the LocalStorageTask thread. In LocalStorageTask, thread creation isn&apos;t protected by a mutex, so it must happen on the main thread. I moved this code out of the constructor to the initialization function, which now must run on the main thread, and so I removed the assert in this patch.

So now, it&apos;s fine for the constructor to be called on any thread, but the StorageTracker::initializeTracker() must be called on the main thread for the reason stated above.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>366687</commentid>
    <comment_count>5</comment_count>
    <who name="Alice Liu">alice.barraclough</who>
    <bug_when>2011-03-13 00:25:01 -0800</bug_when>
    <thetext>ok. r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>366711</commentid>
    <comment_count>6</comment_count>
      <attachid>85605</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-03-13 12:08:09 -0700</bug_when>
    <thetext>Comment on attachment 85605
Patch

Clearing flags on attachment: 85605

Committed r80964: &lt;http://trac.webkit.org/changeset/80964&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>366712</commentid>
    <comment_count>7</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-03-13 12:08:14 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>85605</attachid>
            <date>2011-03-12 20:27:11 -0800</date>
            <delta_ts>2011-03-13 12:08:09 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-56259-20110312202710.patch</filename>
            <type>text/plain</type>
            <size>2367</size>
            <attacher name="Anton D&apos;Auria">adauria</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDgwOTU2KQorKysgU291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