Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Side by Side Diff: third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.h

Issue 1767883002: DevTools: generate string16-based handlers for v8_inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for landing 2 Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 29 matching lines...) Expand all
40 40
41 namespace v8 { 41 namespace v8 {
42 class Isolate; 42 class Isolate;
43 } 43 }
44 44
45 namespace blink { 45 namespace blink {
46 46
47 class V8HeapProfilerAgent; 47 class V8HeapProfilerAgent;
48 class V8RuntimeAgent; 48 class V8RuntimeAgent;
49 49
50 typedef String ErrorString;
51
52 class CORE_EXPORT InspectorHeapProfilerAgent final : public InspectorBaseAgent<I nspectorHeapProfilerAgent, protocol::Frontend::HeapProfiler>, public protocol::D ispatcher::HeapProfilerCommandHandler { 50 class CORE_EXPORT InspectorHeapProfilerAgent final : public InspectorBaseAgent<I nspectorHeapProfilerAgent, protocol::Frontend::HeapProfiler>, public protocol::D ispatcher::HeapProfilerCommandHandler {
53 WTF_MAKE_NONCOPYABLE(InspectorHeapProfilerAgent); 51 WTF_MAKE_NONCOPYABLE(InspectorHeapProfilerAgent);
54 USING_FAST_MALLOC_WILL_BE_REMOVED(InspectorHeapProfilerAgent); 52 USING_FAST_MALLOC_WILL_BE_REMOVED(InspectorHeapProfilerAgent);
55 public: 53 public:
56 static PassOwnPtrWillBeRawPtr<InspectorHeapProfilerAgent> create(v8::Isolate *, V8RuntimeAgent*); 54 static PassOwnPtrWillBeRawPtr<InspectorHeapProfilerAgent> create(v8::Isolate *, V8RuntimeAgent*);
57 ~InspectorHeapProfilerAgent() override; 55 ~InspectorHeapProfilerAgent() override;
58 56
59 // InspectorBaseAgent overrides. 57 // InspectorBaseAgent overrides.
60 void setState(protocol::DictionaryValue*) override; 58 void setState(protocol::DictionaryValue*) override;
61 void setFrontend(protocol::Frontend*) override; 59 void setFrontend(protocol::Frontend*) override;
62 void clearFrontend() override; 60 void clearFrontend() override;
63 void restore() override; 61 void restore() override;
64 62
65 void enable(ErrorString*) override; 63 void enable(ErrorString*) override;
66 void disable(ErrorString*) override; 64 void disable(ErrorString*) override;
67 void startTrackingHeapObjects(ErrorString*, const Maybe<bool>& trackAllocati ons) override; 65 void startTrackingHeapObjects(ErrorString*, const Maybe<bool>& trackAllocati ons) override;
68 void stopTrackingHeapObjects(ErrorString*, const Maybe<bool>& reportProgress ) override; 66 void stopTrackingHeapObjects(ErrorString*, const Maybe<bool>& reportProgress ) override;
69 void takeHeapSnapshot(ErrorString*, const Maybe<bool>& reportProgress) overr ide; 67 void takeHeapSnapshot(ErrorString*, const Maybe<bool>& reportProgress) overr ide;
70 void collectGarbage(ErrorString*) override; 68 void collectGarbage(ErrorString*) override;
71 void getObjectByHeapObjectId(ErrorString*, const String& objectId, const May be<String>& objectGroup, OwnPtr<protocol::Runtime::RemoteObject>* result) overri de; 69 void getObjectByHeapObjectId(ErrorString*, const String16& objectId, const M aybe<String16>& objectGroup, OwnPtr<protocol::Runtime::RemoteObject>* result) ov erride;
72 void addInspectedHeapObject(ErrorString*, const String& heapObjectId) overri de; 70 void addInspectedHeapObject(ErrorString*, const String16& heapObjectId) over ride;
73 void getHeapObjectId(ErrorString*, const String& objectId, String* heapSnaps hotObjectId) override; 71 void getHeapObjectId(ErrorString*, const String16& objectId, String16* heapS napshotObjectId) override;
74 void startSampling(ErrorString*) override; 72 void startSampling(ErrorString*) override;
75 void stopSampling(ErrorString*, OwnPtr<protocol::HeapProfiler::SamplingHeapP rofile>*) override; 73 void stopSampling(ErrorString*, OwnPtr<protocol::HeapProfiler::SamplingHeapP rofile>*) override;
76 74
77 private: 75 private:
78 class HeapStatsUpdateTask; 76 class HeapStatsUpdateTask;
79 77
80 InspectorHeapProfilerAgent(v8::Isolate*, V8RuntimeAgent*); 78 InspectorHeapProfilerAgent(v8::Isolate*, V8RuntimeAgent*);
81 79
82 void startUpdateStatsTimer(); 80 void startUpdateStatsTimer();
83 void stopUpdateStatsTimer(); 81 void stopUpdateStatsTimer();
84 bool isInspectableHeapObject(unsigned id); 82 bool isInspectableHeapObject(unsigned id);
85 83
86 OwnPtr<V8HeapProfilerAgent> m_v8HeapProfilerAgent; 84 OwnPtr<V8HeapProfilerAgent> m_v8HeapProfilerAgent;
87 OwnPtr<HeapStatsUpdateTask> m_heapStatsUpdateTask; 85 OwnPtr<HeapStatsUpdateTask> m_heapStatsUpdateTask;
88 v8::Isolate* m_isolate; 86 v8::Isolate* m_isolate;
89 }; 87 };
90 88
91 } // namespace blink 89 } // namespace blink
92 90
93 #endif // !defined(InspectorHeapProfilerAgent_h) 91 #endif // !defined(InspectorHeapProfilerAgent_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698