| 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 #ifndef CONTENT_RENDERER_JAVA_JAVA_BRIDGE_DISPATCHER_H_ | 5 #ifndef CONTENT_RENDERER_JAVA_JAVA_BRIDGE_DISPATCHER_H_ |
| 6 #define CONTENT_RENDERER_JAVA_JAVA_BRIDGE_DISPATCHER_H_ | 6 #define CONTENT_RENDERER_JAVA_JAVA_BRIDGE_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "content/public/renderer/render_view_observer.h" | 11 #include "content/public/renderer/render_view_observer.h" |
| 13 #include "ipc/ipc_channel_handle.h" | 12 #include "ipc/ipc_channel_handle.h" |
| 14 #include "third_party/npapi/bindings/npruntime.h" | 13 #include "third_party/npapi/bindings/npruntime.h" |
| 15 | 14 |
| 16 struct _NPP; | |
| 17 | |
| 18 namespace content { | 15 namespace content { |
| 19 class JavaBridgeChannel; | 16 class JavaBridgeChannel; |
| 20 struct NPVariant_Param; | 17 struct NPVariant_Param; |
| 21 | 18 |
| 22 // This class handles injecting Java objects into the main frame of a | 19 // This class handles injecting Java objects into the main frame of a |
| 23 // RenderView. The 'add' and 'remove' messages received from the browser | 20 // RenderView. The 'add' and 'remove' messages received from the browser |
| 24 // process modify the entries in a map of 'pending' objects. These objects are | 21 // process modify the entries in a map of 'pending' objects. These objects are |
| 25 // bound to the window object of the main frame when that window object is next | 22 // bound to the window object of the main frame when that window object is next |
| 26 // cleared. These objects remain bound until the window object is cleared | 23 // cleared. These objects remain bound until the window object is cleared |
| 27 // again. | 24 // again. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 40 const NPVariant_Param& variant_param); | 37 const NPVariant_Param& variant_param); |
| 41 void OnRemoveNamedObject(const string16& name); | 38 void OnRemoveNamedObject(const string16& name); |
| 42 | 39 |
| 43 void EnsureChannelIsSetUp(); | 40 void EnsureChannelIsSetUp(); |
| 44 | 41 |
| 45 // Objects that will be bound to the window when the window object is next | 42 // Objects that will be bound to the window when the window object is next |
| 46 // cleared. We hold a ref to these. | 43 // cleared. We hold a ref to these. |
| 47 typedef std::map<string16, NPVariant> ObjectMap; | 44 typedef std::map<string16, NPVariant> ObjectMap; |
| 48 ObjectMap objects_; | 45 ObjectMap objects_; |
| 49 scoped_refptr<JavaBridgeChannel> channel_; | 46 scoped_refptr<JavaBridgeChannel> channel_; |
| 50 scoped_ptr<struct _NPP> owner_id_; | |
| 51 }; | 47 }; |
| 52 | 48 |
| 53 } // namespace content | 49 } // namespace content |
| 54 | 50 |
| 55 #endif // CONTENT_RENDERER_JAVA_JAVA_BRIDGE_DISPATCHER_H_ | 51 #endif // CONTENT_RENDERER_JAVA_JAVA_BRIDGE_DISPATCHER_H_ |
| OLD | NEW |