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 #include "content/renderer/pepper/message_channel.h" | 5 #include "content/renderer/pepper/message_channel.h" |
6 | 6 |
7 #include <cstdlib> | 7 #include <cstdlib> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
14 #include "base/thread_task_runner_handle.h" | 14 #include "base/thread_task_runner_handle.h" |
15 #include "content/renderer/pepper/host_array_buffer_var.h" | 15 #include "content/renderer/pepper/host_array_buffer_var.h" |
16 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 16 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
17 #include "content/renderer/pepper/pepper_try_catch.h" | 17 #include "content/renderer/pepper/pepper_try_catch.h" |
18 #include "content/renderer/pepper/plugin_module.h" | 18 #include "content/renderer/pepper/plugin_module.h" |
19 #include "content/renderer/pepper/plugin_object.h" | 19 #include "content/renderer/pepper/plugin_object.h" |
20 #include "gin/arguments.h" | 20 #include "gin/arguments.h" |
21 #include "gin/converter.h" | 21 #include "gin/converter.h" |
22 #include "gin/function_template.h" | 22 #include "gin/function_template.h" |
23 #include "gin/object_template_builder.h" | 23 #include "gin/object_template_builder.h" |
24 #include "gin/public/gin_embedders.h" | 24 #include "gin/public/gin_embedders.h" |
25 #include "ppapi/shared_impl/ppapi_globals.h" | 25 #include "ppapi/shared_impl/ppapi_globals.h" |
26 #include "ppapi/shared_impl/scoped_pp_var.h" | 26 #include "ppapi/shared_impl/scoped_pp_var.h" |
27 #include "ppapi/shared_impl/var.h" | 27 #include "ppapi/shared_impl/var.h" |
28 #include "ppapi/shared_impl/var_tracker.h" | 28 #include "ppapi/shared_impl/var_tracker.h" |
29 #include "third_party/WebKit/public/web/WebBindings.h" | |
30 #include "third_party/WebKit/public/web/WebDOMMessageEvent.h" | 29 #include "third_party/WebKit/public/web/WebDOMMessageEvent.h" |
31 #include "third_party/WebKit/public/web/WebDocument.h" | 30 #include "third_party/WebKit/public/web/WebDocument.h" |
32 #include "third_party/WebKit/public/web/WebElement.h" | 31 #include "third_party/WebKit/public/web/WebElement.h" |
33 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 32 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
34 #include "third_party/WebKit/public/web/WebNode.h" | 33 #include "third_party/WebKit/public/web/WebNode.h" |
35 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 34 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
36 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" | 35 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" |
37 #include "v8/include/v8.h" | 36 #include "v8/include/v8.h" |
38 | 37 |
39 using ppapi::ArrayBufferVar; | 38 using ppapi::ArrayBufferVar; |
40 using ppapi::PpapiGlobals; | 39 using ppapi::PpapiGlobals; |
41 using ppapi::ScopedPPVar; | 40 using ppapi::ScopedPPVar; |
42 using ppapi::StringVar; | 41 using ppapi::StringVar; |
43 using blink::WebBindings; | |
44 using blink::WebElement; | 42 using blink::WebElement; |
45 using blink::WebDOMEvent; | 43 using blink::WebDOMEvent; |
46 using blink::WebDOMMessageEvent; | 44 using blink::WebDOMMessageEvent; |
47 using blink::WebPluginContainer; | 45 using blink::WebPluginContainer; |
48 using blink::WebSerializedScriptValue; | 46 using blink::WebSerializedScriptValue; |
49 | 47 |
50 namespace content { | 48 namespace content { |
51 | 49 |
52 namespace { | 50 namespace { |
53 | 51 |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 v8::Local<v8::FunctionTemplate> function_template = template_cache_.Get(name); | 474 v8::Local<v8::FunctionTemplate> function_template = template_cache_.Get(name); |
477 if (!function_template.IsEmpty()) | 475 if (!function_template.IsEmpty()) |
478 return function_template; | 476 return function_template; |
479 function_template = gin::CreateFunctionTemplate( | 477 function_template = gin::CreateFunctionTemplate( |
480 isolate, base::Bind(memberFuncPtr, weak_ptr_factory_.GetWeakPtr())); | 478 isolate, base::Bind(memberFuncPtr, weak_ptr_factory_.GetWeakPtr())); |
481 template_cache_.Set(name, function_template); | 479 template_cache_.Set(name, function_template); |
482 return function_template; | 480 return function_template; |
483 } | 481 } |
484 | 482 |
485 } // namespace content | 483 } // namespace content |
OLD | NEW |