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

Side by Side Diff: WebCore/bindings/v8/V8Proxy.h

Issue 3453022: Merge 68061 - 2010-09-22 Matt Perry <mpcomplete@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/517/
Patch Set: Created 10 years, 3 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 | « WebCore/bindings/v8/V8DOMWindowShell.cpp ('k') | WebCore/bindings/v8/V8Proxy.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 // Information about an extension that is registered for use with V8. If 122 // Information about an extension that is registered for use with V8. If
123 // scheme is non-empty, it contains the URL scheme the extension should be 123 // scheme is non-empty, it contains the URL scheme the extension should be
124 // used with. If group is non-zero, the extension will only be loaded into 124 // used with. If group is non-zero, the extension will only be loaded into
125 // script contexts that belong to that group. Otherwise, the extension is 125 // script contexts that belong to that group. Otherwise, the extension is
126 // used with all schemes and contexts. 126 // used with all schemes and contexts.
127 struct V8ExtensionInfo { 127 struct V8ExtensionInfo {
128 String scheme; 128 String scheme;
129 int group; 129 int group;
130 v8::Extension* extension; 130 v8::Extension* extension;
131 bool useCallback; // FIXME: remove
131 }; 132 };
132 typedef WTF::Vector<V8ExtensionInfo> V8Extensions; 133 typedef WTF::Vector<V8ExtensionInfo> V8Extensions;
133 134
134 class V8Proxy { 135 class V8Proxy {
135 public: 136 public:
136 // The types of javascript errors that can be thrown. 137 // The types of javascript errors that can be thrown.
137 enum ErrorType { 138 enum ErrorType {
138 RangeError, 139 RangeError,
139 ReferenceError, 140 ReferenceError,
140 SyntaxError, 141 SyntaxError,
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 // Registers a v8 extension to be available on webpages. The two forms 323 // Registers a v8 extension to be available on webpages. The two forms
323 // offer various restrictions on what types of contexts the extension is 324 // offer various restrictions on what types of contexts the extension is
324 // loaded into. If a scheme is provided, only pages whose URL has the gi ven 325 // loaded into. If a scheme is provided, only pages whose URL has the gi ven
325 // scheme will match. If extensionGroup is provided, the extension will 326 // scheme will match. If extensionGroup is provided, the extension will
326 // only be loaded into scripts run via evaluateInNewWorld with the 327 // only be loaded into scripts run via evaluateInNewWorld with the
327 // matching group. Will only affect v8 contexts initialized after this 328 // matching group. Will only affect v8 contexts initialized after this
328 // call. Takes ownership of the v8::Extension object passed. 329 // call. Takes ownership of the v8::Extension object passed.
329 static void registerExtension(v8::Extension*, const String& schemeRestri ction); 330 static void registerExtension(v8::Extension*, const String& schemeRestri ction);
330 static void registerExtension(v8::Extension*, int extensionGroup); 331 static void registerExtension(v8::Extension*, int extensionGroup);
331 332
333 // Same as above, but new version.
334 // FIXME: remove the other 2 versions in phase 3 of multipart checkin:
335 // https://bugs.webkit.org/show_bug.cgi?id=45721
336 static void registerExtension(v8::Extension*);
337
332 static void registerExtensionWithV8(v8::Extension*); 338 static void registerExtensionWithV8(v8::Extension*);
333 static bool registeredExtensionWithV8(v8::Extension*); 339 static bool registeredExtensionWithV8(v8::Extension*);
334 340
335 static const V8Extensions& extensions() { return m_extensions; } 341 static const V8Extensions& extensions() { return m_extensions; }
336 342
337 // Report an unsafe attempt to access the given frame on the console. 343 // Report an unsafe attempt to access the given frame on the console.
338 static void reportUnsafeAccessTo(Frame* target, DelayReporting delay); 344 static void reportUnsafeAccessTo(Frame* target, DelayReporting delay);
339 345
340 private: 346 private:
341 void didLeaveScriptContext(); 347 void didLeaveScriptContext();
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 template <class T> inline v8::Handle<v8::Object> toV8(PassRefPtr<T> object, v8::Local<v8::Object> holder) 477 template <class T> inline v8::Handle<v8::Object> toV8(PassRefPtr<T> object, v8::Local<v8::Object> holder)
472 { 478 {
473 object->ref(); 479 object->ref();
474 V8DOMWrapper::setJSWrapperForDOMObject(object.get(), v8::Persistent<v8:: Object>::New(holder)); 480 V8DOMWrapper::setJSWrapperForDOMObject(object.get(), v8::Persistent<v8:: Object>::New(holder));
475 return holder; 481 return holder;
476 } 482 }
477 483
478 } 484 }
479 485
480 #endif // V8Proxy_h 486 #endif // V8Proxy_h
OLDNEW
« no previous file with comments | « WebCore/bindings/v8/V8DOMWindowShell.cpp ('k') | WebCore/bindings/v8/V8Proxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698