| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // TODO(jar): DNS calls should be renderer specific, not including browser. | 23 // TODO(jar): DNS calls should be renderer specific, not including browser. |
| 24 #include "chrome/browser/net/dns_global.h" | 24 #include "chrome/browser/net/dns_global.h" |
| 25 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
| 26 #include "chrome/common/chrome_paths.h" | 26 #include "chrome/common/chrome_paths.h" |
| 27 #include "chrome/common/render_messages.h" | 27 #include "chrome/common/render_messages.h" |
| 28 #include "chrome/common/transport_dib.h" | 28 #include "chrome/common/transport_dib.h" |
| 29 #include "chrome/renderer/render_view.h" | 29 #include "chrome/renderer/render_view.h" |
| 30 #include "ipc/ipc_channel.h" | 30 #include "ipc/ipc_channel.h" |
| 31 #include "ipc/ipc_message_utils.h" | 31 #include "ipc/ipc_message_utils.h" |
| 32 #include "media/base/media.h" | 32 #include "media/base/media.h" |
| 33 #include "native_client/src/trusted/plugin/nacl_entry_points.h" |
| 33 #include "webkit/glue/webkit_glue.h" | 34 #include "webkit/glue/webkit_glue.h" |
| 35 #include "webkit/glue/plugins/plugin_list.h" |
| 34 | 36 |
| 35 //----------------------------------------------------------------------------- | 37 //----------------------------------------------------------------------------- |
| 36 | 38 |
| 37 RenderProcess::RenderProcess() | 39 RenderProcess::RenderProcess() |
| 38 : ALLOW_THIS_IN_INITIALIZER_LIST(shared_mem_cache_cleaner_( | 40 : ALLOW_THIS_IN_INITIALIZER_LIST(shared_mem_cache_cleaner_( |
| 39 base::TimeDelta::FromSeconds(5), | 41 base::TimeDelta::FromSeconds(5), |
| 40 this, &RenderProcess::ClearTransportDIBCache)), | 42 this, &RenderProcess::ClearTransportDIBCache)), |
| 41 sequence_number_(0) { | 43 sequence_number_(0) { |
| 42 in_process_plugins_ = InProcessPlugins(); | 44 in_process_plugins_ = InProcessPlugins(); |
| 43 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) | 45 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) |
| (...skipping 29 matching lines...) Expand all Loading... |
| 73 } | 75 } |
| 74 | 76 |
| 75 if (command_line.HasSwitch(switches::kEnableWatchdog)) { | 77 if (command_line.HasSwitch(switches::kEnableWatchdog)) { |
| 76 // TODO(JAR): Need to implement renderer IO msgloop watchdog. | 78 // TODO(JAR): Need to implement renderer IO msgloop watchdog. |
| 77 } | 79 } |
| 78 | 80 |
| 79 if (command_line.HasSwitch(switches::kDumpHistogramsOnExit)) { | 81 if (command_line.HasSwitch(switches::kDumpHistogramsOnExit)) { |
| 80 StatisticsRecorder::set_dump_on_exit(true); | 82 StatisticsRecorder::set_dump_on_exit(true); |
| 81 } | 83 } |
| 82 | 84 |
| 85 if (command_line.HasSwitch(switches::kInternalNaCl)) { |
| 86 NPAPI::PluginEntryPoints entry_points = { |
| 87 #if !defined(OS_LINUX) |
| 88 NaCl_NP_GetEntryPoints, |
| 89 #endif |
| 90 NaCl_NP_Initialize, |
| 91 NaCl_NP_Shutdown}; |
| 92 NPAPI::PluginList::UseInternalNaCl(&entry_points); |
| 93 } |
| 94 |
| 83 FilePath module_path; | 95 FilePath module_path; |
| 84 initialized_media_library_ = | 96 initialized_media_library_ = |
| 85 PathService::Get(base::DIR_MODULE, &module_path) && | 97 PathService::Get(base::DIR_MODULE, &module_path) && |
| 86 media::InitializeMediaLibrary(module_path); | 98 media::InitializeMediaLibrary(module_path); |
| 87 } | 99 } |
| 88 | 100 |
| 89 RenderProcess::~RenderProcess() { | 101 RenderProcess::~RenderProcess() { |
| 90 // TODO(port) | 102 // TODO(port) |
| 91 // Try and limit what we pull in for our non-Win unit test bundle | 103 // Try and limit what we pull in for our non-Win unit test bundle |
| 92 #ifndef NDEBUG | 104 #ifndef NDEBUG |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 } | 251 } |
| 240 | 252 |
| 241 void RenderProcess::ClearTransportDIBCache() { | 253 void RenderProcess::ClearTransportDIBCache() { |
| 242 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) { | 254 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) { |
| 243 if (shared_mem_cache_[i]) { | 255 if (shared_mem_cache_[i]) { |
| 244 FreeTransportDIB(shared_mem_cache_[i]); | 256 FreeTransportDIB(shared_mem_cache_[i]); |
| 245 shared_mem_cache_[i] = NULL; | 257 shared_mem_cache_[i] = NULL; |
| 246 } | 258 } |
| 247 } | 259 } |
| 248 } | 260 } |
| OLD | NEW |