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 29 matching lines...) Expand all Loading... |
40 class WebFileWriter; | 40 class WebFileWriter; |
41 } | 41 } |
42 | 42 |
43 namespace WebCore { | 43 namespace WebCore { |
44 | 44 |
45 class Blob; | 45 class Blob; |
46 class AsyncFileWriterClient; | 46 class AsyncFileWriterClient; |
47 | 47 |
48 class AsyncFileWriterChromium : public AsyncFileWriter, public WebKit::WebFileWr
iterClient { | 48 class AsyncFileWriterChromium : public AsyncFileWriter, public WebKit::WebFileWr
iterClient { |
49 public: | 49 public: |
50 AsyncFileWriterChromium(AsyncFileWriterClient* client); | 50 static PassOwnPtr<AsyncFileWriterChromium> create(AsyncFileWriterClient*); |
51 ~AsyncFileWriterChromium(); | 51 virtual ~AsyncFileWriterChromium(); |
52 | 52 |
53 void setWebFileWriter(PassOwnPtr<WebKit::WebFileWriter> writer); | 53 void setWebFileWriter(PassOwnPtr<WebKit::WebFileWriter> writer); |
54 | 54 |
55 // FileWriter | 55 // FileWriter |
56 virtual void write(long long position, Blob* data); | 56 virtual void write(long long position, Blob* data); |
57 virtual void truncate(long long length); | 57 virtual void truncate(long long length); |
58 virtual void abort(); | 58 virtual void abort(); |
59 | 59 |
60 // WebFileWriterClient | 60 // WebFileWriterClient |
61 virtual void didWrite(long long bytes, bool complete); | 61 virtual void didWrite(long long bytes, bool complete); |
62 virtual void didTruncate(); | 62 virtual void didTruncate(); |
63 virtual void didFail(WebKit::WebFileError); | 63 virtual void didFail(WebKit::WebFileError); |
64 | 64 |
65 private: | 65 private: |
| 66 explicit AsyncFileWriterChromium(AsyncFileWriterClient*); |
| 67 |
66 OwnPtr<WebKit::WebFileWriter> m_writer; | 68 OwnPtr<WebKit::WebFileWriter> m_writer; |
67 AsyncFileWriterClient* m_client; | 69 AsyncFileWriterClient* m_client; |
68 }; | 70 }; |
69 | 71 |
70 } // namespace | 72 } // namespace |
71 | 73 |
72 #endif // AsyncFileWriterChromium_h | 74 #endif // AsyncFileWriterChromium_h |
OLD | NEW |