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

Unified Diff: chrome/renderer/extensions/dom_activity_logger.cc

Issue 15520002: Moved DOMActionType information from extras into a real field (ActivityLog) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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
« no previous file with comments | « chrome/renderer/extensions/dom_activity_logger.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/dom_activity_logger.cc
diff --git a/chrome/renderer/extensions/dom_activity_logger.cc b/chrome/renderer/extensions/dom_activity_logger.cc
index 657458473c175b9d7159b6ca1d102e3611301e9d..5f2d83ec16c7158d76efefa83438ffe2d420af4c 100644
--- a/chrome/renderer/extensions/dom_activity_logger.cc
+++ b/chrome/renderer/extensions/dom_activity_logger.cc
@@ -15,19 +15,30 @@
using content::V8ValueConverter;
+namespace {
+
+// Do not alter the existing options. Append only.
+enum CallType {
Matt Perry 2013/05/21 22:14:21 It'd be better to use the same enum on both ends o
felt 2013/05/22 01:34:39 Done.
+ GETTER = 0,
+ SETTER = 1,
+ METHOD = 2
+};
+
+} // namespace
+
namespace extensions {
DOMActivityLogger::DOMActivityLogger(const std::string& extension_id,
const GURL& url,
const string16& title)
: extension_id_(extension_id), url_(url), title_(title) {
-}
+} // namespace extensions
void DOMActivityLogger::log(
const WebString& api_name,
int argc,
const v8::Handle<v8::Value> argv[],
- const WebString& extra_info) {
+ const WebString& call_type) {
scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create());
scoped_ptr<ListValue> argv_list_value(new ListValue());
for (int i =0; i < argc; i++) {
@@ -39,7 +50,13 @@ void DOMActivityLogger::log(
params.url_title = title_;
params.api_call = api_name.utf8();
params.arguments.Swap(argv_list_value.get());
- params.extra = extra_info.utf8();
+ const std::string type = std::string(call_type.utf8());
Matt Perry 2013/05/21 22:14:21 the extra std::string cast is unnecessary
felt 2013/05/22 01:34:39 Done.
felt 2013/05/22 01:34:39 Done.
+ if (type == "Getter")
+ params.call_type = static_cast<int>(GETTER);
Matt Perry 2013/05/21 22:14:21 I believe these casts are unnecessary.
felt 2013/05/22 01:34:39 Done.
+ else if (type == "Setter")
+ params.call_type = static_cast<int>(SETTER);
+ else
+ params.call_type = static_cast<int>(METHOD);
content::RenderThread::Get()->Send(
new ExtensionHostMsg_AddDOMActionToActivityLog(extension_id_, params));
« no previous file with comments | « chrome/renderer/extensions/dom_activity_logger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698