OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 // Return the available virtual memory of the current machine, in MB. Or | 269 // Return the available virtual memory of the current machine, in MB. Or |
270 // zero, if there is no limit. | 270 // zero, if there is no limit. |
271 virtual size_t virtualMemoryLimitMB() { return 0; } | 271 virtual size_t virtualMemoryLimitMB() { return 0; } |
272 | 272 |
273 // True when Blink runs on low end devices. | 273 // True when Blink runs on low end devices. |
274 virtual bool isLowEndDeviceMode() { return false; } | 274 virtual bool isLowEndDeviceMode() { return false; } |
275 | 275 |
276 // Return the number of of processors of the current machine. | 276 // Return the number of of processors of the current machine. |
277 virtual size_t numberOfProcessors() { return 0; } | 277 virtual size_t numberOfProcessors() { return 0; } |
278 | 278 |
279 // Returns private and shared usage, in bytes. Private bytes is the amount o
f | |
280 // memory currently allocated to this process that cannot be shared. Returns | |
281 // false on platform specific error conditions. | |
282 virtual bool processMemorySizesInBytes(size_t* privateBytes, size_t* sharedB
ytes) { return false; } | |
283 | |
284 // Reports number of bytes used by memory allocator for internal needs. | |
285 // Returns true if the size has been reported, or false otherwise. | |
286 virtual bool memoryAllocatorWasteInBytes(size_t*) { return false; } | |
287 | |
288 // Allocates discardable memory. May return nullptr, even if the platform su
pports | 279 // Allocates discardable memory. May return nullptr, even if the platform su
pports |
289 // discardable memory. If nonzero, however, then the WebDiscardableMmeory is | 280 // discardable memory. If nonzero, however, then the WebDiscardableMmeory is |
290 // returned in an locked state. You may use its underlying data() member | 281 // returned in an locked state. You may use its underlying data() member |
291 // directly, taking care to unlock it when you are ready to let it become | 282 // directly, taking care to unlock it when you are ready to let it become |
292 // discardable. | 283 // discardable. |
293 virtual WebDiscardableMemory* allocateAndLockDiscardableMemory(size_t bytes)
{ return nullptr; } | 284 virtual WebDiscardableMemory* allocateAndLockDiscardableMemory(size_t bytes)
{ return nullptr; } |
294 | 285 |
295 static const size_t noDecodedImageByteLimit = static_cast<size_t>(-1); | 286 static const size_t noDecodedImageByteLimit = static_cast<size_t>(-1); |
296 | 287 |
297 // Returns the maximum amount of memory a decoded image should be allowed. | 288 // Returns the maximum amount of memory a decoded image should be allowed. |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 protected: | 728 protected: |
738 BLINK_PLATFORM_EXPORT Platform(); | 729 BLINK_PLATFORM_EXPORT Platform(); |
739 virtual ~Platform() { } | 730 virtual ~Platform() { } |
740 | 731 |
741 WebThread* m_mainThread; | 732 WebThread* m_mainThread; |
742 }; | 733 }; |
743 | 734 |
744 } // namespace blink | 735 } // namespace blink |
745 | 736 |
746 #endif | 737 #endif |
OLD | NEW |