| Differences between
and this patch
- a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig -1 / +2 lines
Lines 66-71 ENABLE_DATAGRID = ; a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig_sec1
66
ENABLE_DATALIST = $(ENABLE_DATALIST_$(REAL_PLATFORM_NAME));
66
ENABLE_DATALIST = $(ENABLE_DATALIST_$(REAL_PLATFORM_NAME));
67
ENABLE_DATALIST_macosx = ENABLE_DATALIST;
67
ENABLE_DATALIST_macosx = ENABLE_DATALIST;
68
68
69
ENABLE_DEVICE_ELEMENT = ;
69
ENABLE_DEVICE_ORIENTATION = ;
70
ENABLE_DEVICE_ORIENTATION = ;
70
ENABLE_DIRECTORY_UPLOAD = ;
71
ENABLE_DIRECTORY_UPLOAD = ;
71
ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE;
72
ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE;
Lines 125-128 ENABLE_XHTMLMP = ; a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig_sec2
125
ENABLE_XPATH = ENABLE_XPATH;
126
ENABLE_XPATH = ENABLE_XPATH;
126
ENABLE_XSLT = ENABLE_XSLT;
127
ENABLE_XSLT = ENABLE_XSLT;
127
128
128
FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_WEBGL) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
129
FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_WEBGL) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
- a/Source/WebCore/Configurations/FeatureDefines.xcconfig -1 / +2 lines
Lines 66-71 ENABLE_DATAGRID = ; a/Source/WebCore/Configurations/FeatureDefines.xcconfig_sec1
66
ENABLE_DATALIST = $(ENABLE_DATALIST_$(REAL_PLATFORM_NAME));
66
ENABLE_DATALIST = $(ENABLE_DATALIST_$(REAL_PLATFORM_NAME));
67
ENABLE_DATALIST_macosx = ENABLE_DATALIST;
67
ENABLE_DATALIST_macosx = ENABLE_DATALIST;
68
68
69
ENABLE_DEVICE_ELEMENT = ;
69
ENABLE_DEVICE_ORIENTATION = ;
70
ENABLE_DEVICE_ORIENTATION = ;
70
ENABLE_DIRECTORY_UPLOAD = ;
71
ENABLE_DIRECTORY_UPLOAD = ;
71
ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE;
72
ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE;
Lines 125-128 ENABLE_XHTMLMP = ; a/Source/WebCore/Configurations/FeatureDefines.xcconfig_sec2
125
ENABLE_XPATH = ENABLE_XPATH;
126
ENABLE_XPATH = ENABLE_XPATH;
126
ENABLE_XSLT = ENABLE_XSLT;
127
ENABLE_XSLT = ENABLE_XSLT;
127
128
128
FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_WEBGL) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
129
FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_WEBGL) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
- a/Source/WebCore/GNUmakefile.am +10 lines
Lines 4112-4117 webcore_built_sources += \ a/Source/WebCore/GNUmakefile.am_sec1
4112
endif # END ENABLE_FILE_SYSTEM
4112
endif # END ENABLE_FILE_SYSTEM
4113
4113
4114
# ----
4114
# ----
4115
# Device Element Support
4116
# ----
4117
if ENABLE_DEVICE_ELEMENT
4118
FEATURE_DEFINES += ENABLE_DEVICE_ELEMENT=1
4119
webcore_cppflags += -DENABLE_DEVICE_ELEMENT=1
4120
else
4121
webcore_cppflags += -DENABLE_DEVICE_ELEMENT=0
4122
endif # END ENABLE_DEVICE_ELEMENT
4123
4124
# ----
4115
# Speech Input API support
4125
# Speech Input API support
4116
# ----
4126
# ----
4117
if ENABLE_INPUT_SPEECH
4127
if ENABLE_INPUT_SPEECH
- a/Source/WebCore/WebCore.gypi +23 lines
Lines 76-81 a/Source/WebCore/WebCore.gypi_sec1
76
            'dom/Range.idl',
76
            'dom/Range.idl',
77
            'dom/RangeException.idl',
77
            'dom/RangeException.idl',
78
            'dom/RequestAnimationFrameCallback.idl',
78
            'dom/RequestAnimationFrameCallback.idl',
79
            'dom/Stream.idl',
80
            'dom/StreamRecorder.idl',
79
            'dom/Text.idl',
81
            'dom/Text.idl',
80
            'dom/TextEvent.idl',
82
            'dom/TextEvent.idl',
81
            'dom/Touch.idl',
83
            'dom/Touch.idl',
Lines 143-148 a/Source/WebCore/WebCore.gypi_sec2
143
            'html/HTMLDataGridRowElement.idl',
145
            'html/HTMLDataGridRowElement.idl',
144
            'html/HTMLDataListElement.idl',
146
            'html/HTMLDataListElement.idl',
145
            'html/HTMLDetailsElement.idl',
147
            'html/HTMLDetailsElement.idl',
148
            'html/HTMLDeviceElement.idl',
146
            'html/HTMLDirectoryElement.idl',
149
            'html/HTMLDirectoryElement.idl',
147
            'html/HTMLDivElement.idl',
150
            'html/HTMLDivElement.idl',
148
            'html/HTMLDocument.idl',
151
            'html/HTMLDocument.idl',
Lines 648-653 a/Source/WebCore/WebCore.gypi_sec3
648
            'bindings/js/JSHTMLCanvasElementCustom.cpp',
651
            'bindings/js/JSHTMLCanvasElementCustom.cpp',
649
            'bindings/js/JSHTMLCollectionCustom.cpp',
652
            'bindings/js/JSHTMLCollectionCustom.cpp',
650
            'bindings/js/JSHTMLDataGridElementCustom.cpp',
653
            'bindings/js/JSHTMLDataGridElementCustom.cpp',
654
            'bindings/js/JSHTMLDeviceElementCustom.cpp',
651
            'bindings/js/JSHTMLDocumentCustom.cpp',
655
            'bindings/js/JSHTMLDocumentCustom.cpp',
652
            'bindings/js/JSHTMLElementCustom.cpp',
656
            'bindings/js/JSHTMLElementCustom.cpp',
653
            'bindings/js/JSHTMLEmbedElementCustom.cpp',
657
            'bindings/js/JSHTMLEmbedElementCustom.cpp',
Lines 832-837 a/Source/WebCore/WebCore.gypi_sec4
832
            'bindings/v8/custom/V8HTMLCanvasElementCustom.cpp',
836
            'bindings/v8/custom/V8HTMLCanvasElementCustom.cpp',
833
            'bindings/v8/custom/V8HTMLCollectionCustom.cpp',
837
            'bindings/v8/custom/V8HTMLCollectionCustom.cpp',
834
            'bindings/v8/custom/V8HTMLDataGridElementCustom.cpp',
838
            'bindings/v8/custom/V8HTMLDataGridElementCustom.cpp',
839
            'bindings/v8/custom/V8HTMLDeviceElementCustom.cpp',
835
            'bindings/v8/custom/V8HTMLDocumentCustom.cpp',
840
            'bindings/v8/custom/V8HTMLDocumentCustom.cpp',
836
            'bindings/v8/custom/V8HTMLElementCustom.cpp',
841
            'bindings/v8/custom/V8HTMLElementCustom.cpp',
837
            'bindings/v8/custom/V8HTMLFormElementCustom.cpp',
842
            'bindings/v8/custom/V8HTMLFormElementCustom.cpp',
Lines 1188-1193 a/Source/WebCore/WebCore.gypi_sec5
1188
            'dom/CrossThreadTask.h',
1193
            'dom/CrossThreadTask.h',
1189
            'dom/CustomEvent.cpp',
1194
            'dom/CustomEvent.cpp',
1190
            'dom/CustomEvent.h',
1195
            'dom/CustomEvent.h',
1196
            'dom/DeviceConnectionId.h',
1197
            'dom/DeviceType.cpp',
1198
            'dom/DeviceType.h',
1191
            'dom/DOMCoreException.h',
1199
            'dom/DOMCoreException.h',
1192
            'dom/DOMImplementation.cpp',
1200
            'dom/DOMImplementation.cpp',
1193
            'dom/DOMImplementation.h',
1201
            'dom/DOMImplementation.h',
Lines 1200-1205 a/Source/WebCore/WebCore.gypi_sec6
1200
            'dom/DatasetDOMStringMap.h',
1208
            'dom/DatasetDOMStringMap.h',
1201
            'dom/DecodedDataDocumentParser.cpp',
1209
            'dom/DecodedDataDocumentParser.cpp',
1202
            'dom/DecodedDataDocumentParser.h',
1210
            'dom/DecodedDataDocumentParser.h',
1211
            'dom/DeviceElement.cpp',
1212
            'dom/DeviceElement.h',
1203
            'dom/DeviceMotionClient.h',
1213
            'dom/DeviceMotionClient.h',
1204
            'dom/DeviceMotionController.cpp',
1214
            'dom/DeviceMotionController.cpp',
1205
            'dom/DeviceMotionController.h',
1215
            'dom/DeviceMotionController.h',
Lines 1346-1351 a/Source/WebCore/WebCore.gypi_sec7
1346
            'dom/StaticNodeList.h',
1356
            'dom/StaticNodeList.h',
1347
            'dom/StaticStringList.cpp',
1357
            'dom/StaticStringList.cpp',
1348
            'dom/StaticStringList.h',
1358
            'dom/StaticStringList.h',
1359
            'dom/Stream.cpp',
1360
            'dom/Stream.h',
1361
            'dom/StreamRecorder.cpp',
1362
            'dom/StreamRecorder.h',
1349
            'dom/StyleElement.cpp',
1363
            'dom/StyleElement.cpp',
1350
            'dom/StyleElement.h',
1364
            'dom/StyleElement.h',
1351
            'dom/StyledElement.cpp',
1365
            'dom/StyledElement.cpp',
Lines 1700-1705 a/Source/WebCore/WebCore.gypi_sec8
1700
            'html/HTMLDataListElement.h',
1714
            'html/HTMLDataListElement.h',
1701
            'html/HTMLDetailsElement.cpp',
1715
            'html/HTMLDetailsElement.cpp',
1702
            'html/HTMLDetailsElement.h',
1716
            'html/HTMLDetailsElement.h',
1717
            'html/HTMLDeviceElement.cpp',
1718
            'html/HTMLDeviceElement.h',
1703
            'html/HTMLDirectoryElement.cpp',
1719
            'html/HTMLDirectoryElement.cpp',
1704
            'html/HTMLDirectoryElement.h',
1720
            'html/HTMLDirectoryElement.h',
1705
            'html/HTMLDivElement.cpp',
1721
            'html/HTMLDivElement.cpp',
Lines 2281-2286 a/Source/WebCore/WebCore.gypi_sec9
2281
            'page/ContextMenuController.cpp',
2297
            'page/ContextMenuController.cpp',
2282
            'page/ContextMenuController.h',
2298
            'page/ContextMenuController.h',
2283
            'page/ContextMenuProvider.h',
2299
            'page/ContextMenuProvider.h',
2300
            'page/DeviceClient.h',
2301
            'page/DeviceConnection.h',
2302
            'page/DeviceConnectionController.cpp',
2303
            'page/DeviceConnectionController.h',
2304
            'page/DeviceListener.h',
2284
            'page/DOMSelection.cpp',
2305
            'page/DOMSelection.cpp',
2285
            'page/DOMSelection.h',
2306
            'page/DOMSelection.h',
2286
            'page/DOMTimer.cpp',
2307
            'page/DOMTimer.cpp',
Lines 3841-3846 a/Source/WebCore/WebCore.gypi_sec10
3841
            'rendering/RenderDetails.h',
3862
            'rendering/RenderDetails.h',
3842
            'rendering/RenderDetailsMarker.cpp',
3863
            'rendering/RenderDetailsMarker.cpp',
3843
            'rendering/RenderDetailsMarker.h',
3864
            'rendering/RenderDetailsMarker.h',
3865
            'rendering/RenderDevice.cpp',
3866
            'rendering/RenderDevice.h',
3844
            'rendering/RenderEmbeddedObject.cpp',
3867
            'rendering/RenderEmbeddedObject.cpp',
3845
            'rendering/RenderEmbeddedObject.h',
3868
            'rendering/RenderEmbeddedObject.h',
3846
            'rendering/RenderFieldset.cpp',
3869
            'rendering/RenderFieldset.cpp',
- a/Source/WebCore/WebCore.pri +3 lines
Lines 143-148 IDL_BINDINGS += \ a/Source/WebCore/WebCore.pri_sec1
143
    dom/ProgressEvent.idl \
143
    dom/ProgressEvent.idl \
144
    dom/RangeException.idl \
144
    dom/RangeException.idl \
145
    dom/Range.idl \
145
    dom/Range.idl \
146
    dom/Stream.idl \
147
    dom/StreamRecorder.idl \
146
    dom/Text.idl \
148
    dom/Text.idl \
147
    dom/TextEvent.idl \
149
    dom/TextEvent.idl \
148
    dom/Touch.idl \
150
    dom/Touch.idl \
Lines 235-240 IDL_BINDINGS += \ a/Source/WebCore/WebCore.pri_sec2
235
    html/HTMLDataGridRowElement.idl \
237
    html/HTMLDataGridRowElement.idl \
236
    html/HTMLDataListElement.idl \
238
    html/HTMLDataListElement.idl \
237
    html/HTMLDetailsElement.idl \
239
    html/HTMLDetailsElement.idl \
240
    html/HTMLDeviceElement.idl \
238
    html/HTMLDirectoryElement.idl \
241
    html/HTMLDirectoryElement.idl \
239
    html/HTMLDivElement.idl \
242
    html/HTMLDivElement.idl \
240
    html/HTMLDListElement.idl \
243
    html/HTMLDListElement.idl \
