Home | History | Annotate | Download | only in wince
      1 /*
      2  * Copyright (C) 2009 Torch Mobile, Inc. All rights reserved.
      3  *
      4  * Redistribution and use in source and binary forms, with or without
      5  * modification, are permitted provided that the following conditions
      6  * are met:
      7  * 1. Redistributions of source code must retain the above copyright
      8  *    notice, this list of conditions and the following disclaimer.
      9  * 2. Redistributions in binary form must reproduce the above copyright
     10  *    notice, this list of conditions and the following disclaimer in the
     11  *    documentation and/or other materials provided with the distribution.
     12  *
     13  *  This library is distributed in the hope that i will be useful,
     14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
     15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     16  *  Library General Public License for more details.
     17  *
     18  *  You should have received a copy of the GNU Library General Public License
     19  *  along with this library; see the file COPYING.LIB.  If not, write to
     20  *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
     21  *  Boston, MA 02110-1301, USA.
     22  */
     23 
     24 
     25 #ifndef LocalStorageThreadWince_h
     26 #define LocalStorageThreadWince_h
     27 
     28 #include <wtf/Deque.h>
     29 #include <wtf/PassRefPtr.h>
     30 
     31 namespace WebCore {
     32 
     33     class StorageAreaSync;
     34     class LocalStorageTask;
     35 
     36     class LocalStorageThread : public RefCounted<LocalStorageThread> {
     37     public:
     38         static PassRefPtr<LocalStorageThread> create() { return adoptRef(new LocalStorageThread); }
     39 
     40         ~LocalStorageThread();
     41         bool start();
     42         void scheduleImport(PassRefPtr<StorageAreaSync>);
     43         void scheduleSync(PassRefPtr<StorageAreaSync>);
     44         void terminate();
     45         void performTerminate();
     46 
     47     private:
     48         LocalStorageThread();
     49 
     50         void timerFired(Timer<LocalStorageThread>*);
     51 
     52         Deque<RefPtr<LocalStorageTask> > m_queue;
     53         Timer<LocalStorageThread> m_timer;
     54     };
     55 
     56 } // namespace WebCore
     57 
     58 #endif // LocalStorageThreadWince_h
     59