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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptController.h

Issue 2555653002: [WIP Prototype] ES6 https://html.spec.whatwg.org/#fetch-a-single-module-script implementation (Closed)
Patch Set: ScriptModule interaction refactored to ScriptController Created 4 years 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 /* 1 /*
2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "wtf/text/TextPosition.h" 44 #include "wtf/text/TextPosition.h"
45 #include <v8.h> 45 #include <v8.h>
46 46
47 namespace blink { 47 namespace blink {
48 48
49 class DOMWrapperWorld; 49 class DOMWrapperWorld;
50 class Element; 50 class Element;
51 class HTMLDocument; 51 class HTMLDocument;
52 class KURL; 52 class KURL;
53 class ScriptSourceCode; 53 class ScriptSourceCode;
54 class ScriptModule;
54 class SecurityOrigin; 55 class SecurityOrigin;
55 class WindowProxy; 56 class WindowProxy;
56 class Widget; 57 class Widget;
57 58
58 typedef WTF::Vector<v8::Extension*> V8Extensions; 59 typedef WTF::Vector<v8::Extension*> V8Extensions;
59 60
60 enum ReasonForCallingCanExecuteScripts { 61 enum ReasonForCallingCanExecuteScripts {
61 AboutToExecuteScript, 62 AboutToExecuteScript,
62 NotAboutToExecuteScript 63 NotAboutToExecuteScript
63 }; 64 };
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // FIXME: Get rid of extensionGroup here. 107 // FIXME: Get rid of extensionGroup here.
107 // FIXME: We don't want to support multiple scripts. 108 // FIXME: We don't want to support multiple scripts.
108 void executeScriptInIsolatedWorld(int worldID, 109 void executeScriptInIsolatedWorld(int worldID,
109 const HeapVector<ScriptSourceCode>& sources, 110 const HeapVector<ScriptSourceCode>& sources,
110 int extensionGroup, 111 int extensionGroup,
111 Vector<v8::Local<v8::Value>>* results); 112 Vector<v8::Local<v8::Value>>* results);
112 113
113 // Returns true if argument is a JavaScript URL. 114 // Returns true if argument is a JavaScript URL.
114 bool executeScriptIfJavaScriptURL(const KURL&, Element*); 115 bool executeScriptIfJavaScriptURL(const KURL&, Element*);
115 116
117 // TODO(kouhei): I think script should be a ScriptSourceCode
118 ScriptModule compileModule(const String& script, const String& urlStr);
119
116 // Returns true if the current world is isolated, and has its own Content 120 // Returns true if the current world is isolated, and has its own Content
117 // Security Policy. In this case, the policy of the main world should be 121 // Security Policy. In this case, the policy of the main world should be
118 // ignored when evaluating resources injected into the DOM. 122 // ignored when evaluating resources injected into the DOM.
119 bool shouldBypassMainWorldCSP(); 123 bool shouldBypassMainWorldCSP();
120 124
121 PassRefPtr<SharedPersistent<v8::Object>> createPluginWrapper(Widget*); 125 PassRefPtr<SharedPersistent<v8::Object>> createPluginWrapper(Widget*);
122 126
123 void enableEval(); 127 void enableEval();
124 void disableEval(const String& errorMessage); 128 void disableEval(const String& errorMessage);
125 129
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 v8::Local<v8::Value> evaluateScriptInMainWorld(const ScriptSourceCode&, 163 v8::Local<v8::Value> evaluateScriptInMainWorld(const ScriptSourceCode&,
160 AccessControlStatus, 164 AccessControlStatus,
161 ExecuteScriptPolicy); 165 ExecuteScriptPolicy);
162 166
163 Member<WindowProxyManager> m_windowProxyManager; 167 Member<WindowProxyManager> m_windowProxyManager;
164 }; 168 };
165 169
166 } // namespace blink 170 } // namespace blink
167 171
168 #endif // ScriptController_h 172 #endif // ScriptController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698