Skip to content

Commit 2198a8e

Browse files
committed
Use a typedef for ExceptionCode in all header files instead of including ExceptionCode.h
https://bugs.webkit.org/show_bug.cgi?id=71845 Reviewed by Adam Barth. Source/WebCore: Some headers in WebCore include ExceptionCode.h to get the ExceptionCode typedef, while others provide the typedef themselves. Per Darin, the latter is preferred, so this patch updates all references, and fixes up .cpp files that need the include in order to access the enum. * bindings/js/JSSVGLengthCustom.cpp: * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): #include ExceptionCode.h when needed for SVG. * bindings/scripts/CodeGeneratorObjC.pm: (GenerateImplementation): #include ExceptionCode.h when needed for SVG. * bindings/v8/custom/V8NotificationCenterCustom.cpp: * bindings/v8/custom/V8SVGLengthCustom.cpp: * css/WebKitCSSMatrix.h: * fileapi/DirectoryReaderSync.h: * fileapi/EntrySync.h: * fileapi/FileReader.h: * fileapi/FileReaderSync.h: * fileapi/SyncCallbackHelper.h: * html/ClassList.h: * html/DOMSettableTokenList.h: * html/DOMTokenList.cpp: * html/DOMTokenList.h: * html/TextTrack.cpp: * html/TextTrack.h: * html/TimeRanges.cpp: * html/TimeRanges.h: * html/canvas/ArrayBuffer.cpp: * html/canvas/ArrayBuffer.h: * html/canvas/ArrayBufferView.cpp: * html/canvas/ArrayBufferView.h: * html/canvas/DataView.cpp: * html/canvas/DataView.h: * html/canvas/OESVertexArrayObject.h: * html/canvas/WebGLDebugShaders.h: * html/canvas/WebGLRenderingContext.cpp: * html/canvas/WebGLRenderingContext.h: * mediastream/MediaStreamFrameController.cpp: * mediastream/MediaStreamFrameController.h: * notifications/Notification.h: * notifications/NotificationCenter.h: * storage/AbstractDatabase.cpp: * storage/AbstractDatabase.h: * storage/Database.h: * storage/DatabaseSync.h: * storage/DatabaseTask.h: * storage/IDBCursor.h: * storage/IDBCursorBackendInterface.h: * storage/IDBDatabase.h: * storage/IDBDatabaseBackendInterface.h: * storage/IDBFactory.h: * storage/IDBFactoryBackendInterface.h: * storage/IDBIndexBackendInterface.h: * storage/IDBKeyRange.h: * storage/IDBObjectStoreBackendInterface.h: * storage/IDBRequest.h: * storage/IDBTransactionBackendInterface.h: * storage/SQLResultSet.cpp: * storage/SQLResultSet.h: * storage/SQLStatementSync.h: * storage/SQLTransaction.cpp: * storage/SQLTransaction.h: * storage/SQLTransactionSync.h: * svg/ElementTimeControl.h: * svg/SVGAngle.cpp: * svg/SVGAngle.h: * svg/SVGLength.cpp: * svg/SVGLength.h: * svg/SVGLengthContext.cpp: * svg/SVGLengthContext.h: * svg/SVGLocatable.h: * svg/SVGMatrix.h: * svg/SVGPreserveAspectRatio.cpp: * svg/SVGPreserveAspectRatio.h: * testing/Internals.h: * webaudio/AudioContext.cpp: * workers/DefaultSharedWorkerRepository.cpp: * workers/DefaultSharedWorkerRepository.h: * workers/SharedWorkerRepository.h: Source/WebKit/chromium: * src/SharedWorkerRepository.cpp: Canonical link: https://commits.webkit.org/88212@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@99645 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 02e1fcd commit 2198a8e

75 files changed

