Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <objidl.h> | 9 #include <objidl.h> |
| 10 #include <mlang.h> | 10 #include <mlang.h> |
| 11 #endif | 11 #endif |
| 12 | 12 |
| 13 #include "chrome/renderer/render_process_impl.h" | 13 #include "chrome/renderer/render_process_impl.h" |
| 14 | 14 |
| 15 #include "app/surface/transport_dib.h" | 15 #include "app/surface/transport_dib.h" |
| 16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
| 17 #include "base/command_line.h" | 17 #include "base/command_line.h" |
| 18 #include "base/compiler_specific.h" | 18 #include "base/compiler_specific.h" |
| 19 #include "base/file_util.h" | 19 #include "base/file_util.h" |
| 20 #include "base/message_loop.h" | 20 #include "base/message_loop.h" |
| 21 #include "base/metrics/histogram.h" | 21 #include "base/metrics/histogram.h" |
| 22 #include "base/nss_util.h" | |
| 22 #include "base/path_service.h" | 23 #include "base/path_service.h" |
| 23 #include "base/sys_info.h" | 24 #include "base/sys_info.h" |
| 24 #include "base/utf_string_conversions.h" | 25 #include "base/utf_string_conversions.h" |
| 25 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
| 26 #include "chrome/common/chrome_paths.h" | 27 #include "chrome/common/chrome_paths.h" |
| 27 #include "chrome/common/render_messages.h" | 28 #include "chrome/common/render_messages.h" |
| 28 #include "chrome/renderer/render_thread.h" | 29 #include "chrome/renderer/render_thread.h" |
| 29 #include "chrome/renderer/render_view.h" | 30 #include "chrome/renderer/render_view.h" |
| 30 #include "ipc/ipc_channel.h" | 31 #include "ipc/ipc_channel.h" |
| 31 #include "ipc/ipc_message_utils.h" | 32 #include "ipc/ipc_message_utils.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 152 // Need to patch a few functions for font loading to work correctly. | 153 // Need to patch a few functions for font loading to work correctly. |
| 153 FilePath pdf; | 154 FilePath pdf; |
| 154 if (PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf) && | 155 if (PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf) && |
| 155 file_util::PathExists(pdf)) { | 156 file_util::PathExists(pdf)) { |
| 156 g_iat_patch_createdca.Patch( | 157 g_iat_patch_createdca.Patch( |
| 157 pdf.value().c_str(), "gdi32.dll", "CreateDCA", CreateDCAPatch); | 158 pdf.value().c_str(), "gdi32.dll", "CreateDCA", CreateDCAPatch); |
| 158 g_iat_patch_get_font_data.Patch( | 159 g_iat_patch_get_font_data.Patch( |
| 159 pdf.value().c_str(), "gdi32.dll", "GetFontData", GetFontDataPatch); | 160 pdf.value().c_str(), "gdi32.dll", "GetFontData", GetFontDataPatch); |
| 160 } | 161 } |
| 161 #endif | 162 #endif |
| 163 | |
| 164 #if defined(OS_LINUX) | |
| 165 // Remoting requires NSS to function properly. | |
| 166 if (command_line.HasSwitch(switches::kEnableRemoting)) { | |
| 167 // We are going to fork to engage the sandbox and we have not loaded | |
| 168 // any security modules so it is safe to disable the fork check in NSS. | |
| 169 base::DisableNSSForkCheck(); | |
| 170 base::EnsureNSPRInit(); | |
|
wtc
2011/03/15 00:21:45
EnsureNSSNoDBInit calls EnsureNSPRInit, so you don
Alpha Left Google
2011/03/15 01:27:51
Done.
| |
| 171 base::EnsureNSSNoDBInit(); | |
| 172 } | |
| 173 #endif | |
| 162 } | 174 } |
| 163 | 175 |
| 164 RenderProcessImpl::~RenderProcessImpl() { | 176 RenderProcessImpl::~RenderProcessImpl() { |
| 165 // TODO(port): Try and limit what we pull in for our non-Win unit test bundle. | 177 // TODO(port): Try and limit what we pull in for our non-Win unit test bundle. |
| 166 #ifndef NDEBUG | 178 #ifndef NDEBUG |
| 167 // log important leaked objects | 179 // log important leaked objects |
| 168 webkit_glue::CheckForLeaks(); | 180 webkit_glue::CheckForLeaks(); |
| 169 #endif | 181 #endif |
| 170 | 182 |
| 171 GetShutDownEvent()->Signal(); | 183 GetShutDownEvent()->Signal(); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 321 } | 333 } |
| 322 | 334 |
| 323 void RenderProcessImpl::ClearTransportDIBCache() { | 335 void RenderProcessImpl::ClearTransportDIBCache() { |
| 324 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) { | 336 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) { |
| 325 if (shared_mem_cache_[i]) { | 337 if (shared_mem_cache_[i]) { |
| 326 FreeTransportDIB(shared_mem_cache_[i]); | 338 FreeTransportDIB(shared_mem_cache_[i]); |
| 327 shared_mem_cache_[i] = NULL; | 339 shared_mem_cache_[i] = NULL; |
| 328 } | 340 } |
| 329 } | 341 } |
| 330 } | 342 } |
| OLD | NEW |