Commit c1a602ff authored by Hans Wennborg's avatar Hans Wennborg Committed by Commit Bot

Make WebSettings::V8CacheOptions an enum class, fixing -Wshadow warnings

A new version of Clang made the -Wshadow warning also apply to
enumerators, warning that the blink::WebSettings::V8CacheOptions
enumerators shadow the enumerators from blink::V8CacheOptions, e.g.

49344/58815] CXX obj/third_party/blink/renderer/core/core_generated/v8_code_cache.o
In file included from
../../third_party/blink/renderer/bindings/core/v8/v8_code_cache.cc:9:
../../third_party/blink/public/web/web_settings.h:66:5: warning: declaration
shadows a variable in namespace 'blink' [-Wshadow]
    kV8CacheOptionsDefault,
    ^
../../third_party/blink/renderer/bindings/core/v8/v8_cache_options.h:37:3:
note: previous declaration is here
  kV8CacheOptionsDefault,  // Use whatever the current default is.
  ^

Bug: 895475
Change-Id: I6de82855f3db4655c1bfaa4bb8d77fab1466188e
Reviewed-on: https://chromium-review.googlesource.com/c/1282445Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599974}
parent 9780253f
...@@ -27,15 +27,15 @@ STATIC_ASSERT_ENUM(EDITING_BEHAVIOR_ANDROID, ...@@ -27,15 +27,15 @@ STATIC_ASSERT_ENUM(EDITING_BEHAVIOR_ANDROID,
WebSettings::kEditingBehaviorAndroid); WebSettings::kEditingBehaviorAndroid);
STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_DEFAULT, STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_DEFAULT,
WebSettings::kV8CacheOptionsDefault); WebSettings::V8CacheOptions::kDefault);
STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_NONE, WebSettings::kV8CacheOptionsNone); STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_NONE, WebSettings::V8CacheOptions::kNone);
STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_CODE, WebSettings::kV8CacheOptionsCode); STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_CODE, WebSettings::V8CacheOptions::kCode);
STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_CODE_WITHOUT_HEAT_CHECK, STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_CODE_WITHOUT_HEAT_CHECK,
WebSettings::kV8CacheOptionsCodeWithoutHeatCheck); WebSettings::V8CacheOptions::kCodeWithoutHeatCheck);
STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_FULLCODE_WITHOUT_HEAT_CHECK, STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_FULLCODE_WITHOUT_HEAT_CHECK,
WebSettings::kV8CacheOptionsFullCodeWithoutHeatCheck); WebSettings::V8CacheOptions::kFullCodeWithoutHeatCheck);
STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_LAST, STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_LAST,
WebSettings::kV8CacheOptionsFullCodeWithoutHeatCheck); WebSettings::V8CacheOptions::kFullCodeWithoutHeatCheck);
STATIC_ASSERT_ENUM(SavePreviousDocumentResources::NEVER, STATIC_ASSERT_ENUM(SavePreviousDocumentResources::NEVER,
WebSettings::SavePreviousDocumentResources::kNever); WebSettings::SavePreviousDocumentResources::kNever);
......
...@@ -1932,8 +1932,8 @@ void TestRunner::SetV8CacheDisabled(bool disabled) { ...@@ -1932,8 +1932,8 @@ void TestRunner::SetV8CacheDisabled(bool disabled) {
return; return;
} }
main_view_->GetSettings()->SetV8CacheOptions( main_view_->GetSettings()->SetV8CacheOptions(
disabled ? blink::WebSettings::kV8CacheOptionsNone disabled ? blink::WebSettings::V8CacheOptions::kNone
: blink::WebSettings::kV8CacheOptionsDefault); : blink::WebSettings::V8CacheOptions::kDefault);
} }
void TestRunner::NavigateSecondaryWindow(const GURL& url) { void TestRunner::NavigateSecondaryWindow(const GURL& url) {
......
...@@ -68,7 +68,7 @@ struct WebEmbeddedWorkerStartData { ...@@ -68,7 +68,7 @@ struct WebEmbeddedWorkerStartData {
WebEmbeddedWorkerStartData() WebEmbeddedWorkerStartData()
: pause_after_download_mode(kDontPauseAfterDownload), : pause_after_download_mode(kDontPauseAfterDownload),
wait_for_debugger_mode(kDontWaitForDebugger), wait_for_debugger_mode(kDontWaitForDebugger),
v8_cache_options(WebSettings::kV8CacheOptionsDefault) {} v8_cache_options(WebSettings::V8CacheOptions::kDefault) {}
}; };
} // namespace blink } // namespace blink
......
...@@ -62,12 +62,12 @@ class WebSettings { ...@@ -62,12 +62,12 @@ class WebSettings {
kEditingBehaviorAndroid kEditingBehaviorAndroid
}; };
enum V8CacheOptions { enum class V8CacheOptions {
kV8CacheOptionsDefault, kDefault,
kV8CacheOptionsNone, kNone,
kV8CacheOptionsCode, kCode,
kV8CacheOptionsCodeWithoutHeatCheck, kCodeWithoutHeatCheck,
kV8CacheOptionsFullCodeWithoutHeatCheck kFullCodeWithoutHeatCheck
}; };
enum class SavePreviousDocumentResources { enum class SavePreviousDocumentResources {
......
...@@ -324,12 +324,13 @@ scoped_refptr<CachedMetadata> V8CodeCache::GenerateFullCodeCache( ...@@ -324,12 +324,13 @@ scoped_refptr<CachedMetadata> V8CodeCache::GenerateFullCodeCache(
return cached_metadata; return cached_metadata;
} }
STATIC_ASSERT_ENUM(WebSettings::kV8CacheOptionsDefault, kV8CacheOptionsDefault); STATIC_ASSERT_ENUM(WebSettings::V8CacheOptions::kDefault,
STATIC_ASSERT_ENUM(WebSettings::kV8CacheOptionsNone, kV8CacheOptionsNone); kV8CacheOptionsDefault);
STATIC_ASSERT_ENUM(WebSettings::kV8CacheOptionsCode, kV8CacheOptionsCode); STATIC_ASSERT_ENUM(WebSettings::V8CacheOptions::kNone, kV8CacheOptionsNone);
STATIC_ASSERT_ENUM(WebSettings::kV8CacheOptionsCodeWithoutHeatCheck, STATIC_ASSERT_ENUM(WebSettings::V8CacheOptions::kCode, kV8CacheOptionsCode);
STATIC_ASSERT_ENUM(WebSettings::V8CacheOptions::kCodeWithoutHeatCheck,
kV8CacheOptionsCodeWithoutHeatCheck); kV8CacheOptionsCodeWithoutHeatCheck);
STATIC_ASSERT_ENUM(WebSettings::kV8CacheOptionsFullCodeWithoutHeatCheck, STATIC_ASSERT_ENUM(WebSettings::V8CacheOptions::kFullCodeWithoutHeatCheck,
kV8CacheOptionsFullCodeWithoutHeatCheck); kV8CacheOptionsFullCodeWithoutHeatCheck);
} // namespace blink } // namespace blink
...@@ -116,7 +116,7 @@ class WebEmbeddedWorkerImplTest : public testing::Test { ...@@ -116,7 +116,7 @@ class WebEmbeddedWorkerImplTest : public testing::Test {
WebEmbeddedWorkerStartData::kDontPauseAfterDownload; WebEmbeddedWorkerStartData::kDontPauseAfterDownload;
start_data_.wait_for_debugger_mode = start_data_.wait_for_debugger_mode =
WebEmbeddedWorkerStartData::kDontWaitForDebugger; WebEmbeddedWorkerStartData::kDontWaitForDebugger;
start_data_.v8_cache_options = WebSettings::kV8CacheOptionsDefault; start_data_.v8_cache_options = WebSettings::V8CacheOptions::kDefault;
} }
void TearDown() override { void TearDown() override {
......
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