- a/Source/WebCore/WebCore.pro +32 lines
Lines 3488-3493 contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) { a/Source/WebCore/WebCore.pro_sec1
3488
    MOBILITY += sensors
3488
    MOBILITY += sensors
3489
}
3489
}
3490
3490
3491
contains(DEFINES, ENABLE_DEVICE_ELEMENT=1) {
3492
    HEADERS += \
3493
        dom/DeviceConnectionId.h \
3494
        dom/DeviceElement.h \
3495
        dom/DeviceType.h \
3496
        dom/Stream.h \
3497
        dom/StreamRecorder.h \
3498
        html/HTMLDeviceElement.h \
3499
        page/DeviceClient.h \
3500
        page/DeviceConnection.h \
3501
        page/DeviceConnectionController.h \
3502
        page/DeviceListener.h \
3503
        rendering/RenderDevice.h
3504
3505
    SOURCES += \
3506
        dom/DeviceElement.cpp \
3507
        dom/DeviceType.cpp \
3508
        dom/Stream.cpp \
3509
        dom/StreamRecorder.cpp \
3510
        html/HTMLDeviceElement.cpp \
3511
        page/DeviceConnectionController.cpp \
3512
        rendering/RenderDevice.cpp
3513
3514
    v8 {
3515
        SOURCES += \
3516
            bindings/v8/custom/V8HTMLDeviceElementCustom.cpp
3517
    } else {
3518
        SOURCES += \
3519
            bindings/js/JSHTMLDeviceElementCustom.cpp
3520
    }
3521
}
3522
3491
contains(DEFINES, ENABLE_SVG=1) {
3523
contains(DEFINES, ENABLE_SVG=1) {
3492
    !v8 {
3524
    !v8 {
3493
        SOURCES += \
3525
        SOURCES += \
- a/Source/WebCore/bindings/js/JSHTMLDeviceElementCustom.cpp +58 lines
Line 0 a/Source/WebCore/bindings/js/JSHTMLDeviceElementCustom.cpp_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
#include "config.h"
32
#include "JSHTMLDeviceElement.h"
33
34
#if ENABLE(DEVICE_ELEMENT)
35
36
#include "DeviceConnection.h"
37
#include "HTMLDeviceElement.h"
38
#include "JSStream.h"
39
40
using namespace JSC;
41
42
namespace WebCore {
43
44
JSValue JSHTMLDeviceElement::data(ExecState* exec) const
45
{
46
    HTMLDeviceElement* device = static_cast<HTMLDeviceElement*>(impl());
47
    if (const DeviceConnection* connection = device->connection())
48
        if (connection->state() == DeviceConnection::Connected)
49
            // FIXME: return device->data() (Requires conversion to JSObject).
50
            // return toJS(exec, globalObject(), device->data());
51
            return jsNull();
52
53
    return jsNull();
54
}
55
56
} // namespace WebCore
57
58
#endif // ENABLE(DEVICE_ELEMENT)
- a/Source/WebCore/bindings/v8/custom/V8HTMLDeviceElementCustom.cpp +59 lines
Line 0 a/Source/WebCore/bindings/v8/custom/V8HTMLDeviceElementCustom.cpp_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
#include "config.h"
32
#include "V8HTMLDeviceElement.h"
33
34
#if ENABLE(DEVICE_ELEMENT)
35
36
#include "DeviceConnection.h"
37
#include "HTMLDeviceElement.h"
38
#include "V8Binding.h"
39
#include "V8Stream.h"
40
41
#include <v8.h>
42
43
namespace WebCore {
44
45
v8::Handle<v8::Value> V8HTMLDeviceElement::dataAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
46
{
47
    INC_STATS("DOM.HTMLDeviceElement.data._get");
48
    v8::Handle<v8::Object> holder = info.Holder();
49
    HTMLDeviceElement* device = V8HTMLDeviceElement::toNative(holder);
50
    if (const DeviceConnection* connection = device->connection())
51
        if (connection->state() == DeviceConnection::Connected)
52
            return toV8(device->data());
53
54
    return v8::Null();
55
}
56
57
} // namespace WebCore
58
59
#endif // ENABLE(DEVICE_ELEMENT)
- a/Source/WebCore/css/CSSPrimitiveValueMappings.h +4 lines
Lines 354-359 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ControlPart e) a/Source/WebCore/css/CSSPrimitiveValueMappings.h_sec1
354
#if ENABLE(INPUT_SPEECH)
354
#if ENABLE(INPUT_SPEECH)
355
            m_value.ident = CSSValueWebkitInputSpeechButton;
355
            m_value.ident = CSSValueWebkitInputSpeechButton;
356
#endif
356
#endif
357
        case DeviceButtonPart:
358
#if ENABLE(DEVICE_TAG)
359
            m_value.ident = CSSValueWebkitDeviceButton;
360
#endif
357
            break;
361
            break;
358
    }
362
    }
359
}
363
}
- a/Source/WebCore/css/CSSSelector.cpp +13 lines
Lines 130-135 PseudoId CSSSelector::pseudoId(PseudoType type) a/Source/WebCore/css/CSSSelector.cpp_sec1
130
    case PseudoInputSpeechButton:
130
    case PseudoInputSpeechButton:
131
        return INPUT_SPEECH_BUTTON;
131
        return INPUT_SPEECH_BUTTON;
132
#endif
132
#endif
133
#if ENABLE(DEVICE_ELEMENT)
134
    case PseudoDeviceButton:
135
        return DEVICE_BUTTON;
136
#endif
133
    case PseudoSearchCancelButton:
137
    case PseudoSearchCancelButton:
134
        return SEARCH_CANCEL_BUTTON;
138
        return SEARCH_CANCEL_BUTTON;
135
    case PseudoSearchDecoration:
139
    case PseudoSearchDecoration:
