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

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

Issue 120733003: Feature detection-friendly restrictions for packaged apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed feedback. Created 6 years, 11 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 | « no previous file | chrome/renderer/resources/extensions/platform_app.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/renderer/extensions/safe_builtins.h" 5 #include "chrome/renderer/extensions/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 "chrome/renderer/extensions/chrome_v8_context.h" 10 #include "chrome/renderer/extensions/chrome_v8_context.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 " safe.self = builtin;\n" 59 " safe.self = builtin;\n"
60 " makeCallable(builtin.prototype, safe, false, protoPropertyNames);\n" 60 " makeCallable(builtin.prototype, safe, false, protoPropertyNames);\n"
61 " if (staticPropertyNames)\n" 61 " if (staticPropertyNames)\n"
62 " makeCallable(builtin, safe, true, staticPropertyNames);\n" 62 " makeCallable(builtin, safe, true, staticPropertyNames);\n"
63 " Save(builtin.name, safe);\n" 63 " Save(builtin.name, safe);\n"
64 "}\n" 64 "}\n"
65 "\n" 65 "\n"
66 "// Save only what is needed to make tests that override builtins pass.\n" 66 "// Save only what is needed to make tests that override builtins pass.\n"
67 "saveBuiltin(Object,\n" 67 "saveBuiltin(Object,\n"
68 " ['hasOwnProperty'],\n" 68 " ['hasOwnProperty'],\n"
69 " ['getPrototypeOf', 'keys']);\n" 69 " ['defineProperty', 'getOwnPropertyDescriptor',\n"
70 " 'getPrototypeOf', 'keys']);\n"
70 "saveBuiltin(Function,\n" 71 "saveBuiltin(Function,\n"
71 " ['apply', 'bind', 'call']);\n" 72 " ['apply', 'bind', 'call']);\n"
72 "saveBuiltin(Array,\n" 73 "saveBuiltin(Array,\n"
73 " ['concat', 'forEach', 'indexOf', 'join', 'push', 'slice',\n" 74 " ['concat', 'forEach', 'indexOf', 'join', 'push', 'slice',\n"
74 " 'splice', 'map', 'filter']);\n" 75 " 'splice', 'map', 'filter']);\n"
75 "saveBuiltin(String,\n" 76 "saveBuiltin(String,\n"
76 " ['slice', 'split']);\n" 77 " ['slice', 'split']);\n"
77 "saveBuiltin(RegExp,\n" 78 "saveBuiltin(RegExp,\n"
78 " ['test']);\n" 79 " ['test']);\n"
79 "\n" 80 "\n"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 229
229 v8::Local<v8::Object> SafeBuiltins::GetRegExp() const { 230 v8::Local<v8::Object> SafeBuiltins::GetRegExp() const {
230 return Load("RegExp", context_->v8_context()); 231 return Load("RegExp", context_->v8_context());
231 } 232 }
232 233
233 v8::Local<v8::Object> SafeBuiltins::GetString() const { 234 v8::Local<v8::Object> SafeBuiltins::GetString() const {
234 return Load("String", context_->v8_context()); 235 return Load("String", context_->v8_context());
235 } 236 }
236 237
237 } // namespace extensions 238 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/resources/extensions/platform_app.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698