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

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

Issue 1546143002: Switch to standard integer types in components/, part 1 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/browser_watcher/exit_funnel_win.h" 5 #include "components/browser_watcher/exit_funnel_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <stdint.h>
8 9
9 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
10 #include "base/time/time.h" 11 #include "base/time/time.h"
11 12
12 namespace browser_watcher { 13 namespace browser_watcher {
13 14
14 ExitFunnel::ExitFunnel() { 15 ExitFunnel::ExitFunnel() {
15 } 16 }
16 17
17 ExitFunnel::~ExitFunnel() { 18 ExitFunnel::~ExitFunnel() {
(...skipping 29 matching lines...) Expand all
47 return false; 48 return false;
48 } 49 }
49 50
50 return true; 51 return true;
51 } 52 }
52 53
53 bool ExitFunnel::RecordEvent(const base::char16* event_name) { 54 bool ExitFunnel::RecordEvent(const base::char16* event_name) {
54 if (!key_.Valid()) 55 if (!key_.Valid())
55 return false; 56 return false;
56 57
57 int64 now = base::Time::Now().ToInternalValue(); 58 int64_t now = base::Time::Now().ToInternalValue();
58 59
59 LONG res = key_.WriteValue(event_name, &now, sizeof(now), REG_QWORD); 60 LONG res = key_.WriteValue(event_name, &now, sizeof(now), REG_QWORD);
60 if (res != ERROR_SUCCESS) { 61 if (res != ERROR_SUCCESS) {
61 LOG(ERROR) << "Unable to write value " << event_name << " error " << res; 62 LOG(ERROR) << "Unable to write value " << event_name << " error " << res;
62 return false; 63 return false;
63 } 64 }
64 65
65 return true; 66 return true;
66 } 67 }
67 68
68 bool ExitFunnel::RecordSingleEvent(const base::char16* registry_path, 69 bool ExitFunnel::RecordSingleEvent(const base::char16* registry_path,
69 const base::char16* event_name) { 70 const base::char16* event_name) {
70 ExitFunnel funnel; 71 ExitFunnel funnel;
71 72
72 if (!funnel.Init(registry_path, base::GetCurrentProcessHandle())) 73 if (!funnel.Init(registry_path, base::GetCurrentProcessHandle()))
73 return false; 74 return false;
74 75
75 return funnel.RecordEvent(event_name); 76 return funnel.RecordEvent(event_name);
76 } 77 }
77 78
78 } // namespace browser_watcher 79 } // namespace browser_watcher
OLDNEW
« no previous file with comments | « components/browser_watcher/exit_code_watcher_win_unittest.cc ('k') | components/browser_watcher/exit_funnel_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698