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 #include "chrome/renderer/chrome_render_process_observer.h" | 5 #include "chrome/renderer/chrome_render_process_observer.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/allocator/allocator_extension.h" | 10 #include "base/allocator/allocator_extension.h" |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 } | 274 } |
275 | 275 |
276 RenderThread* thread = RenderThread::Get(); | 276 RenderThread* thread = RenderThread::Get(); |
277 resource_delegate_.reset(new RendererResourceDelegate()); | 277 resource_delegate_.reset(new RendererResourceDelegate()); |
278 thread->SetResourceDispatcherDelegate(resource_delegate_.get()); | 278 thread->SetResourceDispatcherDelegate(resource_delegate_.get()); |
279 | 279 |
280 // Configure modules that need access to resources. | 280 // Configure modules that need access to resources. |
281 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider); | 281 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider); |
282 | 282 |
283 #if defined(OS_WIN) | 283 #if defined(OS_WIN) |
284 // Need to patch a few functions for font loading to work correctly. | 284 if (!command_line.HasSwitch(switches::kEnableOutOfProcessPdf)) { |
285 base::FilePath pdf; | 285 // Need to patch a few functions for font loading to work correctly. |
286 if (PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf) && | 286 base::FilePath pdf; |
287 base::PathExists(pdf)) { | 287 if (PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf) && |
288 g_iat_patch_createdca.Patch( | 288 base::PathExists(pdf)) { |
289 pdf.value().c_str(), "gdi32.dll", "CreateDCA", CreateDCAPatch); | 289 g_iat_patch_createdca.Patch(pdf.value().c_str(), "gdi32.dll", "CreateDCA", |
290 g_iat_patch_get_font_data.Patch( | 290 CreateDCAPatch); |
291 pdf.value().c_str(), "gdi32.dll", "GetFontData", GetFontDataPatch); | 291 g_iat_patch_get_font_data.Patch(pdf.value().c_str(), "gdi32.dll", |
| 292 "GetFontData", GetFontDataPatch); |
| 293 } |
292 } | 294 } |
293 #endif | 295 #endif |
294 | 296 |
295 #if defined(OS_POSIX) && !defined(OS_MACOSX) && defined(USE_NSS) | 297 #if defined(OS_POSIX) && !defined(OS_MACOSX) && defined(USE_NSS) |
296 // On platforms where we use system NSS shared libraries, | 298 // On platforms where we use system NSS shared libraries, |
297 // initialize NSS now because it won't be able to load the .so's | 299 // initialize NSS now because it won't be able to load the .so's |
298 // after we engage the sandbox. | 300 // after we engage the sandbox. |
299 if (!command_line.HasSwitch(switches::kSingleProcess)) | 301 if (!command_line.HasSwitch(switches::kSingleProcess)) |
300 crypto::InitNSSSafely(); | 302 crypto::InitNSSSafely(); |
301 #elif defined(OS_WIN) | 303 #elif defined(OS_WIN) |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 } | 380 } |
379 | 381 |
380 void ChromeRenderProcessObserver::OnGetV8HeapStats() { | 382 void ChromeRenderProcessObserver::OnGetV8HeapStats() { |
381 HeapStatisticsCollector::Instance()->InitiateCollection(); | 383 HeapStatisticsCollector::Instance()->InitiateCollection(); |
382 } | 384 } |
383 | 385 |
384 const RendererContentSettingRules* | 386 const RendererContentSettingRules* |
385 ChromeRenderProcessObserver::content_setting_rules() const { | 387 ChromeRenderProcessObserver::content_setting_rules() const { |
386 return &content_setting_rules_; | 388 return &content_setting_rules_; |
387 } | 389 } |
OLD | NEW |