| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * Copyright (C) 2010 Google Inc.  All rights reserved. | 2  * Copyright (C) 2010 Google Inc.  All rights reserved. | 
| 3  * | 3  * | 
| 4  * Redistribution and use in source and binary forms, with or without | 4  * Redistribution and use in source and binary forms, with or without | 
| 5  * modification, are permitted provided that the following conditions are | 5  * modification, are permitted provided that the following conditions are | 
| 6  * met: | 6  * met: | 
| 7  * | 7  * | 
| 8  *     * Redistributions of source code must retain the above copyright | 8  *     * Redistributions of source code must retain the above copyright | 
| 9  * notice, this list of conditions and the following disclaimer. | 9  * notice, this list of conditions and the following disclaimer. | 
| 10  *     * Redistributions in binary form must reproduce the above | 10  *     * Redistributions in binary form must reproduce the above | 
| (...skipping 13 matching lines...) Expand all  Loading... | 
| 24  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 
| 25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 
| 26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 
| 27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 
| 28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 
| 29  */ | 29  */ | 
| 30 | 30 | 
| 31 #ifndef FileWriterBase_h | 31 #ifndef FileWriterBase_h | 
| 32 #define FileWriterBase_h | 32 #define FileWriterBase_h | 
| 33 | 33 | 
|  | 34 #include "heap/Handle.h" | 
| 34 #include "wtf/OwnPtr.h" | 35 #include "wtf/OwnPtr.h" | 
| 35 #include "wtf/PassOwnPtr.h" | 36 #include "wtf/PassOwnPtr.h" | 
| 36 #include "wtf/RefCounted.h" | 37 #include "wtf/RefCounted.h" | 
| 37 | 38 | 
| 38 namespace blink { class WebFileWriter; } | 39 namespace blink { class WebFileWriter; } | 
| 39 | 40 | 
| 40 namespace WebCore { | 41 namespace WebCore { | 
| 41 | 42 | 
| 42 class FileWriterBase : public RefCounted<FileWriterBase> { | 43 class FileWriterBase : public RefCountedWillBeRefCountedGarbageCollected<FileWri
    terBase> { | 
| 43 public: | 44 public: | 
| 44     virtual ~FileWriterBase(); | 45     virtual ~FileWriterBase(); | 
| 45     void initialize(PassOwnPtr<blink::WebFileWriter>, long long length); | 46     void initialize(PassOwnPtr<blink::WebFileWriter>, long long length); | 
| 46 | 47 | 
| 47     long long position() const | 48     long long position() const | 
| 48     { | 49     { | 
| 49         return m_position; | 50         return m_position; | 
| 50     } | 51     } | 
| 51     long long length() const | 52     long long length() const | 
| 52     { | 53     { | 
| 53         return m_length; | 54         return m_length; | 
| 54     } | 55     } | 
| 55 | 56 | 
|  | 57     virtual void trace(Visitor*) { } | 
|  | 58 | 
| 56 protected: | 59 protected: | 
| 57     FileWriterBase(); | 60     FileWriterBase(); | 
| 58 | 61 | 
| 59     blink::WebFileWriter* writer() | 62     blink::WebFileWriter* writer() | 
| 60     { | 63     { | 
| 61         return m_writer.get(); | 64         return m_writer.get(); | 
| 62     } | 65     } | 
| 63 | 66 | 
| 64     void setPosition(long long position) | 67     void setPosition(long long position) | 
| 65     { | 68     { | 
| (...skipping 11 matching lines...) Expand all  Loading... | 
| 77     friend class WTF::RefCounted<FileWriterBase>; | 80     friend class WTF::RefCounted<FileWriterBase>; | 
| 78 | 81 | 
| 79     OwnPtr<blink::WebFileWriter> m_writer; | 82     OwnPtr<blink::WebFileWriter> m_writer; | 
| 80     long long m_position; | 83     long long m_position; | 
| 81     long long m_length; | 84     long long m_length; | 
| 82 }; | 85 }; | 
| 83 | 86 | 
| 84 } // namespace WebCore | 87 } // namespace WebCore | 
| 85 | 88 | 
| 86 #endif // FileWriterBase_h | 89 #endif // FileWriterBase_h | 
| OLD | NEW | 
|---|