Lines 285-290 static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap( a/Source/WebCore/css/CSSSelector.cpp_sec2
285
#if ENABLE(INPUT_SPEECH)
289
#if ENABLE(INPUT_SPEECH)
286
    DEFINE_STATIC_LOCAL(AtomicString, inputSpeechButton, ("-webkit-input-speech-button"));
290
    DEFINE_STATIC_LOCAL(AtomicString, inputSpeechButton, ("-webkit-input-speech-button"));
287
#endif
291
#endif
292
#if ENABLE(DEVICE_ELEMENT)
293
    DEFINE_STATIC_LOCAL(AtomicString, deviceButton, ("-webkit-device-button"));
294
#endif
288
    DEFINE_STATIC_LOCAL(AtomicString, defaultString, ("default"));
295
    DEFINE_STATIC_LOCAL(AtomicString, defaultString, ("default"));
289
    DEFINE_STATIC_LOCAL(AtomicString, disabled, ("disabled"));
296
    DEFINE_STATIC_LOCAL(AtomicString, disabled, ("disabled"));
290
    DEFINE_STATIC_LOCAL(AtomicString, readOnly, ("read-only"));
297
    DEFINE_STATIC_LOCAL(AtomicString, readOnly, ("read-only"));
Lines 389-394 static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap( a/Source/WebCore/css/CSSSelector.cpp_sec3
389
#if ENABLE(INPUT_SPEECH)
396
#if ENABLE(INPUT_SPEECH)
390
        nameToPseudoType->set(inputSpeechButton.impl(), CSSSelector::PseudoInputSpeechButton);
397
        nameToPseudoType->set(inputSpeechButton.impl(), CSSSelector::PseudoInputSpeechButton);
391
#endif
398
#endif
399
#if ENABLE(DEVICE_ELEMENT)
400
        nameToPseudoType->set(deviceButton.impl(), CSSSelector::PseudoDeviceButton);
401
#endif
392
        nameToPseudoType->set(defaultString.impl(), CSSSelector::PseudoDefault);
402
        nameToPseudoType->set(defaultString.impl(), CSSSelector::PseudoDefault);
393
        nameToPseudoType->set(disabled.impl(), CSSSelector::PseudoDisabled);
403
        nameToPseudoType->set(disabled.impl(), CSSSelector::PseudoDisabled);
394
        nameToPseudoType->set(readOnly.impl(), CSSSelector::PseudoReadOnly);
404
        nameToPseudoType->set(readOnly.impl(), CSSSelector::PseudoReadOnly);
Lines 513-518 void CSSSelector::extractPseudoType() const a/Source/WebCore/css/CSSSelector.cpp_sec4
513
#if ENABLE(INPUT_SPEECH)
523
#if ENABLE(INPUT_SPEECH)
514
    case PseudoInputSpeechButton:
524
    case PseudoInputSpeechButton:
515
#endif
525
#endif
526
#if ENABLE(DEVICE_ELEMENT)
527
    case PseudoDeviceButton:
528
#endif
516
    case PseudoInnerSpinButton:
529
    case PseudoInnerSpinButton:
517
    case PseudoMediaControlsPanel:
530
    case PseudoMediaControlsPanel:
518
    case PseudoMediaControlsCurrentTimeDisplay:
531
    case PseudoMediaControlsCurrentTimeDisplay:
- a/Source/WebCore/css/CSSSelector.h +3 lines
Lines 193-198 namespace WebCore { a/Source/WebCore/css/CSSSelector.h_sec1
193
#if ENABLE(INPUT_SPEECH)
193
#if ENABLE(INPUT_SPEECH)
194
            PseudoInputSpeechButton,
194
            PseudoInputSpeechButton,
195
#endif
195
#endif
196
#if ENABLE(DEVICE_ELEMENT)
197
            PseudoDeviceButton,
198
#endif
196
            PseudoInnerSpinButton,
199
            PseudoInnerSpinButton,
197
            PseudoOuterSpinButton,
200
            PseudoOuterSpinButton,
198
            PseudoLeftPage,
201
            PseudoLeftPage,
- a/Source/WebCore/css/CSSValueKeywords.in +1 lines
Lines 571-576 button-bevel a/Source/WebCore/css/CSSValueKeywords.in_sec1
571
default-button
571
default-button
572
inner-spin-button
572
inner-spin-button
573
-webkit-input-speech-button
573
-webkit-input-speech-button
574
-webkit-device-button
574
list-button
575
list-button
575
listbox
576
listbox
576
listitem
577
listitem
- a/Source/WebCore/css/html.css -6 / +8 lines
Lines 479-490 input[type="radio"], input[type="checkbox"] { a/Source/WebCore/css/html.css_sec1
479
    border: initial;
479
    border: initial;
480
}
480
}
481
481
482
input[type="button"], input[type="submit"], input[type="reset"], input[type="file"]::-webkit-file-upload-button {
482
input[type="button"], input[type="submit"], input[type="reset"], input[type="file"]::-webkit-file-upload-button, device::-webkit-device-button {
483
    -webkit-appearance: push-button;
483
    -webkit-appearance: push-button;
484
    white-space: pre
484
    white-space: pre
485
}
485
}
486
486
487
input[type="button"], input[type="submit"], input[type="reset"], input[type="file"]::-webkit-file-upload-button, button {
487
input[type="button"], input[type="submit"], input[type="reset"], input[type="file"]::-webkit-file-upload-button, device::-webkit-device-button, button {
488
    -webkit-box-align: center;
488
    -webkit-box-align: center;
489
    text-align: center;
489
    text-align: center;
490
    cursor: default;
490
    cursor: default;
Lines 509-523 input[type="range"]::-webkit-slider-thumb { a/Source/WebCore/css/html.css_sec2
509
509
510
input[type="button"]:disabled, input[type="submit"]:disabled, input[type="reset"]:disabled,
510
input[type="button"]:disabled, input[type="submit"]:disabled, input[type="reset"]:disabled,
511
input[type="file"]:disabled::-webkit-file-upload-button, button:disabled,
511
input[type="file"]:disabled::-webkit-file-upload-button, button:disabled,
512
select:disabled, keygen:disabled, optgroup:disabled, option:disabled, datagrid:disabled {
512
select:disabled, keygen:disabled, optgroup:disabled, option:disabled, datagrid:disabled,
513
device:disabled::-webkit-device-button {
513
    color: GrayText
514
    color: GrayText
514
}
515
}
515
516
516
input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active, input[type="file"]:active::-webkit-file-upload-button, button:active {
517
input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active, input[type="file"]:active::-webkit-file-upload-button, device:active::-webkit-device-button, button:active {
517
    border-style: inset
518
    border-style: inset
518
}
519
}
519
520
520
input[type="button"]:active:disabled, input[type="submit"]:active:disabled, input[type="reset"]:active:disabled, input[type="file"]:active:disabled::-webkit-file-upload-button, button:active:disabled {
521
input[type="button"]:active:disabled, input[type="submit"]:active:disabled, input[type="reset"]:active:disabled, input[type="file"]:active:disabled::-webkit-file-upload-button, device:active:disabled::-webkit-device-button, button:active:disabled {
521
    border-style: outset
522
    border-style: outset
522
}
523
}
523
524
Lines 797-803 input[type="radio"]:focus, a/Source/WebCore/css/html.css_sec3
797
input[type="reset"]:focus,
798
input[type="reset"]:focus,
798
input[type="search"]:focus,
799
input[type="search"]:focus,
799
input[type="submit"]:focus,
800
input[type="submit"]:focus,
800
input[type="file"]:focus::-webkit-file-upload-button {
801
input[type="file"]:focus::-webkit-file-upload-button,
802
device:focus::-webkit-device-button {
801
    outline-offset: 0
803
    outline-offset: 0
802
}
804
}
803
    
805
    
- a/Source/WebCore/dom/DOMAllInOne.cpp +4 lines
Lines 51-62 a/Source/WebCore/dom/DOMAllInOne.cpp_sec1
51
#include "DOMStringMap.cpp"
51
#include "DOMStringMap.cpp"
52
#include "DatasetDOMStringMap.cpp"
52
#include "DatasetDOMStringMap.cpp"
53
#include "DecodedDataDocumentParser.cpp"
53
#include "DecodedDataDocumentParser.cpp"
54
#include "DeviceElement.cpp"
54
#include "DeviceMotionController.cpp"
55
#include "DeviceMotionController.cpp"
55
#include "DeviceMotionData.cpp"
56
#include "DeviceMotionData.cpp"
56
#include "DeviceMotionEvent.cpp"
57
#include "DeviceMotionEvent.cpp"
57
#include "DeviceOrientation.cpp"
58
#include "DeviceOrientation.cpp"
58
#include "DeviceOrientationController.cpp"
59
#include "DeviceOrientationController.cpp"
59
#include "DeviceOrientationEvent.cpp"
60
#include "DeviceOrientationEvent.cpp"
61
#include "DeviceType.cpp"
60
#include "Document.cpp"
62
#include "Document.cpp"
61
#include "DocumentFragment.cpp"
63
#include "DocumentFragment.cpp"
62
#include "DocumentMarkerController.cpp"
64
#include "DocumentMarkerController.cpp"
Lines 110-115 a/Source/WebCore/dom/DOMAllInOne.cpp_sec2
110
#include "SpaceSplitString.cpp"
112
#include "SpaceSplitString.cpp"
111
#include "StaticHashSetNodeList.cpp"
113
#include "StaticHashSetNodeList.cpp"
112
#include "StaticNodeList.cpp"
114
#include "StaticNodeList.cpp"
115
#include "Stream.cpp"
116
#include "StreamRecorder.cpp"
113
#include "StyleElement.cpp"
117
#include "StyleElement.cpp"
114
#include "StyledElement.cpp"
118
#include "StyledElement.cpp"
115
#include "TagNodeList.cpp"
119
#include "TagNodeList.cpp"
- a/Source/WebCore/dom/DeviceConnectionId.h +94 lines
Line 0 a/Source/WebCore/dom/DeviceConnectionId.h_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
#ifndef DeviceConnectionId_h
32
#define DeviceConnectionId_h
33
34
#if ENABLE(DEVICE_ELEMENT)
35
36
#include <wtf/HashFunctions.h>
37
#include <wtf/HashTraits.h>
38
#include <wtf/OwnPtr.h>
39
40
namespace WebCore {
41
42
// Tuple of <connection identifier, type>.
43
// Allows the DeviceConnectionController to avoid collisions between local device connection ids (managed by itself)
44
// and remote device connection ids (managed by the ConnectionPeerClient).
45
class DeviceConnectionId {
46
public:
47
    enum ConnectionType {
48
        None = 0,
49
        Local,
50
        Remote
51
    };
52
53
    DeviceConnectionId()
54
        : m_id(0)
55
        , m_type(None)
56
    {
57
    }
58
59
    DeviceConnectionId(int id, ConnectionType type)
60
        : m_id(id)
61
        , m_type(type)
62
    {
63
    }
64
65
    int id() const { return m_id; }
66
    ConnectionType type() const { return m_type; }
67
    bool isNull() const { return !m_id || m_type == None; }
68
    void reset() { *this = DeviceConnectionId(); }
69
70
    // Operators required to reuse std::pair hashing templates.
71
    operator std::pair<int, int>() const { return std::pair<int, int>(m_id, m_type); }
72
    bool operator==(const DeviceConnectionId& c) const { return m_id == c.m_id && m_type == c.m_type; }
73
74
private:
75
    friend class DeviceConnectionController;
76
    int m_id;
77
    ConnectionType m_type;
78
};
79
80
} // namespace WebCore
81
82
namespace WTF {
83
84
template<> struct DefaultHash<WebCore::DeviceConnectionId> {
85
    typedef PairHash<int, int> Hash;
86
};
87
88
template<> struct HashTraits<WebCore::DeviceConnectionId> : public PairHashTraits<HashTraits<int>, HashTraits<int> > { };
89
90
} // namespace WTF
91
92
#endif // ENABLE(DEVICE_ELEMENT)
93
94
#endif // DeviceConnectionId_h
- a/Source/WebCore/dom/DeviceElement.cpp +54 lines
Line 0 a/Source/WebCore/dom/DeviceElement.cpp_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
#include "config.h"
32
#include "DeviceElement.h"
33
34
#if ENABLE(DEVICE_ELEMENT)
35
36
namespace WebCore {
37
38
DeviceElement::DeviceElement()
39
{
40
}
41
42
DeviceElement::DeviceElement(const String& type)
43
    : m_type(type)
44
{
45
}
46
47
String DeviceElement::type() const
48
{
49
    return m_type.name();
50
}
51
52
} // namespace WebCore
53
54
#endif // ENABLE(DEVICE_ELEMENT)
- a/Source/WebCore/dom/DeviceElement.h +61 lines
Line 0 a/Source/WebCore/dom/DeviceElement.h_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
#ifndef DeviceElement_h
32
#define DeviceElement_h
33
34
#if ENABLE(DEVICE_ELEMENT)
35
36
#include "DeviceType.h"
37
#include <wtf/Forward.h>
38
#include <wtf/PassRefPtr.h>
39
40
namespace WebCore {
41
42
class Stream;
43
44
class DeviceElement {
45
public:
46
    DeviceElement();
47
    DeviceElement(const String& type);
48
49
    String type() const;
50
    virtual void setType(const String&) = 0;
51
    virtual PassRefPtr<Stream> data() = 0; // FIXME: use generic data types when extending the device type beyond media.
52
53
protected:
54
    DeviceType m_type;
55
};
56
57
} // namespace WebCore
58
59
#endif // ENABLE(DEVICE_ELEMENT)
60
61
#endif // DeviceElement_h
- a/Source/WebCore/dom/DeviceType.cpp +100 lines
Line 0 a/Source/WebCore/dom/DeviceType.cpp_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
#include "config.h"
32
#include "DeviceType.h"
33
34
#if ENABLE(DEVICE_ELEMENT)
35
36
namespace WebCore {
37
38
DeviceType::DeviceType()
39
    : m_id(Invalid)
40
{
41
}
42
43
DeviceType::DeviceType(TypeId id)
44
{
45
    ASSERT(id > Invalid && id < NumDeviceTypes);
46
    m_id = id;
47
}
48
49
DeviceType::DeviceType(const String& name)
50
{
51
    m_id = idFromName(name);
52
}
53
54
DeviceType::TypeId DeviceType::id() const
55
{
56
    return m_id;
57
}
58
59
const AtomicString& DeviceType::name() const
60
{
61
    return nameFromId(m_id);
62
}
63
64
bool DeviceType::isValid() const
65
{
66
    return m_id > Invalid && m_id < NumDeviceTypes;
67
}
68
69
DeviceType::TypeId DeviceType::idFromName(const String& name)
70
{
71
    // Add code for extra device types here.
72
    if (name == media())
73
        return Media;
74
75
    return Invalid;
76
}
77
78
const AtomicString& DeviceType::nameFromId(TypeId id)
79
{
80
    DEFINE_STATIC_LOCAL(AtomicString, nullTypeName, ());
81
82
    // Add code for extra device types here.
83
    switch (id) {
84
    case Media:
85
        return media();
86
87
    default:
88
        return nullTypeName;
89
    }
90
}
91
92
const AtomicString& DeviceType::media()
93
{
94
    DEFINE_STATIC_LOCAL(AtomicString, name, ("media"));
95
    return name;
96
}
97
98
} // namespace WebCore
99
100
#endif // ENABLE(DEVICE_ELEMENT)
- a/Source/WebCore/dom/DeviceType.h +79 lines
Line 0 a/Source/WebCore/dom/DeviceType.h_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
#ifndef DeviceType_h
32
#define DeviceType_h
33
34
#if ENABLE(DEVICE_ELEMENT)
35
36
#include "PlatformString.h"
37
#include <wtf/text/AtomicString.h>
38
39
namespace WebCore {
40
41
class DeviceType {
42
public:
43
    // Allowed type values for the device element.
44
    enum TypeId {
45
        Invalid = 0, // Invalid device type value. Not a reserved type in the spec.
46
        Media,
47
        NumDeviceTypes
48
    };
49
50
    // Used in multi-device connections as media.
51
    enum SubtypeId {
52
        None = 0,
53
        MediaAudio,
54
        MediaVideo
55
    };
56
57
    DeviceType();
58
    DeviceType(TypeId);
59
    DeviceType(const String& name);
60
61
    TypeId id() const;
62
    const AtomicString& name() const;
63
    bool isValid() const;
64
65
    static const AtomicString& nameFromId(TypeId);
66
    static TypeId idFromName(const String&);
67
68
    // Add extra device types here.
69
    static const AtomicString& media();
70
71
private:
72
    TypeId m_id;
73
};
74
75
} // namespace WebCore
76
77
#endif // ENABLE(DEVICE_ELEMENT)
78
79
#endif // DeviceType_h
- a/Source/WebCore/dom/Stream.cpp +101 lines
Line 0 a/Source/WebCore/dom/Stream.cpp_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
#include "config.h"
32
#include "Stream.h"
33
34
#if ENABLE(DEVICE_ELEMENT)
35
36
#include "DeviceConnection.h"
37
#include "StreamRecorder.h"
38
39
namespace WebCore {
40
41
PassRefPtr<Stream> Stream::create(DeviceConnectionController* controller, DeviceConnectionId id, const KURL& url)
42
{
43
    ASSERT(controller);
44
    ASSERT(controller->isConnectionIdValid(id));
45
    ASSERT(controller->connection(id).state() == DeviceConnection::Connected);
46
    ASSERT(url.isValid());
47
48
    return adoptRef(new Stream(controller, id, url));
49
}
50
51
Stream::Stream(DeviceConnectionController* controller, DeviceConnectionId id, const KURL& url)
52
    : m_controller(controller)
53
    , m_connectionId(id)
54
    , m_url(url)
55
{
56
    m_controller->registerConnectionListener(m_connectionId, this);
57
}
58
59
Stream::~Stream()
60
{
61
    if (m_controller)
62
        m_controller->unregisterConnectionListener(m_connectionId, this);
63
}
64
65
const KURL& Stream::url() const
66
{
67
    return m_url;
68
}
69
70
PassRefPtr<StreamRecorder> Stream::record()
71
{
72
    return StreamRecorder::create(m_controller, m_connectionId);
73
}
74
75
void Stream::deviceConnectionUpdate(const DeviceConnection& connection)
76
{
77
    switch (connection.state()) {
78
    case DeviceConnection::Connected:
79
        break;
80
81
    case DeviceConnection::Failed:
82
    case DeviceConnection::Disconnected:
83
        ASSERT(m_controller->isConnectionIdValid(m_connectionId));
84
        m_controller->unregisterConnectionListener(m_connectionId, this);
85
        m_connectionId.reset();
86
        break;
87
88
    default:
89
        ASSERT_NOT_REACHED();
90
    };
91
}
92
93
void Stream::connectionControllerShutdown()
94
{
95
    m_connectionId.reset();
96
    m_controller = 0;
97
}
98
99
} // namespace WebCore
100
101
#endif // ENABLE(DEVICE_ELEMENT)
- a/Source/WebCore/dom/Stream.h +72 lines
Line 0 a/Source/WebCore/dom/Stream.h_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
#ifndef Stream_h
32
#define Stream_h
33
34
#if ENABLE(DEVICE_ELEMENT)
35
36
#include "DeviceConnectionController.h"
37
#include "DeviceConnectionId.h"
38
#include "KURL.h"
39
#include <wtf/Forward.h>
40
#include <wtf/PassRefPtr.h>
41
#include <wtf/RefCounted.h>
42
43
namespace WebCore {
44
45
class StreamRecorder;
46
47
class Stream : public RefCounted<Stream>,
48
               public DeviceConnectionController::ConnectionListener {
49
public:
50
    static PassRefPtr<Stream> create(DeviceConnectionController*, DeviceConnectionId, const KURL&);
51
    ~Stream();
52
53
    const KURL& url() const;
54
    PassRefPtr<StreamRecorder> record();
55
56
    // DeviceConnectionController::ConnectionListener implementation.
57
    virtual void deviceConnectionUpdate(const DeviceConnection&);
58
    virtual void connectionControllerShutdown();
59
60
private:
61
    Stream(DeviceConnectionController*, DeviceConnectionId, const KURL&);
62
63
    DeviceConnectionController* m_controller;
64
    DeviceConnectionId m_connectionId;
65
    KURL m_url;
66
};
67
68
} // namespace WebCore
69
70
#endif // ENABLE(DEVICE_ELEMENT)
71
72
#endif // Stream_h
- a/Source/WebCore/dom/Stream.idl +40 lines
Line 0 a/Source/WebCore/dom/Stream.idl_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
module core {
32
33
    interface [
34
        Conditional=DEVICE_ELEMENT
35
    ] Stream {
36
        readonly attribute DOMString url;
37
        StreamRecorder record();
38
    };
39
}
40
- a/Source/WebCore/dom/StreamRecorder.cpp +122 lines
Line 0 a/Source/WebCore/dom/StreamRecorder.cpp_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
#include "config.h"
32
#include "StreamRecorder.h"
33
34
#include "DeviceConnection.h"
35
36
#if ENABLE(DEVICE_ELEMENT)
37
38
namespace WebCore {
39
40
PassRefPtr<StreamRecorder> StreamRecorder::create(DeviceConnectionController* controller, DeviceConnectionId id)
41
{
42
    ASSERT(controller);
43
    ASSERT(controller->isConnectionIdValid(id));
44
45
    return adoptRef(new StreamRecorder(controller, id));
46
}
47
48
StreamRecorder::StreamRecorder(DeviceConnectionController* controller, DeviceConnectionId id)
49
    : m_controller(controller)
50
    , m_connectionId(id)
51
    , m_mediaListenerId(controller->registerMediaListener(this))
52
    , m_stopped(false)
53
{
54
    m_controller->recordStreamToFile(m_mediaListenerId, m_connectionId);
55
}
56
57
StreamRecorder::~StreamRecorder()
58
{
59
    if (m_controller) {
60
        if (!m_stopped)
61
            m_controller->stopRecordingStream(m_mediaListenerId, m_connectionId, m_path);
62
63
        m_controller->unregisterMediaListener(m_mediaListenerId);
64
        m_controller->unregisterConnectionListener(m_connectionId, this);
65
    }
66
}
67
68
PassRefPtr<File> StreamRecorder::stop()
69
{
70
    // Spec question: if it has already stopped, should it return a null JS object or a reference to the file object?
71
    if (m_stopped)
72
        return m_file;
73
74
    // Note: this will return a file with an empty path if stop is called before the streamRecordingStarted message
75
    // is received in an asynchronous model. Also, the file may keep being recorded in the lapse between sending
76
    // stopRecordingStream and being procesed by the client. We are currently analyzing if forcing a synchronous
77
    // behaviour here is also an option for sandboxed platform implementations.
78
    if (m_controller)
79
        m_controller->stopRecordingStream(m_mediaListenerId, m_connectionId, m_path);
80
81
    m_file = File::create(m_path);
82
    m_stopped = true;
83
    return m_file;
84
}
85
86
void StreamRecorder::streamRecordingStarted(int mediaListenerId, const String& path)
87
{
88
    ASSERT(m_mediaListenerId == mediaListenerId);
89
    ASSERT(!m_stopped);
90
    m_path = path;
91
}
92
93
void StreamRecorder::deviceConnectionUpdate(const DeviceConnection& connection)
94
{
95
    switch (connection.state()) {
96
    case DeviceConnection::NotConnected:
97
    case DeviceConnection::Connected:
98
        // Any StreamRecorder object must be created after successfully connecting the device.
99
        ASSERT_NOT_REACHED();
100
        break;
101
102
    case DeviceConnection::Failed:
103
    case DeviceConnection::Disconnected:
104
        ASSERT(m_controller->isConnectionIdValid(m_connectionId));
105
        m_controller->unregisterConnectionListener(m_connectionId, this);
106
        m_connectionId.reset();
107
        break;
108
109
    default:
110
        ASSERT_NOT_REACHED();
111
    };
112
}
113
114
void StreamRecorder::connectionControllerShutdown()
115
{
116
    m_connectionId.reset();
117
    m_controller = 0;
118
}
119
120
} // namespace WebCore
121
122
#endif // ENABLE(DEVICE_ELEMENT)
- a/Source/WebCore/dom/StreamRecorder.h +76 lines
Line 0 a/Source/WebCore/dom/StreamRecorder.h_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
#ifndef StreamRecorder_h
32
#define StreamRecorder_h
33
34
#if ENABLE(DEVICE_ELEMENT)
35
36
#include "DeviceConnectionController.h"
37
#include "DeviceConnectionId.h"
38
#include "File.h"
39
#include "PlatformString.h"
40
#include <wtf/Forward.h>
41
#include <wtf/RefCounted.h>
42
43
namespace WebCore {
44
45
class StreamRecorder : public RefCounted<StreamRecorder>,
46
                       public DeviceConnectionController::ConnectionListener,
47
                       public DeviceConnectionController::MediaListener {
48
public:
49
    static PassRefPtr<StreamRecorder> create(DeviceConnectionController*, DeviceConnectionId);
50
    ~StreamRecorder();
51
52
    PassRefPtr<File> stop();
53
54
    // DeviceConnectionController::ConnectionListener implementation.
55
    virtual void deviceConnectionUpdate(const DeviceConnection&);
56
    virtual void connectionControllerShutdown();
57
58
    // DeviceConnectionController::MediaListener implementation.
59
    virtual void streamRecordingStarted(int mediaListenerId, const String& path);
60
61
private:
62
    StreamRecorder(DeviceConnectionController*, DeviceConnectionId);
63
64
    DeviceConnectionController* m_controller;
65
    DeviceConnectionId m_connectionId;
66
    String m_path;
67
    RefPtr<File> m_file;
68
    int m_mediaListenerId;
69
    bool m_stopped;
70
};
71
72
} // namespace WebCore
73
74
#endif // ENABLE(DEVICE_ELEMENT)
75
76
#endif // StreamRecorder_h
- a/Source/WebCore/dom/StreamRecorder.idl +39 lines
Line 0 a/Source/WebCore/dom/StreamRecorder.idl_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
module core {
32
33
    interface [
34
        Conditional=DEVICE_ELEMENT
35
    ] StreamRecorder {
36
        File stop();
37
    };
38
}
39
- a/Source/WebCore/features.pri +1 lines
Lines 75-80 contains(DEFINES, ENABLE_SINGLE_THREADED=1) { a/Source/WebCore/features.pri_sec1
75
!contains(DEFINES, ENABLE_WEB_AUDIO=.): DEFINES += ENABLE_WEB_AUDIO=0
75
!contains(DEFINES, ENABLE_WEB_AUDIO=.): DEFINES += ENABLE_WEB_AUDIO=0
76
!contains(DEFINES, ENABLE_WEBGL=.): DEFINES += ENABLE_WEBGL=0
76
!contains(DEFINES, ENABLE_WEBGL=.): DEFINES += ENABLE_WEBGL=0
77
!contains(DEFINES, ENABLE_MEDIA_STATISTICS=.): DEFINES += ENABLE_MEDIA_STATISTICS=0
77
!contains(DEFINES, ENABLE_MEDIA_STATISTICS=.): DEFINES += ENABLE_MEDIA_STATISTICS=0
78
!contains(DEFINES, ENABLE_DEVICE_ELEMENT=.): DEFINES += ENABLE_DEVICE_ELEMENT=1
78
79
79
# SVG support
80
# SVG support
80
!contains(DEFINES, ENABLE_SVG=0) {
81
!contains(DEFINES, ENABLE_SVG=0) {
- a/Source/WebCore/html/HTMLDeviceElement.cpp +292 lines
Line 0 a/Source/WebCore/html/HTMLDeviceElement.cpp_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
#include "config.h"
32
#include "HTMLDeviceElement.h"
33
34
#if ENABLE(DEVICE_ELEMENT)
35
36
#include "DeviceConnection.h"
37
#include "Event.h"
38
#include "EventHandler.h"
39
#include "EventNames.h"
40
#include "Frame.h"
41
#include "HTMLNames.h"
42
#include "MouseEvent.h"
43
#include "Page.h"
44
#include "RenderDevice.h"
45
#include "Stream.h"
46
#include <wtf/Assertions.h>
47
48
namespace WebCore {
49
50
using namespace HTMLNames;
51
52
PassRefPtr<HTMLDeviceElement> HTMLDeviceElement::create(const QualifiedName& tagName, Document* document)
53
{
54
    return adoptRef(new HTMLDeviceElement(tagName, document));
55
}
56
57
HTMLDeviceElement::HTMLDeviceElement(const QualifiedName& tagName, Document* document)
58
    : HTMLElement(tagName, document)
59
    , m_state(NotConnected)
60
    , m_controller(HTMLElement::document()->page() ? HTMLElement::document()->page()->deviceConnectionController() : 0)
61
{
62
}
63
64
HTMLDeviceElement::~HTMLDeviceElement()
65
{
66
}
67
68
bool HTMLDeviceElement::rendererIsNeeded(RenderStyle *style)
69
{
70
    return true;
71
}
72
73
RenderObject* HTMLDeviceElement::createRenderer(RenderArena* arena, RenderStyle* style)
74
{
75
    return new (arena) RenderDevice(this);
76
}
77
78
void HTMLDeviceElement::parseMappedAttribute(Attribute* attribute)
79
{
80
    if (attribute->name() == typeAttr)
81
        m_type = DeviceType(fastGetAttribute(typeAttr));
82
    else
83
        HTMLElement::parseMappedAttribute(attribute);
84
}
85
86
void HTMLDeviceElement::attach()
87
{
88
    HTMLElement::attach();
89
90
    // Create a new local device connection object for the current type.
91
    m_connectionId = m_controller->registerDeviceConnection(
92
          DeviceConnection(m_type, DeviceConnectionId::Local, document()->securityOrigin()),
93
          this);
94
95
    // The call to updateFromElement() needs to go after the call through
96
    // to the base class's attach() because that can sometimes do a close
97
    // on the renderer.
98
    if (renderer())
99
        renderer()->updateFromElement();
100
}
101
102
void HTMLDeviceElement::detach()
103
{
104
    // Spec question: should we close any active local device connections when the device element
105
    // used to create them is detached from the DOM? There may be nothing else associated with the
106
    // connection that could ask to close it, leaving the connection open until failure.
107
    if (m_controller) {
108
        if (connection()->state() == DeviceConnection::Connected)
109
            m_controller->disconnectDevice(m_connectionId);
110
111
        if (!m_connectionId.isNull())
112
            m_controller->unregisterConnectionListener(m_connectionId, this);
113
    }
114
115
    HTMLElement::detach();
116
}
117
118
void HTMLDeviceElement::setType(const String& type)
119
{
120
    DeviceType m_previousType = m_type;
121
    m_type = DeviceType(type);
122
123
    if (m_type.id() != m_previousType.id())
124
        closeAndResetConnection();
125
}
126
127
PassRefPtr<Stream> HTMLDeviceElement::data()
128
{
129
    if (!m_controller)
130
        return 0;
131
132
    // JS binding should make this assertion always true.
133
    ASSERT(connection()->state() == DeviceConnection::Connected);
134
    return connection()->stream();
135
}
136
137
HTMLDeviceElement::DeviceElementState HTMLDeviceElement::state() const
138
{
139
    return m_state;
140
}
141
142
const DeviceType& HTMLDeviceElement::deviceType() const
143
{
144
    return m_type;
145
}
146
147
const DeviceConnection* HTMLDeviceElement::connection() const
148
{
149
    if (!m_controller)
150
        return 0;
151
152
    ASSERT(m_controller);
153
    return &m_controller->connection(m_connectionId);
154
}
155
156
void HTMLDeviceElement::setState(DeviceElementState state)
157
{
158
    if (m_state != state) {
159
        m_state = state;
160
161
        if (renderer())
162
            renderer()->updateFromElement();
163
164
        shadowAncestorNode()->renderer()->repaint();
165
    }
166
}
167
168
void HTMLDeviceElement::closeAndResetConnection()
169
{
170
    if (m_controller && m_state == Connected) {
171
        // If the connection is in the Connected state then we are disconnecting.
172
        // If not then we are resetting a closed, cancelled or failed connection.
173
        if (connection()->state() == DeviceConnection::Connected)
174
            m_controller->disconnectDevice(m_connectionId);
175
176
       // Remove the listener to the current connection. This should destroy any non-active local device connection.
177
       // The active connections will be destroyed when the connection is updated to the closed state.
178
        if (!m_connectionId.isNull())
179
            m_controller->unregisterConnectionListener(m_connectionId, this);
180
181
        // Associate the element to a new local device connection object in the NoConnection state.
182
        m_connectionId = m_controller->registerDeviceConnection(
183
            DeviceConnection(m_type, DeviceConnectionId::Local, document()->securityOrigin()), this);
184
185
        setState(NotConnected);
186
    }
187
}
188
189
void HTMLDeviceElement::defaultEventHandler(Event* event)
190
{
191
    if (!m_controller)
192
        return;
193
194
    // Ignore events from invalid device elements.
195
    if (!m_type.isValid())
196
        return;
197
198
    // For security reasons, only allow clicks directly coming from the user.
199
    if (!event->fromUserGesture()) {
200
        HTMLElement::defaultEventHandler(event);
201
        return;
202
    }
203
204
    if (event->type() == eventNames().clickEvent) {
205
        switch (m_state) {
206
        case NotConnected:
207
            ASSERT(connection()->state() == DeviceConnection::NotConnected);
208
            if (m_controller->connectToLocalDevice(m_connectionId))
209
                setState(Connecting);
210
            break;
211
212
        case Connected:
213
            ASSERT(connection()->state() == DeviceConnection::Connected);
214
            m_controller->disconnectDevice(m_connectionId);
215
            setState(Disconnecting);
216
            break;
217
218
        case Connecting:
219
        case Disconnecting:
220
            // Nothing to do here, wait for some device connection update notification.
221
            break;
222
223
        default:
224
            // Invalid device element state value.
225
            ASSERT_NOT_REACHED();
226
        }
227
        event->setDefaultHandled();
228
    }
229
230
    if (!event->defaultHandled())
231
        HTMLElement::defaultEventHandler(event);
232
}
233
234
void HTMLDeviceElement::deviceConnectionUpdate(const DeviceConnection& connection)
235
{
236
    switch (connection.state()) {
237
    case DeviceConnection::NotConnected:
238
        ASSERT_NOT_REACHED();
239
        break;
240
241
    case DeviceConnection::Connected:
242
        ASSERT(m_state == Connecting);
243
        setState(Connected);
244
245
        // FIXME: dispatching the event only when a device is connected ignoring other situations.
246
        //        Update this as the specification evolves (see failed case below).
247
        dispatchEvent(Event::create(eventNames().changeEvent, true, false));
248
        break;
249
250
    case DeviceConnection::Cancelled:
251
        ASSERT(m_state == Connecting);
252
        closeAndResetConnection();
253
        break;
254
255
    case DeviceConnection::Failed:
256
        ASSERT(m_state != NotConnected);
257
        // FIXME: how should we report the error to the user? Specification doesn't mention this.
258
        // Should we launch an onError event?
259
        closeAndResetConnection();
260
        break;
261
262
    case DeviceConnection::Disconnected:
263
        ASSERT(m_state == Connected || m_state == Disconnecting);
264
        // FIXME: should we dispatch another onchange event?
265
        closeAndResetConnection();
266
        break;
267
268
    default:
269
        // Invalid device connection state value.
270
        ASSERT_NOT_REACHED();
271
    }
272
273
}
274
275
void HTMLDeviceElement::connectionControllerShutdown()
276
{
277
    m_connectionId.reset();
278
    m_controller = 0;
279
    setState(NotConnected);
280
}
281
282
HTMLDeviceElement* toHTMLDeviceElement(Element* element)
283
{
284
    if (element->isHTMLElement() && element->hasTagName(HTMLNames::deviceTag))
285
        return static_cast<HTMLDeviceElement*>(element);
286
287
    return 0;
288
}
289
290
} // namespace WebCore
291
292
#endif // ENABLE(DEVICE_ELEMENT)
- a/Source/WebCore/html/HTMLDeviceElement.h +99 lines
Line 0 a/Source/WebCore/html/HTMLDeviceElement.h_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
#ifndef HTMLDeviceElement_h
32
#define HTMLDeviceElement_h
33
34
#if ENABLE(DEVICE_ELEMENT)
35
36
#include "DeviceConnectionController.h"
37
#include "DeviceConnectionId.h"
38
#include "DeviceElement.h"
39
#include "HTMLElement.h"
40
#include <wtf/Forward.h>
41
#include <wtf/PassRefPtr.h>
42
43
namespace WebCore {
44
45
class DeviceType;
46
class Stream;
47
48
class HTMLDeviceElement : public HTMLElement,
49
                          public DeviceElement,
50
                          public DeviceConnectionController::ConnectionListener {
51
public:
52
    enum DeviceElementState {
53
        NotConnected = 0,
54
        Connecting,
55
        Connected,
56
        Disconnecting
57
    };
58
59
    static PassRefPtr<HTMLDeviceElement> create(const QualifiedName&, Document*);
60
    virtual ~HTMLDeviceElement();
61
62
    virtual void attach();
63
    virtual void detach();
64
    virtual bool rendererIsNeeded(RenderStyle*);
65
    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
66
    virtual void parseMappedAttribute(Attribute*);
67
68
    DeviceElementState state() const;
69
    const DeviceType& deviceType() const;
70
    const DeviceConnection* connection() const;
71
72
    // Implementation of virtual methods from DeviceElement.
73
    virtual void setType(const String&);
74
    virtual PassRefPtr<Stream> data();
75
76
    // DeviceConnectionController::ConnectionListener implementation.
77
    virtual void deviceConnectionUpdate(const DeviceConnection&);
78
    virtual void connectionControllerShutdown();
79
80
protected:
81
    HTMLDeviceElement(const QualifiedName&, Document*);
82
    virtual void defaultEventHandler(Event*);
83
84
private:
85
    void setState(DeviceElementState);
86
    void closeAndResetConnection();
87
88
    DeviceElementState m_state;
89
    DeviceConnectionId m_connectionId;
90
    DeviceConnectionController *m_controller;
91
};
92
93
HTMLDeviceElement* toHTMLDeviceElement(Element*);
94
95
} // namespace WebCore
96
97
#endif // ENABLE(DEVICE_ELEMENT)
98
99
#endif // HTMLDeviceElement_h
- a/Source/WebCore/html/HTMLDeviceElement.idl +39 lines
Line 0 a/Source/WebCore/html/HTMLDeviceElement.idl_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
module html {
32
33
    interface [
34
        Conditional=DEVICE_ELEMENT
35
    ] HTMLDeviceElement : HTMLElement {
36
                 attribute [ConvertNullToNullString] DOMString type;
37
        readonly attribute [CustomGetter] DOMObject data;
38
    };
39
}
- a/Source/WebCore/html/HTMLTagNames.in +1 lines
Lines 37-42 drow interfaceName=HTMLDataGridRowElement, conditional=DATAGRID a/Source/WebCore/html/HTMLTagNames.in_sec1
37
dd interfaceName=HTMLElement
37
dd interfaceName=HTMLElement
38
del interfaceName=HTMLModElement
38
del interfaceName=HTMLModElement
39
details
39
details
40
device interfaceName=HTMLDeviceElement, conditional=DEVICE_ELEMENT
40
dfn interfaceName=HTMLElement
41
dfn interfaceName=HTMLElement
41
dir interfaceName=HTMLDirectoryElement
42
dir interfaceName=HTMLDirectoryElement
42
div
43
div
- a/Source/WebCore/page/DOMWindow.idl +1 lines
Lines 427-432 module window { a/Source/WebCore/page/DOMWindow.idl_sec1
427
        attribute [Conditional=DATAGRID] HTMLDataGridElementConstructor HTMLDataGridElement;
427
        attribute [Conditional=DATAGRID] HTMLDataGridElementConstructor HTMLDataGridElement;
428
        attribute [Conditional=DATAGRID] HTMLDataGridCellElementConstructor HTMLDataGridCellElement;
428
        attribute [Conditional=DATAGRID] HTMLDataGridCellElementConstructor HTMLDataGridCellElement;
429
        attribute [Conditional=DATAGRID] HTMLDataGridColElementConstructor HTMLDataGridColElement;
429
        attribute [Conditional=DATAGRID] HTMLDataGridColElementConstructor HTMLDataGridColElement;
430
        attribute [Conditional=DEVICE_ELEMENT] HTMLDeviceElementConstructor HTMLDeviceElement;
430
        attribute HTMLDListElementConstructor HTMLDListElement;
431
        attribute HTMLDListElementConstructor HTMLDListElement;
431
        attribute HTMLDirectoryElementConstructor HTMLDirectoryElement;
432
        attribute HTMLDirectoryElementConstructor HTMLDirectoryElement;
432
        attribute HTMLDivElementConstructor HTMLDivElement;
433
        attribute HTMLDivElementConstructor HTMLDivElement;
- a/Source/WebCore/page/DeviceClient.h +75 lines
Line 0 a/Source/WebCore/page/DeviceClient.h_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
#ifndef DeviceClient_h
32
#define DeviceClient_h
33
34
#if ENABLE(DEVICE_ELEMENT)
35
36
#include <wtf/Forward.h>
37
38
namespace WebCore {
39
40
class DeviceConnection;
41
class DeviceListener;
42
class DeviceType;
43
class SecurityOrigin;
44
45
class DeviceClient {
46
public:
47
    // ----- Connection-related methods ----- //
48
49
    // Register the listener for receiving callbacks. Should set to null when not required anymore. No ownership is taken.
50
    // Under normal circumstances the listener should be the page DeviceConnectionController object.
51
    virtual void setListener(DeviceListener*) = 0;
52
53
    // Request device selection and connection to the client.
54
    virtual bool connectToLocalDevice(const DeviceConnection&) = 0;
55
56
    // Close a currently enabled device connection.
57
    virtual void disconnectDevice(const DeviceConnection&) = 0;
58
59
    // ----- Media-related methods ----- //
60
61
    // Request to start recording an existing stream to a file.
62
    virtual bool recordStreamToFile(int mediaListenerId, const DeviceConnection&) = 0;
63
64
    // Stop recording a stream to a file.
65
    virtual void stopRecordingStream(int mediaListenerId, const DeviceConnection&, const String& path) = 0;
66
67
protected:
68
    virtual ~DeviceClient() { }
69
};
70
71
} // namespace WebCore
72
73
#endif // ENABLE(DEVICE_ELEMENT)
74
75
#endif // DeviceClient_h
- a/Source/WebCore/page/DeviceConnection.h +149 lines
Line 0 a/Source/WebCore/page/DeviceConnection.h_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
#ifndef DeviceConnection_h
32
#define DeviceConnection_h
33
34
#if ENABLE(DEVICE_ELEMENT)
35
36
#include "DeviceConnectionId.h"
37
#include "DeviceType.h"
38
#include "KURL.h"
39
#include "PlatformString.h"
40
#include "SecurityOrigin.h"
41
#include "Stream.h"
42
#include <wtf/Forward.h>
43
#include <wtf/Vector.h>
44
45
namespace WebCore {
46
47
class DeviceConnectionInfo {
48
public:
49
    // No error value for error codes.
50
    // FIXME: this could be made an enum including values for basic error situations and leaving values for vendor-specific errors.
51
    static const int NoError = 0;
52
53
    DeviceConnectionInfo() : m_subtype(DeviceType::None), m_errorCode(NoError) { }
54
55
    DeviceConnectionInfo(const DeviceType::SubtypeId& subtype, const String& name, const String& id, int errorCode, const String& errorMessage)
56
        : m_subtype(subtype)
57
        , m_name(name)
58
        , m_id(id)
59
        , m_errorCode(errorCode)
60
        , m_errorMessage(errorMessage)
61
    {
62
    }
63
64
    DeviceType::SubtypeId subtype() const { return m_subtype; }
65
    const String& name() const { return m_name; }
66
    const String& id() const { return m_id; }
67
    int errorCode() const { return m_errorCode; }
68
    const String& errorMessage() const { return m_errorMessage; }
69
70
private:
71
    DeviceType::SubtypeId m_subtype;
72
    String m_name;
73
    String m_id;
74
    int m_errorCode;
75
    String m_errorMessage;
76
};
77
78
class DeviceConnection {
79
public:
80
    enum DeviceConnectionState {
81
        NotConnected = 0, // Object not associated with any connection (initialization state).
82
        Connected, // Device connected successfully.
83
        Cancelled, // Device selection/connection cancelled by the user.
84
        Failed, // Error connecting the device or during connection.
85
        Disconnected, // Connection legitimately closed.
86
    };
87
88
    DeviceConnection()
89
        : m_state(NotConnected)
90
    {
91
    }
92
93
    DeviceConnection(const DeviceType& deviceType,
94
                     DeviceConnectionId::ConnectionType connectionType,
95
                     PassRefPtr<SecurityOrigin> origin)
96
        : m_id(DeviceConnectionId(0, connectionType))
97
        , m_type(deviceType)
98
        , m_state(NotConnected)
99
        , m_origin(origin)
100
    {
101
    }
102
103
    DeviceConnection(const DeviceConnectionId& id,
104
                     const DeviceType& type,
105
                     DeviceConnectionState state,
106
                     const Vector<DeviceConnectionInfo>& devices,
107
                     PassRefPtr<SecurityOrigin> origin,
108
                     const KURL& streamUrl)
109
        : m_id(id)
110
        , m_type(type)
111
        , m_state(state)
112
        , m_devices(devices)
113
        , m_origin(origin)
114
        , m_streamUrl(streamUrl)
115
    { }
116
117
    const DeviceConnectionId& id() const { return m_id; }
118
    const DeviceType& type() const { return m_type; }
119
    DeviceConnectionState state() const { return m_state; }
120
    const Vector<DeviceConnectionInfo>& devices() const { return m_devices; }
121
    PassRefPtr<SecurityOrigin> origin() const { return m_origin; }
122
123
    bool isLocal() const { return m_id.type() == DeviceConnectionId::Local; }
124
    bool isRemote() const { return m_id.type() == DeviceConnectionId::Remote; }
125
126
    // FIXME: move the type-specific methods to a separate class and make this type independent.
127
    PassRefPtr<Stream> stream() const { return m_stream; }
128
    const KURL& streamUrl() const { return m_streamUrl; }
129
130
private:
131
    friend class DeviceConnectionController;
132
    DeviceConnectionId& mutableId() { return m_id; }
133
134
    DeviceConnectionId m_id;
135
    DeviceType m_type;
136
    DeviceConnectionState m_state;
137
    Vector<DeviceConnectionInfo> m_devices;
138
    RefPtr<SecurityOrigin> m_origin;
139
140
    // FIXME: move the type-specific data to a separate class and make this type independent.
141
    RefPtr<Stream> m_stream;
142
    KURL m_streamUrl;
143
};
144
145
} // namespace WebCore
146
147
#endif // ENABLE(DEVICE_ELEMENT)
148
149
#endif // DeviceConnection_h
- a/Source/WebCore/page/DeviceConnectionController.cpp +227 lines
Line 0 a/Source/WebCore/page/DeviceConnectionController.cpp_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
#include "config.h"
32
#include "DeviceConnectionController.h"
33
34
#include "DeviceClient.h"
35
#include "DeviceConnection.h"
36
#include "DeviceType.h"
37
38
#if ENABLE(DEVICE_ELEMENT)
39
40
namespace WebCore {
41
42
DeviceConnectionController::DeviceConnectionController(DeviceClient* client)
43
    : m_client(client)
44
    , m_nextLocalDeviceConnectionId(1)
45
    , m_nextMediaListenerId(1)
46
{
47
    // FIXME: enable this when the client is ready.
48
    // m_client->setListener(this);
49
}
50
51
DeviceConnectionController::~DeviceConnectionController()
52
{
53
    // FIXME: enable this when the client is ready.
54
    // m_client->setListener(0);
55
56
    for (ConnectionListenersMap::iterator listeners = m_connectionListeners.begin(); listeners != m_connectionListeners.end(); ++listeners) {
57
        for (ConnectionListenerSet::iterator listener = listeners->second->begin(); listener != listeners->second->end(); ++listener)
58
            (*listener)->connectionControllerShutdown();
59
60
        delete listeners->second;
61
    }
62
63
    for (DeviceConnectionMap::iterator connection = m_deviceConnections.begin(); connection != m_deviceConnections.end(); ++connection) {
64
        if (connection->second->state() == DeviceConnection::Connected)
65
            disconnectDevice(connection->second->id());
66
67
        delete connection->second;
68
    }
69
}
70
71
DeviceConnectionId DeviceConnectionController::registerDeviceConnection(const DeviceConnection& connection, ConnectionListener* listener)
72
{
73
    DeviceConnection* newConnection = new DeviceConnection(connection);
74
75
    switch (connection.id().type()) {
76
    case DeviceConnectionId::Local:
77
        // Local device connection ids should be assigned by this method.
78
        ASSERT(!newConnection->id().id());
79
        newConnection->mutableId().m_id = m_nextLocalDeviceConnectionId;
80
        ++m_nextLocalDeviceConnectionId;
81
        break;
82
83
    case DeviceConnectionId::Remote:
84
        // Remote device connection ids should be already assigned by the ConnectionPeer API.
85
        ASSERT(newConnection->id().id());
86
        break;
87
88
    default:
89
        ASSERT_NOT_REACHED();
90
    }
91
92
    ASSERT(!m_deviceConnections.contains(newConnection->id()));
93
    m_deviceConnections.set(newConnection->id(), newConnection);
94
95
    ASSERT(!m_connectionListeners.contains(newConnection->id()));
96
    m_connectionListeners.set(newConnection->id(), new HashSet<ConnectionListener*>);
97
98
    ASSERT(!m_connectionListeners.get(newConnection->id())->contains(listener));
99
    m_connectionListeners.get(newConnection->id())->add(listener);
100
101
    return newConnection->id();
102
}
103
104
void DeviceConnectionController::registerConnectionListener(const DeviceConnectionId& id, ConnectionListener* listener)
105
{
106
    ASSERT(!id.isNull());
107
    ASSERT(m_deviceConnections.contains(id));
108
    ASSERT(m_connectionListeners.contains(id));
109
    ASSERT(!m_connectionListeners.get(id)->contains(listener));
110
111
    m_connectionListeners.get(id)->add(listener);
112
}
113
114
void DeviceConnectionController::unregisterConnectionListener(const DeviceConnectionId& id, ConnectionListener* listener)
115
{
116
    ASSERT(!id.isNull());
117
    ASSERT(m_deviceConnections.contains(id));
118
    ASSERT(m_connectionListeners.contains(id));
119
    ASSERT(m_connectionListeners.get(id)->contains(listener));
120
121
    m_connectionListeners.get(id)->remove(listener);
122
    if (m_connectionListeners.get(id)->isEmpty()) {
123
        delete m_connectionListeners.take(id);
124
        delete m_deviceConnections.take(id);
125
    }
126
}
127
128
int DeviceConnectionController::registerMediaListener(MediaListener* listener)
129
{
130
#if defined(DEBUG)
131
    // Check if already present.
132
    for (MediaListenerMap::iterator it = m_mediaListeners.begin(); it != m_mediaListeners.end(); ++it)
133
        ASSERT(it->second != listener);
134
#endif
135
136
    m_mediaListeners.add(m_nextMediaListenerId, listener);
137
    return m_nextMediaListenerId++;
138
}
139
140
void DeviceConnectionController::unregisterMediaListener(int mediaListenerId)
141
{
142
    ASSERT(mediaListenerId);
143
    ASSERT(m_mediaListeners.contains(mediaListenerId));
144
    m_mediaListeners.remove(mediaListenerId);
145
}
146
147
const DeviceConnection& DeviceConnectionController::connection(const DeviceConnectionId& id) const
148
{
149
    ASSERT(!id.isNull());
150
    ASSERT(m_deviceConnections.contains(id));
151
    return *m_deviceConnections.get(id);
152
}
153
154
DeviceConnection& DeviceConnectionController::mutableConnection(const DeviceConnectionId& id)
155
{
156
    ASSERT(!id.isNull());
157
    ASSERT(m_deviceConnections.contains(id));
158
    return *m_deviceConnections.get(id);
159
}
160
161
bool DeviceConnectionController::isConnectionIdValid(const DeviceConnectionId& id) const
162
{
163
    if (id.isNull() || id.type() == DeviceConnectionId::None)
164
        return false;
165
166
    return m_deviceConnections.contains(id);
167
}
168
169
bool DeviceConnectionController::connectToLocalDevice(const DeviceConnectionId& id)
170
{
171
    return m_client->connectToLocalDevice(connection(id));
172
}
173
174
void DeviceConnectionController::disconnectDevice(const DeviceConnectionId& id)
175
{
176
    return m_client->disconnectDevice(connection(id));
177
}
178
179
void DeviceConnectionController::deviceConnectionUpdate(const DeviceConnection& connection)
180
{
181
    // Don't assert if not present as the connection might have been destroyed (by deleting all its listeners)
182
    // while this event was on its way.
183
    if (m_connectionListeners.contains(connection.id())) {
184
185
        if (connection.state() == DeviceConnection::Connected) {
186
            switch (connection.type().id()) {
187
            case DeviceType::Media:
188
                mutableConnection(connection.id()).m_stream = Stream::create(this, connection.id(), connection.streamUrl());
189
                break;
190
191
            // Create here more type-specific objects representing active connections for other device types if necessary.
192
            default:
193
                break;
194
            }
195
        }
196
197
        const ConnectionListenerSet *listeners = m_connectionListeners.get(connection.id());
198
        for (ConnectionListenerSet::iterator it = listeners->begin(); it != listeners->end(); ++it)
199
            (*it)->deviceConnectionUpdate(connection);
200
    }
201
}
202
203
bool DeviceConnectionController::recordStreamToFile(int mediaListenerId, const DeviceConnectionId& connectionId)
204
{
205
    ASSERT(mediaListenerId);
206
    ASSERT(m_mediaListeners.contains(mediaListenerId));
207
    return m_client->recordStreamToFile(mediaListenerId, connection(connectionId));
208
}
209
210
void DeviceConnectionController::stopRecordingStream(int mediaListenerId, const DeviceConnectionId& connectionId, const String& path)
211
{
212
    ASSERT(mediaListenerId);
213
    ASSERT(m_mediaListeners.contains(mediaListenerId));
214
    return m_client->stopRecordingStream(mediaListenerId, connection(connectionId), path);
215
}
216
217
void DeviceConnectionController::streamRecordingStarted(int mediaListenerId, const String& path)
218
{
219
    // Don't assert if not present as the listener might have been removed while this event was on its way.
220
    ASSERT(mediaListenerId);
221
    if (m_mediaListeners.contains(mediaListenerId))
222
        m_mediaListeners.get(mediaListenerId)->streamRecordingStarted(mediaListenerId, path);
223
}
224
225
} // namespace WebCore
226
227
#endif // ENABLE(DEVICE_ELEMENT)
- a/Source/WebCore/page/DeviceConnectionController.h +142 lines
Line 0 a/Source/WebCore/page/DeviceConnectionController.h_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
#ifndef DeviceConnectionController_h
32
#define DeviceConnectionController_h
33
34
#if ENABLE(DEVICE_ELEMENT)
35
36
#include "DeviceConnectionId.h"
37
#include "DeviceListener.h"
38
#include <wtf/Forward.h>
39
#include <wtf/HashMap.h>
40
#include <wtf/HashSet.h>
41
#include <wtf/Noncopyable.h>
42
43
namespace WebCore {
44
45
class DeviceClient;
46
class DeviceConnection;
47
class DeviceType;
48
class SecurityOrigin;
49
50
class DeviceConnectionController : public DeviceListener {
51
    WTF_MAKE_NONCOPYABLE(DeviceConnectionController);
52
public:
53
    DeviceConnectionController(DeviceClient*);
54
    virtual ~DeviceConnectionController();
55
56
    // Connection management. Many listeners can register to recieve status updates for a connection.
57
58
    class ConnectionListener {
59
    public:
60
        virtual ~ConnectionListener() { }
61
62
        // Reports an update in the state of a device connection.
63
        virtual void deviceConnectionUpdate(const DeviceConnection&) = 0;
64
65
        // Connection controller shutting down. Listeners should invalidate any connection ids and assume
66
        // to be unregistered for device connections. Any active connections will be automatically closed.
67
        virtual void connectionControllerShutdown() = 0;
68
    };
69
70
    // Create a new device connection associated with the listener and return its device connection id.
71
    // The id element of the connection id tuple will be managed by this object for local device connections.
72
    // For remote device connections, a valid id value is assumed to be already present and managed by the ConnectionPeerClient.
73
    DeviceConnectionId registerDeviceConnection(const DeviceConnection&, ConnectionListener*);
74
75
    // Register a new listener to the status updates of an existing connection.
76
    void registerConnectionListener(const DeviceConnectionId&, ConnectionListener*);
77
78
    // Unregister a listener of a existing connection.
79
    // The connection object will be destroyed if all listeners are unregistered. Any active connection will be closed.
80
    // Note: in the case of media, it should be kept alive by its own stream object until the connection to the device is either
81
    // properly closed or fails. In that case the stream will unregister itself as listener when receiving deviceConnectionUpdate.
82
    void unregisterConnectionListener(const DeviceConnectionId&, ConnectionListener*);
83
84
85
    // Media listening. Message replies are received by the same object that made the requests.
86
87
    class MediaListener {
88
    public:
89
        virtual ~MediaListener() { }
90
91
        // Notifies that a stream recording has started and its being recorded into a specified file.
92
        virtual void streamRecordingStarted(int mediaListenerId, const String& path) = 0;
93
    };
94
95
    // Register a new media listener and return a unique ID for it.
96
    int registerMediaListener(MediaListener*);
97
98
    // Unregister a media listener.
99
    void unregisterMediaListener(int mediaListenerId);
100
101
102
    // Controller methods.
103
104
    // Provides the device connection object associated with an id.
105
    const DeviceConnection& connection(const DeviceConnectionId&) const;
106
    bool isConnectionIdValid(const DeviceConnectionId&) const;
107
108
    // Request to establish an active connection with a local device of the specified type.
109
    bool connectToLocalDevice(const DeviceConnectionId&);
110
111
    // Request to close an active device connection, either local or remote.
112
    void disconnectDevice(const DeviceConnectionId&);
113
114
    // Methods invoked by the media listeners.
115
    bool recordStreamToFile(int mediaListenerId, const DeviceConnectionId&);
116
    void stopRecordingStream(int mediaListenerId, const DeviceConnectionId&, const String& path);
117
118
    // DeviceListener implementation.
119
    virtual void deviceConnectionUpdate(const DeviceConnection&);
120
    virtual void streamRecordingStarted(int mediaListenerId, const String& path);
121
122
private:
123
    typedef HashSet<ConnectionListener*> ConnectionListenerSet;
124
    typedef HashMap<DeviceConnectionId, DeviceConnection*> DeviceConnectionMap;
125
    typedef HashMap<DeviceConnectionId, ConnectionListenerSet*> ConnectionListenersMap;
126
    typedef HashMap<int, MediaListener*> MediaListenerMap;
127
128
    DeviceConnection& mutableConnection(const DeviceConnectionId&);
129
130
    DeviceClient* m_client;
131
    DeviceConnectionMap m_deviceConnections;
132
    ConnectionListenersMap m_connectionListeners;
133
    MediaListenerMap m_mediaListeners;
134
    int m_nextLocalDeviceConnectionId;
135
    int m_nextMediaListenerId;
136
};
137
138
} // namespace WebCore
139
140
#endif // ENABLE(DEVICE_ELEMENT)
141
142
#endif // DeviceConnectionController_h
- a/Source/WebCore/page/DeviceListener.h +59 lines
Line 0 a/Source/WebCore/page/DeviceListener.h_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
#ifndef DeviceListener_h
32
#define DeviceListener_h
33
34
#if ENABLE(DEVICE_ELEMENT)
35
36
#include "PlatformString.h"
37
38
namespace WebCore {
39
40
class DeviceConnection;
41
42
// This interface composes the different kinds of incoming messages so that they can
43
// be implemented by both the DeviceController and the DeviceClientMock.
44
class DeviceListener  {
45
public:
46
    virtual ~DeviceListener() { }
47
48
    // Reports an update in the state of a device connection.
49
    virtual void deviceConnectionUpdate(const DeviceConnection&) = 0;
50
51
    // Notifies that a stream recording has started and its being recorded into a specified file.
52
    virtual void streamRecordingStarted(int mediaListenerId, const String& path) = 0;
53
};
54
55
} // namespace WebCore
56
57
#endif // ENABLE(DEVICE_ELEMENT)
58
59
#endif // DeviceListener_h
- a/Source/WebCore/page/Page.cpp -1 / +16 lines
Lines 29-34 a/Source/WebCore/page/Page.cpp_sec1
29
#include "ContextMenuClient.h"
29
#include "ContextMenuClient.h"
30
#include "ContextMenuController.h"
30
#include "ContextMenuController.h"
31
#include "DOMWindow.h"
31
#include "DOMWindow.h"
32
#include "DeviceClient.h"
33
#include "DeviceConnectionController.h"
32
#include "DeviceMotionController.h"
34
#include "DeviceMotionController.h"
33
#include "DeviceOrientationController.h"
35
#include "DeviceOrientationController.h"
34
#include "DocumentMarkerController.h"
36
#include "DocumentMarkerController.h"
Lines 139-144 Page::Page(const PageClients& pageClients) a/Source/WebCore/page/Page.cpp_sec2
139
#if ENABLE(INPUT_SPEECH)
141
#if ENABLE(INPUT_SPEECH)
140
    , m_speechInputClient(pageClients.speechInputClient)
142
    , m_speechInputClient(pageClients.speechInputClient)
141
#endif
143
#endif
144
#if ENABLE(DEVICE_ELEMENT)
145
    , m_deviceClient(pageClients.deviceClient)
146
#endif
142
    , m_settings(adoptPtr(new Settings(this)))
147
    , m_settings(adoptPtr(new Settings(this)))
143
    , m_progress(adoptPtr(new ProgressTracker))
148
    , m_progress(adoptPtr(new ProgressTracker))
144
    , m_backForwardController(adoptPtr(new BackForwardController(this, pageClients.backForwardClient)))
149
    , m_backForwardController(adoptPtr(new BackForwardController(this, pageClients.backForwardClient)))
Lines 164-170 Page::Page(const PageClients& pageClients) a/Source/WebCore/page/Page.cpp_sec3
164
{
169
{
165
    if (!allPages) {
170
    if (!allPages) {
166
        allPages = new HashSet<Page*>;
171
        allPages = new HashSet<Page*>;
167
        
172
168
        networkStateNotifier().setNetworkStateChangedFunction(networkStateChanged);
173
        networkStateNotifier().setNetworkStateChangedFunction(networkStateChanged);
169
    }
174
    }
170
175
Lines 842-847 SpeechInput* Page::speechInput() a/Source/WebCore/page/Page.cpp_sec4
842
}
847
}
843
#endif
848
#endif
844
849
850
#if ENABLE(DEVICE_ELEMENT)
851
DeviceConnectionController* Page::deviceConnectionController()
852
{
853
    ASSERT(m_deviceClient);
854
    if (!m_deviceConnectionController.get())
855
        m_deviceConnectionController.set(new DeviceConnectionController(m_deviceClient));
856
    return m_deviceConnectionController.get();
857
}
858
#endif
859
845
void Page::dnsPrefetchingStateChanged()
860
void Page::dnsPrefetchingStateChanged()
846
{
861
{
847
    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
862
    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
- a/Source/WebCore/page/Page.h -3 / +13 lines
Lines 75-80 namespace WebCore { a/Source/WebCore/page/Page.h_sec1
75
    class SharedGraphicsContext3D;
75
    class SharedGraphicsContext3D;
76
    class SpeechInput;
76
    class SpeechInput;
77
    class SpeechInputClient;
77
    class SpeechInputClient;
78
    class DeviceClient;
79
    class DeviceConnectionController;
78
80
79
#if ENABLE(DOM_STORAGE)
81
#if ENABLE(DOM_STORAGE)
80
    class StorageNamespace;
82
    class StorageNamespace;
Lines 113-118 namespace WebCore { a/Source/WebCore/page/Page.h_sec2
113
            DeviceOrientationClient* deviceOrientationClient;
115
            DeviceOrientationClient* deviceOrientationClient;
114
            RefPtr<BackForwardList> backForwardClient;
116
            RefPtr<BackForwardList> backForwardClient;
115
            SpeechInputClient* speechInputClient;
117
            SpeechInputClient* speechInputClient;
118
            DeviceClient* deviceClient;
116
        };
119
        };
117
120
118
        Page(const PageClients&);
121
        Page(const PageClients&);
Lines 182-187 namespace WebCore { a/Source/WebCore/page/Page.h_sec3
182
#if ENABLE(INPUT_SPEECH)
185
#if ENABLE(INPUT_SPEECH)
183
        SpeechInput* speechInput();
186
        SpeechInput* speechInput();
184
#endif
187
#endif
188
#if ENABLE(DEVICE_ELEMENT)
189
        DeviceConnectionController* deviceConnectionController();
190
#endif
185
        Settings* settings() const { return m_settings.get(); }
191
        Settings* settings() const { return m_settings.get(); }
186
        ProgressTracker* progress() const { return m_progress.get(); }
192
        ProgressTracker* progress() const { return m_progress.get(); }
187
        BackForwardController* backForward() const { return m_backForwardController.get(); }
193
        BackForwardController* backForward() const { return m_backForwardController.get(); }
Lines 198-204 namespace WebCore { a/Source/WebCore/page/Page.h_sec4
198
204
199
        ViewMode viewMode() const { return m_viewMode; }
205
        ViewMode viewMode() const { return m_viewMode; }
200
        void setViewMode(ViewMode);
206
        void setViewMode(ViewMode);
201
        
207
202
        void setTabKeyCyclesThroughElements(bool b) { m_tabKeyCyclesThroughElements = b; }
208
        void setTabKeyCyclesThroughElements(bool b) { m_tabKeyCyclesThroughElements = b; }
203
        bool tabKeyCyclesThroughElements() const { return m_tabKeyCyclesThroughElements; }
209
        bool tabKeyCyclesThroughElements() const { return m_tabKeyCyclesThroughElements; }
204
210
Lines 304-310 namespace WebCore { a/Source/WebCore/page/Page.h_sec5
304
#if ENABLE(ACCELERATED_2D_CANVAS)
310
#if ENABLE(ACCELERATED_2D_CANVAS)
305
        RefPtr<SharedGraphicsContext3D> m_sharedGraphicsContext3D;
311
        RefPtr<SharedGraphicsContext3D> m_sharedGraphicsContext3D;
306
#endif
312
#endif
307
        
313
308
#if ENABLE(DRAG_SUPPORT)
314
#if ENABLE(DRAG_SUPPORT)
309
        OwnPtr<DragController> m_dragController;
315
        OwnPtr<DragController> m_dragController;
310
#endif
316
#endif
Lines 326-334 namespace WebCore { a/Source/WebCore/page/Page.h_sec6
326
        SpeechInputClient* m_speechInputClient;
332
        SpeechInputClient* m_speechInputClient;
327
        OwnPtr<SpeechInput> m_speechInput;
333
        OwnPtr<SpeechInput> m_speechInput;
328
#endif
334
#endif
335
#if ENABLE(DEVICE_ELEMENT)
336
        DeviceClient* m_deviceClient;
337
        OwnPtr<DeviceConnectionController> m_deviceConnectionController;
338
#endif
329
        OwnPtr<Settings> m_settings;
339
        OwnPtr<Settings> m_settings;
330
        OwnPtr<ProgressTracker> m_progress;
340
        OwnPtr<ProgressTracker> m_progress;
331
        
341
332
        OwnPtr<BackForwardController> m_backForwardController;
342
        OwnPtr<BackForwardController> m_backForwardController;
333
        RefPtr<Frame> m_mainFrame;
343
        RefPtr<Frame> m_mainFrame;
334
344
- a/Source/WebCore/platform/ThemeTypes.h -1 / +1 lines
Lines 47-53 typedef unsigned ControlStates; a/Source/WebCore/platform/ThemeTypes.h_sec1
47
// Must follow CSSValueKeywords.in order
47
// Must follow CSSValueKeywords.in order
48
enum ControlPart {
48
enum ControlPart {
49
    NoControlPart, CheckboxPart, RadioPart, PushButtonPart, SquareButtonPart, ButtonPart,
49
    NoControlPart, CheckboxPart, RadioPart, PushButtonPart, SquareButtonPart, ButtonPart,
50
    ButtonBevelPart, DefaultButtonPart, InnerSpinButtonPart, InputSpeechButtonPart, ListButtonPart, ListboxPart, ListItemPart,
50
    ButtonBevelPart, DefaultButtonPart, InnerSpinButtonPart, InputSpeechButtonPart, DeviceButtonPart, ListButtonPart, ListboxPart, ListItemPart,
51
    MediaFullscreenButtonPart, MediaMuteButtonPart, MediaPlayButtonPart, MediaSeekBackButtonPart, 
51
    MediaFullscreenButtonPart, MediaMuteButtonPart, MediaPlayButtonPart, MediaSeekBackButtonPart, 
52
    MediaSeekForwardButtonPart, MediaRewindButtonPart, MediaReturnToRealtimeButtonPart, MediaToggleClosedCaptionsButtonPart,
52
    MediaSeekForwardButtonPart, MediaRewindButtonPart, MediaReturnToRealtimeButtonPart, MediaToggleClosedCaptionsButtonPart,
53
    MediaSliderPart, MediaSliderThumbPart, MediaVolumeSliderContainerPart, MediaVolumeSliderPart, MediaVolumeSliderThumbPart,
53
    MediaSliderPart, MediaSliderThumbPart, MediaVolumeSliderContainerPart, MediaVolumeSliderPart, MediaVolumeSliderThumbPart,
- a/Source/WebCore/rendering/RenderDevice.cpp +151 lines
Line 0 a/Source/WebCore/rendering/RenderDevice.cpp_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
#include "config.h"
32
#include "RenderDevice.h"
33
34
#include "HTMLDeviceElement.h"
35
#include "HTMLInputElement.h"
36
#include "RenderButton.h"
37
#include "RenderTheme.h"
38
#include "ShadowElement.h"
39
40
#if ENABLE(DEVICE_ELEMENT)
41
42
using namespace std;
43
44
namespace WebCore {
45
46
RenderDevice::RenderDevice(HTMLDeviceElement* device)
47
    : RenderBlock(device)
48
{
49
}
50
51
RenderDevice::~RenderDevice()
52
{
53
    if (m_button)
54
        m_button->detach();
55
}
56
57
void RenderDevice::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
58
{
59
    RenderBlock::styleDidChange(diff, oldStyle);
60
    if (m_button)
61
        m_button->renderer()->setStyle(createButtonStyle(style()));
62
63
    setReplaced(isInline());
64
}
65
66
void RenderDevice::updateFromElement()
67
{
68
    HTMLDeviceElement* deviceElement = static_cast<HTMLDeviceElement*>(node());
69
70
    if (!m_button) {
71
        m_button = ShadowInputElement::create(deviceElement);
72
        m_button->setType("button");
73
        RefPtr<RenderStyle> buttonStyle = createButtonStyle(style());
74
        RenderObject* renderer = m_button->createRenderer(renderArena(), buttonStyle.get());
75
        m_button->setRenderer(renderer);
76
        renderer->setStyle(buttonStyle.release());
77
        renderer->updateFromElement();
78
        m_button->setAttached();
79
        m_button->setInDocument();
80
81
        addChild(renderer);
82
    }
83
84
    switch (deviceElement->state()) {
85
    case HTMLDeviceElement::NotConnected:
86
        m_button->setValue("Select device");
87
        break;
88
89
    case HTMLDeviceElement::Connecting:
90
        m_button->setValue("Connecting...");
91
        break;
92
93
    case HTMLDeviceElement::Connected:
94
        m_button->setValue("Disconnect");
95
        break;
96
97
    case HTMLDeviceElement::Disconnecting:
98
        m_button->setValue("Disconnecting...");
99
        break;
100
101
    default:
102
        ASSERT_NOT_REACHED();
103
    }
104
105
    m_button->renderer()->updateFromElement();
106
    m_button->setDisabled(!theme()->isEnabled(this));
107
}
108
109
PassRefPtr<RenderStyle> RenderDevice::createButtonStyle(const RenderStyle* parentStyle) const
110
{
111
    RefPtr<RenderStyle> style = getCachedPseudoStyle(DEVICE_BUTTON);
112
    if (!style) {
113
        style = RenderStyle::create();
114
        if (parentStyle)
115
            style->inheritFrom(parentStyle);
116
    }
117
118
    style->setWhiteSpace(NOWRAP);
119
120
    return style.release();
121
}
122
123
void RenderDevice::computePreferredLogicalWidths()
124
{
125
    ASSERT(preferredLogicalWidthsDirty());
126
127
    m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeContentBoxLogicalWidth(style()->width().value());
128
129
    if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
130
        m_maxPreferredLogicalWidth = max(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));
131
        m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->minWidth().value()));
132
    } else if (style()->width().isPercent() || (style()->width().isAuto() && style()->height().isPercent()))
133
        m_minPreferredLogicalWidth = 0;
134
    else
135
        m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth;
136
137
    if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength) {
138
        m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));
139
        m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, computeContentBoxLogicalWidth(style()->maxWidth().value()));
140
    }
141
142
    int toAdd = borderAndPaddingWidth();
143
    m_minPreferredLogicalWidth += toAdd;
144
    m_maxPreferredLogicalWidth += toAdd;
145
146
    setPreferredLogicalWidthsDirty(false);
147
}
148
149
} // namespace WebCore
150
151
#endif // ENABLE(DEVICE_ELEMENT)
- a/Source/WebCore/rendering/RenderDevice.h +77 lines
Line 0 a/Source/WebCore/rendering/RenderDevice.h_sec1
1
/*
2
 * Copyright (C) 2011 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29
 */
30
31
#ifndef RenderDevice_h
32
#define RenderDevice_h
33
34
#include "RenderBlock.h"
35
36
#if ENABLE(DEVICE_ELEMENT)
37
38
namespace WebCore {
39
40
class HTMLDeviceElement;
41
class HTMLInputElement;
42
43
class RenderDevice : public RenderBlock {
44
public:
45
    RenderDevice(HTMLDeviceElement*);
46
    virtual ~RenderDevice();
47
48
    virtual bool isDevice() const { return true; }
49
50
private:
51
    virtual const char* renderName() const { return "RenderDevice"; }
52
53
    virtual void updateFromElement();
54
    virtual void computePreferredLogicalWidths();
55
56
    virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
57
58
    virtual bool requiresForcedStyleRecalcPropagation() const { return true; }
59
60
    PassRefPtr<RenderStyle> createButtonStyle(const RenderStyle* parentStyle) const;
61
62
    RefPtr<HTMLInputElement> m_button;
63
};
64
65
inline RenderDevice* toRenderDevice(RenderObject* object)
66
{
67
    ASSERT(!object || object->isDevice());
68
    return static_cast<RenderDevice*>(object);
69
}
70
71
void toRenderDevice(const RenderDevice*);
72
73
} // namespace WebCore
74
75
#endif // ENABLE(DEVICE_ELEMENT)
76
77
#endif // RenderDevice_h
- a/Source/WebCore/rendering/RenderObject.h +3 lines
Lines 255-260 public: a/Source/WebCore/rendering/RenderObject.h_sec1
255
    virtual bool isDetails() const { return false; }
255
    virtual bool isDetails() const { return false; }
256
    virtual bool isDetailsMarker() const { return false; }
256
    virtual bool isDetailsMarker() const { return false; }
257
    virtual bool isEmbeddedObject() const { return false; }
257
    virtual bool isEmbeddedObject() const { return false; }
258
#if ENABLE(DEVICE_ELEMENT)
259
    virtual bool isDevice() const { return false; }
260
#endif
258
    virtual bool isFieldset() const { return false; }
261
    virtual bool isFieldset() const { return false; }
259
    virtual bool isFileUploadControl() const { return false; }
262
    virtual bool isFileUploadControl() const { return false; }
260
    virtual bool isFrame() const { return false; }
263
    virtual bool isFrame() const { return false; }
- a/Source/WebCore/rendering/RenderTheme.cpp +14 lines
Lines 237-242 void RenderTheme::adjustStyle(CSSStyleSelector* selector, RenderStyle* style, El a/Source/WebCore/rendering/RenderTheme.cpp_sec1
237
        case InputSpeechButtonPart:
237
        case InputSpeechButtonPart:
238
            return adjustInputFieldSpeechButtonStyle(selector, style, e);
238
            return adjustInputFieldSpeechButtonStyle(selector, style, e);
239
#endif
239
#endif
240
#if ENABLE(DEVICE_ELEMENT)
241
        case DeviceButtonPart:
242
        // FIXME: adjust device button style and sizes.
243
#endif
240
        default:
244
        default:
241
            break;
245
            break;
242
    }
246
    }
Lines 373-378 bool RenderTheme::paint(RenderObject* o, const PaintInfo& paintInfo, const IntRe a/Source/WebCore/rendering/RenderTheme.cpp_sec2
373
        case InputSpeechButtonPart:
377
        case InputSpeechButtonPart:
374
            return paintInputFieldSpeechButton(o, paintInfo, r);
378
            return paintInputFieldSpeechButton(o, paintInfo, r);
375
#endif
379
#endif
380
#if ENABLE(DEVICE_ELEMENT)
381
        case DeviceButtonPart:
382
        // FIXME: add painting code to draw the device button.
383
#endif
376
        default:
384
        default:
377
            break;
385
            break;
378
    }
386
    }
Lines 424-429 bool RenderTheme::paintBorderOnly(RenderObject* o, const PaintInfo& paintInfo, c a/Source/WebCore/rendering/RenderTheme.cpp_sec3
424
#if ENABLE(INPUT_SPEECH)
432
#if ENABLE(INPUT_SPEECH)
425
        case InputSpeechButtonPart:
433
        case InputSpeechButtonPart:
426
#endif
434
#endif
435
#if ENABLE(DEVICE_ELEMENT)
436
        case DeviceButtonPart:
437
#endif
427
        default:
438
        default:
428
            break;
439
            break;
429
    }
440
    }
Lines 473-478 bool RenderTheme::paintDecorations(RenderObject* o, const PaintInfo& paintInfo, a/Source/WebCore/rendering/RenderTheme.cpp_sec4
473
#if ENABLE(INPUT_SPEECH)
484
#if ENABLE(INPUT_SPEECH)
474
        case InputSpeechButtonPart:
485
        case InputSpeechButtonPart:
475
#endif
486
#endif
487
#if ENABLE(DEVICE_ELEMENT)
488
        case DeviceButtonPart:
489
#endif
476
        default:
490
        default:
477
            break;
491
            break;
478
    }
492
    }
- a/Source/WebCore/rendering/style/RenderStyleConstants.h -1 / +1 lines
Lines 73-79 enum PseudoId { a/Source/WebCore/rendering/style/RenderStyleConstants.h_sec1
73
    MEDIA_CONTROLS_STATUS_DISPLAY, SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER,
73
    MEDIA_CONTROLS_STATUS_DISPLAY, SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER,
74
    INPUT_LIST_BUTTON, INPUT_SPEECH_BUTTON, INNER_SPIN_BUTTON, OUTER_SPIN_BUTTON, VISITED_LINK,
74
    INPUT_LIST_BUTTON, INPUT_SPEECH_BUTTON, INNER_SPIN_BUTTON, OUTER_SPIN_BUTTON, VISITED_LINK,
75
    METER_HORIZONTAL_BAR, METER_HORIZONTAL_OPTIMUM, METER_HORIZONTAL_SUBOPTIMAL, METER_HORIZONTAL_EVEN_LESS_GOOD,
75
    METER_HORIZONTAL_BAR, METER_HORIZONTAL_OPTIMUM, METER_HORIZONTAL_SUBOPTIMAL, METER_HORIZONTAL_EVEN_LESS_GOOD,
76
    METER_VERTICAL_BAR, METER_VERTICAL_OPTIMUM, METER_VERTICAL_SUBOPTIMAL, METER_VERTICAL_EVEN_LESS_GOOD, 
76
    METER_VERTICAL_BAR, METER_VERTICAL_OPTIMUM, METER_VERTICAL_SUBOPTIMAL, METER_VERTICAL_EVEN_LESS_GOOD, DEVICE_BUTTON,
77
    AFTER_LAST_INTERNAL_PSEUDOID,
77
    AFTER_LAST_INTERNAL_PSEUDOID,
78
    FULL_SCREEN, FULL_SCREEN_DOCUMENT,
78
    FULL_SCREEN, FULL_SCREEN_DOCUMENT,
79
    FIRST_PUBLIC_PSEUDOID = FIRST_LINE,
79
    FIRST_PUBLIC_PSEUDOID = FIRST_LINE,
- a/Source/WebKit/chromium/features.gypi +1 lines
Lines 49-54 a/Source/WebKit/chromium/features.gypi_sec1
49
        'ENABLE_DASHBOARD_SUPPORT=0',
49
        'ENABLE_DASHBOARD_SUPPORT=0',
50
        'ENABLE_DATABASE=1',
50
        'ENABLE_DATABASE=1',
51
        'ENABLE_DATAGRID=0',
51
        'ENABLE_DATAGRID=0',
52
        'ENABLE_DEVICE_ELEMENT=1',
52
        'ENABLE_DEVICE_ORIENTATION=1',
53
        'ENABLE_DEVICE_ORIENTATION=1',
53
        'ENABLE_DIRECTORY_UPLOAD=1',
54
        'ENABLE_DIRECTORY_UPLOAD=1',
54
        'ENABLE_DOM_STORAGE=1',
55
        'ENABLE_DOM_STORAGE=1',
- a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig -1 / +2 lines
Lines 66-71 ENABLE_DATAGRID = ; a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig_sec1
66
ENABLE_DATALIST = $(ENABLE_DATALIST_$(REAL_PLATFORM_NAME));
66
ENABLE_DATALIST = $(ENABLE_DATALIST_$(REAL_PLATFORM_NAME));
67
ENABLE_DATALIST_macosx = ENABLE_DATALIST;
67
ENABLE_DATALIST_macosx = ENABLE_DATALIST;
68
68
69
ENABLE_DEVICE_ELEMENT = ;
69
ENABLE_DEVICE_ORIENTATION = ;
70
ENABLE_DEVICE_ORIENTATION = ;
70
ENABLE_DIRECTORY_UPLOAD = ;
71
ENABLE_DIRECTORY_UPLOAD = ;
71
ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE;
72
ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE;
Lines 125-128 ENABLE_XHTMLMP = ; a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig_sec2
125
ENABLE_XPATH = ENABLE_XPATH;
126
ENABLE_XPATH = ENABLE_XPATH;
126
ENABLE_XSLT = ENABLE_XSLT;
127
ENABLE_XSLT = ENABLE_XSLT;
127
128
128
FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_WEBGL) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
129
FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_WEBGL) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
- a/Source/WebKit2/Configurations/FeatureDefines.xcconfig -1 / +2 lines
Lines 66-71 ENABLE_DATAGRID = ; a/Source/WebKit2/Configurations/FeatureDefines.xcconfig_sec1
66
ENABLE_DATALIST = $(ENABLE_DATALIST_$(REAL_PLATFORM_NAME));
66
ENABLE_DATALIST = $(ENABLE_DATALIST_$(REAL_PLATFORM_NAME));
67
ENABLE_DATALIST_macosx = ENABLE_DATALIST;
67
ENABLE_DATALIST_macosx = ENABLE_DATALIST;
68
68
69
ENABLE_DEVICE_ELEMENT = ;
69
ENABLE_DEVICE_ORIENTATION = ;
70
ENABLE_DEVICE_ORIENTATION = ;
70
ENABLE_DIRECTORY_UPLOAD = ;
71
ENABLE_DIRECTORY_UPLOAD = ;
71
ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE;
72
ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE;
Lines 125-128 ENABLE_XHTMLMP = ; a/Source/WebKit2/Configurations/FeatureDefines.xcconfig_sec2
125
ENABLE_XPATH = ENABLE_XPATH;
126
ENABLE_XPATH = ENABLE_XPATH;
126
ENABLE_XSLT = ENABLE_XSLT;
127
ENABLE_XSLT = ENABLE_XSLT;
127
128
128
FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_WEBGL) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
129
FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_WEBGL) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
- a/Tools/Scripts/build-webkit +4 lines
Lines 70-75 my ( a/Tools/Scripts/build-webkit_sec1
70
    $databaseSupport,
70
    $databaseSupport,
71
    $datagridSupport,
71
    $datagridSupport,
72
    $datalistSupport,
72
    $datalistSupport,
73
    $deviceSupport,
73
    $deviceOrientationSupport,
74
    $deviceOrientationSupport,
74
    $directoryUploadSupport,
75
    $directoryUploadSupport,
75
    $domStorageSupport,
76
    $domStorageSupport,
Lines 148-153 my @features = ( a/Tools/Scripts/build-webkit_sec2
148
    { option => "datalist", desc => "Toggle HTML5 datalist support",
149
    { option => "datalist", desc => "Toggle HTML5 datalist support",
149
      define => "ENABLE_DATALIST", default => 1, value => \$datalistSupport },
150
      define => "ENABLE_DATALIST", default => 1, value => \$datalistSupport },
150
151
152
    { option => "device", desc => "Toggle device element support",
153
      define => "ENABLE_DEVICE_ELEMENT", default => 0, value => \$deviceSupport },
154
151
    { option => "device-orientation", desc => "Toggle DeviceOrientation support",
155
    { option => "device-orientation", desc => "Toggle DeviceOrientation support",
152
      define => "ENABLE_DEVICE_ORIENTATION", default => 0, value => \$deviceOrientationSupport },
156
      define => "ENABLE_DEVICE_ORIENTATION", default => 0, value => \$deviceOrientationSupport },
153
157
- a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops -1 / +6 lines
Lines 9-15 a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops_sec1
9
	>
9
	>
10
  <Tool
10
  <Tool
11
		Name="VCCLCompilerTool"
11
		Name="VCCLCompilerTool"
12
		PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_IMAGE_RESIZER);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_SPEECH);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LINK_PREFETCH);$(ENABLE_MATHML);$(ENABLE_METER_TAG);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_PROGRESS_TAG);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
