summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/js_only_v8_extensions.cc
blob: d304ef1d6e4c5e5bb7c3a1230566e1aaeb2de9f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) 2009 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/js_only_v8_extensions.h"

#include "chrome/renderer/extensions/bindings_utils.h"
#include "grit/renderer_resources.h"
#include "grit/webkit_resources.h"

// BaseJsV8Extension
const char* BaseJsV8Extension::kName = "chrome/base";
v8::Extension* BaseJsV8Extension::Get() {
  return new v8::Extension(kName, GetStringResource<IDR_DEVTOOLS_BASE_JS>(),
                           0, NULL);
}

// JsonJsV8Extension
const char* JsonJsV8Extension::kName = "chrome/json";
v8::Extension* JsonJsV8Extension::Get() {
  static const char* deps[] = {
    BaseJsV8Extension::kName
  };
  return new v8::Extension(kName, GetStringResource<IDR_DEVTOOLS_JSON_JS>(),
                           arraysize(deps), deps);
}

// JsonSchemaJsV8Extension
const char* JsonSchemaJsV8Extension::kName = "chrome/jsonschema";
v8::Extension* JsonSchemaJsV8Extension::Get() {
  return new v8::Extension(kName, GetStringResource<IDR_JSON_SCHEMA_JS>(),
                           0, NULL);
}