OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webkit/glue/plugins/pepper_file_system.h" | 5 #include "webkit/glue/plugins/pepper_file_system.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
9 #include "base/weak_ptr.h" | 9 #include "base/weak_ptr.h" |
10 #include "third_party/ppapi/c/dev/ppb_file_system_dev.h" | 10 #include "third_party/ppapi/c/dev/ppb_file_system_dev.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 } | 47 } |
48 | 48 |
49 virtual void DidOpenFileSystem(const std::string&, const FilePath&) { | 49 virtual void DidOpenFileSystem(const std::string&, const FilePath&) { |
50 NOTREACHED(); | 50 NOTREACHED(); |
51 } | 51 } |
52 | 52 |
53 virtual void DidFail(base::PlatformFileError error_code) { | 53 virtual void DidFail(base::PlatformFileError error_code) { |
54 RunCallback(error_code); | 54 RunCallback(error_code); |
55 } | 55 } |
56 | 56 |
57 virtual void DidWrite(int64 bytes, bool complete) { | |
58 NOTREACHED(); | |
59 } | |
60 | |
61 private: | 57 private: |
62 void RunCallback(base::PlatformFileError error_code) { | 58 void RunCallback(base::PlatformFileError error_code) { |
63 if (!module_.get() || !callback_.func) | 59 if (!module_.get() || !callback_.func) |
64 return; | 60 return; |
65 | 61 |
66 PP_RunCompletionCallback( | 62 PP_RunCompletionCallback( |
67 &callback_, pepper::PlatformFileErrorToPepperError(error_code)); | 63 &callback_, pepper::PlatformFileErrorToPepperError(error_code)); |
68 | 64 |
69 delete this; | 65 delete this; |
70 } | 66 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 } | 98 } |
103 | 99 |
104 virtual void DidOpenFileSystem(const std::string&, const FilePath&) { | 100 virtual void DidOpenFileSystem(const std::string&, const FilePath&) { |
105 NOTREACHED(); | 101 NOTREACHED(); |
106 } | 102 } |
107 | 103 |
108 virtual void DidFail(base::PlatformFileError error_code) { | 104 virtual void DidFail(base::PlatformFileError error_code) { |
109 RunCallback(error_code, base::PlatformFileInfo()); | 105 RunCallback(error_code, base::PlatformFileInfo()); |
110 } | 106 } |
111 | 107 |
112 virtual void DidWrite(int64 bytes, bool complete) { | |
113 NOTREACHED(); | |
114 } | |
115 | |
116 private: | 108 private: |
117 void RunCallback(base::PlatformFileError error_code, | 109 void RunCallback(base::PlatformFileError error_code, |
118 const base::PlatformFileInfo& file_info) { | 110 const base::PlatformFileInfo& file_info) { |
119 if (!module_.get() || !callback_.func) | 111 if (!module_.get() || !callback_.func) |
120 return; | 112 return; |
121 | 113 |
122 if (error_code == base::PLATFORM_FILE_OK) { | 114 if (error_code == base::PLATFORM_FILE_OK) { |
123 info_->size = file_info.size; | 115 info_->size = file_info.size; |
124 info_->creation_time = file_info.creation_time.ToDoubleT(); | 116 info_->creation_time = file_info.creation_time.ToDoubleT(); |
125 info_->last_access_time = file_info.last_accessed.ToDoubleT(); | 117 info_->last_access_time = file_info.last_accessed.ToDoubleT(); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 &Rename | 240 &Rename |
249 }; | 241 }; |
250 | 242 |
251 } // namespace | 243 } // namespace |
252 | 244 |
253 const PPB_FileSystem_Dev* FileSystem::GetInterface() { | 245 const PPB_FileSystem_Dev* FileSystem::GetInterface() { |
254 return &ppb_filesystem; | 246 return &ppb_filesystem; |
255 } | 247 } |
256 | 248 |
257 } // namespace pepper | 249 } // namespace pepper |
OLD | NEW |