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

Side by Side Diff: content/browser/browser_ipc_logging.cc

Issue 1008613002: favor DCHECK_CURRENTLY_ON for better logs in content/browser/[a-d]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « content/browser/browser_context.cc ('k') | content/browser/browser_main_loop.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/public/browser/browser_ipc_logging.h" 5 #include "content/public/browser/browser_ipc_logging.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/common/child_process_messages.h" 8 #include "content/common/child_process_messages.h"
9 #include "content/public/browser/browser_child_process_host_iterator.h" 9 #include "content/public/browser/browser_child_process_host_iterator.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
11 #include "content/public/browser/render_process_host.h" 11 #include "content/public/browser/render_process_host.h"
12 #include "ipc/ipc_logging.h" 12 #include "ipc/ipc_logging.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 #if defined(IPC_MESSAGE_LOG_ENABLED) 16 #if defined(IPC_MESSAGE_LOG_ENABLED)
17 17
18 void EnableIPCLoggingForChildProcesses(bool enabled) { 18 void EnableIPCLoggingForChildProcesses(bool enabled) {
19 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 19 DCHECK_CURRENTLY_ON(BrowserThread::IO);
20 20
21 BrowserChildProcessHostIterator i; // default constr references a singleton 21 BrowserChildProcessHostIterator i; // default constr references a singleton
22 while (!i.Done()) { 22 while (!i.Done()) {
23 i.Send(new ChildProcessMsg_SetIPCLoggingEnabled(enabled)); 23 i.Send(new ChildProcessMsg_SetIPCLoggingEnabled(enabled));
24 ++i; 24 ++i;
25 } 25 }
26 } 26 }
27 27
28 void EnableIPCLogging(bool enable) { 28 void EnableIPCLogging(bool enable) {
29 // First enable myself. 29 // First enable myself.
(...skipping 12 matching lines...) Expand all
42 // Finally, tell the renderers which don't derive from ChildProcess. 42 // Finally, tell the renderers which don't derive from ChildProcess.
43 // Messages to the renderers must be done on the UI (main) thread. 43 // Messages to the renderers must be done on the UI (main) thread.
44 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); 44 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator());
45 !i.IsAtEnd(); i.Advance()) 45 !i.IsAtEnd(); i.Advance())
46 i.GetCurrentValue()->Send(new ChildProcessMsg_SetIPCLoggingEnabled(enable)); 46 i.GetCurrentValue()->Send(new ChildProcessMsg_SetIPCLoggingEnabled(enable));
47 } 47 }
48 48
49 #endif // IPC_MESSAGE_LOG_ENABLED 49 #endif // IPC_MESSAGE_LOG_ENABLED
50 50
51 } // namespace content 51 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_context.cc ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698