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

Side by Side Diff: src/platform.h

Issue 6240002: Introducing MemoryMappedExternalResource for creating an external... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 11 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 | src/platform-freebsd.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 // taking daylight savings time into account. 167 // taking daylight savings time into account.
168 static double LocalTimeOffset(); 168 static double LocalTimeOffset();
169 169
170 // Returns the daylight savings offset for the given time. 170 // Returns the daylight savings offset for the given time.
171 static double DaylightSavingsOffset(double time); 171 static double DaylightSavingsOffset(double time);
172 172
173 // Returns last OS error. 173 // Returns last OS error.
174 static int GetLastError(); 174 static int GetLastError();
175 175
176 static FILE* FOpen(const char* path, const char* mode); 176 static FILE* FOpen(const char* path, const char* mode);
177 static bool Remove(const char* path);
177 178
178 // Log file open mode is platform-dependent due to line ends issues. 179 // Log file open mode is platform-dependent due to line ends issues.
179 static const char* LogFileOpenMode; 180 static const char* LogFileOpenMode;
180 181
181 // Print output to console. This is mostly used for debugging output. 182 // Print output to console. This is mostly used for debugging output.
182 // On platforms that has standard terminal output, the output 183 // On platforms that has standard terminal output, the output
183 // should go to stdout. 184 // should go to stdout.
184 static void Print(const char* format, ...); 185 static void Print(const char* format, ...);
185 static void VPrint(const char* format, va_list args); 186 static void VPrint(const char* format, va_list args);
186 187
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 // Factory method for creating platform dependent Semaphore. 245 // Factory method for creating platform dependent Semaphore.
245 // Please use delete to reclaim the storage for the returned Semaphore. 246 // Please use delete to reclaim the storage for the returned Semaphore.
246 static Semaphore* CreateSemaphore(int count); 247 static Semaphore* CreateSemaphore(int count);
247 248
248 // Factory method for creating platform dependent Socket. 249 // Factory method for creating platform dependent Socket.
249 // Please use delete to reclaim the storage for the returned Socket. 250 // Please use delete to reclaim the storage for the returned Socket.
250 static Socket* CreateSocket(); 251 static Socket* CreateSocket();
251 252
252 class MemoryMappedFile { 253 class MemoryMappedFile {
253 public: 254 public:
255 static MemoryMappedFile* open(const char* name);
254 static MemoryMappedFile* create(const char* name, int size, void* initial); 256 static MemoryMappedFile* create(const char* name, int size, void* initial);
255 virtual ~MemoryMappedFile() { } 257 virtual ~MemoryMappedFile() { }
256 virtual void* memory() = 0; 258 virtual void* memory() = 0;
259 virtual int size() = 0;
257 }; 260 };
258 261
259 // Safe formatting print. Ensures that str is always null-terminated. 262 // Safe formatting print. Ensures that str is always null-terminated.
260 // Returns the number of chars written, or -1 if output was truncated. 263 // Returns the number of chars written, or -1 if output was truncated.
261 static int SNPrintF(Vector<char> str, const char* format, ...); 264 static int SNPrintF(Vector<char> str, const char* format, ...);
262 static int VSNPrintF(Vector<char> str, 265 static int VSNPrintF(Vector<char> str,
263 const char* format, 266 const char* format,
264 va_list args); 267 va_list args);
265 268
266 static char* StrChr(char* str, int c); 269 static char* StrChr(char* str, int c);
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 PlatformData* data_; // Platform specific data. 627 PlatformData* data_; // Platform specific data.
625 int samples_taken_; // Counts stack samples taken. 628 int samples_taken_; // Counts stack samples taken.
626 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); 629 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler);
627 }; 630 };
628 631
629 #endif // ENABLE_LOGGING_AND_PROFILING 632 #endif // ENABLE_LOGGING_AND_PROFILING
630 633
631 } } // namespace v8::internal 634 } } // namespace v8::internal
632 635
633 #endif // V8_PLATFORM_H_ 636 #endif // V8_PLATFORM_H_
OLDNEW
« no previous file with comments | « no previous file | src/platform-freebsd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698