Commit b969b739 authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Remove variable shadowing in blink/modules/notifications

In an effort to reduce or even ban variable shadowing, this renames
a variable to avoid such shadowing. I'm interested in prohibiting
shadowing because I think it might prevent potential jumbo problems.

The exact error this avoids is:
third_party/blink/renderer/modules/notifications/notification_data.cc:93:45: error: declaration shadows a local variable [-Werror,-Wshadow]

    SerializedScriptValue::SerializeOptions options;
                                            ^
./../../third_party/blink/renderer/modules/notifications/notification_data.cc:43:32: note: previous declaration is here
    const NotificationOptions* options,
                               ^

Bug: 923510
Change-Id: Ie49096ef30fbab30567ad45f3f2d8b76a8eab9ed
Reviewed-on: https://chromium-review.googlesource.com/c/1478891Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#633744}
parent 2d8ae68b
...@@ -90,11 +90,11 @@ mojom::blink::NotificationDataPtr CreateNotificationData( ...@@ -90,11 +90,11 @@ mojom::blink::NotificationDataPtr CreateNotificationData(
const ScriptValue& data = options->data(); const ScriptValue& data = options->data();
v8::Isolate* isolate = data.GetIsolate(); v8::Isolate* isolate = data.GetIsolate();
DCHECK(isolate->InContext()); DCHECK(isolate->InContext());
SerializedScriptValue::SerializeOptions options; SerializedScriptValue::SerializeOptions serialize_options;
options.for_storage = SerializedScriptValue::kForStorage; serialize_options.for_storage = SerializedScriptValue::kForStorage;
scoped_refptr<SerializedScriptValue> serialized_script_value = scoped_refptr<SerializedScriptValue> serialized_script_value =
SerializedScriptValue::Serialize(isolate, data.V8Value(), options, SerializedScriptValue::Serialize(isolate, data.V8Value(),
exception_state); serialize_options, exception_state);
if (exception_state.HadException()) if (exception_state.HadException())
return nullptr; return nullptr;
......
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