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

Side by Side Diff: base/win/event_trace_provider.cc

Issue 9584017: New test infrastructure for producing verbose logs in failing tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moved logging_win to logging/win so regular filename_rules work Created 8 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 | Annotate | Revision Log
« no previous file with comments | « base/logging_win.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/win/event_trace_provider.h" 5 #include "base/win/event_trace_provider.h"
6 #include <windows.h> 6 #include <windows.h>
7 #include <cguid.h> 7 #include <cguid.h>
8 8
9 namespace base { 9 namespace base {
10 namespace win { 10 namespace win {
11 11
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 ULONG EtwTraceProvider::Register() { 78 ULONG EtwTraceProvider::Register() {
79 if (provider_name_ == GUID_NULL) 79 if (provider_name_ == GUID_NULL)
80 return ERROR_INVALID_NAME; 80 return ERROR_INVALID_NAME;
81 81
82 return ::RegisterTraceGuids(ControlCallback, this, &provider_name_, 82 return ::RegisterTraceGuids(ControlCallback, this, &provider_name_,
83 1, &obligatory_guid_registration_, NULL, NULL, &registration_handle_); 83 1, &obligatory_guid_registration_, NULL, NULL, &registration_handle_);
84 } 84 }
85 85
86 ULONG EtwTraceProvider::Unregister() { 86 ULONG EtwTraceProvider::Unregister() {
87 // If a session is active, notify subclasses that it's going away.
88 if (session_handle_ != NULL)
89 DisableEvents();
90
87 ULONG ret = ::UnregisterTraceGuids(registration_handle_); 91 ULONG ret = ::UnregisterTraceGuids(registration_handle_);
88 92
89 // Make sure we don't log anything from here on.
90 enable_level_ = 0;
91 enable_flags_ = 0;
92 session_handle_ = NULL;
93 registration_handle_ = NULL; 93 registration_handle_ = NULL;
94 94
95 return ret; 95 return ret;
96 } 96 }
97 97
98 ULONG EtwTraceProvider::Log(const EtwEventClass& event_class, 98 ULONG EtwTraceProvider::Log(const EtwEventClass& event_class,
99 EtwEventType type, EtwEventLevel level, const char *message) { 99 EtwEventType type, EtwEventLevel level, const char *message) {
100 if (NULL == session_handle_ || enable_level_ < level) 100 if (NULL == session_handle_ || enable_level_ < level)
101 return ERROR_SUCCESS; // No one listening. 101 return ERROR_SUCCESS; // No one listening.
102 102
(...skipping 22 matching lines...) Expand all
125 125
126 ULONG EtwTraceProvider::Log(EVENT_TRACE_HEADER* event) { 126 ULONG EtwTraceProvider::Log(EVENT_TRACE_HEADER* event) {
127 if (enable_level_ < event->Class.Level) 127 if (enable_level_ < event->Class.Level)
128 return ERROR_SUCCESS; 128 return ERROR_SUCCESS;
129 129
130 return ::TraceEvent(session_handle_, event); 130 return ::TraceEvent(session_handle_, event);
131 } 131 }
132 132
133 } // namespace win 133 } // namespace win
134 } // namespace base 134 } // namespace base
OLDNEW
« no previous file with comments | « base/logging_win.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698