12
		PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DEVICE_ELEMENT);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_IMAGE_RESIZER);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_SPEECH);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LINK_PREFETCH);$(ENABLE_MATHML);$(ENABLE_METER_TAG);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_PROGRESS_TAG);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
13
	/>
13
	/>
14
  <UserMacro
14
  <UserMacro
15
		Name="ENABLE_3D_CANVAS"
15
		Name="ENABLE_3D_CANVAS"
Lines 57-62 a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops_sec2
57
		PerformEnvironmentSet="true"
57
		PerformEnvironmentSet="true"
58
	/>
58
	/>
59
  <UserMacro
59
  <UserMacro
60
		Name="ENABLE_DEVICE_ELEMENT"
61
		Value=""
62
		PerformEnvironmentSet="true"
63
	/>
64
  <UserMacro
60
		Name="ENABLE_DEVICE_ORIENTATION"
65
		Name="ENABLE_DEVICE_ORIENTATION"
61
		Value=""
66
		Value=""
62
		PerformEnvironmentSet="true"
67
		PerformEnvironmentSet="true"
- a/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops -1 / +6 lines
Lines 9-15 a/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops_sec1
9
	>
9
	>
10
  <Tool
10
  <Tool
11
		Name="VCCLCompilerTool"
11
		Name="VCCLCompilerTool"
