| 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 // A class that receives IPC messages from an NPObjectProxy and calls the real | 5 // A class that receives IPC messages from an NPObjectProxy and calls the real |
| 6 // NPObject. | 6 // NPObject. |
| 7 | 7 |
| 8 #ifndef CONTENT_PLUGIN_NPOBJECT_STUB_H_ | 8 #ifndef CONTENT_PLUGIN_NPOBJECT_STUB_H_ |
| 9 #define CONTENT_PLUGIN_NPOBJECT_STUB_H_ | 9 #define CONTENT_PLUGIN_NPOBJECT_STUB_H_ |
| 10 #pragma once | 10 #pragma once |
| 11 | 11 |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/debug/stack_trace.h" |
| 14 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 16 #include "content/plugin/npobject_base.h" | 17 #include "content/plugin/npobject_base.h" |
| 17 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
| 18 #include "ipc/ipc_channel.h" | 19 #include "ipc/ipc_channel.h" |
| 19 #include "ui/gfx/native_widget_types.h" | 20 #include "ui/gfx/native_widget_types.h" |
| 20 | 21 |
| 21 class PluginChannelBase; | 22 class PluginChannelBase; |
| 22 struct NPIdentifier_Param; | 23 struct NPIdentifier_Param; |
| 23 struct NPObject; | 24 struct NPObject; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 bool* result); | 79 bool* result); |
| 79 void OnInvalidate(); | 80 void OnInvalidate(); |
| 80 void OnEnumeration(std::vector<NPIdentifier_Param>* value, | 81 void OnEnumeration(std::vector<NPIdentifier_Param>* value, |
| 81 bool* result); | 82 bool* result); |
| 82 void OnConstruct(const std::vector<NPVariant_Param>& args, | 83 void OnConstruct(const std::vector<NPVariant_Param>& args, |
| 83 IPC::Message* reply_msg); | 84 IPC::Message* reply_msg); |
| 84 void OnEvaluate(const std::string& script, bool popups_allowed, | 85 void OnEvaluate(const std::string& script, bool popups_allowed, |
| 85 IPC::Message* reply_msg); | 86 IPC::Message* reply_msg); |
| 86 | 87 |
| 87 private: | 88 private: |
| 89 //---------------------------------------------------------------------------- |
| 90 // Temporary code for debugging 94179 |
| 91 // TODO(eroman): Delete this when done investigating. |
| 92 //---------------------------------------------------------------------------- |
| 93 void CheckIsAlive(); |
| 94 static void DeleteSoonHelper( |
| 95 const base::debug::StackTrace& task_origin_stack_trace, |
| 96 NPObjectStub* stub); |
| 97 |
| 98 bool has_deletion_stack_trace_; |
| 99 base::debug::StackTrace deletion_stack_trace_; |
| 100 |
| 101 // Value to indicate whether this instance is alive or dead. |
| 102 static const int kTokenAlive = 0x1Cd9fe38; |
| 103 static const int kTokenDead = 0xDEADBEEF; |
| 104 int liveness_token_; |
| 105 //---------------------------------------------------------------------------- |
| 106 |
| 88 NPObject* npobject_; | 107 NPObject* npobject_; |
| 89 scoped_refptr<PluginChannelBase> channel_; | 108 scoped_refptr<PluginChannelBase> channel_; |
| 90 int route_id_; | 109 int route_id_; |
| 91 gfx::NativeViewId containing_window_; | 110 gfx::NativeViewId containing_window_; |
| 92 | 111 |
| 93 // The url of the main frame hosting the plugin. | 112 // The url of the main frame hosting the plugin. |
| 94 GURL page_url_; | 113 GURL page_url_; |
| 95 }; | 114 }; |
| 96 | 115 |
| 97 #endif // CONTENT_PLUGIN_NPOBJECT_STUB_H_ | 116 #endif // CONTENT_PLUGIN_NPOBJECT_STUB_H_ |
| OLD | NEW |