Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/DefaultFileSystem.h

Issue 29731562: Issue 6477 - separate done and error callbacks in IFileSystem::Read (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git@c0a6434596a83383e37678ef3b6ecef00ed6a261
Patch Set: Created March 23, 2018, 10:58 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 std::string Resolve(const std::string& fileName) const; 47 std::string Resolve(const std::string& fileName) const;
48 protected: 48 protected:
49 std::string basePath; 49 std::string basePath;
50 }; 50 };
51 51
52 class DefaultFileSystem : public IFileSystem 52 class DefaultFileSystem : public IFileSystem
53 { 53 {
54 public: 54 public:
55 explicit DefaultFileSystem(const Scheduler& scheduler, std::unique_ptr<Defau ltFileSystemSync> syncImpl); 55 explicit DefaultFileSystem(const Scheduler& scheduler, std::unique_ptr<Defau ltFileSystemSync> syncImpl);
56 void Read(const std::string& fileName, 56 void Read(const std::string& fileName,
57 const ReadCallback& callback) const override; 57 const ReadCallback& doneCallback,
58 const Callback& errorCallback) const override;
58 void Write(const std::string& fileName, 59 void Write(const std::string& fileName,
59 const IOBuffer& data, 60 const IOBuffer& data,
60 const Callback& callback) override; 61 const Callback& callback) override;
61 void Move(const std::string& fromFileName, 62 void Move(const std::string& fromFileName,
62 const std::string& toFileName, 63 const std::string& toFileName,
63 const Callback& callback) override; 64 const Callback& callback) override;
64 void Remove(const std::string& fileName, const Callback& callback) override; 65 void Remove(const std::string& fileName, const Callback& callback) override;
65 void Stat(const std::string& fileName, 66 void Stat(const std::string& fileName,
66 const StatCallback& callback) const override; 67 const StatCallback& callback) const override;
67 68
68 private: 69 private:
69 // Returns the absolute path to a file. 70 // Returns the absolute path to a file.
70 std::string Resolve(const std::string& fileName) const; 71 std::string Resolve(const std::string& fileName) const;
71 Scheduler scheduler; 72 Scheduler scheduler;
72 std::unique_ptr<DefaultFileSystemSync> syncImpl; 73 std::unique_ptr<DefaultFileSystemSync> syncImpl;
73 }; 74 };
74 } 75 }
75 76
76 #endif 77 #endif
OLDNEW
« no previous file with comments | « lib/prefs.js ('k') | src/DefaultFileSystem.cpp » ('j') | src/FileSystemJsObject.cpp » ('J')

Powered by Google App Engine
This is Rietveld