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

Side by Side Diff: webkit/api/public/WebKit.h

Issue 275026: Move scripting / v8 related methods out of WebKit.h, second try (Closed)
Patch Set: rebase Created 11 years, 2 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 | « chrome/test/render_view_test.cc ('k') | webkit/api/public/WebScriptController.h » ('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 16 matching lines...) Expand all
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef WebKit_h 31 #ifndef WebKit_h
32 #define WebKit_h 32 #define WebKit_h
33 33
34 #include "WebCommon.h" 34 #include "WebCommon.h"
35 #include "WebURL.h" 35 #include "WebURL.h"
36 36
37 namespace v8 {
38 class Extension;
39 }
40
41 namespace WebKit { 37 namespace WebKit {
42 class WebKitClient; 38 class WebKitClient;
43 class WebString; 39 class WebString;
44 40
45 // Must be called on the thread that will be the main WebKit thread before 41 // Must be called on the thread that will be the main WebKit thread before
46 // using any other WebKit APIs. The provided WebKitClient must be non-null 42 // using any other WebKit APIs. The provided WebKitClient must be non-null
47 // and must remain valid until the current thread calls shutdown. 43 // and must remain valid until the current thread calls shutdown.
48 WEBKIT_API void initialize(WebKitClient*); 44 WEBKIT_API void initialize(WebKitClient*);
49 45
50 // Once shutdown, the WebKitClient passed to initialize will no longer be 46 // Once shutdown, the WebKitClient passed to initialize will no longer be
(...skipping 12 matching lines...) Expand all
63 // Registers a URL scheme to be treated as a local scheme (i.e., with the 59 // Registers a URL scheme to be treated as a local scheme (i.e., with the
64 // same security rules as those applied to "file" URLs). This means that 60 // same security rules as those applied to "file" URLs). This means that
65 // normal pages cannot link to or access URLs of this scheme. 61 // normal pages cannot link to or access URLs of this scheme.
66 WEBKIT_API void registerURLSchemeAsLocal(const WebString&); 62 WEBKIT_API void registerURLSchemeAsLocal(const WebString&);
67 63
68 // Registers a URL scheme to be treated as a noAccess scheme. This means 64 // Registers a URL scheme to be treated as a noAccess scheme. This means
69 // that pages loaded with this URL scheme cannot access pages loaded with 65 // that pages loaded with this URL scheme cannot access pages loaded with
70 // any other URL scheme. 66 // any other URL scheme.
71 WEBKIT_API void registerURLSchemeAsNoAccess(const WebString&); 67 WEBKIT_API void registerURLSchemeAsNoAccess(const WebString&);
72 68
73 // Registers a v8 extension to be available on webpages. The three forms
74 // offer various restrictions on what types of contexts the extension is
75 // loaded into. If a scheme is provided, only pages whose URL has the given
76 // scheme will match. If extensionGroup is provided, the extension will only
77 // be loaded into scripts run via WebFrame::ExecuteInNewWorld with the
78 // matching group.
79 // Will only affect v8 contexts initialized after this call. Takes ownership
80 // of the v8::Extension object passed.
81 WEBKIT_API void registerExtension(v8::Extension*);
82 WEBKIT_API void registerExtension(v8::Extension*,
83 const WebString& schemeRestriction);
84 WEBKIT_API void registerExtension(v8::Extension*, int extensionGroup);
85
86 // Enables special settings which are only applicable if V8 is executed
87 // in the single thread which must be the main thread.
88 // FIXME: make a try to dynamically detect when this condition is broken
89 // and automatically switch off single thread mode.
90 WEBKIT_API void enableV8SingleThreadMode();
91
92 // Process any pending JavaScript console messages.
93 WEBKIT_API void flushConsoleMessages();
94
95 // Enables HTML5 media support. 69 // Enables HTML5 media support.
96 WEBKIT_API void enableMediaPlayer(); 70 WEBKIT_API void enableMediaPlayer();
97 71
98 // Purge the plugin list cache. If |reloadPages| is true, any pages 72 // Purge the plugin list cache. If |reloadPages| is true, any pages
99 // containing plugins will be reloaded after refreshing the plugin list. 73 // containing plugins will be reloaded after refreshing the plugin list.
100 WEBKIT_API void resetPluginCache(bool reloadPages); 74 WEBKIT_API void resetPluginCache(bool reloadPages);
101 75
102 // Enables HTML5 database support. 76 // Enables HTML5 database support.
103 WEBKIT_API void enableDatabases(); 77 WEBKIT_API void enableDatabases();
104 WEBKIT_API bool databasesEnabled(); 78 WEBKIT_API bool databasesEnabled();
105 79
106 // Support for whitelisting access to origins beyond the same-origin policy. 80 // Support for whitelisting access to origins beyond the same-origin policy.
107 WEBKIT_API void whiteListAccessFromOrigin( 81 WEBKIT_API void whiteListAccessFromOrigin(
108 const WebURL& sourceOrigin, const WebString& destinationProtocol, 82 const WebURL& sourceOrigin, const WebString& destinationProtocol,
109 const WebString& destinationHost, bool allowDestinationSubdomains); 83 const WebString& destinationHost, bool allowDestinationSubdomains);
110 WEBKIT_API void resetOriginAccessWhiteLists(); 84 WEBKIT_API void resetOriginAccessWhiteLists();
111 85
112 } // namespace WebKit 86 } // namespace WebKit
113 87
114 #endif 88 #endif
OLDNEW
« no previous file with comments | « chrome/test/render_view_test.cc ('k') | webkit/api/public/WebScriptController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698