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

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

Issue 100214: Only send events to renderers that are listening to an event.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « chrome/common/render_messages_internal.h ('k') | chrome/renderer/extensions/event_bindings.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_ 5 #ifndef CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_
6 #define CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_ 6 #define CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_
7 7
8 #include "v8/include/v8.h" 8 #include "v8/include/v8.h"
9 9
10 #include <string> 10 #include <string>
11 11
12 class RenderThreadBase;
13
12 // This class deals with the javascript bindings related to Event objects. 14 // This class deals with the javascript bindings related to Event objects.
13 class EventBindings { 15 class EventBindings {
14 public: 16 public:
15 static const char* kName; // The v8::Extension name, for dependencies. 17 static const char* kName; // The v8::Extension name, for dependencies.
16 static v8::Extension* Get(); 18 static v8::Extension* Get();
17 19
20 // Allow RenderThread to be mocked out.
21 static void SetRenderThread(RenderThreadBase* thread);
22
18 // Calls the given function in each registered context which is listening 23 // Calls the given function in each registered context which is listening
19 // for events. The function can be an object property, ie: 24 // for events. The function can be an object property, ie:
20 // "chromium.Event.dispatch_". 25 // "chromium.Event.dispatch_".
21 static void CallFunction(const std::string& function_name, int argc, 26 static void CallFunction(const std::string& function_name, int argc,
22 v8::Handle<v8::Value>* argv); 27 v8::Handle<v8::Value>* argv);
23 }; 28 };
24 29
25 #endif // CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_ 30 #endif // CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_
OLDNEW
« no previous file with comments | « chrome/common/render_messages_internal.h ('k') | chrome/renderer/extensions/event_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698