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

Unified Diff: chrome/renderer/extensions/activity_log_converter_strategy.h

Issue 19730002: V8ValueConverter for the activity logger that does not invoke interceptors and (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Dan's comment Created 7 years, 4 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/chrome_tests_unit.gypi ('k') | chrome/renderer/extensions/activity_log_converter_strategy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/activity_log_converter_strategy.h
diff --git a/chrome/renderer/extensions/activity_log_converter_strategy.h b/chrome/renderer/extensions/activity_log_converter_strategy.h
new file mode 100644
index 0000000000000000000000000000000000000000..5137921e556dcb8f3b35d6369bd4690ea38fb8d6
--- /dev/null
+++ b/chrome/renderer/extensions/activity_log_converter_strategy.h
@@ -0,0 +1,36 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_RENDERER_EXTENSIONS_ACTIVITY_LOG_CONVERTER_STRATEGY_H_
+#define CHROME_RENDERER_EXTENSIONS_ACTIVITY_LOG_CONVERTER_STRATEGY_H_
+
+#include "base/compiler_specific.h"
+#include "content/public/renderer/v8_value_converter.h"
+#include "v8/include/v8.h"
+
+namespace extensions {
+
+// This class is used by activity logger and extends behavior of
+// V8ValueConverter. It overwrites conversion of V8 arrays and objects. When
+// converting arrays and objects, we must not invoke any JS code which may
+// result in triggering activity logger. In such case, the log entries will be
+// generated due to V8 object conversion rather than extension activity.
+class ActivityLogConverterStrategy
+ : public content::V8ValueConverter::Strategy {
+ public:
+ virtual ~ActivityLogConverterStrategy() {}
+
+ virtual bool FromV8Object(v8::Handle<v8::Object> value,
+ base::Value** out) const OVERRIDE;
+ virtual bool FromV8Array(v8::Handle<v8::Array> value,
+ base::Value** out) const OVERRIDE;
+
+ private:
+ bool FromV8ObjectInternal(v8::Handle<v8::Object> value,
+ base::Value** out) const;
+};
+
+} // namespace extensions
+
+#endif // CHROME_RENDERER_EXTENSIONS_ACTIVITY_LOG_CONVERTER_STRATEGY_H_
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | chrome/renderer/extensions/activity_log_converter_strategy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698