OLD | NEW |
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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1943 | 1943 |
1944 #if defined(OS_WIN) | 1944 #if defined(OS_WIN) |
1945 // The cbstext.dll loads as a global GetMessage hook in the browser process | 1945 // The cbstext.dll loads as a global GetMessage hook in the browser process |
1946 // and intercepts/unintercepts the kernel32 API SetPriorityClass in a | 1946 // and intercepts/unintercepts the kernel32 API SetPriorityClass in a |
1947 // background thread. If the UI thread invokes this API just when it is | 1947 // background thread. If the UI thread invokes this API just when it is |
1948 // intercepted the stack is messed up on return from the interceptor | 1948 // intercepted the stack is messed up on return from the interceptor |
1949 // which causes random crashes in the browser process. Our hack for now | 1949 // which causes random crashes in the browser process. Our hack for now |
1950 // is to not invoke the SetPriorityClass API if the dll is loaded. | 1950 // is to not invoke the SetPriorityClass API if the dll is loaded. |
1951 if (GetModuleHandle(L"cbstext.dll")) | 1951 if (GetModuleHandle(L"cbstext.dll")) |
1952 return; | 1952 return; |
| 1953 #endif // OS_WIN |
| 1954 |
| 1955 // Notify the child process of background state. |
| 1956 Send(new ChildProcessMsg_SetProcessBackgrounded(backgrounded)); |
| 1957 |
| 1958 #if !defined(OS_WIN) |
| 1959 // Backgrounding may require elevated privileges not available to renderer |
| 1960 // processes, so control backgrounding from the process host. |
1953 | 1961 |
1954 // Windows Vista+ has a fancy process backgrounding mode that can only be set | 1962 // Windows Vista+ has a fancy process backgrounding mode that can only be set |
1955 // from within the process. So notify the child process of background state. | 1963 // from within the process. |
1956 Send(new ChildProcessMsg_SetProcessBackgrounded(backgrounded)); | |
1957 #else | |
1958 | |
1959 // Backgrounding may require elevated privileges not available to renderer | |
1960 // processes, so control backgrounding from the process host. | |
1961 child_process_launcher_->SetProcessBackgrounded(backgrounded); | 1964 child_process_launcher_->SetProcessBackgrounded(backgrounded); |
1962 #endif // OS_WIN | 1965 #endif // !OS_WIN |
1963 } | 1966 } |
1964 | 1967 |
1965 void RenderProcessHostImpl::OnProcessLaunched() { | 1968 void RenderProcessHostImpl::OnProcessLaunched() { |
1966 // No point doing anything, since this object will be destructed soon. We | 1969 // No point doing anything, since this object will be destructed soon. We |
1967 // especially don't want to send the RENDERER_PROCESS_CREATED notification, | 1970 // especially don't want to send the RENDERER_PROCESS_CREATED notification, |
1968 // since some clients might expect a RENDERER_PROCESS_TERMINATED afterwards to | 1971 // since some clients might expect a RENDERER_PROCESS_TERMINATED afterwards to |
1969 // properly cleanup. | 1972 // properly cleanup. |
1970 if (deleting_soon_) | 1973 if (deleting_soon_) |
1971 return; | 1974 return; |
1972 | 1975 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2083 mojo::ScopedMessagePipeHandle handle) { | 2086 mojo::ScopedMessagePipeHandle handle) { |
2084 mojo_activation_required_ = true; | 2087 mojo_activation_required_ = true; |
2085 MaybeActivateMojo(); | 2088 MaybeActivateMojo(); |
2086 | 2089 |
2087 mojo::AllocationScope scope; | 2090 mojo::AllocationScope scope; |
2088 mojo_application_host_->shell_client()->AcceptConnection(service_name, | 2091 mojo_application_host_->shell_client()->AcceptConnection(service_name, |
2089 handle.Pass()); | 2092 handle.Pass()); |
2090 } | 2093 } |
2091 | 2094 |
2092 } // namespace content | 2095 } // namespace content |
OLD | NEW |