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

Side by Side Diff: snapshot/thread_snapshot.h

Issue 597673004: Add the Snapshot interface (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Make everything else const too Created 6 years, 2 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
« no previous file with comments | « snapshot/system_snapshot.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #ifndef CRASHPAD_SNAPSHOT_THREAD_SNAPSHOT_H_
16 #define CRASHPAD_SNAPSHOT_THREAD_SNAPSHOT_H_
17
18 #include <stdint.h>
19
20 namespace crashpad {
21
22 struct CPUContext;
23 class MemorySnapshot;
24
25 //! \brief An abstract interface to a snapshot representing a thread
26 //! (lightweight process) present in a snapshot process.
27 class ThreadSnapshot {
28 public:
29 //! \brief Returns a CPUContext object corresponding to the thread’s CPU
30 //! context.
31 //!
32 //! The caller does not take ownership of this object, it is scoped to the
33 //! lifetime of the ThreadSnapshot object that it was obtained from.
34 virtual const CPUContext* Context() const = 0;
35
36 //! \brief Returns a MemorySnapshot object corresponding to the memory region
37 //! that contains the thread’s stack.
38 //!
39 //! The caller does not take ownership of this object, it is scoped to the
40 //! lifetime of the ThreadSnapshot object that it was obtained from.
41 virtual const MemorySnapshot* Stack() const = 0;
42
43 //! \brief Returns the thread’s identifier.
44 //!
45 //! Thread identifiers are at least unique within a process, and may be unique
46 //! system-wide.
47 virtual uint64_t ThreadID() const = 0;
48
49 //! \brief Returns the thread’s suspend count.
50 //!
51 //! A suspend count of `0` denotes a schedulable (not suspended) thread.
52 virtual int SuspendCount() const = 0;
53
54 //! \brief Returns the thread’s priority.
55 //!
56 //! Threads with higher priorities will have higher priority values.
57 virtual int Priority() const = 0;
58
59 //! \brief Returns the base address of a region used to store thread-specific
60 //! data.
61 virtual uint64_t ThreadSpecificDataAddress() const = 0;
62
63 protected:
64 ~ThreadSnapshot() {}
65 };
66
67 } // namespace crashpad
68
69 #endif // CRASHPAD_SNAPSHOT_THREAD_SNAPSHOT_H_
OLDNEW
« no previous file with comments | « snapshot/system_snapshot.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698