Chromium Code Reviews
|
| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
|
Matt Perry
2013/03/05 02:32:37
2013
Ankur Taly
2013/03/05 20:03:32
Done.
| |
| 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 "base/string_piece.h" | |
| 9 #include "googleurl/src/gurl.h" | |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDOMActivityLogger. h" | |
| 11 #include "v8/include/v8.h" | |
| 12 | |
| 13 namespace extensions { | |
| 14 | |
| 15 class DOMActivityLogger: public WebKit::WebDOMActivityLogger { | |
| 16 public: | |
| 17 static const int kMainWorldId = 0; | |
| 18 DOMActivityLogger(std::string extension_id, | |
| 19 GURL url, | |
| 20 string16 title); | |
|
Matt Perry
2013/03/05 02:32:37
pass these all by const ref
Ankur Taly
2013/03/05 20:03:32
Done.
| |
| 21 | |
| 22 // Marshalls the arguments into an ExtensionHostMsg_DOMAction_Params | |
| 23 // and sends it over to the browser (via IPC) for appending it to the | |
| 24 // extension activity log. | |
| 25 virtual void log(const char* api_name, | |
|
Matt Perry
2013/03/05 02:32:37
This is chrome code, so use chrome style naming (e
Ankur Taly
2013/03/05 20:03:32
This method is supposed to override the "log" meth
Matt Perry
2013/03/05 20:34:22
Oops, I missed that this class overrode a WebKit A
| |
| 26 int argc, | |
| 27 const v8::Handle<v8::Value> args[], | |
| 28 const char* extra_info); | |
|
Matt Perry
2013/03/05 02:32:37
also, use std::string instead of const char*
Ankur Taly
2013/03/05 20:03:32
This would require changing the "log" method decla
| |
| 29 | |
| 30 // If extension activity logging is enabled then check (using the | |
| 31 // WebKit API) if there is no logger attached to the world corresponding | |
| 32 // to world_id, and if so, construct a new logger and attach it. | |
| 33 // worl_id = 0 indicates the main world. | |
| 34 static void attachToWorld(int world_id, | |
| 35 std::string extension_id, | |
| 36 GURL url, | |
| 37 string16 title); | |
|
Matt Perry
2013/03/05 02:32:37
const ref
Ankur Taly
2013/03/05 20:03:32
Done.
| |
| 38 | |
| 39 private: | |
| 40 std::string extension_id_; | |
| 41 GURL url_; | |
| 42 string16 title_; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(DOMActivityLogger); | |
| 45 }; | |
| 46 | |
| 47 } // namespace extensions | |
| 48 | |
| 49 #endif // CHROME_RENDERER_EXTENSIONS_DOM_ACTIVITY_LOGGER_H_ | |
| OLD | NEW |