| OLD | NEW |
| 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 "chrome/renderer/chrome_render_process_observer.h" | 5 #include "chrome/renderer/chrome_render_process_observer.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "content/common/resource_dispatcher_delegate.h" | 24 #include "content/common/resource_dispatcher_delegate.h" |
| 25 #include "content/common/view_messages.h" | 25 #include "content/common/view_messages.h" |
| 26 #include "content/renderer/render_thread.h" | 26 #include "content/renderer/render_thread.h" |
| 27 #include "content/renderer/render_view.h" | 27 #include "content/renderer/render_view.h" |
| 28 #include "content/renderer/render_view_visitor.h" | 28 #include "content/renderer/render_view_visitor.h" |
| 29 #include "crypto/nss_util.h" | 29 #include "crypto/nss_util.h" |
| 30 #include "media/base/media.h" | 30 #include "media/base/media.h" |
| 31 #include "media/base/media_switches.h" | 31 #include "media/base/media_switches.h" |
| 32 #include "net/base/net_errors.h" | 32 #include "net/base/net_errors.h" |
| 33 #include "net/base/net_module.h" | 33 #include "net/base/net_module.h" |
| 34 #include "net/ocsp/nss_ocsp.h" | |
| 35 #include "third_party/sqlite/sqlite3.h" | 34 #include "third_party/sqlite/sqlite3.h" |
| 36 #include "third_party/tcmalloc/chromium/src/google/malloc_extension.h" | 35 #include "third_party/tcmalloc/chromium/src/google/malloc_extension.h" |
| 37 #include "third_party/tcmalloc/chromium/src/google/heap-profiler.h" | 36 #include "third_party/tcmalloc/chromium/src/google/heap-profiler.h" |
| 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
| 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" | 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" |
| 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCrossOriginPreflig
htResultCache.h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCrossOriginPreflig
htResultCache.h" |
| 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFontCache.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFontCache.h" |
| 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" | 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" |
| 44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 #endif | 369 #endif |
| 371 | 370 |
| 372 #if defined(OS_POSIX) && !defined(OS_MACOSX) && defined(USE_NSS) | 371 #if defined(OS_POSIX) && !defined(OS_MACOSX) && defined(USE_NSS) |
| 373 // Remoting requires NSS to function properly. | 372 // Remoting requires NSS to function properly. |
| 374 if (!command_line.HasSwitch(switches::kSingleProcess)) { | 373 if (!command_line.HasSwitch(switches::kSingleProcess)) { |
| 375 // We are going to fork to engage the sandbox and we have not loaded | 374 // We are going to fork to engage the sandbox and we have not loaded |
| 376 // any security modules so it is safe to disable the fork check in NSS. | 375 // any security modules so it is safe to disable the fork check in NSS. |
| 377 crypto::DisableNSSForkCheck(); | 376 crypto::DisableNSSForkCheck(); |
| 378 crypto::ForceNSSNoDBInit(); | 377 crypto::ForceNSSNoDBInit(); |
| 379 crypto::EnsureNSSInit(); | 378 crypto::EnsureNSSInit(); |
| 380 | |
| 381 // Disable OCSP. OCSP needs to make HTTP requests, and currently | |
| 382 // it doesn't work in sandbox. SSL is used in renderer process | |
| 383 // only for peer-to-peer connections with self-signed certs. OCSP | |
| 384 // is not useful in this case, thus it is safe to disable it. | |
| 385 net::DisableOCSP(); | |
| 386 } | 379 } |
| 387 #elif defined(OS_WIN) | 380 #elif defined(OS_WIN) |
| 388 // crypt32.dll is used to decode X509 certificates for Chromoting. | 381 // crypt32.dll is used to decode X509 certificates for Chromoting. |
| 389 // Only load this library when the feature is enabled. | 382 // Only load this library when the feature is enabled. |
| 390 std::string error; | 383 std::string error; |
| 391 base::LoadNativeLibrary(FilePath(L"crypt32.dll"), &error); | 384 base::LoadNativeLibrary(FilePath(L"crypt32.dll"), &error); |
| 392 #endif | 385 #endif |
| 393 | 386 |
| 394 // Note that under Linux, the media library will normally already have | 387 // Note that under Linux, the media library will normally already have |
| 395 // been initialized by the Zygote before this instance became a Renderer. | 388 // been initialized by the Zygote before this instance became a Renderer. |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 } | 541 } |
| 549 | 542 |
| 550 #if !defined(OS_MACOSX) && defined(USE_TCMALLOC) | 543 #if !defined(OS_MACOSX) && defined(USE_TCMALLOC) |
| 551 // Tell tcmalloc to release any free pages it's still holding. | 544 // Tell tcmalloc to release any free pages it's still holding. |
| 552 MallocExtension::instance()->ReleaseFreeMemory(); | 545 MallocExtension::instance()->ReleaseFreeMemory(); |
| 553 #endif | 546 #endif |
| 554 | 547 |
| 555 if (client_) | 548 if (client_) |
| 556 client_->OnPurgeMemory(); | 549 client_->OnPurgeMemory(); |
| 557 } | 550 } |
| OLD | NEW |