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

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

Issue 1939833003: Sanitize inheritance in callers of utils.expose (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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
« no previous file with comments | « extensions/renderer/resources/web_request_internal_custom_bindings.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 "// Save only what is needed by the extension modules.\n" 69 "// Save only what is needed by the extension modules.\n"
70 "saveBuiltin(Object,\n" 70 "saveBuiltin(Object,\n"
71 " ['hasOwnProperty'],\n" 71 " ['hasOwnProperty'],\n"
72 " ['create', 'defineProperty', 'freeze',\n" 72 " ['create', 'defineProperty', 'freeze',\n"
73 " 'getOwnPropertyDescriptor', 'getPrototypeOf', 'keys',\n" 73 " 'getOwnPropertyDescriptor', 'getPrototypeOf', 'keys',\n"
74 " 'assign', 'setPrototypeOf']);\n" 74 " 'assign', 'setPrototypeOf']);\n"
75 "saveBuiltin(Function,\n" 75 "saveBuiltin(Function,\n"
76 " ['apply', 'bind', 'call']);\n" 76 " ['apply', 'bind', 'call']);\n"
77 "saveBuiltin(Array,\n" 77 "saveBuiltin(Array,\n"
78 " ['concat', 'forEach', 'indexOf', 'join', 'push', 'slice',\n" 78 " ['concat', 'forEach', 'indexOf', 'join', 'push', 'slice',\n"
79 " 'splice', 'map', 'filter', 'unshift'],\n" 79 " 'splice', 'map', 'filter', 'unshift', 'pop', 'reverse'],\n"
80 " ['isArray']);\n" 80 " ['isArray']);\n"
81 "saveBuiltin(String,\n" 81 "saveBuiltin(String,\n"
82 " ['indexOf', 'slice', 'split', 'substr', 'toUpperCase',\n" 82 " ['indexOf', 'slice', 'split', 'substr', 'toUpperCase',\n"
83 " 'replace']);\n" 83 " 'replace']);\n"
84 "// Use exec rather than test to defend against clobbering in the\n" 84 "// Use exec rather than test to defend against clobbering in the\n"
85 "// presence of ES2015 semantics, which read RegExp.prototype.exec.\n" 85 "// presence of ES2015 semantics, which read RegExp.prototype.exec.\n"
86 "saveBuiltin(RegExp,\n" 86 "saveBuiltin(RegExp,\n"
87 " ['exec']);\n" 87 " ['exec']);\n"
88 "saveBuiltin(Error,\n" 88 "saveBuiltin(Error,\n"
89 " [],\n" 89 " [],\n"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 250
251 v8::Local<v8::Object> SafeBuiltins::GetString() const { 251 v8::Local<v8::Object> SafeBuiltins::GetString() const {
252 return Load("String", context_->v8_context()); 252 return Load("String", context_->v8_context());
253 } 253 }
254 254
255 v8::Local<v8::Object> SafeBuiltins::GetError() const { 255 v8::Local<v8::Object> SafeBuiltins::GetError() const {
256 return Load("Error", context_->v8_context()); 256 return Load("Error", context_->v8_context());
257 } 257 }
258 258
259 } // namespace extensions 259 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/resources/web_request_internal_custom_bindings.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698