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

Unified Diff: runtime/bin/file.h

Issue 2694103004: Cleanup app snapshots on isolate/vm exit. (Closed)
Patch Set: merge Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/extensions_win.cc ('k') | runtime/bin/file_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file.h
diff --git a/runtime/bin/file.h b/runtime/bin/file.h
index d5d76b77cd6ab7c304514adc7b42cf112df40d0a..ec4ca3bab51aeffebf86467fdae150b8318b944e 100644
--- a/runtime/bin/file.h
+++ b/runtime/bin/file.h
@@ -21,6 +21,23 @@ namespace bin {
// Forward declaration.
class FileHandle;
+class MappedMemory {
+ public:
+ MappedMemory(void* address, intptr_t size) : address_(address), size_(size) {}
+ ~MappedMemory() { Unmap(); }
+
+ void* address() const { return address_; }
+ intptr_t size() const { return size_; }
+
+ private:
+ void Unmap();
+
+ void* address_;
+ intptr_t size_;
+
+ DISALLOW_COPY_AND_ASSIGN(MappedMemory);
+};
+
class File : public ReferenceCounted<File> {
public:
enum FileOpenMode {
@@ -83,7 +100,7 @@ class File : public ReferenceCounted<File> {
kReadOnly = 0,
kReadExecute = 1,
};
- void* Map(MapType type, int64_t position, int64_t length);
+ MappedMemory* Map(MapType type, int64_t position, int64_t length);
// Read/Write attempt to transfer num_bytes to/from buffer. It returns
// the number of bytes read/written.
« no previous file with comments | « runtime/bin/extensions_win.cc ('k') | runtime/bin/file_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698