12
		PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_IMAGE_RESIZER);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_SPEECH);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LINK_PREFETCH);$(ENABLE_MATHML);$(ENABLE_METER_TAG);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_PROGRESS_TAG);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
12
		PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DEVICE_ELEMENT);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_IMAGE_RESIZER);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_SPEECH);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LINK_PREFETCH);$(ENABLE_MATHML);$(ENABLE_METER_TAG);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_PROGRESS_TAG);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
13
	/>
13
	/>
14
  <UserMacro
14
  <UserMacro
15
		Name="ENABLE_3D_CANVAS"
15
		Name="ENABLE_3D_CANVAS"
Lines 57-62 a/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops_sec2
57
		PerformEnvironmentSet="true"
57
		PerformEnvironmentSet="true"
58
	/>
58
	/>
59
  <UserMacro
59
  <UserMacro
60
		Name="ENABLE_DEVICE_ELEMENT"
61
		Value=""
62
		PerformEnvironmentSet="true"
63
	/>
64
  <UserMacro
60
		Name="ENABLE_DEVICE_ORIENTATION"
65
		Name="ENABLE_DEVICE_ORIENTATION"
61
		Value=""
66
		Value=""
62
		PerformEnvironmentSet="true"
67
		PerformEnvironmentSet="true"
