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 "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 19 matching lines...) Expand all Loading... |
30 #include "webkit/plugins/npapi/plugin_instance.h" | 30 #include "webkit/plugins/npapi/plugin_instance.h" |
31 #include "webkit/plugins/npapi/plugin_lib.h" | 31 #include "webkit/plugins/npapi/plugin_lib.h" |
32 #include "webkit/glue/webkit_glue.h" | 32 #include "webkit/glue/webkit_glue.h" |
33 | 33 |
34 #if defined(OS_MACOSX) | 34 #if defined(OS_MACOSX) |
35 #include "base/mac/mac_util.h" | 35 #include "base/mac/mac_util.h" |
36 #endif | 36 #endif |
37 | 37 |
38 RenderProcessImpl::RenderProcessImpl() | 38 RenderProcessImpl::RenderProcessImpl() |
39 : ALLOW_THIS_IN_INITIALIZER_LIST(shared_mem_cache_cleaner_( | 39 : ALLOW_THIS_IN_INITIALIZER_LIST(shared_mem_cache_cleaner_( |
40 FROM_HERE, base::TimeDelta::FromSeconds(5), | 40 base::TimeDelta::FromSeconds(5), |
41 this, &RenderProcessImpl::ClearTransportDIBCache)), | 41 this, &RenderProcessImpl::ClearTransportDIBCache)), |
42 transport_dib_next_sequence_number_(0) { | 42 transport_dib_next_sequence_number_(0) { |
43 in_process_plugins_ = InProcessPlugins(); | 43 in_process_plugins_ = InProcessPlugins(); |
44 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) | 44 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) |
45 shared_mem_cache_[i] = NULL; | 45 shared_mem_cache_[i] = NULL; |
46 | 46 |
47 #if defined(OS_WIN) | 47 #if defined(OS_WIN) |
48 // HACK: See http://b/issue?id=1024307 for rationale. | 48 // HACK: See http://b/issue?id=1024307 for rationale. |
49 if (GetModuleHandle(L"LPK.DLL") == NULL) { | 49 if (GetModuleHandle(L"LPK.DLL") == NULL) { |
50 // Makes sure lpk.dll is loaded by gdi32 to make sure ExtTextOut() works | 50 // Makes sure lpk.dll is loaded by gdi32 to make sure ExtTextOut() works |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 } | 230 } |
231 | 231 |
232 void RenderProcessImpl::ClearTransportDIBCache() { | 232 void RenderProcessImpl::ClearTransportDIBCache() { |
233 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) { | 233 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) { |
234 if (shared_mem_cache_[i]) { | 234 if (shared_mem_cache_[i]) { |
235 FreeTransportDIB(shared_mem_cache_[i]); | 235 FreeTransportDIB(shared_mem_cache_[i]); |
236 shared_mem_cache_[i] = NULL; | 236 shared_mem_cache_[i] = NULL; |
237 } | 237 } |
238 } | 238 } |
239 } | 239 } |
OLD | NEW |