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

Side by Side Diff: content/child/child_process.h

Issue 2334533002: base: Move renderer threads to the appropriate cpuset. (Closed)
Patch Set: Created 4 years, 3 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) 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 #ifndef CONTENT_CHILD_CHILD_PROCESS_H_ 5 #ifndef CONTENT_CHILD_CHILD_PROCESS_H_
6 #define CONTENT_CHILD_CHILD_PROCESS_H_ 6 #define CONTENT_CHILD_CHILD_PROCESS_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // These are used for ref-counting the child process. The process shuts 62 // These are used for ref-counting the child process. The process shuts
63 // itself down when the ref count reaches 0. 63 // itself down when the ref count reaches 0.
64 // For example, in the renderer process, generally each tab managed by this 64 // For example, in the renderer process, generally each tab managed by this
65 // process will hold a reference to the process, and release when closed. 65 // process will hold a reference to the process, and release when closed.
66 // However for renderer processes specifically, there is also fast shutdown 66 // However for renderer processes specifically, there is also fast shutdown
67 // code path initiated by the browser process. The process refcount does 67 // code path initiated by the browser process. The process refcount does
68 // not influence fast shutdown. See blink::Platform::suddenTerminationChanged. 68 // not influence fast shutdown. See blink::Platform::suddenTerminationChanged.
69 void AddRefProcess(); 69 void AddRefProcess();
70 void ReleaseProcess(); 70 void ReleaseProcess();
71 71
72 void SetIOThreadAffinity(base::ThreadPriority io_thread_priority);
73
72 // Getter for the one ChildProcess object for this process. Can only be called 74 // Getter for the one ChildProcess object for this process. Can only be called
73 // on the main thread. 75 // on the main thread.
74 static ChildProcess* current(); 76 static ChildProcess* current();
75 77
76 static void WaitForDebugger(const std::string& label); 78 static void WaitForDebugger(const std::string& label);
77 private: 79 private:
78 int ref_count_; 80 int ref_count_;
79 81
80 // An event that will be signalled when we shutdown. 82 // An event that will be signalled when we shutdown.
81 base::WaitableEvent shutdown_event_; 83 base::WaitableEvent shutdown_event_;
82 84
83 // The thread that handles IO events. 85 // The thread that handles IO events.
84 base::Thread io_thread_; 86 base::Thread io_thread_;
85 87
86 // NOTE: make sure that main_thread_ is listed after shutdown_event_, since 88 // NOTE: make sure that main_thread_ is listed after shutdown_event_, since
87 // it depends on it (indirectly through IPC::SyncChannel). Same for 89 // it depends on it (indirectly through IPC::SyncChannel). Same for
88 // io_thread_. 90 // io_thread_.
89 std::unique_ptr<ChildThreadImpl> main_thread_; 91 std::unique_ptr<ChildThreadImpl> main_thread_;
90 92
91 DISALLOW_COPY_AND_ASSIGN(ChildProcess); 93 DISALLOW_COPY_AND_ASSIGN(ChildProcess);
92 }; 94 };
93 95
94 } // namespace content 96 } // namespace content
95 97
96 #endif // CONTENT_CHILD_CHILD_PROCESS_H_ 98 #endif // CONTENT_CHILD_CHILD_PROCESS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698