- a/configure.ac +10 lines
Lines 411-416 AC_ARG_ENABLE(input_speech, a/configure.ac_sec1
411
              [],[enable_input_speech="no"])
411
              [],[enable_input_speech="no"])
412
AC_MSG_RESULT([$enable_input_speech])
412
AC_MSG_RESULT([$enable_input_speech])
413
413
414
# check whether to enable the device element support
415
AC_MSG_CHECKING([whether to enable the device element support])
416
AC_ARG_ENABLE(device_element,
417
              AC_HELP_STRING([--enable-device-element],
418
                             [enable the device element support [default=no]]),
419
              [],[enable_device_element="no"])
420
AC_MSG_RESULT([$enable_device_element])
421
414
# check whether to build with database support
422
# check whether to build with database support
415
AC_MSG_CHECKING([whether to enable HTML5 client-side database storage support])
423
AC_MSG_CHECKING([whether to enable HTML5 client-side database storage support])
416
AC_ARG_ENABLE(database,
424
AC_ARG_ENABLE(database,
Lines 958-963 AM_CONDITIONAL([ENABLE_DIRECTORY_UPLOAD],[test "$enable_directory_upload" = "yes a/configure.ac_sec2
958
AM_CONDITIONAL([ENABLE_DOM_STORAGE],[test "$enable_dom_storage" = "yes"])
966
AM_CONDITIONAL([ENABLE_DOM_STORAGE],[test "$enable_dom_storage" = "yes"])
959
AM_CONDITIONAL([ENABLE_DATABASE],[test "$enable_database" = "yes"])
967
AM_CONDITIONAL([ENABLE_DATABASE],[test "$enable_database" = "yes"])
960
AM_CONDITIONAL([ENABLE_DATALIST],[test "$enable_datalist" = "yes"])
968
AM_CONDITIONAL([ENABLE_DATALIST],[test "$enable_datalist" = "yes"])
969
AM_CONDITIONAL([ENABLE_DEVICE_ELEMENT],[test "$enable_device_element" = "yes"])
961
AM_CONDITIONAL([ENABLE_EVENTSOURCE],[test "$enable_eventsource" = "yes"])
970
AM_CONDITIONAL([ENABLE_EVENTSOURCE],[test "$enable_eventsource" = "yes"])
962
AM_CONDITIONAL([ENABLE_FAST_MOBILE_SCROLLING],[test "$enable_fast_mobile_scrolling" = "yes"])
971
AM_CONDITIONAL([ENABLE_FAST_MOBILE_SCROLLING],[test "$enable_fast_mobile_scrolling" = "yes"])
963
AM_CONDITIONAL([ENABLE_FILE_SYSTEM],[test "$enable_file_system" = "yes"])
972
AM_CONDITIONAL([ENABLE_FILE_SYSTEM],[test "$enable_file_system" = "yes"])
Lines 1042-1047 Features: a/configure.ac_sec3
1042
 WebGL                                                    : $enable_webgl
1051
 WebGL                                                    : $enable_webgl
1043
 Blob support                                             : $enable_blob
1052
 Blob support                                             : $enable_blob
1044
 Directory upload                                         : $enable_directory_upload
1053
 Directory upload                                         : $enable_directory_upload
1054
 Device element support                                   : $enable_device_element
1045
 Fast Mobile Scrolling                                    : $enable_fast_mobile_scrolling
1055
 Fast Mobile Scrolling                                    : $enable_fast_mobile_scrolling
1046
 JIT compilation                                          : $enable_jit
1056
 JIT compilation                                          : $enable_jit
1047
 Filters support                                          : $enable_filters
1057
 Filters support                                          : $enable_filters

Return to Bug 53777