OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 27 matching lines...) Expand all Loading... |
38 namespace blink { | 38 namespace blink { |
39 | 39 |
40 class KURL; | 40 class KURL; |
41 | 41 |
42 class V8DOMActivityLogger { | 42 class V8DOMActivityLogger { |
43 public: | 43 public: |
44 virtual ~V8DOMActivityLogger() { } | 44 virtual ~V8DOMActivityLogger() { } |
45 | 45 |
46 virtual void logGetter(const String& apiName) { } | 46 virtual void logGetter(const String& apiName) { } |
47 virtual void logSetter(const String& apiName, const v8::Handle<v8::Value>& n
ewValue) { } | 47 virtual void logSetter(const String& apiName, const v8::Handle<v8::Value>& n
ewValue) { } |
48 virtual void logSetter(const String& apiName, const v8::Handle<v8::Value>& n
ewValue, const v8::Handle<v8::Value>& oldValue) { } | |
49 virtual void logMethod(const String& apiName, int argc, const v8::Handle<v8:
:Value>* argv) { } | 48 virtual void logMethod(const String& apiName, int argc, const v8::Handle<v8:
:Value>* argv) { } |
50 virtual void logEvent(const String& eventName, int argc, const String* argv)
{ } | 49 virtual void logEvent(const String& eventName, int argc, const String* argv)
{ } |
51 | 50 |
52 // Associates a logger with the world identified by worldId (worlId may be 0 | 51 // Associates a logger with the world identified by worldId (worlId may be 0 |
53 // identifying the main world) and extension ID. Extension ID is used to | 52 // identifying the main world) and extension ID. Extension ID is used to |
54 // identify a logger for main world only (worldId == 0). If the world is not | 53 // identify a logger for main world only (worldId == 0). If the world is not |
55 // a main world, an extension ID is ignored. | 54 // a main world, an extension ID is ignored. |
56 // | 55 // |
57 // A renderer process may host multiple extensions when the browser hits the | 56 // A renderer process may host multiple extensions when the browser hits the |
58 // renderer process limit. In such case, we assign multiple extensions to | 57 // renderer process limit. In such case, we assign multiple extensions to |
59 // the same main world of a renderer process. In order to distinguish the | 58 // the same main world of a renderer process. In order to distinguish the |
60 // extensions and their activity loggers in the main world, we require an | 59 // extensions and their activity loggers in the main world, we require an |
61 // extension ID. Otherwise, extension activities may be logged under | 60 // extension ID. Otherwise, extension activities may be logged under |
62 // a wrong extension ID. | 61 // a wrong extension ID. |
63 static void setActivityLogger(int worldId, const String&, PassOwnPtr<V8DOMAc
tivityLogger>); | 62 static void setActivityLogger(int worldId, const String&, PassOwnPtr<V8DOMAc
tivityLogger>); |
64 static V8DOMActivityLogger* activityLogger(int worldId, const String& extens
ionId); | 63 static V8DOMActivityLogger* activityLogger(int worldId, const String& extens
ionId); |
65 static V8DOMActivityLogger* activityLogger(int worldId, const KURL&); | 64 static V8DOMActivityLogger* activityLogger(int worldId, const KURL&); |
66 | 65 |
67 // Returns activity logger for current V8 context or 0. | 66 // Returns activity logger for current V8 context or 0. |
68 static V8DOMActivityLogger* currentActivityLogger(); | 67 static V8DOMActivityLogger* currentActivityLogger(); |
69 // Returns activity logger for current V8 context if the context belongs to | 68 // Returns activity logger for current V8 context if the context belongs to |
70 // an isolated world or 0. | 69 // an isolated world or 0. |
71 static V8DOMActivityLogger* currentActivityLoggerIfIsolatedWorld(); | 70 static V8DOMActivityLogger* currentActivityLoggerIfIsolatedWorld(); |
72 | 71 |
73 }; | 72 }; |
74 | 73 |
75 } // namespace blink | 74 } // namespace blink |
76 | 75 |
77 #endif // V8DOMActivityLogger_h | 76 #endif // V8DOMActivityLogger_h |
OLD | NEW |