OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/mojo/service_registry_js_wrapper.h" | 5 #include "content/renderer/mojo/service_registry_js_wrapper.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "content/common/mojo/service_registry_impl.h" | 10 #include "content/common/mojo/service_registry_impl.h" |
11 #include "content/public/common/service_registry.h" | 11 #include "content/public/common/service_registry.h" |
12 #include "third_party/mojo/src/mojo/edk/js/handle.h" | 12 #include "mojo/edk/js/handle.h" |
13 #include "v8/include/v8.h" | 13 #include "v8/include/v8.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 struct JsFactoryDeleter { | 19 struct JsFactoryDeleter { |
20 inline void operator()(v8::Persistent<v8::Function>* ptr) const { | 20 inline void operator()(v8::Persistent<v8::Function>* ptr) const { |
21 ptr->Reset(); | 21 ptr->Reset(); |
22 delete ptr; | 22 delete ptr; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 registry->AddServiceOverrideForTesting( | 86 registry->AddServiceOverrideForTesting( |
87 service_name, base::Bind(&CallJsFactory, base::Passed(&factory))); | 87 service_name, base::Bind(&CallJsFactory, base::Passed(&factory))); |
88 } | 88 } |
89 | 89 |
90 ServiceRegistryJsWrapper::ServiceRegistryJsWrapper( | 90 ServiceRegistryJsWrapper::ServiceRegistryJsWrapper( |
91 base::WeakPtr<ServiceRegistry> service_registry) | 91 base::WeakPtr<ServiceRegistry> service_registry) |
92 : service_registry_(service_registry) { | 92 : service_registry_(service_registry) { |
93 } | 93 } |
94 | 94 |
95 } // namespace content | 95 } // namespace content |
OLD | NEW |