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 // TODO(dcarney): Remove this when UnsafePersistent is removed. | 5 // TODO(dcarney): Remove this when UnsafePersistent is removed. |
6 #define V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR | 6 #define V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR |
7 | 7 |
8 #include "chrome/renderer/extensions/v8_schema_registry.h" | 8 #include "chrome/renderer/extensions/v8_schema_registry.h" |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chrome/common/extensions/api/extension_api.h" | |
13 #include "chrome/renderer/extensions/chrome_v8_context.h" | 12 #include "chrome/renderer/extensions/chrome_v8_context.h" |
14 #include "chrome/renderer/extensions/object_backed_native_handler.h" | 13 #include "chrome/renderer/extensions/object_backed_native_handler.h" |
15 #include "content/public/renderer/v8_value_converter.h" | 14 #include "content/public/renderer/v8_value_converter.h" |
| 15 #include "extensions/common/extension_api.h" |
16 | 16 |
17 using content::V8ValueConverter; | 17 using content::V8ValueConverter; |
18 | 18 |
19 namespace extensions { | 19 namespace extensions { |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 class SchemaRegistryNativeHandler : public ObjectBackedNativeHandler { | 23 class SchemaRegistryNativeHandler : public ObjectBackedNativeHandler { |
24 public: | 24 public: |
25 SchemaRegistryNativeHandler(V8SchemaRegistry* registry, | 25 SchemaRegistryNativeHandler(V8SchemaRegistry* registry, |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // when we have a HandleScope. | 110 // when we have a HandleScope. |
111 if (context_.IsEmpty()) { | 111 if (context_.IsEmpty()) { |
112 v8::Handle<v8::Context> context = v8::Context::New(isolate); | 112 v8::Handle<v8::Context> context = v8::Context::New(isolate); |
113 context_.reset(context); | 113 context_.reset(context); |
114 return context; | 114 return context; |
115 } | 115 } |
116 return context_.NewHandle(isolate); | 116 return context_.NewHandle(isolate); |
117 } | 117 } |
118 | 118 |
119 } // namespace extensions | 119 } // namespace extensions |
OLD | NEW |