RESOLVED FIXED 39339
Move enum ReasonForCallingCanExecuteScripts to header ScriptControllerBase.h
https://bugs.webkit.org/show_bug.cgi?id=39339
Summary Move enum ReasonForCallingCanExecuteScripts to header ScriptControllerBase.h
Daniel Bates
Reported 2010-05-18 20:30:11 PDT
The enum ReasonForCallingCanExecuteScripts is present in both the JSC and V8 versions of ScriptController.h, and is used in ScriptControllerBase.cpp. We should move this enum into a new header, say ScriptControllerBase.h, so that it is defined in one file. This will also be useful in the patch for Bug #39249, which proposes adding an enum to be used in ScriptController.
Attachments
Patch (9.94 KB, patch)
2010-05-18 20:34 PDT, Daniel Bates
no flags
Patch (127.05 KB, patch)
2010-07-10 01:26 PDT, Daniel Bates
abarth: review+
Daniel Bates
Comment 1 2010-05-18 20:34:27 PDT
Created attachment 56448 [details] Patch No functionality was changed, so no new tests.
Darin Adler
Comment 2 2010-05-19 11:33:47 PDT
Comment on attachment 56448 [details] Patch Seems OK to move this to a separate file. I'm not so fond of the name ScriptControllerBase.h for this.
Daniel Bates
Comment 3 2010-05-19 14:04:33 PDT
(In reply to comment #2) > (From update of attachment 56448 [details]) > Seems OK to move this to a separate file. I'm not so fond of the name ScriptControllerBase.h for this. I am open to suggestions. There will be at least two enums in this file: ReasonForCallingCanExecuteScripts, and ShouldAllowXSS (will update patch for Bug #39249).
Daniel Bates
Comment 4 2010-05-22 15:08:31 PDT
Daniel Bates
Comment 5 2010-05-22 15:48:00 PDT
This broke the Windows and Qt bots. Committed revert in 60019 <http://trac.webkit.org/changeset/60019> while I look into this some more.
Csaba Osztrogonác
Comment 6 2010-05-23 02:42:38 PDT
The problem with Qt build was the missing include path. You can fix it easyily, I think the second one is the nicer. 1.) diff --git a/WebCore/bindings/js/ScriptController.h b/WebCore/bindings/js/ScriptController.h -#include "ScriptControllerBase.h" +#include "../ScriptControllerBase.h" 2.) diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro index 6fbeffc..034e45f 100644 --- a/WebCore/WebCore.pro +++ b/WebCore/WebCore.pro @@ -170,6 +170,7 @@ include(WebCore.pri) INCLUDEPATH = \ $$PWD \ $$PWD/accessibility \ + $$PWD/bindings \ $$PWD/bindings/js \ $$PWD/bridge \ $$PWD/bridge/c \
Daniel Bates
Comment 7 2010-05-23 21:23:46 PDT
(In reply to comment #6) > The problem with Qt build was the missing include path. > You can fix it easyily, I think the second one is the nicer. > > 1.) > diff --git a/WebCore/bindings/js/ScriptController.h b/WebCore/bindings/js/ScriptController.h > -#include "ScriptControllerBase.h" > +#include "../ScriptControllerBase.h" > > 2.) > diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro > index 6fbeffc..034e45f 100644 > --- a/WebCore/WebCore.pro > +++ b/WebCore/WebCore.pro > @@ -170,6 +170,7 @@ include(WebCore.pri) > INCLUDEPATH = \ > $$PWD \ > $$PWD/accessibility \ > + $$PWD/bindings \ > $$PWD/bindings/js \ > $$PWD/bridge \ > $$PWD/bridge/c \ Thanks Csaba. I also prefer the second option of adding "$$PWD/bindings \" to WebCore.pri. Will give this a try.
Shinichiro Hamaji
Comment 8 2010-06-17 01:33:57 PDT
Comment on attachment 56448 [details] Patch Clearing r+ flag to remove this from pending-commit.
Daniel Bates
Comment 9 2010-07-10 01:26:29 PDT
Created attachment 61145 [details] Patch Updated patch based on Csaba's suggestion and fixed Windows build issues.
Adam Barth
Comment 10 2010-07-10 11:12:40 PDT
Comment on attachment 61145 [details] Patch There's probably more we can move into that header too. I think some of the build systems are unhappy with this change. WebCore/bindings/ScriptControllerBase.h:35 + enum ReasonForCallingCanExecuteScripts { No namespace indent.
Daniel Bates
Comment 11 2010-07-10 12:48:42 PDT
(In reply to comment #10) > (From update of attachment 61145 [details]) > There's probably more we can move into that header too. I think some of the build systems are unhappy with this change. > > WebCore/bindings/ScriptControllerBase.h:35 > + enum ReasonForCallingCanExecuteScripts { > No namespace indent. Will fix when I land. This change built on my Mac and Windows builds. The EWS bots don't show any descriptive error messages and/or other error output.
Daniel Bates
Comment 12 2010-07-10 14:19:19 PDT
Note You need to log in before you can comment on or make changes to this bug.