OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Helper functions that are used by the NPObject proxy and stub. | 5 // Helper functions that are used by the NPObject proxy and stub. |
6 | 6 |
7 #ifndef CONTENT_COMMON_NPOBJECT_UTIL_H_ | 7 #ifndef CONTENT_COMMON_NPOBJECT_UTIL_H_ |
8 #define CONTENT_COMMON_NPOBJECT_UTIL_H_ | 8 #define CONTENT_COMMON_NPOBJECT_UTIL_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
11 #include "base/file_path.h" | |
11 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 #include "content/common/npobject_stub.h" | |
12 | 14 |
13 #if defined(OS_WIN) | 15 #if defined(OS_WIN) |
14 #include <windows.h> | 16 #include <windows.h> |
15 #endif | 17 #endif |
16 | 18 |
17 #include "content/common/npobject_stub.h" | |
18 | |
19 class GURL; | 19 class GURL; |
20 class NPObjectProxy; | 20 class NPObjectProxy; |
21 class NPChannelBase; | 21 class NPChannelBase; |
22 | 22 |
23 struct _NPVariant; | 23 struct _NPVariant; |
24 struct NPIdentifier_Param; | 24 struct NPIdentifier_Param; |
25 struct NPVariant_Param; | 25 struct NPVariant_Param; |
26 | 26 |
27 typedef _NPVariant NPVariant; | 27 typedef _NPVariant NPVariant; |
28 typedef void *NPIdentifier; | 28 typedef void *NPIdentifier; |
29 | 29 |
30 // Needs to be called early in the plugin process lifetime, before any | 30 // Needs to be called early in the plugin process lifetime, before any |
31 // plugin instances are initialized. | 31 // plugin instances are initialized. |
32 void PatchNPNFunctions(); | 32 void PatchNPNFunctions(const FilePath& plugin_path); |
33 | 33 |
34 // Returns true if the current process is a plugin process, or false if it's a | 34 // Returns true if the current process is a plugin process, or false otherwise. |
35 // renderer process. | |
36 bool IsPluginProcess(); | 35 bool IsPluginProcess(); |
Steve Block
2011/09/21 13:19:05
This seems like a strange place for this function.
| |
37 | 36 |
37 // Returns the path of the plugin file that this process hosts. Must only be | |
38 // called if this is a plugin process. | |
39 const FilePath& GetPluginPath(); | |
40 | |
38 // Creates an object similar to NPIdentifier that can be marshalled. | 41 // Creates an object similar to NPIdentifier that can be marshalled. |
39 void CreateNPIdentifierParam(NPIdentifier id, NPIdentifier_Param* param); | 42 void CreateNPIdentifierParam(NPIdentifier id, NPIdentifier_Param* param); |
40 | 43 |
41 // Creates an NPIdentifier from the marshalled object. | 44 // Creates an NPIdentifier from the marshalled object. |
42 NPIdentifier CreateNPIdentifier(const NPIdentifier_Param& param); | 45 NPIdentifier CreateNPIdentifier(const NPIdentifier_Param& param); |
43 | 46 |
44 // Creates an object similar to NPVariant that can be marshalled. | 47 // Creates an object similar to NPVariant that can be marshalled. |
45 // If the containing NPObject happens to be an NPObject, then a stub | 48 // If the containing NPObject happens to be an NPObject, then a stub |
46 // is created around it and param holds the routing id for it. | 49 // is created around it and param holds the routing id for it. |
47 // If release is true, the NPVariant object is released (except if | 50 // If release is true, the NPVariant object is released (except if |
(...skipping 16 matching lines...) Expand all Loading... | |
64 #if defined(OS_WIN) | 67 #if defined(OS_WIN) |
65 // Given a plugin's HWND, returns an event associated with the TabContents | 68 // Given a plugin's HWND, returns an event associated with the TabContents |
66 // that's set when inside a messagebox. This tells the plugin process that | 69 // that's set when inside a messagebox. This tells the plugin process that |
67 // the message queue should be pumped (as what would happen if everything was | 70 // the message queue should be pumped (as what would happen if everything was |
68 // in-process). This avoids deadlocks when a plugin invokes javascript that | 71 // in-process). This avoids deadlocks when a plugin invokes javascript that |
69 // causes a message box to come up. | 72 // causes a message box to come up. |
70 HANDLE GetMessageBoxEvent(HWND hwnd); | 73 HANDLE GetMessageBoxEvent(HWND hwnd); |
71 #endif // defined(OS_WIN) | 74 #endif // defined(OS_WIN) |
72 | 75 |
73 #endif // CONTENT_COMMON_NPOBJECT_UTIL_H_ | 76 #endif // CONTENT_COMMON_NPOBJECT_UTIL_H_ |
OLD | NEW |