Lines changed: 220 additions & 52 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Source/WebCore/ChangeLog

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,89 @@
1+
2011-11-08 Adam Klein <adamk@chromium.org>
2+
3+
Use a typedef for ExceptionCode in all header files instead of including ExceptionCode.h
4+
https://bugs.webkit.org/show_bug.cgi?id=71845
5+
6+
Reviewed by Adam Barth.
7+
8+
Some headers in WebCore include ExceptionCode.h to get the ExceptionCode typedef,
9+
while others provide the typedef themselves. Per Darin, the latter is preferred,
10+
so this patch updates all references, and fixes up .cpp files that
11+
need the include in order to access the enum.
12+
13+
* bindings/js/JSSVGLengthCustom.cpp:
14+
* bindings/scripts/CodeGeneratorJS.pm:
15+
(GenerateImplementation): #include ExceptionCode.h when needed for SVG.
16+
* bindings/scripts/CodeGeneratorObjC.pm:
17+
(GenerateImplementation): #include ExceptionCode.h when needed for SVG.
18+
* bindings/v8/custom/V8NotificationCenterCustom.cpp:
19+
* bindings/v8/custom/V8SVGLengthCustom.cpp:
20+
* css/WebKitCSSMatrix.h:
21+
* fileapi/DirectoryReaderSync.h:
22+
* fileapi/EntrySync.h:
23+
* fileapi/FileReader.h:
24+
* fileapi/FileReaderSync.h:
25+
* fileapi/SyncCallbackHelper.h:
26+
* html/ClassList.h:
27+
* html/DOMSettableTokenList.h:
28+
* html/DOMTokenList.cpp:
29+
* html/DOMTokenList.h:
30+
* html/TextTrack.cpp:
31+
* html/TextTrack.h:
32+
* html/TimeRanges.cpp:
33+
* html/TimeRanges.h:
34+
* html/canvas/ArrayBuffer.cpp:
35+
* html/canvas/ArrayBuffer.h:
36+
* html/canvas/ArrayBufferView.cpp:
37+
* html/canvas/ArrayBufferView.h:
38+
* html/canvas/DataView.cpp:
39+
* html/canvas/DataView.h:
40+
* html/canvas/OESVertexArrayObject.h:
41+
* html/canvas/WebGLDebugShaders.h:
42+
* html/canvas/WebGLRenderingContext.cpp:
43+
* html/canvas/WebGLRenderingContext.h:
44+
* mediastream/MediaStreamFrameController.cpp:
45+
* mediastream/MediaStreamFrameController.h:
46+
* notifications/Notification.h:
47+
* notifications/NotificationCenter.h:
48+
* storage/AbstractDatabase.cpp:
49+
* storage/AbstractDatabase.h:
50+
* storage/Database.h:
51+
* storage/DatabaseSync.h:
52+
* storage/DatabaseTask.h:
53+
* storage/IDBCursor.h:
54+
* storage/IDBCursorBackendInterface.h:
55+
* storage/IDBDatabase.h:
56+
* storage/IDBDatabaseBackendInterface.h:
57+
* storage/IDBFactory.h:
58+
* storage/IDBFactoryBackendInterface.h:
59+
* storage/IDBIndexBackendInterface.h:
60+
* storage/IDBKeyRange.h:
61+
* storage/IDBObjectStoreBackendInterface.h:
62+
* storage/IDBRequest.h:
63+
* storage/IDBTransactionBackendInterface.h:
64+
* storage/SQLResultSet.cpp:
65+
* storage/SQLResultSet.h:
66+
* storage/SQLStatementSync.h:
67+
* storage/SQLTransaction.cpp:
68+
* storage/SQLTransaction.h:
69+
* storage/SQLTransactionSync.h:
70+
* svg/ElementTimeControl.h:
71+
* svg/SVGAngle.cpp:
72+
* svg/SVGAngle.h:
73+
* svg/SVGLength.cpp:
74+
* svg/SVGLength.h:
75+
* svg/SVGLengthContext.cpp:
76+
* svg/SVGLengthContext.h:
77+
* svg/SVGLocatable.h:
78+
* svg/SVGMatrix.h:
79+
* svg/SVGPreserveAspectRatio.cpp:
80+
* svg/SVGPreserveAspectRatio.h:
81+
* testing/Internals.h:
82+
* webaudio/AudioContext.cpp:
83+
* workers/DefaultSharedWorkerRepository.cpp:
84+
* workers/DefaultSharedWorkerRepository.h:
85+
* workers/SharedWorkerRepository.h:
86+
187
2011-11-08 Kentaro Hara <haraken@chromium.org>
288

389
CodeGeneratorV8.pm can generate a NamedConstructor

Source/WebCore/bindings/js/JSSVGLengthCustom.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@
2222
#if ENABLE(SVG)
2323
#include "JSSVGLength.h"
2424

25-
#include <runtime/Error.h>
25+
#include "ExceptionCode.h"
2626
#include "SVGAnimatedProperty.h"
2727
#include "SVGException.h"
28+
#include <runtime/Error.h>
2829

2930
using namespace JSC;
3031

Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,6 +1862,7 @@ sub GenerateImplementation
18621862
push(@implContent, " setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);\n");
18631863
push(@implContent, " return;\n");
18641864
push(@implContent, " }\n");
1865+
$implIncludes{"ExceptionCode.h"} = 1;
18651866
}
18661867
push(@implContent, " $svgPropertyOrListPropertyType& podImp = imp->propertyReference();\n");
18671868
if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber
@@ -2007,6 +2008,7 @@ sub GenerateImplementation
20072008
push(@implContent, " return JSValue::encode(jsUndefined());\n");
20082009
push(@implContent, " }\n");
20092010
push(@implContent, " $svgPropertyType& podImp = imp->propertyReference();\n");
2011+
$implIncludes{"ExceptionCode.h"} = 1;
20102012
}
20112013

20122014
GenerateArgumentsCountCheck(\@implContent, $function, $dataNode);

Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,6 +1390,7 @@ sub GenerateImplementation
13901390
}
13911391

