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

Side by Side Diff: components/browser_watcher/exit_funnel_win.h

Issue 792163002: Add ExitFunnel to prepare for instrumenting browser exits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Add some more testing, make a start on pulling the reader to a standalone function. Created 6 years 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
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_BROWSER_WATCHER_END_SESSION_WIN_H_
erikwright (departed) 2014/12/12 16:58:29 fix this guard
Sigurður Ásgeirsson 2014/12/12 20:25:13 Done.
6 #define COMPONENTS_BROWSER_WATCHER_END_SESSION_WIN_H_
7
8 #include "base/process/process_handle.h"
9 #include "base/strings/string16.h"
10 #include "base/win/registry.h"
11
12 namespace browser_watcher {
13
14 // A wrapper class that takes care of persistently recording a trace of named,
15 // timed events in registry, associated with a process instance. This allows
16 // reconstructing and reporting an event trace on a subsequent launch.
17 class ExitFunnel {
18 public:
19 ExitFunnel();
20 ~ExitFunnel();
21
22 // Initializes the exit funnel with |registry_path| and |process|.
23 // |process| must be open for PROCESS_QUERY_INFORMATION at least.
24 // Returns false on failure to create or open the registry path corresponding
25 // to |process|.
26 bool Init(const base::char16* registry_path, base::ProcessHandle process);
27
28 // Records |event_name| at the current time in the registry for the process
29 // this instance is associated with. Returns false on failure to record the
30 // event.
31 bool RecordEvent(const base::char16* event_name);
32
33 // Records |event_name| at the current time in the registry at |registry_path|
34 // for this process.
35 static bool RecordSingleEvent(const base::char16* registry_path,
36 const base::char16* event_name);
37
38 private:
39 base::win::RegKey key_;
40 };
erikwright (departed) 2014/12/12 16:58:29 DISALLOW_...
Sigurður Ásgeirsson 2014/12/12 20:25:13 Ah - thanks.
41
42 } // namespace browser_watcher
43
44 #endif // COMPONENTS_BROWSER_WATCHER_END_SESSION_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698