Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: extensions/renderer/safe_builtins.cc

Issue 1055673002: [Extensions API] Remove inline enums (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "extensions/renderer/safe_builtins.h" 5 #include "extensions/renderer/safe_builtins.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "extensions/renderer/script_context.h" 10 #include "extensions/renderer/script_context.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 "saveBuiltin(Object,\n" 67 "saveBuiltin(Object,\n"
68 " ['hasOwnProperty'],\n" 68 " ['hasOwnProperty'],\n"
69 " ['create', 'defineProperty', 'freeze',\n" 69 " ['create', 'defineProperty', 'freeze',\n"
70 " 'getOwnPropertyDescriptor', 'getPrototypeOf', 'keys']);\n" 70 " 'getOwnPropertyDescriptor', 'getPrototypeOf', 'keys']);\n"
71 "saveBuiltin(Function,\n" 71 "saveBuiltin(Function,\n"
72 " ['apply', 'bind', 'call']);\n" 72 " ['apply', 'bind', 'call']);\n"
73 "saveBuiltin(Array,\n" 73 "saveBuiltin(Array,\n"
74 " ['concat', 'forEach', 'indexOf', 'join', 'push', 'slice',\n" 74 " ['concat', 'forEach', 'indexOf', 'join', 'push', 'slice',\n"
75 " 'splice', 'map', 'filter']);\n" 75 " 'splice', 'map', 'filter']);\n"
76 "saveBuiltin(String,\n" 76 "saveBuiltin(String,\n"
77 " ['indexOf', 'slice', 'split']);\n" 77 " ['indexOf', 'slice', 'split', 'substr']);\n"
78 "saveBuiltin(RegExp,\n" 78 "saveBuiltin(RegExp,\n"
79 " ['test']);\n" 79 " ['test']);\n"
80 "saveBuiltin(Error,\n" 80 "saveBuiltin(Error,\n"
81 " [],\n" 81 " [],\n"
82 " ['captureStackTrace']);\n" 82 " ['captureStackTrace']);\n"
83 "\n" 83 "\n"
84 "// JSON is trickier because extensions can override toJSON in\n" 84 "// JSON is trickier because extensions can override toJSON in\n"
85 "// incompatible ways, and we need to prevent that.\n" 85 "// incompatible ways, and we need to prevent that.\n"
86 "var builtinTypes = [\n" 86 "var builtinTypes = [\n"
87 " Object, Function, Array, String, Boolean, Number, Date, RegExp\n" 87 " Object, Function, Array, String, Boolean, Number, Date, RegExp\n"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 232
233 v8::Local<v8::Object> SafeBuiltins::GetString() const { 233 v8::Local<v8::Object> SafeBuiltins::GetString() const {
234 return Load("String", context_->v8_context()); 234 return Load("String", context_->v8_context());
235 } 235 }
236 236
237 v8::Local<v8::Object> SafeBuiltins::GetError() const { 237 v8::Local<v8::Object> SafeBuiltins::GetError() const {
238 return Load("Error", context_->v8_context()); 238 return Load("Error", context_->v8_context());
239 } 239 }
240 240
241 } // namespace extensions 241 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/resources/binding.js ('k') | extensions/shell/browser/shell_runtime_api_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698