13921392
if ($svgPropertyType) {
1393+
$implIncludes{"ExceptionCode.h"} = 1;
13931394
$getterContentHead = "$getterExpressionPrefix";
13941395
push(@implContent, " if (IMPL->role() == WebCore::AnimValRole) {\n");
13951396
push(@implContent, " WebCore::raiseOnDOMError(WebCore::NO_MODIFICATION_ALLOWED_ERR);\n");
@@ -1559,6 +1560,7 @@ sub GenerateImplementation
15591560
my $implGetter = GetObjCTypeGetter($paramName, $idlType);
15601561
my $idlTypeWithNamespace = GetSVGTypeWithNamespace($idlType);
15611562

1563+
$implIncludes{"ExceptionCode.h"} = 1;
15621564
push(@functionContent, " $idlTypeWithNamespace* ${paramName}Core = $implGetter;\n");
15631565
push(@functionContent, " if (!${paramName}Core) {\n");
15641566
push(@functionContent, " WebCore::ExceptionCode ec = WebCore::TYPE_MISMATCH_ERR;\n");
@@ -1577,6 +1579,7 @@ sub GenerateImplementation
15771579
my $content = $codeGenerator->WK_lcfirst($functionName) . "(" . join(", ", @parameterNames) . ")";
15781580

15791581
if ($svgPropertyType) {
1582+
$implIncludes{"ExceptionCode.h"} = 1;
15801583
push(@functionContent, " if (IMPL->role() == WebCore::AnimValRole) {\n");
15811584
push(@functionContent, " WebCore::raiseOnDOMError(WebCore::NO_MODIFICATION_ALLOWED_ERR);\n");
15821585
if ($returnType eq "void") {

Source/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#if ENABLE(NOTIFICATIONS)
3434
#include "V8NotificationCenter.h"
3535

36+
#include "ExceptionCode.h"
3637
#include "NotImplemented.h"
3738
#include "Notification.h"
3839
#include "NotificationCenter.h"

Source/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#if ENABLE(SVG)
3434
#include "V8SVGLength.h"
3535

36+
#include "ExceptionCode.h"
3637
#include "SVGPropertyTearOff.h"
3738
#include "V8Binding.h"
3839
#include "V8BindingMacros.h"

Source/WebCore/css/WebKitCSSMatrix.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@
2626
#ifndef WebKitCSSMatrix_h
2727
#define WebKitCSSMatrix_h
2828

29-
#include "ExceptionCode.h"
3029
#include "PlatformString.h"
3130
#include "TransformationMatrix.h"
3231
#include <wtf/RefCounted.h>
3332
#include <wtf/RefPtr.h>
3433

3534
namespace WebCore {
3635

36+
typedef int ExceptionCode;
37+
3738
class WebKitCSSMatrix : public RefCounted<WebKitCSSMatrix> {
3839
public:
3940
static PassRefPtr<WebKitCSSMatrix> create(const TransformationMatrix& m)

Source/WebCore/dom/WebKitMutationObserver.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333

3434
#if ENABLE(MUTATION_OBSERVERS)
3535

36-
#include "ExceptionCode.h"
3736
#include <wtf/HashSet.h>
3837
#include <wtf/PassRefPtr.h>
3938
#include <wtf/RefCounted.h>
@@ -48,6 +47,8 @@ class MutationObserverRegistration;
4847
class MutationRecord;
4948
class Node;
5049

50+
typedef int ExceptionCode;
51+
5152
typedef unsigned char MutationObserverOptions;
5253
typedef unsigned char MutationRecordDeliveryOptions;
5354

Source/WebCore/fileapi/DirectoryReaderSync.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#if ENABLE(FILE_SYSTEM)
3535

3636
#include "DirectoryReaderBase.h"
37-
#include "ExceptionCode.h"
3837
#include "PlatformString.h"
3938
#include <wtf/PassRefPtr.h>
4039
#include <wtf/RefCounted.h>
@@ -43,6 +42,8 @@ namespace WebCore {
4342

4443
class EntryArraySync;
4544

45+
typedef int ExceptionCode;
46+
4647
class DirectoryReaderSync : public DirectoryReaderBase {
4748
public:
4849
static PassRefPtr<DirectoryReaderSync> create(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)

Source/WebCore/fileapi/EntrySync.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535

3636
#include "DOMFileSystemSync.h"
3737
#include "EntryBase.h"
38-
#include "ExceptionCode.h"
3938
#include "PlatformString.h"
4039
#include <wtf/PassRefPtr.h>
4140
#include <wtf/RefCounted.h>
@@ -45,6 +44,8 @@ namespace WebCore {
4544
class DirectoryEntrySync;
4645
class Metadata;
4746

47+
typedef int ExceptionCode;
48+
4849
class EntrySync : public EntryBase {
4950
public:
5051
static PassRefPtr<EntrySync> create(EntryBase*);

0 commit comments

Comments
 (0)