Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: webkit/glue/plugins/pepper_file_system.cc

Issue 3599011: Add truncate and cancel for FileWriter; write and tests will come in later CL... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
57 private: 61 private:
58 void RunCallback(base::PlatformFileError error_code) { 62 void RunCallback(base::PlatformFileError error_code) {
59 if (!module_.get() || !callback_.func) 63 if (!module_.get() || !callback_.func)
60 return; 64 return;
61 65
62 PP_RunCompletionCallback( 66 PP_RunCompletionCallback(
63 &callback_, pepper::PlatformFileErrorToPepperError(error_code)); 67 &callback_, pepper::PlatformFileErrorToPepperError(error_code));
64 68
65 delete this; 69 delete this;
66 } 70 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } 102 }
99 103
100 virtual void DidOpenFileSystem(const std::string&, const FilePath&) { 104 virtual void DidOpenFileSystem(const std::string&, const FilePath&) {
101 NOTREACHED(); 105 NOTREACHED();
102 } 106 }
103 107
104 virtual void DidFail(base::PlatformFileError error_code) { 108 virtual void DidFail(base::PlatformFileError error_code) {
105 RunCallback(error_code, base::PlatformFileInfo()); 109 RunCallback(error_code, base::PlatformFileInfo());
106 } 110 }
107 111
112 virtual void DidWrite(int64 bytes, bool complete) {
113 NOTREACHED();
114 }
115
108 private: 116 private:
109 void RunCallback(base::PlatformFileError error_code, 117 void RunCallback(base::PlatformFileError error_code,
110 const base::PlatformFileInfo& file_info) { 118 const base::PlatformFileInfo& file_info) {
111 if (!module_.get() || !callback_.func) 119 if (!module_.get() || !callback_.func)
112 return; 120 return;
113 121
114 if (error_code == base::PLATFORM_FILE_OK) { 122 if (error_code == base::PLATFORM_FILE_OK) {
115 info_->size = file_info.size; 123 info_->size = file_info.size;
116 info_->creation_time = file_info.creation_time.ToDoubleT(); 124 info_->creation_time = file_info.creation_time.ToDoubleT();
117 info_->last_access_time = file_info.last_accessed.ToDoubleT(); 125 info_->last_access_time = file_info.last_accessed.ToDoubleT();
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 &Rename 248 &Rename
241 }; 249 };
242 250
243 } // namespace 251 } // namespace
244 252
245 const PPB_FileSystem_Dev* FileSystem::GetInterface() { 253 const PPB_FileSystem_Dev* FileSystem::GetInterface() {
246 return &ppb_filesystem; 254 return &ppb_filesystem;
247 } 255 }
248 256
249 } // namespace pepper 257 } // namespace pepper
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_operation_unittest.cc ('k') | webkit/tools/test_shell/simple_file_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698