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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 // Returns true if the size has been reported, or false otherwise. | 270 // Returns true if the size has been reported, or false otherwise. |
271 virtual bool memoryAllocatorWasteInBytes(size_t*) { return false; } | 271 virtual bool memoryAllocatorWasteInBytes(size_t*) { return false; } |
272 | 272 |
273 // Allocates discardable memory. May return 0, even if the platform supports | 273 // Allocates discardable memory. May return 0, even if the platform supports |
274 // discardable memory. If nonzero, however, then the WebDiscardableMmeory is | 274 // discardable memory. If nonzero, however, then the WebDiscardableMmeory is |
275 // returned in an locked state. You may use its underlying data() member | 275 // returned in an locked state. You may use its underlying data() member |
276 // directly, taking care to unlock it when you are ready to let it become | 276 // directly, taking care to unlock it when you are ready to let it become |
277 // discardable. | 277 // discardable. |
278 virtual WebDiscardableMemory* allocateAndLockDiscardableMemory(size_t bytes)
{ return 0; } | 278 virtual WebDiscardableMemory* allocateAndLockDiscardableMemory(size_t bytes)
{ return 0; } |
279 | 279 |
280 // A wrapper for tcmalloc's HeapProfilerStart(); | |
281 virtual void startHeapProfiling(const WebString& /*prefix*/) { } | |
282 // A wrapper for tcmalloc's HeapProfilerStop(); | |
283 virtual void stopHeapProfiling() { } | |
284 // A wrapper for tcmalloc's HeapProfilerDump() | |
285 virtual void dumpHeapProfiling(const WebString& /*reason*/) { } | |
286 // A wrapper for tcmalloc's GetHeapProfile() | |
287 virtual WebString getHeapProfile() { return WebString(); } | |
288 | |
289 static const size_t noDecodedImageByteLimit = static_cast<size_t>(-1); | 280 static const size_t noDecodedImageByteLimit = static_cast<size_t>(-1); |
290 | 281 |
291 // Returns the maximum amount of memory a decoded image should be allowed. | 282 // Returns the maximum amount of memory a decoded image should be allowed. |
292 // See comments on ImageDecoder::m_maxDecodedBytes. | 283 // See comments on ImageDecoder::m_maxDecodedBytes. |
293 virtual size_t maxDecodedImageBytes() { return noDecodedImageByteLimit; } | 284 virtual size_t maxDecodedImageBytes() { return noDecodedImageByteLimit; } |
294 | 285 |
295 | 286 |
296 // Message Ports ------------------------------------------------------- | 287 // Message Ports ------------------------------------------------------- |
297 | 288 |
298 // Creates a Message Port Channel pair. This can be called on any thread. | 289 // Creates a Message Port Channel pair. This can be called on any thread. |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 // Returns pointer to client owned WebBluetooth implementation. | 636 // Returns pointer to client owned WebBluetooth implementation. |
646 virtual WebBluetooth* bluetooth() { return 0; } | 637 virtual WebBluetooth* bluetooth() { return 0; } |
647 | 638 |
648 protected: | 639 protected: |
649 virtual ~Platform() { } | 640 virtual ~Platform() { } |
650 }; | 641 }; |
651 | 642 |
652 } // namespace blink | 643 } // namespace blink |
653 | 644 |
654 #endif | 645 #endif |
OLD | NEW |