| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 public: | 54 public: |
| 55 class HeapSnapshotProgress { | 55 class HeapSnapshotProgress { |
| 56 public: | 56 public: |
| 57 virtual ~HeapSnapshotProgress() { } | 57 virtual ~HeapSnapshotProgress() { } |
| 58 virtual void Start(int totalWork) = 0; | 58 virtual void Start(int totalWork) = 0; |
| 59 virtual void Worked(int workDone) = 0; | 59 virtual void Worked(int workDone) = 0; |
| 60 virtual void Done() = 0; | 60 virtual void Done() = 0; |
| 61 virtual bool isCanceled() = 0; | 61 virtual bool isCanceled() = 0; |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 class OutputStream { |
| 65 public: |
| 66 virtual ~OutputStream() { } |
| 67 virtual void write(const uint32_t* chunk, const int size) = 0; |
| 68 }; |
| 69 |
| 64 static void collectGarbage(); | 70 static void collectGarbage(); |
| 65 static ScriptObject objectByHeapObjectId(unsigned id); | 71 static ScriptObject objectByHeapObjectId(unsigned id); |
| 66 static unsigned getHeapObjectId(const ScriptValue&); | 72 static unsigned getHeapObjectId(const ScriptValue&); |
| 67 static void start(ScriptState* state, const String& title); | 73 static void start(ScriptState* state, const String& title); |
| 68 static void startForPage(Page*, const String& title); | 74 static void startForPage(Page*, const String& title); |
| 69 static void startForWorkerContext(WorkerContext*, const String& title); | 75 static void startForWorkerContext(WorkerContext*, const String& title); |
| 70 static PassRefPtr<ScriptProfile> stop(ScriptState* state, const String& titl
e); | 76 static PassRefPtr<ScriptProfile> stop(ScriptState* state, const String& titl
e); |
| 71 static PassRefPtr<ScriptProfile> stopForPage(Page*, const String& title); | 77 static PassRefPtr<ScriptProfile> stopForPage(Page*, const String& title); |
| 72 static PassRefPtr<ScriptProfile> stopForWorkerContext(WorkerContext*, const
String& title); | 78 static PassRefPtr<ScriptProfile> stopForWorkerContext(WorkerContext*, const
String& title); |
| 73 static PassRefPtr<ScriptHeapSnapshot> takeHeapSnapshot(const String& title,
HeapSnapshotProgress*); | 79 static PassRefPtr<ScriptHeapSnapshot> takeHeapSnapshot(const String& title,
HeapSnapshotProgress*); |
| 80 static void startTrackingHeapObjects(); |
| 81 static void stopTrackingHeapObjects(); |
| 82 static unsigned requestHeapStatsUpdate(OutputStream*); |
| 74 static void initialize(); | 83 static void initialize(); |
| 75 static void visitNodeWrappers(WrappedNodeVisitor*); | 84 static void visitNodeWrappers(WrappedNodeVisitor*); |
| 76 static void visitExternalStrings(ExternalStringVisitor*); | 85 static void visitExternalStrings(ExternalStringVisitor*); |
| 77 static void visitExternalArrays(ExternalArrayVisitor*); | 86 static void visitExternalArrays(ExternalArrayVisitor*); |
| 78 static void collectBindingMemoryInfo(MemoryInstrumentation*); | 87 static void collectBindingMemoryInfo(MemoryInstrumentation*); |
| 79 static size_t profilerSnapshotsSize(); | 88 static size_t profilerSnapshotsSize(); |
| 80 static HashMap<String, double>* currentProfileNameIdleTimeMap(); | 89 static HashMap<String, double>* currentProfileNameIdleTimeMap(); |
| 81 }; | 90 }; |
| 82 | 91 |
| 83 } // namespace WebCore | 92 } // namespace WebCore |
| 84 | 93 |
| 85 #endif // ScriptProfiler_h | 94 #endif // ScriptProfiler_h |
| OLD | NEW |