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

Side by Side Diff: third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.cpp

Issue 2040563002: Remove FileError interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fe-dep
Patch Set: Rebased, and closure annotations Created 4 years, 6 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
OLDNEW
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 DOMFileSystemSync::DOMFileSystemSync(ExecutionContext* context, const String& na me, FileSystemType type, const KURL& rootURL) 58 DOMFileSystemSync::DOMFileSystemSync(ExecutionContext* context, const String& na me, FileSystemType type, const KURL& rootURL)
59 : DOMFileSystemBase(context, name, type, rootURL) 59 : DOMFileSystemBase(context, name, type, rootURL)
60 , m_rootEntry(DirectoryEntrySync::create(this, DOMFilePath::root)) 60 , m_rootEntry(DirectoryEntrySync::create(this, DOMFilePath::root))
61 { 61 {
62 } 62 }
63 63
64 DOMFileSystemSync::~DOMFileSystemSync() 64 DOMFileSystemSync::~DOMFileSystemSync()
65 { 65 {
66 } 66 }
67 67
68 void DOMFileSystemSync::reportError(ErrorCallback* errorCallback, FileError* fil eError) 68 void DOMFileSystemSync::reportError(ErrorCallback* errorCallback, FileError::Err orCode fileError)
69 { 69 {
70 errorCallback->handleEvent(fileError); 70 errorCallback->handleEvent(fileError);
71 } 71 }
72 72
73 DirectoryEntrySync* DOMFileSystemSync::root() 73 DirectoryEntrySync* DOMFileSystemSync::root()
74 { 74 {
75 return m_rootEntry.get(); 75 return m_rootEntry.get();
76 } 76 }
77 77
78 namespace { 78 namespace {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 } 181 }
182 }; 182 };
183 183
184 class LocalErrorCallback final : public ErrorCallback { 184 class LocalErrorCallback final : public ErrorCallback {
185 public: 185 public:
186 static LocalErrorCallback* create(FileError::ErrorCode& errorCode) 186 static LocalErrorCallback* create(FileError::ErrorCode& errorCode)
187 { 187 {
188 return new LocalErrorCallback(errorCode); 188 return new LocalErrorCallback(errorCode);
189 } 189 }
190 190
191 void handleEvent(FileError* error) override 191 void handleEvent(DOMException* error) override
192 { 192 {
193 ASSERT(error->code() != FileError::OK); 193 NOTREACHED();
194 m_errorCode = error->code(); 194 }
195
196 void handleEvent(FileError::ErrorCode error) override
197 {
198 DCHECK_NE(error, FileError::OK);
199 m_errorCode = error;
195 } 200 }
196 201
197 private: 202 private:
198 explicit LocalErrorCallback(FileError::ErrorCode& errorCode) 203 explicit LocalErrorCallback(FileError::ErrorCode& errorCode)
199 : m_errorCode(errorCode) 204 : m_errorCode(errorCode)
200 { 205 {
201 } 206 }
202 207
203 FileError::ErrorCode& m_errorCode; 208 FileError::ErrorCode& m_errorCode;
204 }; 209 };
(...skipping 20 matching lines...) Expand all
225 return fileWriter; 230 return fileWriter;
226 } 231 }
227 232
228 DEFINE_TRACE(DOMFileSystemSync) 233 DEFINE_TRACE(DOMFileSystemSync)
229 { 234 {
230 DOMFileSystemBase::trace(visitor); 235 DOMFileSystemBase::trace(visitor);
231 visitor->trace(m_rootEntry); 236 visitor->trace(m_rootEntry);
232 } 237 }
233 238
234 } // namespace blink 239 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698