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 "content/renderer/render_process_impl.h" | 5 #include "content/renderer/render_process_impl.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
10 #include <windows.h> | 10 #include <windows.h> |
11 #include <objidl.h> | 11 #include <objidl.h> |
12 #include <mlang.h> | 12 #include <mlang.h> |
13 #endif | 13 #endif |
14 | 14 |
15 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
17 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
18 #include "base/message_loop/message_loop.h" | 18 #include "base/message_loop/message_loop.h" |
19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
20 #include "base/sys_info.h" | 20 #include "base/sys_info.h" |
21 #include "content/child/child_thread.h" | 21 #include "content/child/child_thread.h" |
22 #include "content/child/npapi/plugin_instance.h" | 22 #include "content/child/npapi/plugin_instance.h" |
23 #include "content/child/npapi/plugin_lib.h" | 23 #include "content/child/npapi/plugin_lib.h" |
| 24 #include "content/child/site_isolation_policy.h" |
24 #include "content/common/view_messages.h" | 25 #include "content/common/view_messages.h" |
25 #include "content/public/common/content_switches.h" | 26 #include "content/public/common/content_switches.h" |
26 #include "content/public/renderer/content_renderer_client.h" | 27 #include "content/public/renderer/content_renderer_client.h" |
27 #include "ipc/ipc_channel.h" | 28 #include "ipc/ipc_channel.h" |
28 #include "ipc/ipc_message_utils.h" | 29 #include "ipc/ipc_message_utils.h" |
29 #include "skia/ext/platform_canvas.h" | 30 #include "skia/ext/platform_canvas.h" |
30 #include "third_party/WebKit/public/web/WebFrame.h" | 31 #include "third_party/WebKit/public/web/WebFrame.h" |
31 #include "ui/surface/transport_dib.h" | 32 #include "ui/surface/transport_dib.h" |
32 #include "webkit/glue/webkit_glue.h" | 33 #include "webkit/glue/webkit_glue.h" |
33 | 34 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 #endif | 66 #endif |
66 | 67 |
67 // Out of process dev tools rely upon auto break behavior. | 68 // Out of process dev tools rely upon auto break behavior. |
68 webkit_glue::SetJavaScriptFlags("--debugger-auto-break"); | 69 webkit_glue::SetJavaScriptFlags("--debugger-auto-break"); |
69 | 70 |
70 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 71 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
71 if (command_line.HasSwitch(switches::kJavaScriptFlags)) { | 72 if (command_line.HasSwitch(switches::kJavaScriptFlags)) { |
72 webkit_glue::SetJavaScriptFlags( | 73 webkit_glue::SetJavaScriptFlags( |
73 command_line.GetSwitchValueASCII(switches::kJavaScriptFlags)); | 74 command_line.GetSwitchValueASCII(switches::kJavaScriptFlags)); |
74 } | 75 } |
| 76 |
| 77 // Turn on cross-site document blocking for renderer processes. |
| 78 SiteIsolationPolicy::SetPolicyEnabled( |
| 79 GetContentClient()->renderer()->ShouldEnableSiteIsolationPolicy()); |
75 } | 80 } |
76 | 81 |
77 RenderProcessImpl::~RenderProcessImpl() { | 82 RenderProcessImpl::~RenderProcessImpl() { |
78 #ifndef NDEBUG | 83 #ifndef NDEBUG |
79 int count = WebKit::WebFrame::instanceCount(); | 84 int count = WebKit::WebFrame::instanceCount(); |
80 if (count) | 85 if (count) |
81 DLOG(ERROR) << "WebFrame LEAKED " << count << " TIMES"; | 86 DLOG(ERROR) << "WebFrame LEAKED " << count << " TIMES"; |
82 #endif | 87 #endif |
83 | 88 |
84 GetShutDownEvent()->Signal(); | 89 GetShutDownEvent()->Signal(); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 void RenderProcessImpl::ClearTransportDIBCache() { | 246 void RenderProcessImpl::ClearTransportDIBCache() { |
242 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) { | 247 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) { |
243 if (shared_mem_cache_[i]) { | 248 if (shared_mem_cache_[i]) { |
244 FreeTransportDIB(shared_mem_cache_[i]); | 249 FreeTransportDIB(shared_mem_cache_[i]); |
245 shared_mem_cache_[i] = NULL; | 250 shared_mem_cache_[i] = NULL; |
246 } | 251 } |
247 } | 252 } |
248 } | 253 } |
249 | 254 |
250 } // namespace content | 255 } // namespace content |
OLD | NEW |