Chromium Code Reviews| 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 the cross-site document blocking. | |
|
Charlie Reis
2013/09/03 20:22:10
nit: drop "the", add "for renderer processes."
dsjang
2013/09/03 22:31:30
Done.
| |
| 78 DCHECK(GetContentClient()->renderer()); | |
|
Charlie Reis
2013/09/03 20:22:10
No need for this DCHECK. It's no different than c
dsjang
2013/09/03 22:31:30
Done.
| |
| 79 SiteIsolationPolicy::SetPolicyEnabled( | |
| 80 GetContentClient()->renderer()->ShouldEnableSiteIsolationPolicy()); | |
| 75 } | 81 } |
| 76 | 82 |
| 77 RenderProcessImpl::~RenderProcessImpl() { | 83 RenderProcessImpl::~RenderProcessImpl() { |
| 78 #ifndef NDEBUG | 84 #ifndef NDEBUG |
| 79 int count = WebKit::WebFrame::instanceCount(); | 85 int count = WebKit::WebFrame::instanceCount(); |
| 80 if (count) | 86 if (count) |
| 81 DLOG(ERROR) << "WebFrame LEAKED " << count << " TIMES"; | 87 DLOG(ERROR) << "WebFrame LEAKED " << count << " TIMES"; |
| 82 #endif | 88 #endif |
| 83 | 89 |
| 84 GetShutDownEvent()->Signal(); | 90 GetShutDownEvent()->Signal(); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 241 void RenderProcessImpl::ClearTransportDIBCache() { | 247 void RenderProcessImpl::ClearTransportDIBCache() { |
| 242 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) { | 248 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) { |
| 243 if (shared_mem_cache_[i]) { | 249 if (shared_mem_cache_[i]) { |
| 244 FreeTransportDIB(shared_mem_cache_[i]); | 250 FreeTransportDIB(shared_mem_cache_[i]); |
| 245 shared_mem_cache_[i] = NULL; | 251 shared_mem_cache_[i] = NULL; |
| 246 } | 252 } |
| 247 } | 253 } |
| 248 } | 254 } |
| 249 | 255 |
| 250 } // namespace content | 256 } // namespace content |
| OLD | NEW |