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

Unified Diff: Source/web/WebDOMActivityLogger.cpp

Issue 213783002: Pass current value of attributes to WebDOMActivityLogger Setter logs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Working Version Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: Source/web/WebDOMActivityLogger.cpp
diff --git a/Source/web/WebDOMActivityLogger.cpp b/Source/web/WebDOMActivityLogger.cpp
index 7ca839fc649dd3b7ad1af8837e873b6af882967d..8e5725a9a5ee40407391a921ba8d196404ae1d24 100644
--- a/Source/web/WebDOMActivityLogger.cpp
+++ b/Source/web/WebDOMActivityLogger.cpp
@@ -51,16 +51,39 @@ public:
virtual void log(const String& apiName, int argc, const v8::Handle<v8::Value>* argv, const String& extraInfo) OVERRIDE
{
- KURL url;
- String title;
- if (Document* document = currentDOMWindow(v8::Isolate::GetCurrent())->document()) {
- url = document->url();
- title = document->title();
- }
- m_domActivityLogger->log(WebString(apiName), argc, argv, WebString(extraInfo), WebURL(url), WebString(title));
+ m_domActivityLogger->log(WebString(apiName), argc, argv, WebString(extraInfo), getURL(), getTitle());
+ }
+
+ virtual void logGetter(const String& apiName) OVERRIDE
+ {
+ m_domActivityLogger->logGetter(WebString(apiName), getURL(), getTitle());
+ }
+
+ virtual void logSetter(const String& apiName, const v8::Handle<v8::Value>& newValue, const v8::Handle<v8::Value>& oldValue) OVERRIDE
+ {
+ m_domActivityLogger->logSetter(WebString(apiName), newValue, oldValue, getURL(), getTitle());
+ }
+
+ virtual void logMethod(const String& apiName, int argc, const v8::Handle<v8::Value>* argv) OVERRIDE
+ {
+ m_domActivityLogger->logMethod(WebString(apiName), argc, argv, getURL(), getTitle());
}
private:
+ WebURL getURL()
+ {
+ if (Document* document = currentDOMWindow(v8::Isolate::GetCurrent())->document())
+ return WebURL(document->url());
+ return WebURL();
+ }
+
+ WebString getTitle()
+ {
+ if (Document* document = currentDOMWindow(v8::Isolate::GetCurrent())->document())
+ return WebString(document->title());
+ return WebString();
+ }
+
OwnPtr<WebDOMActivityLogger> m_domActivityLogger;
};

Powered by Google App Engine
This is Rietveld 408576698