Index: webkit/glue/dalvik_heap_size_android.h |
diff --git a/webkit/glue/dalvik_heap_size_android.h b/webkit/glue/dalvik_heap_size_android.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..096a85bfef410e0aeaeff451d6451e92f5b4fc8e |
--- /dev/null |
+++ b/webkit/glue/dalvik_heap_size_android.h |
@@ -0,0 +1,34 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef DALVIK_VM_HEAP_SIZE_ANDROID_H_ |
+#define DALVIK_VM_HEAP_SIZE_ANDROID_H_ |
+ |
+#include <string> |
+#include <sys/system_properties.h> |
+ |
+#include "base/string_number_conversions.h" |
tonyg
2012/04/19 16:04:30
The two includes above should move to the .cc file
ulan
2012/04/19 17:46:24
Done.
|
+ |
+namespace webkit_glue{ |
tonyg
2012/04/19 16:04:30
nit: space before {
ulan
2012/04/19 17:46:24
Done.
|
+// A simple class to cache the heap size of the device. |
+class DalvikHeapSize { |
+ public: |
+ // Retrieves the Singleton. |
+ static DalvikHeapSize* GetInstance(); |
+ |
+ DalvikHeapSize(); |
+ ~DalvikHeapSize(); |
tonyg
2012/04/19 16:04:30
These should both be private since it is only supp
ulan
2012/04/19 17:46:24
This gives compiler error, Singleton apparently re
|
+ |
+ int HeapSizeMB(); |
tonyg
2012/04/19 16:04:30
Mark this const.
ulan
2012/04/19 17:46:24
Done.
|
+ |
+ private: |
+ |
tonyg
2012/04/19 16:04:30
No need for this linebreak
ulan
2012/04/19 17:46:24
Done.
|
+ int heap_size_mb_; |
+ |
+ int ParseHeapSize(const std::string& str); |
tonyg
2012/04/19 16:04:30
const
ulan
2012/04/19 17:46:24
Done.
|
+}; |
+ |
+} // webkit_glue namespace |
+ |
+#endif // DALVIK_VM_HEAP_SIZE_ANDROID_H_ |