| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 | 11 |
| 12 #if defined(OS_WIN) | 12 #if defined(OS_WIN) |
| 13 #include <windows.h> | 13 #include <windows.h> |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 #include "content/common/npobject_stub.h" | 16 #include "content/common/npobject_stub.h" |
| 17 | 17 |
| 18 class GURL; | 18 class GURL; |
| 19 class NPChannelBase; | |
| 20 | 19 |
| 21 struct _NPVariant; | 20 struct _NPVariant; |
| 22 struct NPIdentifier_Param; | |
| 23 struct NPVariant_Param; | |
| 24 | 21 |
| 25 typedef _NPVariant NPVariant; | 22 typedef _NPVariant NPVariant; |
| 26 typedef void *NPIdentifier; | 23 typedef void *NPIdentifier; |
| 27 | 24 |
| 25 namespace content { |
| 26 class NPChannelBase; |
| 27 struct NPIdentifier_Param; |
| 28 struct NPVariant_Param; |
| 29 |
| 28 // 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 |
| 29 // plugin instances are initialized. | 31 // plugin instances are initialized. |
| 30 void PatchNPNFunctions(); | 32 void PatchNPNFunctions(); |
| 31 | 33 |
| 32 // Returns true if the current process is a plugin process, or false otherwise. | 34 // Returns true if the current process is a plugin process, or false otherwise. |
| 33 bool IsPluginProcess(); | 35 bool IsPluginProcess(); |
| 34 | 36 |
| 35 // Creates an object similar to NPIdentifier that can be marshalled. | 37 // Creates an object similar to NPIdentifier that can be marshalled. |
| 36 void CreateNPIdentifierParam(NPIdentifier id, NPIdentifier_Param* param); | 38 void CreateNPIdentifierParam(NPIdentifier id, NPIdentifier_Param* param); |
| 37 | 39 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 60 | 62 |
| 61 #if defined(OS_WIN) | 63 #if defined(OS_WIN) |
| 62 // Given a plugin's HWND, returns an event associated with the WebContentsImpl | 64 // Given a plugin's HWND, returns an event associated with the WebContentsImpl |
| 63 // that's set when inside a messagebox. This tells the plugin process that | 65 // that's set when inside a messagebox. This tells the plugin process that |
| 64 // the message queue should be pumped (as what would happen if everything was | 66 // the message queue should be pumped (as what would happen if everything was |
| 65 // in-process). This avoids deadlocks when a plugin invokes javascript that | 67 // in-process). This avoids deadlocks when a plugin invokes javascript that |
| 66 // causes a message box to come up. | 68 // causes a message box to come up. |
| 67 HANDLE GetMessageBoxEvent(HWND hwnd); | 69 HANDLE GetMessageBoxEvent(HWND hwnd); |
| 68 #endif // defined(OS_WIN) | 70 #endif // defined(OS_WIN) |
| 69 | 71 |
| 72 } // namespace content |
| 73 |
| 70 #endif // CONTENT_COMMON_NPOBJECT_UTIL_H_ | 74 #endif // CONTENT_COMMON_NPOBJECT_UTIL_H_ |
| OLD | NEW |