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 | |
1953 | 1954 |
1954 // Windows Vista+ has a fancy process backgrounding mode that can only be set | 1955 // Notify the child process of background state. |
1955 // from within the process. So notify the child process of background state. | |
1956 Send(new ChildProcessMsg_SetProcessBackgrounded(backgrounded)); | 1956 Send(new ChildProcessMsg_SetProcessBackgrounded(backgrounded)); |
1957 #else | |
1958 | 1957 |
1958 #if !defined(OS_WIN) | |
1959 // Backgrounding may require elevated privileges not available to renderer | 1959 // Backgrounding may require elevated privileges not available to renderer |
1960 // processes, so control backgrounding from the process host. | 1960 // processes, so control backgrounding from the process host. |
Avi (use Gerrit)
2014/05/29 14:24:16
Move the comment about Vista+ requiring doing it f
jeremy
2014/06/02 10:21:28
Done.
| |
1961 child_process_launcher_->SetProcessBackgrounded(backgrounded); | 1961 child_process_launcher_->SetProcessBackgrounded(backgrounded); |
1962 #endif // OS_WIN | 1962 #endif // !OS_WIN |
1963 } | 1963 } |
1964 | 1964 |
1965 void RenderProcessHostImpl::OnProcessLaunched() { | 1965 void RenderProcessHostImpl::OnProcessLaunched() { |
1966 // No point doing anything, since this object will be destructed soon. We | 1966 // No point doing anything, since this object will be destructed soon. We |
1967 // especially don't want to send the RENDERER_PROCESS_CREATED notification, | 1967 // especially don't want to send the RENDERER_PROCESS_CREATED notification, |
1968 // since some clients might expect a RENDERER_PROCESS_TERMINATED afterwards to | 1968 // since some clients might expect a RENDERER_PROCESS_TERMINATED afterwards to |
1969 // properly cleanup. | 1969 // properly cleanup. |
1970 if (deleting_soon_) | 1970 if (deleting_soon_) |
1971 return; | 1971 return; |
1972 | 1972 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2083 mojo::ScopedMessagePipeHandle handle) { | 2083 mojo::ScopedMessagePipeHandle handle) { |
2084 mojo_activation_required_ = true; | 2084 mojo_activation_required_ = true; |
2085 MaybeActivateMojo(); | 2085 MaybeActivateMojo(); |
2086 | 2086 |
2087 mojo::AllocationScope scope; | 2087 mojo::AllocationScope scope; |
2088 mojo_application_host_->shell_client()->AcceptConnection(service_name, | 2088 mojo_application_host_->shell_client()->AcceptConnection(service_name, |
2089 handle.Pass()); | 2089 handle.Pass()); |
2090 } | 2090 } |
2091 | 2091 |
2092 } // namespace content | 2092 } // namespace content |
OLD | NEW |