Chromium Code Reviews| Index: chrome/test/pyautolib/remote_inspector_client.py |
| diff --git a/chrome/test/pyautolib/remote_inspector_client.py b/chrome/test/pyautolib/remote_inspector_client.py |
| index bda06c7ebef254b27e3e005115144c35ccc99e88..56575b49dde397e027d17e1643464a511cae3ece 100755 |
| --- a/chrome/test/pyautolib/remote_inspector_client.py |
| +++ b/chrome/test/pyautolib/remote_inspector_client.py |
| @@ -711,6 +711,11 @@ class NativeMemorySnapshot(object): |
| Public Methods: |
| GetProcessPrivateMemorySize: The process total size. |
| GetUnknownSize: Size of not instrumented parts. |
| + GetInstrumentedObjectsCount: Number of instrumented objects traversed by |
| + DevTools memory instrumentation. |
| + GetNumberOfInstrumentedObjectsNotInHeap: Number of instrumented objects |
| + visited by DevTools memory instrumentation that haven't been allocated |
| + by tcmalloc. |
| FindMemoryBlock: Given an array of memory block names return the block. |
| """ |
| def __init__(self, root_block): |
| @@ -726,6 +731,30 @@ class NativeMemorySnapshot(object): |
| known_size += child['size'] |
| return self.GetProcessPrivateMemorySize() - known_size |
| + def GetInstrumentedObjectsCount(self): |
| + """Returns number of objects visited by DevTools memory instrumentation. |
| + |
| + Returns: |
| + None if the number is not available. |
|
dennis_jeffrey
2012/10/04 22:02:57
nit: I'd prefer the "Returns:" section to fully de
yurys
2012/10/05 07:34:53
Done. Changed the text to "Number of known instrum
|
| + """ |
| + memory_block = self.FindMemoryBlock(['ProcessPrivateMemory', |
| + 'InstrumentedObjectsCount']) |
| + if not memory_block is None: |
| + return memory_block['size'] |
| + return None |
| + |
| + def GetNumberOfInstrumentedObjectsNotInHeap(self): |
| + """Returns number of instrumented objects unknown to tcmalloc. |
| + |
| + Returns: |
| + None if the number is not available. |
| + """ |
| + memory_block = self.FindMemoryBlock(['ProcessPrivateMemory', |
| + 'InstrumentedButNotAllocatedObjectsCount']) |
| + if not memory_block is None: |
| + return memory_block['size'] |
| + return None |
| + |
| def FindMemoryBlock(self, path): |
| """Find memory block with given path. |