Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(446)

Side by Side Diff: content/renderer/render_process_impl.cc

Issue 147973002: Move SetJavaScriptFlags() from webkit to content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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>
(...skipping 12 matching lines...) Expand all
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/child/site_isolation_policy.h"
25 #include "content/common/view_messages.h" 25 #include "content/common/view_messages.h"
26 #include "content/public/common/content_switches.h" 26 #include "content/public/common/content_switches.h"
27 #include "content/public/renderer/content_renderer_client.h" 27 #include "content/public/renderer/content_renderer_client.h"
28 #include "ipc/ipc_channel.h" 28 #include "ipc/ipc_channel.h"
29 #include "ipc/ipc_message_utils.h" 29 #include "ipc/ipc_message_utils.h"
30 #include "skia/ext/platform_canvas.h" 30 #include "skia/ext/platform_canvas.h"
31 #include "third_party/WebKit/public/web/WebFrame.h" 31 #include "third_party/WebKit/public/web/WebFrame.h"
32 #include "ui/surface/transport_dib.h" 32 #include "ui/surface/transport_dib.h"
33 #include "webkit/glue/webkit_glue.h"
34 33
35 #if defined(OS_MACOSX) 34 #if defined(OS_MACOSX)
36 #include "base/mac/mac_util.h" 35 #include "base/mac/mac_util.h"
37 #endif 36 #endif
38 37
39 #if defined(OS_ANDROID) 38 #if defined(OS_ANDROID)
40 #include "base/android/sys_utils.h" 39 #include "base/android/sys_utils.h"
41 #endif 40 #endif
42 41
43 namespace content { 42 namespace content {
(...skipping 18 matching lines...) Expand all
62 GetModuleHandle(L"GDI32.DLL"), 61 GetModuleHandle(L"GDI32.DLL"),
63 "GdiInitializeLanguagePack")); 62 "GdiInitializeLanguagePack"));
64 DCHECK(gdi_init_lpk); 63 DCHECK(gdi_init_lpk);
65 if (gdi_init_lpk) { 64 if (gdi_init_lpk) {
66 gdi_init_lpk(0); 65 gdi_init_lpk(0);
67 } 66 }
68 } 67 }
69 #endif 68 #endif
70 69
71 // Out of process dev tools rely upon auto break behavior. 70 // Out of process dev tools rely upon auto break behavior.
72 webkit_glue::SetJavaScriptFlags("--debugger-auto-break"); 71 ChildThread::SetJavaScriptFlags("--debugger-auto-break");
73 72
74 #if defined(OS_ANDROID) 73 #if defined(OS_ANDROID)
75 if (base::android::SysUtils::IsLowEndDevice()) 74 if (base::android::SysUtils::IsLowEndDevice())
76 webkit_glue::SetJavaScriptFlags("--optimize-for-size"); 75 ChildThread::SetJavaScriptFlags("--optimize-for-size");
77 #endif 76 #endif
78 77
79 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 78 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
80 if (command_line.HasSwitch(switches::kJavaScriptFlags)) { 79 if (command_line.HasSwitch(switches::kJavaScriptFlags)) {
81 webkit_glue::SetJavaScriptFlags( 80 ChildThread::SetJavaScriptFlags(
82 command_line.GetSwitchValueASCII(switches::kJavaScriptFlags)); 81 command_line.GetSwitchValueASCII(switches::kJavaScriptFlags));
83 } 82 }
84 83
85 // Turn on cross-site document blocking for renderer processes. 84 // Turn on cross-site document blocking for renderer processes.
86 SiteIsolationPolicy::SetPolicyEnabled( 85 SiteIsolationPolicy::SetPolicyEnabled(
87 GetContentClient()->renderer()->ShouldEnableSiteIsolationPolicy()); 86 GetContentClient()->renderer()->ShouldEnableSiteIsolationPolicy());
88 } 87 }
89 88
90 RenderProcessImpl::~RenderProcessImpl() { 89 RenderProcessImpl::~RenderProcessImpl() {
91 #ifndef NDEBUG 90 #ifndef NDEBUG
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 void RenderProcessImpl::ClearTransportDIBCache() { 235 void RenderProcessImpl::ClearTransportDIBCache() {
237 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) { 236 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) {
238 if (shared_mem_cache_[i]) { 237 if (shared_mem_cache_[i]) {
239 FreeTransportDIB(shared_mem_cache_[i]); 238 FreeTransportDIB(shared_mem_cache_[i]);
240 shared_mem_cache_[i] = NULL; 239 shared_mem_cache_[i] = NULL;
241 } 240 }
242 } 241 }
243 } 242 }
244 243
245 } // namespace content 244 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698