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

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

Issue 12390076: Attaching a DOM Activity Logger to all extension scripts (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 9 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 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_DOM_ACTIVITY_LOGGER_H_
6 #define CHROME_RENDERER_EXTENSIONS_DOM_ACTIVITY_LOGGER_H_
7
8 #include <string>
9
10 #include "base/string_piece.h"
11 #include "googleurl/src/gurl.h"
12 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h"
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMActivityLogger. h"
14 #include "v8/include/v8.h"
15
16 using WebKit::WebString;
17
18 namespace extensions {
19
20 class DOMActivityLogger: public WebKit::WebDOMActivityLogger {
21 public:
22 static const int kMainWorldId = 0;
23 DOMActivityLogger(const std::string& extension_id,
24 const GURL& url,
25 const string16& title);
26
27 // Marshalls the arguments into an ExtensionHostMsg_DOMAction_Params
28 // and sends it over to the browser (via IPC) for appending it to the
29 // extension activity log.
30 // (Overrides the log method in WebKit::WebDOMActivityLogger)
31 virtual void log(const WebString& api_name,
32 int argc,
33 const v8::Handle<v8::Value> argv[],
34 const WebString& extra_info);
35
36 // If extension activity logging is enabled then check (using the
37 // WebKit API) if there is no logger attached to the world corresponding
38 // to world_id, and if so, construct a new logger and attach it.
39 // worl_id = 0 indicates the main world.
40 static void AttachToWorld(int world_id,
41 const std::string& extension_id,
42 const GURL& url,
43 const string16& title);
44
45 private:
46 std::string extension_id_;
47 GURL url_;
48 string16 title_;
49
50 DISALLOW_COPY_AND_ASSIGN(DOMActivityLogger);
51 };
52
53 } // namespace extensions
54
55 #endif // CHROME_RENDERER_EXTENSIONS_DOM_ACTIVITY_LOGGER_H_
56
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/dispatcher.cc ('k') | chrome/renderer/extensions/dom_activity_logger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698