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

Side by Side Diff: chrome/renderer/extensions/activity_log_converter_strategy.h

Issue 268553002: Move DOMActivityLogger and associated code from //chrome to //extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_RENDERER_EXTENSIONS_ACTIVITY_LOG_CONVERTER_STRATEGY_H_
6 #define CHROME_RENDERER_EXTENSIONS_ACTIVITY_LOG_CONVERTER_STRATEGY_H_
7
8 #include "base/compiler_specific.h"
9 #include "base/macros.h"
10 #include "content/public/renderer/v8_value_converter.h"
11 #include "v8/include/v8.h"
12
13 namespace extensions {
14
15 // This class is used by activity logger and extends behavior of
16 // V8ValueConverter. It overwrites conversion of V8 arrays and objects. When
17 // converting arrays and objects, we must not invoke any JS code which may
18 // result in triggering activity logger. In such case, the log entries will be
19 // generated due to V8 object conversion rather than extension activity.
20 class ActivityLogConverterStrategy
21 : public content::V8ValueConverter::Strategy {
22 public:
23 typedef content::V8ValueConverter::Strategy::FromV8ValueCallback
24 FromV8ValueCallback;
25
26 ActivityLogConverterStrategy();
27 virtual ~ActivityLogConverterStrategy();
28
29 // content::V8ValueConverter::Strategy implementation.
30 virtual bool FromV8Object(v8::Handle<v8::Object> value,
31 base::Value** out,
32 v8::Isolate* isolate,
33 const FromV8ValueCallback& callback) const OVERRIDE;
34 virtual bool FromV8Array(v8::Handle<v8::Array> value,
35 base::Value** out,
36 v8::Isolate* isolate,
37 const FromV8ValueCallback& callback) const OVERRIDE;
38
39 void set_enable_detailed_parsing(bool enable_detailed_parsing) {
40 enable_detailed_parsing_ = enable_detailed_parsing;
41 }
42
43 private:
44 bool FromV8Internal(v8::Handle<v8::Object> value,
45 base::Value** out,
46 v8::Isolate* isolate,
47 const FromV8ValueCallback& callback) const;
48
49 // Whether or not to extract a detailed value from the passed in objects. We
50 // do this when we need more information about the arguments in order to
51 // determine, e.g., if an ad was injected.
52 bool enable_detailed_parsing_;
53
54 DISALLOW_COPY_AND_ASSIGN(ActivityLogConverterStrategy);
55 };
56
57 } // namespace extensions
58
59 #endif // CHROME_RENDERER_EXTENSIONS_ACTIVITY_LOG_CONVERTER_STRATEGY_H_
OLDNEW
« no previous file with comments | « chrome/common/extensions/dom_action_types.h ('k') | chrome/renderer/extensions/activity_log_converter_strategy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698