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

Side by Side Diff: Source/core/html/HTMLAnchorElement.cpp

Issue 351923005: Refactoring activity logger. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Simon Hausmann <hausmann@kde.org> 4 * (C) 2000 Simon Hausmann <hausmann@kde.org>
5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
6 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 } 153 }
154 154
155 void HTMLAnchorElement::setActive(bool down) 155 void HTMLAnchorElement::setActive(bool down)
156 { 156 {
157 if (rendererIsEditable()) 157 if (rendererIsEditable())
158 return; 158 return;
159 159
160 ContainerNode::setActive(down); 160 ContainerNode::setActive(down);
161 } 161 }
162 162
163 void HTMLAnchorElement::attributeWillChange(const QualifiedName& name, const Ato micString& oldValue, const AtomicString& newValue)
164 {
165 if (name == hrefAttr && inDocument()) {
166 V8DOMActivityLogger* activityLogger = V8DOMActivityLogger::currentActivi tyLoggerIfIsolatedWorld();
167 if (activityLogger) {
168 Vector<String> argv;
169 argv.append("a");
170 argv.append(hrefAttr.toString());
171 argv.append(oldValue);
172 argv.append(newValue);
173 activityLogger->logEvent("blinkSetAttribute", argv.size(), argv.data ());
174 }
175 }
176 HTMLElement::attributeWillChange(name, oldValue, newValue);
177 }
178
163 void HTMLAnchorElement::parseAttribute(const QualifiedName& name, const AtomicSt ring& value) 179 void HTMLAnchorElement::parseAttribute(const QualifiedName& name, const AtomicSt ring& value)
164 { 180 {
165 if (name == hrefAttr) { 181 if (name == hrefAttr) {
166 bool wasLink = isLink(); 182 bool wasLink = isLink();
167 setIsLink(!value.isNull()); 183 setIsLink(!value.isNull());
168 if (wasLink != isLink()) { 184 if (wasLink != isLink()) {
169 didAffectSelector(AffectedSelectorLink | AffectedSelectorVisited | A ffectedSelectorEnabled); 185 didAffectSelector(AffectedSelectorLink | AffectedSelectorVisited | A ffectedSelectorEnabled);
170 if (wasLink && treeScope().adjustedFocusedElement() == this) { 186 if (wasLink && treeScope().adjustedFocusedElement() == this) {
171 // We might want to call blur(), but it's dangerous to dispatch 187 // We might want to call blur(), but it's dangerous to dispatch
172 // events here. 188 // events here.
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 Vector<String> argv; 382 Vector<String> argv;
367 argv.append("a"); 383 argv.append("a");
368 argv.append(fastGetAttribute(hrefAttr)); 384 argv.append(fastGetAttribute(hrefAttr));
369 activityLogger->logEvent("blinkAddElement", argv.size(), argv.data() ); 385 activityLogger->logEvent("blinkAddElement", argv.size(), argv.data() );
370 } 386 }
371 } 387 }
372 return HTMLElement::insertedInto(insertionPoint); 388 return HTMLElement::insertedInto(insertionPoint);
373 } 389 }
374 390
375 } 391 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698