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

Side by Side Diff: extent_writer.h

Issue 3495002: [update_engine] Fix file creation mask to be 0600 (Closed) Base URL: http://git.chromium.org/git/update_engine.git
Patch Set: Created 10 years, 3 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
« no previous file with comments | « no previous file | file_writer.h » ('j') | main.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium OS 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 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_EXTENT_WRITER_H__ 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_EXTENT_WRITER_H__
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_EXTENT_WRITER_H__ 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_EXTENT_WRITER_H__
7 7
8 #include <vector> 8 #include <vector>
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "update_engine/update_metadata.pb.h" 10 #include "update_engine/update_metadata.pb.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 extents_ = extents; 59 extents_ = extents;
60 return true; 60 return true;
61 } 61 }
62 bool Write(const void* bytes, size_t count); 62 bool Write(const void* bytes, size_t count);
63 bool EndImpl() { 63 bool EndImpl() {
64 return true; 64 return true;
65 } 65 }
66 66
67 private: 67 private:
68 int fd_; 68 int fd_;
69 69
70 size_t block_size_; 70 size_t block_size_;
71 // Bytes written into next_extent_index_ thus far 71 // Bytes written into next_extent_index_ thus far
72 uint64_t extent_bytes_written_; 72 uint64_t extent_bytes_written_;
73 std::vector<Extent> extents_; 73 std::vector<Extent> extents_;
74 // The next call to write should correspond to extents_[next_extent_index_] 74 // The next call to write should correspond to extents_[next_extent_index_]
75 std::vector<Extent>::size_type next_extent_index_; 75 std::vector<Extent>::size_type next_extent_index_;
76 }; 76 };
77 77
78 // Takes an underlying ExtentWriter to which all operations are delegated. 78 // Takes an underlying ExtentWriter to which all operations are delegated.
79 // When End() is called, ZeroPadExtentWriter ensures that the total number 79 // When End() is called, ZeroPadExtentWriter ensures that the total number
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 private: 113 private:
114 ExtentWriter* underlying_extent_writer_; // The underlying ExtentWriter. 114 ExtentWriter* underlying_extent_writer_; // The underlying ExtentWriter.
115 size_t block_size_; 115 size_t block_size_;
116 size_t bytes_written_mod_block_size_; 116 size_t bytes_written_mod_block_size_;
117 }; 117 };
118 118
119 } // namespace chromeos_update_engine 119 } // namespace chromeos_update_engine
120 120
121 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_EXTENT_WRITER_H__ 121 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_EXTENT_WRITER_H__
OLDNEW
« no previous file with comments | « no previous file | file_writer.h » ('j') | main.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698