Chromium Code Reviews| Index: chrome/renderer/extensions/schema_generated_native_handler.cc |
| diff --git a/chrome/renderer/extensions/schema_generated_native_handler.cc b/chrome/renderer/extensions/schema_generated_native_handler.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ecfed22d3990be6176b848197ef92bfd2914903e |
| --- /dev/null |
| +++ b/chrome/renderer/extensions/schema_generated_native_handler.cc |
| @@ -0,0 +1,26 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/renderer/extensions/schema_generated_native_handler.h" |
| + |
| +#include "chrome/renderer/extensions/v8_schema_registry.h" |
| + |
| +namespace extensions { |
| + |
| +SchemaGeneratedNativeHandler::SchemaGeneratedNativeHandler( |
| + V8SchemaRegistry* schema_registry, |
| + const std::string& api_name, |
| + const std::string& bind_to) |
| + : schema_registry_(schema_registry), |
| + api_name_(api_name), |
| + bind_to_(bind_to) { |
| +} |
| + |
| +v8::Handle<v8::Object> SchemaGeneratedNativeHandler::NewInstance() { |
| + v8::Handle<v8::Object> schema = schema_registry_->GetSchema(api_name_); |
| + object_template_->Set(bind_to_.c_str(), schema); |
|
not at google - send to devlin
2012/12/13 22:26:40
My thought was to have this call out to schema_bin
|
| + return object_template_->NewInstance(); |
| +} |
| + |
| +} // extensions |