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

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: changes Created 6 years, 10 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" 33 #include "v8/include/v8.h"
34 34
35 #if defined(OS_MACOSX) 35 #if defined(OS_MACOSX)
36 #include "base/mac/mac_util.h" 36 #include "base/mac/mac_util.h"
37 #endif 37 #endif
38 38
39 #if defined(OS_ANDROID) 39 #if defined(OS_ANDROID)
40 #include "base/android/sys_utils.h" 40 #include "base/android/sys_utils.h"
41 #endif 41 #endif
42 42
43 namespace content { 43 namespace content {
(...skipping 18 matching lines...) Expand all
62 GetModuleHandle(L"GDI32.DLL"), 62 GetModuleHandle(L"GDI32.DLL"),
63 "GdiInitializeLanguagePack")); 63 "GdiInitializeLanguagePack"));
64 DCHECK(gdi_init_lpk); 64 DCHECK(gdi_init_lpk);
65 if (gdi_init_lpk) { 65 if (gdi_init_lpk) {
66 gdi_init_lpk(0); 66 gdi_init_lpk(0);
67 } 67 }
68 } 68 }
69 #endif 69 #endif
70 70
71 // Out of process dev tools rely upon auto break behavior. 71 // Out of process dev tools rely upon auto break behavior.
72 webkit_glue::SetJavaScriptFlags("--debugger-auto-break"); 72 std::string auto_break_flag("--debugger-auto-break");
73 v8::V8::SetFlagsFromString(auto_break_flag.c_str(),
74 static_cast<int>(auto_break_flag.size()));
73 75
74 #if defined(OS_ANDROID) 76 #if defined(OS_ANDROID)
75 if (base::android::SysUtils::IsLowEndDevice()) 77 if (base::android::SysUtils::IsLowEndDevice()) {
76 webkit_glue::SetJavaScriptFlags("--optimize-for-size"); 78 std::string optimize_flag("--optimize-for-size");
79 v8::V8::SetFlagsFromString(optimize_flag.c_str(),
80 static_cast<int>(optimize_flag.size()));
81 }
77 #endif 82 #endif
78 83
79 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 84 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
80 if (command_line.HasSwitch(switches::kJavaScriptFlags)) { 85 if (command_line.HasSwitch(switches::kJavaScriptFlags)) {
81 webkit_glue::SetJavaScriptFlags( 86 std::string flags(switches::kJavaScriptFlags);
82 command_line.GetSwitchValueASCII(switches::kJavaScriptFlags)); 87 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size()));
83 } 88 }
84 89
85 // Turn on cross-site document blocking for renderer processes. 90 // Turn on cross-site document blocking for renderer processes.
86 SiteIsolationPolicy::SetPolicyEnabled( 91 SiteIsolationPolicy::SetPolicyEnabled(
87 GetContentClient()->renderer()->ShouldEnableSiteIsolationPolicy()); 92 GetContentClient()->renderer()->ShouldEnableSiteIsolationPolicy());
88 } 93 }
89 94
90 RenderProcessImpl::~RenderProcessImpl() { 95 RenderProcessImpl::~RenderProcessImpl() {
91 #ifndef NDEBUG 96 #ifndef NDEBUG
92 int count = blink::WebFrame::instanceCount(); 97 int count = blink::WebFrame::instanceCount();
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 void RenderProcessImpl::ClearTransportDIBCache() { 241 void RenderProcessImpl::ClearTransportDIBCache() {
237 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) { 242 for (size_t i = 0; i < arraysize(shared_mem_cache_); ++i) {
238 if (shared_mem_cache_[i]) { 243 if (shared_mem_cache_[i]) {
239 FreeTransportDIB(shared_mem_cache_[i]); 244 FreeTransportDIB(shared_mem_cache_[i]);
240 shared_mem_cache_[i] = NULL; 245 shared_mem_cache_[i] = NULL;
241 } 246 }
242 } 247 }
243 } 248 }
244 249
245 } // namespace content 250 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698