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

Side by Side Diff: ipc/ipc_message.cc

Issue 868603007: Mechanical rename of base::debug -> base::trace_event [final pass]. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_trace_part3_1
Patch Set: Fixing win file. Created 5 years, 10 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 | « gpu/command_buffer/service/gpu_state_tracer.cc ('k') | net/base/trace_net_log_observer.h » ('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) 2012 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 "ipc/ipc_message.h" 5 #include "ipc/ipc_message.h"
6 6
7 #include "base/atomic_sequence_num.h" 7 #include "base/atomic_sequence_num.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "ipc/ipc_message_attachment.h" 10 #include "ipc/ipc_message_attachment.h"
11 #include "ipc/ipc_message_attachment_set.h" 11 #include "ipc/ipc_message_attachment_set.h"
12 12
13 #if defined(OS_POSIX) 13 #if defined(OS_POSIX)
14 #include "base/file_descriptor_posix.h" 14 #include "base/file_descriptor_posix.h"
15 #include "ipc/ipc_platform_file_attachment_posix.h" 15 #include "ipc/ipc_platform_file_attachment_posix.h"
16 #endif 16 #endif
17 17
18 namespace { 18 namespace {
19 19
20 base::StaticAtomicSequenceNumber g_ref_num; 20 base::StaticAtomicSequenceNumber g_ref_num;
21 21
22 // Create a reference number for identifying IPC messages in traces. The return 22 // Create a reference number for identifying IPC messages in traces. The return
23 // values has the reference number stored in the upper 24 bits, leaving the low 23 // values has the reference number stored in the upper 24 bits, leaving the low
24 // 8 bits set to 0 for use as flags. 24 // 8 bits set to 0 for use as flags.
25 inline uint32 GetRefNumUpper24() { 25 inline uint32 GetRefNumUpper24() {
26 base::debug::TraceLog* trace_log = base::debug::TraceLog::GetInstance(); 26 base::trace_event::TraceLog* trace_log =
27 base::trace_event::TraceLog::GetInstance();
27 uint32 pid = trace_log ? trace_log->process_id() : 0; 28 uint32 pid = trace_log ? trace_log->process_id() : 0;
28 uint32 count = g_ref_num.GetNext(); 29 uint32 count = g_ref_num.GetNext();
29 // The 24 bit hash is composed of 14 bits of the count and 10 bits of the 30 // The 24 bit hash is composed of 14 bits of the count and 10 bits of the
30 // Process ID. With the current trace event buffer cap, the 14-bit count did 31 // Process ID. With the current trace event buffer cap, the 14-bit count did
31 // not appear to wrap during a trace. Note that it is not a big deal if 32 // not appear to wrap during a trace. Note that it is not a big deal if
32 // collisions occur, as this is only used for debugging and trace analysis. 33 // collisions occur, as this is only used for debugging and trace analysis.
33 return ((pid << 14) | (count & 0x3fff)) << 8; 34 return ((pid << 14) | (count & 0x3fff)) << 8;
34 } 35 }
35 36
36 } // namespace 37 } // namespace
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 154
154 bool Message::HasAttachments() const { 155 bool Message::HasAttachments() const {
155 return attachment_set_.get() && !attachment_set_->empty(); 156 return attachment_set_.get() && !attachment_set_->empty();
156 } 157 }
157 158
158 bool Message::HasMojoHandles() const { 159 bool Message::HasMojoHandles() const {
159 return attachment_set_.get() && 0 < attachment_set_->num_mojo_handles(); 160 return attachment_set_.get() && 0 < attachment_set_->num_mojo_handles();
160 } 161 }
161 162
162 } // namespace IPC 163 } // namespace IPC
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gpu_state_tracer.cc ('k') | net/base/trace_net_log_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698