Commit 067f519a authored by tfarina@chromium.org's avatar tfarina@chromium.org

Remove SetJavaScriptFlags() wrapper function from webkit.

This function is just an helper/wrapper function around v8::V8::SetFlagsFromString() and used only by content.

John preferred to just remove the wrapper and call the v8 API directly in content.

Also removing it from webkit_glue.h helps with the removal of src/webkit/ directory.

BUG=265753
TEST=content_shell and content_unittests
R=jochen@chromium.org, jam@chromium.org
TBR=darin

Review URL: https://codereview.chromium.org/147973002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247626 0039d316-1c4b-4281-b951-d872f2087c98
parent 7d73f676
include_rules = [ include_rules = [
"-content", "-content",
"+content/public", "+content/public",
"+v8/include/v8.h",
] ]
# Ensure we don't leak internal content headers through public headers. # Ensure we don't leak internal content headers through public headers.
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "third_party/WebKit/public/web/WebScriptSource.h" #include "third_party/WebKit/public/web/WebScriptSource.h"
#include "third_party/WebKit/public/web/WebView.h" #include "third_party/WebKit/public/web/WebView.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "webkit/glue/webkit_glue.h" #include "v8/include/v8.h"
using blink::WebFrame; using blink::WebFrame;
using blink::WebInputEvent; using blink::WebInputEvent;
...@@ -150,7 +150,8 @@ void RenderViewTest::SetUp() { ...@@ -150,7 +150,8 @@ void RenderViewTest::SetUp() {
// Setting flags and really doing anything with WebKit is fairly fragile and // Setting flags and really doing anything with WebKit is fairly fragile and
// hacky, but this is the world we live in... // hacky, but this is the world we live in...
webkit_glue::SetJavaScriptFlags(" --expose-gc"); std::string flags("--expose-gc");
v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size()));
blink::initialize(webkit_platform_support_.Get()); blink::initialize(webkit_platform_support_.Get());
// Ensure that we register any necessary schemes when initializing WebKit, // Ensure that we register any necessary schemes when initializing WebKit,
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "skia/ext/platform_canvas.h" #include "skia/ext/platform_canvas.h"
#include "third_party/WebKit/public/web/WebFrame.h" #include "third_party/WebKit/public/web/WebFrame.h"
#include "ui/surface/transport_dib.h" #include "ui/surface/transport_dib.h"
#include "webkit/glue/webkit_glue.h" #include "v8/include/v8.h"
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
#include "base/mac/mac_util.h" #include "base/mac/mac_util.h"
...@@ -69,17 +69,23 @@ RenderProcessImpl::RenderProcessImpl() ...@@ -69,17 +69,23 @@ RenderProcessImpl::RenderProcessImpl()
#endif #endif
// Out of process dev tools rely upon auto break behavior. // Out of process dev tools rely upon auto break behavior.
webkit_glue::SetJavaScriptFlags("--debugger-auto-break"); std::string auto_break_flag("--debugger-auto-break");
v8::V8::SetFlagsFromString(auto_break_flag.c_str(),
static_cast<int>(auto_break_flag.size()));
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
if (base::android::SysUtils::IsLowEndDevice()) if (base::android::SysUtils::IsLowEndDevice()) {
webkit_glue::SetJavaScriptFlags("--optimize-for-size"); std::string optimize_flag("--optimize-for-size");
v8::V8::SetFlagsFromString(optimize_flag.c_str(),
static_cast<int>(optimize_flag.size()));
}
#endif #endif
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kJavaScriptFlags)) { if (command_line.HasSwitch(switches::kJavaScriptFlags)) {
webkit_glue::SetJavaScriptFlags( std::string flags(
command_line.GetSwitchValueASCII(switches::kJavaScriptFlags)); command_line.GetSwitchValueASCII(switches::kJavaScriptFlags));
v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size()));
} }
// Turn on cross-site document blocking for renderer processes. // Turn on cross-site document blocking for renderer processes.
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "content/shell/renderer/webkit_test_runner.h" #include "content/shell/renderer/webkit_test_runner.h"
#include "third_party/WebKit/public/web/WebRuntimeFeatures.h" #include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
#include "third_party/WebKit/public/web/WebView.h" #include "third_party/WebKit/public/web/WebView.h"
#include "webkit/glue/webkit_glue.h" #include "v8/include/v8.h"
using blink::WebFrame; using blink::WebFrame;
using blink::WebRuntimeFeatures; using blink::WebRuntimeFeatures;
...@@ -66,7 +66,8 @@ void ShellRenderProcessObserver::WebKitInitialized() { ...@@ -66,7 +66,8 @@ void ShellRenderProcessObserver::WebKitInitialized() {
return; return;
// We always expose GC to layout tests. // We always expose GC to layout tests.
webkit_glue::SetJavaScriptFlags(" --expose-gc"); std::string flags("--expose-gc");
v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size()));
if (!CommandLine::ForCurrentProcess()->HasSwitch( if (!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kStableReleaseMode)) { switches::kStableReleaseMode)) {
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include "webkit/browser/database/vfs_backend.h" #include "webkit/browser/database/vfs_backend.h"
#include "webkit/child/webkitplatformsupport_impl.h" #include "webkit/child/webkitplatformsupport_impl.h"
#include "webkit/glue/simple_webmimeregistry_impl.h" #include "webkit/glue/simple_webmimeregistry_impl.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/renderer/compositor_bindings/web_compositor_support_impl.h" #include "webkit/renderer/compositor_bindings/web_compositor_support_impl.h"
#if defined(OS_WIN) #if defined(OS_WIN)
...@@ -104,7 +103,8 @@ TestWebKitPlatformSupport::TestWebKitPlatformSupport() { ...@@ -104,7 +103,8 @@ TestWebKitPlatformSupport::TestWebKitPlatformSupport() {
CommandLine::ForCurrentProcess()->AppendSwitch(switches::kEnableFileCookies); CommandLine::ForCurrentProcess()->AppendSwitch(switches::kEnableFileCookies);
// Test shell always exposes the GC. // Test shell always exposes the GC.
webkit_glue::SetJavaScriptFlags(" --expose-gc"); std::string flags("--expose-gc");
v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size()));
} }
TestWebKitPlatformSupport::~TestWebKitPlatformSupport() { TestWebKitPlatformSupport::~TestWebKitPlatformSupport() {
......
include_rules = [ include_rules = [
"+content/child", "+content/child",
"+sandbox/win/src", "+sandbox/win/src",
"+v8/include/v8.h",
"+webkit/glue", "+webkit/glue",
] ]
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "third_party/WebKit/public/web/WebDatabase.h" #include "third_party/WebKit/public/web/WebDatabase.h"
#include "third_party/WebKit/public/web/WebKit.h" #include "third_party/WebKit/public/web/WebKit.h"
#include "third_party/WebKit/public/web/WebRuntimeFeatures.h" #include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
#include "webkit/glue/webkit_glue.h" #include "v8/include/v8.h"
using blink::WebRuntimeFeatures; using blink::WebRuntimeFeatures;
...@@ -41,8 +41,9 @@ WorkerThread::WorkerThread() { ...@@ -41,8 +41,9 @@ WorkerThread::WorkerThread() {
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kJavaScriptFlags)) { if (command_line.HasSwitch(switches::kJavaScriptFlags)) {
webkit_glue::SetJavaScriptFlags( std::string flags(
command_line.GetSwitchValueASCII(switches::kJavaScriptFlags)); command_line.GetSwitchValueASCII(switches::kJavaScriptFlags));
v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size()));
} }
SetRuntimeFeaturesDefaultsAndUpdateFromArgs(command_line); SetRuntimeFeaturesDefaultsAndUpdateFromArgs(command_line);
......
...@@ -6,14 +6,9 @@ ...@@ -6,14 +6,9 @@
#include "base/logging.h" #include "base/logging.h"
#include "third_party/WebKit/public/platform/WebFileInfo.h" #include "third_party/WebKit/public/platform/WebFileInfo.h"
#include "v8/include/v8.h"
namespace webkit_glue { namespace webkit_glue {
void SetJavaScriptFlags(const std::string& str) {
v8::V8::SetFlagsFromString(str.data(), static_cast<int>(str.size()));
}
void FileInfoToWebFileInfo( void FileInfoToWebFileInfo(
const base::File::Info& file_info, const base::File::Info& file_info,
blink::WebFileInfo* web_file_info) { blink::WebFileInfo* web_file_info) {
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
#ifndef WEBKIT_GLUE_WEBKIT_GLUE_H_ #ifndef WEBKIT_GLUE_WEBKIT_GLUE_H_
#define WEBKIT_GLUE_WEBKIT_GLUE_H_ #define WEBKIT_GLUE_WEBKIT_GLUE_H_
#include <string>
#include "base/files/file.h" #include "base/files/file.h"
#include "webkit/glue/webkit_glue_export.h" #include "webkit/glue/webkit_glue_export.h"
...@@ -16,8 +14,6 @@ struct WebFileInfo; ...@@ -16,8 +14,6 @@ struct WebFileInfo;
namespace webkit_glue { namespace webkit_glue {
WEBKIT_GLUE_EXPORT void SetJavaScriptFlags(const std::string& flags);
// File info conversion // File info conversion
WEBKIT_GLUE_EXPORT void FileInfoToWebFileInfo( WEBKIT_GLUE_EXPORT void FileInfoToWebFileInfo(
const base::File::Info& file_info, const base::File::Info& file_info,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment