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

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

Issue 150125: Send port disconnect events when a frame is unloaded. (Closed)
Patch Set: from linux Created 11 years, 5 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
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; 12 class RenderThreadBase;
13 class WebFrame; 13 class WebFrame;
14 14
15 // This class deals with the javascript bindings related to Event objects. 15 // This class deals with the javascript bindings related to Event objects.
16 class EventBindings { 16 class EventBindings {
17 public: 17 public:
18 static const char* kName; // The v8::Extension name, for dependencies. 18 static const char* kName; // The v8::Extension name, for dependencies.
19 static v8::Extension* Get(); 19 static v8::Extension* Get();
20 20
21 // Allow RenderThread to be mocked out. 21 // Allow RenderThread to be mocked out.
22 static void SetRenderThread(RenderThreadBase* thread); 22 static void SetRenderThread(RenderThreadBase* thread);
23 static RenderThreadBase* GetRenderThread(); 23 static RenderThreadBase* GetRenderThread();
24 24
25 // Handle a script context coming / going away. 25 // Handle a script context coming / going away.
26 static void HandleContextCreated(WebFrame* frame); 26 static void HandleContextCreated(WebFrame* frame);
27 static void HandleContextDestroyed(WebFrame* frame); 27 static void HandleContextDestroyed(WebFrame* frame);
28 28
29 // Calls the given function in each registered context which is listening 29 // Calls the given function in each registered context which is listening
30 // for events. The function can be an object property, ie: 30 // for events. See comments on bindings_utils::CallFunctionInContext for
31 // "chromium.Event.dispatch_". 31 // more details.
32 static void CallFunction(const std::string& function_name, int argc, 32 static void CallFunction(const std::string& function_name, int argc,
33 v8::Handle<v8::Value>* argv); 33 v8::Handle<v8::Value>* argv);
34 34
35 // Handles a response to an API request. 35 // Handles a response to an API request.
36 static void HandleResponse(int request_id, bool success, 36 static void HandleResponse(int request_id, bool success,
37 const std::string& response, 37 const std::string& response,
38 const std::string& error); 38 const std::string& error);
39 }; 39 };
40 40
41 #endif // CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_ 41 #endif // CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_
OLDNEW
« no previous file with comments | « chrome/common/render_messages_internal.h ('k') | chrome/renderer/extensions/renderer_extension_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698