| 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_PEPPER_MESSAGE_CHANNEL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_MESSAGE_CHANNEL_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_MESSAGE_CHANNEL_H_ | 6 #define CONTENT_RENDERER_PEPPER_MESSAGE_CHANNEL_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "content/renderer/pepper/v8_var_converter.h" |
| 14 #include "gin/handle.h" | 15 #include "gin/handle.h" |
| 15 #include "gin/interceptor.h" | 16 #include "gin/interceptor.h" |
| 16 #include "gin/wrappable.h" | 17 #include "gin/wrappable.h" |
| 17 #include "ppapi/proxy/host_dispatcher.h" | 18 #include "ppapi/proxy/host_dispatcher.h" |
| 18 #include "ppapi/shared_impl/resource.h" | 19 #include "ppapi/shared_impl/resource.h" |
| 19 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" | 20 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" |
| 20 #include "v8/include/v8.h" | 21 #include "v8/include/v8.h" |
| 21 | 22 |
| 22 struct PP_Var; | 23 struct PP_Var; |
| 23 | 24 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // preserves the order in which JS->plugin messages are processed. | 174 // preserves the order in which JS->plugin messages are processed. |
| 174 // | 175 // |
| 175 // Note we rely on raw VarConversionResult* pointers remaining valid after | 176 // Note we rely on raw VarConversionResult* pointers remaining valid after |
| 176 // calls to push_back or pop_front; hence why we're using list. (deque would | 177 // calls to push_back or pop_front; hence why we're using list. (deque would |
| 177 // probably also work, but is less clearly specified). | 178 // probably also work, but is less clearly specified). |
| 178 std::list<VarConversionResult> plugin_message_queue_; | 179 std::list<VarConversionResult> plugin_message_queue_; |
| 179 MessageQueueState plugin_message_queue_state_; | 180 MessageQueueState plugin_message_queue_state_; |
| 180 | 181 |
| 181 std::map<std::string, ppapi::ScopedPPVar> internal_named_properties_; | 182 std::map<std::string, ppapi::ScopedPPVar> internal_named_properties_; |
| 182 | 183 |
| 184 V8VarConverter var_converter_; |
| 185 |
| 183 // A callback to invoke at shutdown to ensure we unregister ourselves as | 186 // A callback to invoke at shutdown to ensure we unregister ourselves as |
| 184 // Observers for sync messages. | 187 // Observers for sync messages. |
| 185 base::Closure unregister_observer_callback_; | 188 base::Closure unregister_observer_callback_; |
| 186 | 189 |
| 187 // This is used to ensure pending tasks will not fire after this object is | 190 // This is used to ensure pending tasks will not fire after this object is |
| 188 // destroyed. | 191 // destroyed. |
| 189 base::WeakPtrFactory<MessageChannel> weak_ptr_factory_; | 192 base::WeakPtrFactory<MessageChannel> weak_ptr_factory_; |
| 190 | 193 |
| 191 DISALLOW_COPY_AND_ASSIGN(MessageChannel); | 194 DISALLOW_COPY_AND_ASSIGN(MessageChannel); |
| 192 }; | 195 }; |
| 193 | 196 |
| 194 } // namespace content | 197 } // namespace content |
| 195 | 198 |
| 196 #endif // CONTENT_RENDERER_PEPPER_MESSAGE_CHANNEL_H_ | 199 #endif // CONTENT_RENDERER_PEPPER_MESSAGE_CHANNEL_H_ |
| OLD | NEW |