Commit 6c34bd1a authored by Victor Costan's avatar Victor Costan Committed by Commit Bot

blink: Fix member names in comments.

This CL fixes member names that use the WebKit convention (m_name) to
use the Google convention (name_). Where appropriate, the member names
are wrapped in || so that they get code serachs' cross-reference
navigation.

Change-Id: I4d52de3b734cb28a998810bfb274f9f2716a4d79
Reviewed-on: https://chromium-review.googlesource.com/c/1462152
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Victor Costan <pwnall@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630703}
parent 2e6c3d90
......@@ -300,7 +300,7 @@ scoped_refptr<SerializedScriptValue> SerializedScriptValue::NullValue() {
}
String SerializedScriptValue::ToWireString() const {
// Add the padding '\0', but don't put it in |m_dataBuffer|.
// Add the padding '\0', but don't put it in |data_buffer_|.
// This requires direct use of uninitialized strings, though.
UChar* destination;
wtf_size_t string_size_bytes =
......
......@@ -81,12 +81,12 @@ class WorkerOrWorkletScriptController::ExecutionState final {
// WorkerOrWorkletScriptController::evaluate(), with the contoller using it
// during script evaluation. To handle nested evaluate() uses,
// ExecutionStates are chained together;
// |m_outerState| keeps a pointer to the context object one level out
// |outer_state_| keeps a pointer to the context object one level out
// (or 0, if outermost.) Upon return from evaluate(), the
// WorkerOrWorkletScriptController's ExecutionState is popped and the
// previous one restored (see above dtor.)
//
// With Oilpan, |m_outerState| isn't traced. It'll be "up the stack"
// With Oilpan, |outer_state_| isn't traced. It'll be "up the stack"
// and its fields will be traced when scanning the stack.
Member<WorkerOrWorkletScriptController> controller_;
ExecutionState* outer_state_;
......
......@@ -127,7 +127,7 @@ class CORE_EXPORT WorkerOrWorkletScriptController final
scoped_refptr<RejectedPromises> rejected_promises_;
// |m_executionState| refers to a stack object that evaluate() allocates;
// |execution_state_| refers to a stack object that evaluate() allocates;
// evaluate() ensuring that the pointer reference to it is removed upon
// returning. Hence kept as a bare pointer here, and not a Persistent with
// Oilpan enabled; stack scanning will visit the object and
......
......@@ -35,25 +35,25 @@ class StylePropertyShorthand {
USING_FAST_MALLOC(StylePropertyShorthand);
public:
constexpr StylePropertyShorthand()
: m_properties(0),
m_length(0),
m_shorthandID(CSSPropertyInvalid) {}
: properties_(0),
length_(0),
shorthand_id_(CSSPropertyInvalid) {}
constexpr StylePropertyShorthand(CSSPropertyID id,
const CSSProperty** properties,
unsigned numProperties)
: m_properties(properties),
m_length(numProperties),
m_shorthandID(id) {}
: properties_(properties),
length_(numProperties),
shorthand_id_(id) {}
const CSSProperty** properties() const { return m_properties; }
unsigned length() const { return m_length; }
CSSPropertyID id() const { return m_shorthandID; }
const CSSProperty** properties() const { return properties_; }
unsigned length() const { return length_; }
CSSPropertyID id() const { return shorthand_id_; }
private:
const CSSProperty** m_properties;
unsigned m_length;
CSSPropertyID m_shorthandID;
const CSSProperty** properties_;
unsigned length_;
CSSPropertyID shorthand_id_;
};
{% for property in properties %}
......
......@@ -49,7 +49,7 @@ unsigned {{sink_class}}::s_numSinksWith{{agent}} = 0;
void {{sink_class}}::add{{agent}}({{class_name}}* agent) {
bool already_had_agent = has{{agent}}s();
m_{{getter_name}}s.insert(agent);
{{getter_name}}s_.insert(agent);
if (!already_had_agent) {
MutexLocker lock(AgentCountMutex());
......@@ -64,7 +64,7 @@ void {{sink_class}}::remove{{agent}}({{class_name}}* agent) {
if (!has{{agent}}s())
return;
m_{{getter_name}}s.erase(agent);
{{getter_name}}s_.erase(agent);
if (!has{{agent}}s()) {
MutexLocker lock(AgentCountMutex());
......@@ -82,7 +82,7 @@ void {{sink_class}}::Trace(Visitor* visitor)
{
{% for agent in agents %}
{% set getter_name = agent | to_lower_case %}
visitor->Trace(m_{{getter_name}}s);
visitor->Trace({{getter_name}}s_);
{% endfor %}
}
......
......@@ -11,9 +11,9 @@
namespace blink {
InternalSettingsGenerated::InternalSettingsGenerated(Page* page)
: m_page(page)
: page_(page)
{% for setting in settings if setting.type|to_idl_type %}
, m_{{setting.name}}(page->GetSettings().Get{{setting.name.to_upper_camel_case()}}())
, {{setting.name}}_(page->GetSettings().Get{{setting.name.to_upper_camel_case()}}())
{% endfor %}
{
}
......@@ -22,18 +22,18 @@ InternalSettingsGenerated::~InternalSettingsGenerated() {}
void InternalSettingsGenerated::resetToConsistentState() {
{% for setting in settings if setting.type|to_idl_type %}
m_page->GetSettings().Set{{setting.name.to_upper_camel_case()}}(m_{{setting.name}});
page_->GetSettings().Set{{setting.name.to_upper_camel_case()}}({{setting.name}}_);
{% endfor %}
}
{% for setting in settings if setting.type|to_idl_type %}
void InternalSettingsGenerated::set{{setting.name.to_upper_camel_case()}}({{setting.type|to_passing_type}} {{setting.name}}) {
m_page->GetSettings().Set{{setting.name.to_upper_camel_case()}}({{setting.name}});
page_->GetSettings().Set{{setting.name.to_upper_camel_case()}}({{setting.name}});
}
{% endfor %}
void InternalSettingsGenerated::Trace(Visitor* visitor) {
visitor->Trace(m_page);
visitor->Trace(page_);
ScriptWrappable::Trace(visitor);
}
......
......@@ -30,10 +30,10 @@ class InternalSettingsGenerated : public ScriptWrappable {
void Trace(Visitor*) override;
private:
Member<Page> m_page;
Member<Page> page_;
{% for setting in settings if setting.type|to_idl_type %}
{{setting.type}} m_{{setting.name}};
{{setting.type}} {{setting.name}}_;
{% endfor %}
};
......
......@@ -42,8 +42,8 @@ class {{export_symbol}} {{sink_class}} : public GarbageCollectedFinalized<{{sink
{% for agent in agents %}
{% set class_name = agent | agent_name_to_class %}
{% set getter_name = agent | to_lower_case %}
bool has{{agent}}s() const { return !m_{{getter_name}}s.IsEmpty(); }
const HeapListHashSet<Member<{{class_name}}>>& {{getter_name}}s() const { return m_{{getter_name}}s; }
bool has{{agent}}s() const { return !{{getter_name}}s_.IsEmpty(); }
const HeapListHashSet<Member<{{class_name}}>>& {{getter_name}}s() const { return {{getter_name}}s_; }
void add{{agent}}({{class_name}}* agent);
void remove{{agent}}({{class_name}}* agent);
......@@ -57,7 +57,7 @@ class {{export_symbol}} {{sink_class}} : public GarbageCollectedFinalized<{{sink
{% for agent in agents %}
{% set class_name = agent | agent_name_to_class %}
{% set getter_name = agent | to_lower_case %}
HeapListHashSet<Member<{{class_name}}>> m_{{getter_name}}s;
HeapListHashSet<Member<{{class_name}}>> {{getter_name}}s_;
{% endfor %}
// Number of sinks with an enabled agent of each type, used to keep
......
......@@ -268,7 +268,7 @@ bool DocumentTimeline::NeedsAnimationTimingUpdate() {
std::isnan(last_current_time_internal_))
return false;
// We allow m_lastCurrentTimeInternal to advance here when there
// We allow |last_current_time_internal_| to advance here when there
// are no animations to allow animations spawned during style
// recalc to not invalidate this flag.
if (animations_needing_update_.IsEmpty())
......
......@@ -25,7 +25,7 @@ void InvalidatableInterpolation::Interpolate(int, double fraction) {
if (is_conversion_cached_ && cached_pair_conversion_)
cached_pair_conversion_->InterpolateValue(fraction, cached_value_);
// We defer the interpolation to ensureValidConversion() if
// m_cachedPairConversion is null.
// |cached_pair_conversion_| is null.
}
std::unique_ptr<PairwisePrimitiveInterpolation>
......
......@@ -28,8 +28,8 @@ void UnderlyingValueOwner::Set(const InterpolationType& type,
const InterpolationValue& value) {
DCHECK(value);
type_ = &type;
// By clearing m_valueOwner we will perform a copy before attempting to mutate
// m_value, thus upholding the const contract for this instance of
// By clearing |value_owner_| we will perform a copy before attempting to
// mutate |value_|, thus upholding the const contract for this instance of
// interpolationValue.
value_owner_.Clear();
value_ = &value;
......
......@@ -128,7 +128,7 @@ File* DataObjectItem::GetAsFile() const {
return file_.Get();
DCHECK(shared_buffer_);
// FIXME: This code is currently impossible--we never populate
// m_sharedBuffer when dragging in. At some point though, we may need to
// |shared_buffer_| when dragging in. At some point though, we may need to
// support correctly converting a shared buffer into a file.
return nullptr;
}
......
......@@ -103,8 +103,8 @@ class CORE_EXPORT DataObjectItem
String title_;
KURL base_url_;
uint64_t sequence_number_; // Only valid when m_source == PasteboardSource
String file_system_id_; // Only valid when m_file is backed by FileEntry.
uint64_t sequence_number_; // Only valid when |source_| == PasteboardSource.
String file_system_id_; // Only valid when |file_| is backed by FileEntry.
};
} // namespace blink
......
......@@ -91,7 +91,7 @@ class DraggedNodeImageBuilder {
#if DCHECK_IS_ON()
DCHECK_EQ(dom_tree_version_, node_->GetDocument().DomTreeVersion());
#endif
// Construct layout object for |m_node| with pseudo class "-webkit-drag"
// Construct layout object for |node_| with pseudo class "-webkit-drag"
local_frame_->View()->UpdateAllLifecyclePhasesExceptPaint();
LayoutObject* const dragged_layout_object = node_->GetLayoutObject();
if (!dragged_layout_object)
......@@ -263,7 +263,7 @@ void DataTransfer::setEffectAllowed(const String& effect) {
if (ConvertEffectAllowedToDragOperation(effect) == kDragOperationPrivate) {
// This means that there was no conversion, and the effectAllowed that
// we are passed isn't a valid effectAllowed, so we should ignore it,
// and not set m_effectAllowed.
// and not set |effect_allowed_|.
// The attribute must ignore any attempts to set it to a value other than
// none, copy, copyLink, copyMove, link, linkMove, move, all, and
......
......@@ -74,7 +74,7 @@ class CORE_EXPORT CSSSelectorWatch final
// Maps a CSS selector string with a -webkit-callback property to the number
// of matching ComputedStyle objects in this document.
HashCountedSet<String> matching_callback_selectors_;
// Selectors are relative to m_matchingCallbackSelectors's contents at
// Selectors are relative to |matching_callback_selectors_|'s contents at
// the previous call to selectorMatchChanged.
HashSet<String> added_selectors_;
HashSet<String> removed_selectors_;
......
......@@ -109,7 +109,7 @@ class CORE_EXPORT SelectorQuery {
CSSSelectorList selector_list_;
// Contains the list of CSSSelector's to match, but without ones that could
// never match like pseudo elements, div::before. This can be empty, while
// m_selectorList will never be empty as SelectorQueryCache::add would have
// |selector_list_| will never be empty as SelectorQueryCache::add would have
// thrown an exception.
Vector<const CSSSelector*> selectors_;
AtomicString selector_id_;
......
......@@ -107,7 +107,7 @@ class EphemeralRangeTemplate final {
Node* CommonAncestorContainer() const;
// Returns true if |m_startPosition| == |m_endPosition| or |isNull()|.
// Returns true if |start_position_| == |end_position_| or |isNull()|.
bool IsCollapsed() const;
bool IsNull() const {
DCHECK(IsValid());
......
......@@ -127,7 +127,7 @@ class SimplifiedBackwardsTextIteratorAlgorithm {
Member<const Node> end_node_;
int end_offset_;
// Whether m_node has advanced beyond the iteration range (i.e. start_node_).
// Whether |node_| has advanced beyond the iteration range (i.e. start_node_).
bool have_passed_start_node_;
// Should handle first-letter layoutObject in the next call to handleTextNode.
......
......@@ -750,7 +750,7 @@ void TextIteratorAlgorithm<Strategy>::RepresentNodeOffsetZero() {
// early-return style.
// When we haven't been emitting any characters,
// ShouldRepresentNodeOffsetZero() can create VisiblePositions, which is
// expensive. So, we perform the inexpensive checks on m_node to see if it
// expensive. So, we perform the inexpensive checks on |node_| to see if it
// necessitates emitting a character first and will early return before
// encountering ShouldRepresentNodeOffsetZero()s worse case behavior.
if (ShouldEmitTabBeforeNode(*node_)) {
......
......@@ -257,7 +257,7 @@ bool operator==(const PositionTemplate<Strategy>& a,
return false;
if (!a.IsOffsetInAnchor()) {
// Note: |m_offset| only has meaning when
// Note: |offset_| only has meaning when
// |PositionAnchorType::OffsetInAnchor|.
return true;
}
......
......@@ -240,7 +240,7 @@ VisiblePosition SelectionModifier::PositionForPlatform(
// FIXME: VisibleSelection should be fixed to ensure as an invariant that
// base/extent always point to the same nodes as start/end, but which points
// to which depends on the value of isBaseFirst. Then this can be changed
// to just return m_sel.extent().
// to just return selection_.extent().
return selection_.IsBaseFirst() ? selection_.VisibleEnd()
: selection_.VisibleStart();
}
......
......@@ -103,7 +103,7 @@ bool ErrorEvent::CanBeDispatchedInWorld(const DOMWrapperWorld& world) const {
}
ScriptValue ErrorEvent::error(ScriptState* script_state) const {
// Don't return |m_error| when we are in the different worlds to avoid
// Don't return |error_| when we are in the different worlds to avoid
// leaking a V8 value.
// We do not clone Error objects (exceptions), for 2 reasons:
// 1) Errors carry a reference to the isolated world's global object, and
......
......@@ -79,15 +79,14 @@ class ErrorEvent final : public Event {
ErrorEvent(ScriptState*, const AtomicString&, const ErrorEventInit*);
~ErrorEvent() override;
// As 'message' is exposed to JavaScript, never return unsanitizedMessage.
// As |message| is exposed to JavaScript, never return |unsanitized_message_|.
const String& message() const { return sanitized_message_; }
const String& filename() const { return location_->Url(); }
unsigned lineno() const { return location_->LineNumber(); }
unsigned colno() const { return location_->ColumnNumber(); }
ScriptValue error(ScriptState*) const;
// 'messageForConsole' is not exposed to JavaScript, and prefers
// 'm_unsanitizedMessage'.
// Not exposed to JavaScript, prefers |unsanitized_message_|.
const String& MessageForConsole() const {
return !unsanitized_message_.IsEmpty() ? unsanitized_message_
: sanitized_message_;
......
......@@ -449,8 +449,8 @@ void PointerEventFactory::Clear() {
pointer_id_last_position_mapping_.clear();
// Always add mouse pointer in initialization and never remove it.
// No need to add it to m_pointerIncomingIdMapping as it is not going to be
// used with the existing APIs
// No need to add it to |pointer_incoming_id_mapping_| as it is not going to
// be used with the existing APIs
primary_id_[ToInt(WebPointerProperties::PointerType::kMouse)] = kMouseId;
pointer_id_mapping_[kMouseId] = PointerAttributes(
IncomingId(WebPointerProperties::PointerType::kMouse, 0), false, true);
......@@ -461,7 +461,7 @@ void PointerEventFactory::Clear() {
PointerId PointerEventFactory::AddIdAndActiveButtons(const IncomingId p,
bool is_active_buttons,
bool hovering) {
// Do not add extra mouse pointer as it was added in initialization
// Do not add extra mouse pointer as it was added in initialization.
if (p.GetPointerType() == WebPointerProperties::PointerType::kMouse) {
pointer_id_mapping_[kMouseId] =
PointerAttributes(p, is_active_buttons, true);
......@@ -475,7 +475,7 @@ PointerId PointerEventFactory::AddIdAndActiveButtons(const IncomingId p,
return mapped_id;
}
int type_int = p.PointerTypeInt();
// We do not handle the overflow of m_currentId as it should be very rare
// We do not handle the overflow of |current_id_| as it should be very rare.
PointerId mapped_id = current_id_++;
if (!id_count_[type_int])
primary_id_[type_int] = mapped_id;
......@@ -487,7 +487,7 @@ PointerId PointerEventFactory::AddIdAndActiveButtons(const IncomingId p,
}
bool PointerEventFactory::Remove(const PointerId mapped_id) {
// Do not remove mouse pointer id as it should always be there
// Do not remove mouse pointer id as it should always be there.
if (mapped_id == kMouseId ||
pointer_id_mapping_.find(mapped_id) == pointer_id_mapping_.end())
return false;
......
......@@ -34,7 +34,7 @@ class CORE_EXPORT WebAssociatedURLLoaderImpl final
void SetDefersLoading(bool) override;
void SetLoadingTaskRunner(base::SingleThreadTaskRunner*) override;
// Called by |m_observer| to handle destruction of the Document associated
// Called by |observer_| to handle destruction of the Document associated
// with the frame given to the constructor.
void DocumentDestroyed();
......@@ -57,13 +57,13 @@ class CORE_EXPORT WebAssociatedURLLoaderImpl final
WebAssociatedURLLoaderClient* client_;
WebAssociatedURLLoaderOptions options_;
// An adapter which converts the hreadableLoaderClient method
// calls into the WebURLLoaderClient method calls.
// Converts ThreadableLoaderClient method calls into WebURLLoaderClient method
// calls.
Persistent<ClientAdapter> client_adapter_;
Persistent<ThreadableLoader> loader_;
// A ContextLifecycleObserver for cancelling |m_loader| when the Document
// is detached.
// A ContextLifecycleObserver for cancelling |loader_| when the Document is
// detached.
Persistent<Observer> observer_;
DISALLOW_COPY_AND_ASSIGN(WebAssociatedURLLoaderImpl);
......
......@@ -93,7 +93,7 @@ bool WebInputMethodControllerImpl::FinishComposingText(
// all the time. For instance, resetInputMethod call on RenderViewImpl could
// be after losing the focus on frame. But since we return the core frame
// in WebViewImpl::focusedLocalFrameInWidget(), we will reach here with
// |m_webLocalFrame| not focused on page.
// |web_frame_| not focused on page.
if (WebPlugin* plugin = FocusedPluginIfInputMethodSupported())
return plugin->FinishComposingText(selection_behavior);
......
......@@ -177,10 +177,10 @@ TEST_F(WebMeaningfulLayoutsTest,
test::RunPendingTasks();
EXPECT_EQ(0, WebWidgetClient().VisuallyNonEmptyLayoutCount());
// We serve the SVG file and check visuallyNonEmptyLayoutCount() before
// mainResource.finish() because finishing the main resource causes
// We serve the SVG file and check VisuallyNonEmptyLayoutCount() before
// main_resource.Finish() because finishing the main resource causes
// |FrameView::m_isVisuallyNonEmpty| to be true and
// visuallyNonEmptyLayoutCount() to be 1 irrespective of the SVG sizes.
// VisuallyNonEmptyLayoutCount() to be 1 irrespective of the SVG sizes.
svg_resource.Start();
svg_resource.Write(
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"65536\" "
......
......@@ -548,7 +548,7 @@ void WebPagePopupImpl::ClosePopup() {
DestroyPage();
// m_widgetClient might be 0 because this widget might be already closed.
// |widget_client_| might be 0 because this widget might be already closed.
if (widget_client_ && !close_already_called) {
// closeWidgetSoon() will call this->close() later.
widget_client_->CloseWidgetSoon();
......
......@@ -1136,9 +1136,9 @@ void WebPluginContainerImpl::ComputeClipRectsForPlugin(
void WebPluginContainerImpl::CalculateGeometry(IntRect& window_rect,
IntRect& clip_rect,
IntRect& unobscured_rect) {
// document().layoutView() can be null when we receive messages from the
// GetDocument().LayoutView() can be null when we receive messages from the
// plugins while we are destroying a frame.
// FIXME: Can we just check m_element->document().isActive() ?
// TODO: Can we just check element_->GetDocument().IsActive() ?
if (element_->GetLayoutObject()->GetDocument().GetLayoutView()) {
// Take our element and get the clip rect from the enclosing layer and
// frame view.
......
......@@ -734,9 +734,9 @@ WebInputEventResult WebViewImpl::HandleKeyEvent(const WebKeyboardEvent& event) {
WebInputEvent::GetName(event.GetType()), "text",
String(event.text).Utf8());
// Please refer to the comments explaining the m_suppressNextKeypressEvent
// member.
// The m_suppressNextKeypressEvent is set if the KeyDown is handled by
// Please refer to the comments explaining |suppress_next_keypress_event_|.
//
// |suppress_next_keypress_event_| is set if the KeyDown is handled by
// Webkit. A keyDown event is typically associated with a keyPress(char)
// event and a keyUp event. We reset this flag here as this is a new keyDown
// event.
......@@ -816,8 +816,8 @@ WebInputEventResult WebViewImpl::HandleCharEvent(
TRACE_EVENT1("input", "WebViewImpl::handleCharEvent", "text",
String(event.text).Utf8());
// Please refer to the comments explaining the m_suppressNextKeypressEvent
// member. The m_suppressNextKeypressEvent is set if the KeyDown is
// Please refer to the comments explaining |suppress_next_keypress_event_|
// |suppress_next_keypress_event_| is set if the KeyDown is
// handled by Webkit. A keyDown event is typically associated with a
// keyPress(char) event and a keyUp event. We reset this flag here as it
// only applies to the current keyPress event.
......@@ -1107,7 +1107,7 @@ void WebViewImpl::AnimateDoubleTapZoom(const gfx::Point& point_in_root_frame,
}
// TODO(dglazkov): The only reason why we're using isAnimating and not just
// checking for m_layerTreeView->hasPendingPageScaleAnimation() is because of
// checking for layer_tree_view_->HasPendingPageScaleAnimation() is because of
// fake page scale animation plumbing for testing, which doesn't actually
// initiate a page scale animation.
if (is_animating) {
......@@ -1793,7 +1793,7 @@ WebInputEventResult WebViewImpl::HandleCapturedMouseEvent(
const WebCoalescedInputEvent& coalesced_event) {
const WebInputEvent& input_event = coalesced_event.Event();
TRACE_EVENT1("input", "captured mouse event", "type", input_event.GetType());
// Save m_mouseCaptureNode since mouseCaptureLost() will clear it.
// Save |mouse_capture_element_| since |MouseCaptureLost()| will clear it.
HTMLPlugInElement* element = mouse_capture_element_;
// Not all platforms call mouseCaptureLost() directly.
......@@ -2319,7 +2319,7 @@ double WebViewImpl::SetZoomLevel(double zoom_level) {
if (zoom_factor_for_device_scale_factor_) {
if (compositor_device_scale_factor_override_) {
// Adjust the page's DSF so that DevicePixelRatio becomes
// m_zoomFactorForDeviceScaleFactor.
// |zoom_factor_for_device_scale_factor_|.
AsView().page->SetDeviceScaleFactorDeprecated(
zoom_factor_for_device_scale_factor_ /
compositor_device_scale_factor_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