Bug 39339 - Move enum ReasonForCallingCanExecuteScripts to header ScriptControllerBase.h
Summary: Move enum ReasonForCallingCanExecuteScripts to header ScriptControllerBase.h
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-18 20:30 PDT by Daniel Bates
Modified: 2010-07-10 14:19 PDT (History)
3 users (show)

See Also:


Attachments
Patch (9.94 KB, patch)
2010-05-18 20:34 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff
Patch (127.05 KB, patch)
2010-07-10 01:26 PDT, Daniel Bates
abarth: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 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.
Comment 1 Daniel Bates 2010-05-18 20:34:27 PDT
Created attachment 56448 [details]
Patch

No functionality was changed, so no new tests.
Comment 2 Darin Adler 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.
Comment 3 Daniel Bates 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).
Comment 4 Daniel Bates 2010-05-22 15:08:31 PDT
Committed r60017: <http://trac.webkit.org/changeset/60017>
Comment 5 Daniel Bates 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.
Comment 6 Csaba Osztrogonác 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 \
Comment 7 Daniel Bates 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.
Comment 8 Shinichiro Hamaji 2010-06-17 01:33:57 PDT
Comment on attachment 56448 [details]
Patch

Clearing r+ flag to remove this from pending-commit.
Comment 9 Daniel Bates 2010-07-10 01:26:29 PDT
Created attachment 61145 [details]
Patch

Updated patch based on Csaba's suggestion and fixed Windows build issues.
Comment 10 Adam Barth 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.
Comment 11 Daniel Bates 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.
Comment 12 Daniel Bates 2010-07-10 14:19:19 PDT
Committed r63050: <http://trac.webkit.org/changeset/63050>