diff options
Diffstat (limited to 'WebKit/chromium')
47 files changed, 1794 insertions, 186 deletions
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog index 6867714..2e3ce8e 100644 --- a/WebKit/chromium/ChangeLog +++ b/WebKit/chromium/ChangeLog @@ -1,4 +1,529 @@ -2010-11-08 Alexey Proskuryakov <ap@apple.com> +2010-11-17 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r72228. + http://trac.webkit.org/changeset/72228 + https://bugs.webkit.org/show_bug.cgi?id=49712 + + Caused many >10 regressions on Win and Linux gpu layout test + runs. (Requested by dave_levin on #webkit). + + * src/WebGraphicsContext3DDefaultImpl.cpp: + (WebKit::bytesPerComponent): + (WebKit::componentsPerPixel): + (WebKit::imageSizeInBytes): + (WebKit::WebGraphicsContext3DDefaultImpl::texImage2D): + +2010-11-17 Dimitri Glazkov <dglazkov@chromium.org> + + Reviewed by Darin Adler. + + Converge means of querying a parent node into one way, which is Node::parentNode. + https://bugs.webkit.org/show_bug.cgi?id=49686 + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::insertStyleText): Changed to use parentNode. + (WebKit::WebFrameImpl::setFindEndstateFocusAndSelection): Ditto. + +2010-11-16 Zhenyao Mo <zmo@google.com> + + Reviewed by Kenneth Russell. + + WebGLRenderingContext needs to zero textures and renderbuffers + https://bugs.webkit.org/show_bug.cgi?id=49355 + + * src/WebGraphicsContext3DDefaultImpl.cpp: Don't deal with texture initialization at this level. + +2010-11-17 Satish Sampath <satish@chromium.org> + + Reviewed by Jeremy Orlow. + + Clear the speech input mock explicitly before each test. + https://bugs.webkit.org/show_bug.cgi?id=49660 + + * public/WebSpeechInputControllerMock.h: + * src/WebSpeechInputControllerMockImpl.cpp: + (WebKit::WebSpeechInputControllerMockImpl::clearResults): Added method to clear results. + * src/WebSpeechInputControllerMockImpl.h: + +2010-11-17 Eric Uhrhane <ericu@chromium.org> + + Reviewed by David Levin. + + [Chromium] implementation of async FileWriter for workers + https://bugs.webkit.org/show_bug.cgi?id=47681 + + Tests are in a separate changelist. + + Added new files. + * WebKit.gyp: + + * src/WorkerAsyncFileSystemChromium.cpp: Added WorkerAsyncFileWriterChromium construction. + * src/WorkerAsyncFileWriterChromium.cpp: Added. + * src/WorkerAsyncFileWriterChromium.h: Added. + + This class bridges between the context and main threads for the WorkerAsyncFileWriterChromium. + * src/WorkerFileWriterCallbacksBridge.cpp: Added. + * src/WorkerFileWriterCallbacksBridge.h: Added. + +2010-11-17 John Mellor <johnme@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Expose frame flattening setting in WebSettings. + https://bugs.webkit.org/show_bug.cgi?id=49621 + + * public/WebSettings.h: + * src/WebSettingsImpl.cpp: + (WebKit::WebSettingsImpl::setFrameFlatteningEnabled): + * src/WebSettingsImpl.h: + +2010-11-17 Jonathan Backer <backer@chromium.org> + + Reviewed by Kenneth Russell. + + [Chromium] Resize initiated by renderer. + https://bugs.webkit.org/show_bug.cgi?id=49617 + + To address synchronization issues with resizing, make resize work like DARWIN. + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::resize): + +2010-11-17 Stuart Morgan <stuartmorgan@chromium.org> + + Reviewed by Dimitri Glazkov. + + Fix click count for mouse-up events. + - clickCount for mouse up was lost in conversion from NSEvent + - clickCount was also lost when disptaching events through the + plugin mouse capture event codepath. + + https://bugs.webkit.org/show_bug.cgi?id=49290 + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::handleInputEvent): + * src/mac/WebInputEventFactory.mm: + (WebKit::WebInputEventFactory::mouseEvent): + +2010-11-11 Zhenyao Mo <zmo@google.com> + + Reviewed by Kenneth Russell. + + Implement UNPACK_COLORSPACE_CONVERSION_WEBGL + https://bugs.webkit.org/show_bug.cgi?id=47196 + + * src/WebImageDecoder.cpp: + (WebKit::WebImageDecoder::init): Add ignoreGammaAndColorProfile parameter. + +2010-11-12 Zhenyao Mo <zmo@google.com> + + Reviewed by Kenneth Russell. + + Refactor GL backend flags + https://bugs.webkit.org/show_bug.cgi?id=49460 + + * public/WebGraphicsContext3D.h: Remove GL flag queries at this level. + * src/GraphicsContext3DChromium.cpp: Ditto. + * src/GraphicsContext3DInternal.h: Ditto. + * src/WebGraphicsContext3DDefaultImpl.cpp: Ditto. + * src/WebGraphicsContext3DDefaultImpl.h: Ditto. + +2010-11-16 Pavel Feldman <pfeldman@chromium.org> + + Not reviewed. Chromium build fix. + + * WebKit.gyp: + * scripts/concatenate_css_files.py: Renamed from WebKit/chromium/Build/concatenate_css_files.py. + * scripts/concatenate_js_files.py: Renamed from WebKit/chromium/Build/concatenate_js_files.py. + * scripts/generate_devtools_html.py: Renamed from WebKit/chromium/Build/generate_devtools_html.py. + +2010-11-16 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Chrome DevTools: concatenate CSS files, do not link + missing JS files in release mode. + https://bugs.webkit.org/show_bug.cgi?id=49586 + + * Build/concatenate_css_files.py: Added. + * Build/concatenate_js_files.py: Added. + * Build/generate_devtools_html.py: Added. + * WebKit.gyp: + +2010-11-15 Nat Duca <nduca@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Make WebWidget actively notify client when compositing enables. + https://bugs.webkit.org/show_bug.cgi?id=49396 + + * public/WebWidgetClient.h: + (WebKit::WebWidgetClient::didAcceleratedCompositingEnable): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::resize): + (WebKit::WebViewImpl::paint): + (WebKit::WebViewImpl::setRootLayerNeedsDisplay): + (WebKit::WebViewImpl::scrollRootLayerRect): + (WebKit::WebViewImpl::invalidateRootLayerRect): + (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): + +2010-11-15 Kenneth Russell <kbr@google.com> + + Reviewed by James Robinson. + + [chromium] Remove assumption that GL functions are function pointers + https://bugs.webkit.org/show_bug.cgi?id=49486 + + Added appropriate extension queries and no longer assume that GL + function names are function pointers which can be tested. + + * src/WebGraphicsContext3DDefaultImpl.cpp: + (WebKit::WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl): + (WebKit::WebGraphicsContext3DDefaultImpl::initialize): + (WebKit::WebGraphicsContext3DDefaultImpl::validateAttributes): + (WebKit::WebGraphicsContext3DDefaultImpl::resolveMultisampledFramebuffer): + (WebKit::WebGraphicsContext3DDefaultImpl::reshape): + (WebKit::WebGraphicsContext3DDefaultImpl::generateMipmap): + (WebKit::WebGraphicsContext3DDefaultImpl::getString): + * src/WebGraphicsContext3DDefaultImpl.h: + +2010-11-15 Ilya Sherman <isherman@chromium.org> + + Reviewed by Kent Tamura. + + Add capability for displaying warnings to autofill popup + Warnings are displayed in dark gray italic. + https://bugs.webkit.org/show_bug.cgi?id=49291 + http://code.google.com/p/chromium/issues/detail?id=58509 + + * src/AutoFillPopupMenuClient.cpp: + (WebKit::AutoFillPopupMenuClient::canRemoveSuggestionAtIndex): + Updated logic -- can only remove Autocomplete suggestions, which have unique ID 0. + (WebKit::AutoFillPopupMenuClient::itemIsEnabled): False for warnings. + (WebKit::AutoFillPopupMenuClient::itemStyle): Dark gray italic for warnings. + (WebKit::AutoFillPopupMenuClient::menuStyle): Variable name changed. + (WebKit::AutoFillPopupMenuClient::itemIsWarning): True for unique ID < 0. + (WebKit::AutoFillPopupMenuClient::initialize): Updated cached styles (see above). + * src/AutoFillPopupMenuClient.h: Added itemIsEnabled(), variable to cache warning style. + * src/WebViewImpl.cpp: Minor cleanup. + (WebKit::WebViewImpl::applyAutoFillSuggestions): + +2010-11-14 Kent Tamura <tkent@chromium.org> + + Reviewed by Dimitri Glazkov. + + Improve API for form validation message strings + https://bugs.webkit.org/show_bug.cgi?id=34945 + + * public/WebLocalizedString.h: + * src/LocalizedStrings.cpp: + (WebCore::validationMessageTypeMismatchForEmailText): + (WebCore::validationMessageTypeMismatchForMultipleEmailText): + (WebCore::validationMessageTypeMismatchForURLText): + (WebCore::validationMessageTooLongText): + (WebCore::validationMessageRangeUnderflowText): + (WebCore::validationMessageRangeOverflowText): + (WebCore::validationMessageStepMismatchText): + +2010-11-13 Shinichiro Hamaji <hamaji@chromium.org> + + Reviewed by Kent Tamura. + + [Chromium] print doesn't work on http://nodejs.org/api.html + https://bugs.webkit.org/show_bug.cgi?id=49304 + + * src/WebFrameImpl.cpp: + (WebKit::ChromePrintContext::begin): + (WebKit::WebFrameImpl::printBegin): + +2010-11-12 James Simonsen <simonjam@chromium.org> + + Reviewed by Darin Fisher. + + [Web Timing] Rename interfaces: + - Navigation -> PerformanceNavigation + - Timing -> PerformanceTiming + https://bugs.webkit.org/show_bug.cgi?id=48919 + + * src/WebPerformance.cpp: + (WebKit::WebPerformance::navigationType): + +2010-11-12 Zhenyao Mo <zmo@google.com> + + Reviewed by James Robinson. + + WebGraphicsContext3DDefaultImpl does not run on top of OpenGL ES 2.0 implementations + https://bugs.webkit.org/show_bug.cgi?id=48282 + + Simple fix for a regression introduced in r71793. + + * src/WebGraphicsContext3DDefaultImpl.cpp: + (WebKit::WebGraphicsContext3DDefaultImpl::initialize): + +2010-11-12 Ilya Sherman <isherman@chromium.org> + + Reviewed by Eric Seidel. + + Remove some trailing whitespace + https://bugs.webkit.org/show_bug.cgi?id=49433 + + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::createPopupMenu): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::scrollRootLayerRect): + (WebKit::WebViewImpl::invalidateRootLayerRect): + +2010-11-11 MORITA Hajime <morrita@google.com> + + Unreviewed another attempt to fx windows build. + + * src/WebBindings.cpp: + (WebKit::makeStringArrayImpl): + +2010-11-11 MORITA Hajime <morrita@google.com> + + Unreviewed attempt to fx windows build. + + * src/WebBindings.cpp: + (WebKit::makeStringArrayImpl): + +2010-11-11 MORITA Hajime <morrita@google.com> + + Reviewed by Kent Tamura. + + editing/selection/context-menu-on-text.html fails on chromium + https://bugs.webkit.org/show_bug.cgi?id=45898 + + Added makeStringArray(), that is used by DumpRenderTree. + + * public/WebBindings.h: + * src/WebBindings.cpp: + (WebKit::makeStringArrayImpl): Added. + (WebKit::WebBindings::makeStringArray): Added. + +2010-11-11 Tony Gentilcore <tonyg@chromium.org> + + Reviewed by Nate Chapin. + + [chromium] Convert WebPerformance doubles to seconds + https://bugs.webkit.org/show_bug.cgi?id=49232 + + This makes them suitable for passing to Time::FromDoubleT(). + + * src/WebPerformance.cpp: + (WebKit::millisecondsToSeconds): + (WebKit::WebPerformance::navigationStart): + (WebKit::WebPerformance::unloadEventEnd): + (WebKit::WebPerformance::redirectStart): + (WebKit::WebPerformance::redirectEnd): + (WebKit::WebPerformance::fetchStart): + (WebKit::WebPerformance::domainLookupStart): + (WebKit::WebPerformance::domainLookupEnd): + (WebKit::WebPerformance::connectStart): + (WebKit::WebPerformance::connectEnd): + (WebKit::WebPerformance::requestStart): + (WebKit::WebPerformance::requestEnd): + (WebKit::WebPerformance::responseStart): + (WebKit::WebPerformance::responseEnd): + (WebKit::WebPerformance::loadEventStart): + (WebKit::WebPerformance::loadEventEnd): + +2010-11-11 Hans Wennborg <hans@chromium.org> + + Reviewed by Jeremy Orlow. + + IndexedDB: signal IDBFactoryBackendInterface destruction to embedder + https://bugs.webkit.org/show_bug.cgi?id=49313 + + Implement ChromiumBridge::idbShutdown(), passing through to the + WebKitClient. + + * public/WebKitClient.h: + (WebKit::WebKitClient::idbShutdown): + * src/ChromiumBridge.cpp: + (WebCore::ChromiumBridge::idbShutdown): + +2010-11-10 Kenneth Russell <kbr@google.com> + + Reviewed by James Robinson. + + [chromium] Clean up gfx::GetGLImplementation calls in WebGraphicsContext3DDefaultImpl + https://bugs.webkit.org/show_bug.cgi?id=49336 + + * src/WebGraphicsContext3DDefaultImpl.cpp: + (WebKit::WebGraphicsContext3DDefaultImpl::initialize): + (WebKit::WebGraphicsContext3DDefaultImpl::reshape): + (WebKit::WebGraphicsContext3DDefaultImpl::readBackFramebuffer): + (WebKit::WebGraphicsContext3DDefaultImpl::getIntegerv): + +2010-11-10 Evan Stade <estade@chromium.org> + + Reviewed by Tony Chang. + + [chromium] menu key doesn't work when capslock or numslock is on + https://bugs.webkit.org/show_bug.cgi?id=49289 + + Add a special bitmask for the "input" modifier keys (shift, alt, crtl, meta). The Modifier + enum has grown to something that might be better termed State, but changing the nomenclature + now is difficult. The bitmask gets its name from the related function getWebInputModifiers. + + * public/WebInputEvent.h: add InputModifiers mask for true modifier keys + * src/WebViewImpl.cpp: disregard non-modifier keys + (WebKit::WebViewImpl::keyEvent): + +2010-11-10 Csaba Osztrogonác <ossy@webkit.org> + + Reviewed by David Hyatt. + + HTML5 Ruby support should be mandatory feature + https://bugs.webkit.org/show_bug.cgi?id=49272 + + Remove Ruby as optional feature. + + * features.gypi: + +2010-11-10 Tony Chang <tony@chromium.org> + + Unreviewed, add libvpx as a chromium dependency. + + This should fix the chromium linux build. + + * DEPS: + +2010-11-10 Peter Rybin <peter.rybin@gmail.com> + + Reviewed by Adam Barth. + + HTML parser should provide script column position within HTML document to JavaScript engine + https://bugs.webkit.org/show_bug.cgi?id=45271 + + Replaces script line number with TextPosition structure. + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::executeScript): + (WebKit::WebFrameImpl::executeScriptInIsolatedWorld): + (WebKit::WebFrameImpl::executeScriptAndReturnValue): + +2010-11-09 Kenneth Russell <kbr@google.com> + + Reviewed by James Robinson. + + WebGraphicsContext3DDefaultImpl does not run on top of OpenGL ES 2.0 implementations + https://bugs.webkit.org/show_bug.cgi?id=48282 + + Fixed assumptions in WebGraphicsContext3DDefaultImpl that it was + running on top of desktop GL. + + Tested various WebGL demos on Windows with ANGLE and + --in-process-webgl --disable-accelerated-compositing; all are now + working. Verified that --use-gl=desktop continues to work in the + same configuration. + + * src/WebGraphicsContext3DDefaultImpl.cpp: + (WebKit::WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl): + (WebKit::WebGraphicsContext3DDefaultImpl::initialize): + (WebKit::WebGraphicsContext3DDefaultImpl::validateAttributes): + (WebKit::WebGraphicsContext3DDefaultImpl::resolveMultisampledFramebuffer): + (WebKit::WebGraphicsContext3DDefaultImpl::isGLES2Compliant): + (WebKit::WebGraphicsContext3DDefaultImpl::reshape): + (WebKit::WebGraphicsContext3DDefaultImpl::readBackFramebuffer): + (WebKit::WebGraphicsContext3DDefaultImpl::getIntegerv): + (WebKit::WebGraphicsContext3DDefaultImpl::angleValidateShaderSource): + * src/WebGraphicsContext3DDefaultImpl.h: + +2010-11-09 Kent Tamura <tkent@chromium.org> + + Reviewed by Dimitri Glazkov. + + [Chromium] Add form validation message support to WebLocalizedString.h + https://bugs.webkit.org/show_bug.cgi?id=49239 + + * DEPS: Roll Chromium revision to r65502 to have crrev.com/65502 + * public/WebLocalizedString.h: Add new symbols + * src/LocalizedStrings.cpp: Call query() with the new symbols in the following functions. + (WebCore::validationMessageValueMissingText): + (WebCore::validationMessageTypeMismatchText): + (WebCore::validationMessagePatternMismatchText): + (WebCore::validationMessageTooLongText): + (WebCore::validationMessageRangeUnderflowText): + (WebCore::validationMessageRangeOverflowText): + (WebCore::validationMessageStepMismatchText): + +2010-11-09 Tony Chang <tony@chromium.org> + + Unreviewed, rolling chromium DEPS. + + * DEPS: Roll to r65462. + +2010-11-09 Mihai Parparita <mihaip@chromium.org> + + Unreviewed Chromium Windows build fix. + + Add isDisplayNone to the PopupMenuStyle constructor call in + PopupMenuTest (necessary after r71618). + + * tests/PopupMenuTest.cpp: + (WebKit::TestPopupMenuClient::itemStyle): + +2010-11-09 Shinichiro Hamaji <hamaji@chromium.org> + + Reviewed by Dimitri Glazkov. + + [Chromium] display:none has no effect on <option> element + https://bugs.webkit.org/show_bug.cgi?id=49169 + + * src/AutoFillPopupMenuClient.cpp: + (WebKit::AutoFillPopupMenuClient::initialize): + +2010-11-09 James Simonsen <simonjam@chromium.org> + + Reviewed by Dimitri Glazkov. + + [Web Timing] Remove requestEnd + https://bugs.webkit.org/show_bug.cgi?id=48924 + + * public/WebPerformance.h: + * src/WebPerformance.cpp: + +2010-11-08 John Knottenbelt <jknotten@chromium.org> + + Reviewed by Steve Block. + + Convert to and from DOMTimeStamp with converter functions + https://bugs.webkit.org/show_bug.cgi?id=49066 + + * src/WebDataSourceImpl.cpp: + (WebKit::WebDataSourceImpl::triggeringEventTime): + + +2010-11-08 Pierre-Antoine LaFayette <pierre.lafayette@gmail.com> + + Reviewed by Darin Fisher. + + [chromium] Adding hasUserGesture flag to the ResourceRequest + https://bugs.webkit.org/show_bug.cgi?id=37057 + + This flag is to be used on the browser side to indicate when a + download has been user initiated. + + * public/WebURLRequest.h: + * src/WebURLRequest.cpp: + (WebKit::WebURLRequest::hasUserGesture): + (WebKit::WebURLRequest::setHasUserGesture): + +2010-11-08 Jay Civelli <jcivelli@chromium.org> + + Reviewed by Darin Fisher. + + Add an API to WebViewClient that report the load progress for a frame. + https://bugs.webkit.org/show_bug.cgi?id=49137 + + * public/WebViewClient.h: + (WebKit::WebViewClient::didChangeLoadProgress): + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::postProgressEstimateChangedNotification): + + 2010-11-08 Alexey Proskuryakov <ap@apple.com> Reviewed by Darin Adler. diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS index 4fc0372..f5d56dd 100644 --- a/WebKit/chromium/DEPS +++ b/WebKit/chromium/DEPS @@ -32,7 +32,7 @@ vars = { 'chromium_svn': 'http://src.chromium.org/svn/trunk/src', - 'chromium_rev': '65229' + 'chromium_rev': '65502' } deps = { @@ -95,6 +95,8 @@ deps = { Var('chromium_svn')+'/ppapi@'+Var('chromium_rev'), 'third_party/angle': # needed by the gpu process From('chromium_deps', 'src/third_party/angle'), + 'third_party/libvpx': # needed by webkit/media + From('chromium_deps', 'src/third_party/libvpx'), 'third_party/ffmpeg': # needed by webkit/media From('chromium_deps', 'src/third_party/ffmpeg'), 'third_party/libwebp': diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp index 4dcc61a..a95b88f 100644 --- a/WebKit/chromium/WebKit.gyp +++ b/WebKit/chromium/WebKit.gyp @@ -547,8 +547,12 @@ 'src/WebWorkerImpl.h', 'src/WorkerAsyncFileSystemChromium.cpp', 'src/WorkerAsyncFileSystemChromium.h', + 'src/WorkerAsyncFileWriterChromium.cpp', + 'src/WorkerAsyncFileWriterChromium.h', 'src/WorkerFileSystemCallbacksBridge.cpp', 'src/WorkerFileSystemCallbacksBridge.h', + 'src/WorkerFileWriterCallbacksBridge.cpp', + 'src/WorkerFileWriterCallbacksBridge.h', 'src/WrappedResourceRequest.h', 'src/WrappedResourceResponse.h', 'src/win/WebInputEventFactory.cpp', @@ -671,7 +675,8 @@ ], 'conditions': [ ['debug_devtools==0', { - 'dependencies': ['concatenated_devtools_js'], + 'dependencies': ['concatenated_devtools_js', + 'concatenated_devtools_css'], }], ], 'copies': [ @@ -684,7 +689,7 @@ ], 'conditions': [ ['debug_devtools==0', { - 'files/': [['exclude', '\\.js$']], + 'files/': [['exclude', '\\.(js|css|html)$']], }], ], }, @@ -704,13 +709,13 @@ 'actions': [{ 'action_name': 'devtools_html', 'inputs': [ - '<(chromium_src_dir)/webkit/build/generate_devtools_html.py', + 'scripts/generate_devtools_html.py', # See issue 29695: WebKit.gypi is a source file for devtools.html. 'WebKit.gypi', '../../WebCore/inspector/front-end/inspector.html', ], 'outputs': ['<(PRODUCT_DIR)/resources/inspector/devtools.html'], - 'action': ['python', '<@(_inputs)', '<@(_outputs)', '<@(devtools_files)'], + 'action': ['python', '<@(_inputs)', '<@(_outputs)', '<@(debug_devtools)', '<@(devtools_files)'], }], }, { @@ -723,26 +728,50 @@ 'sources': ['<(PRODUCT_DIR)/resources/inspector/DevTools.js'], 'actions': [{ 'action_name': 'concatenate_devtools_js', - 'script_name': '<(chromium_src_dir)/webkit/build/concatenate_js_files.py', - 'input_page': '<(PRODUCT_DIR)/resources/inspector/devtools.html', + 'script_name': 'scripts/concatenate_js_files.py', + 'input_page': '../../WebCore/inspector/front-end/inspector.html', 'inputs': [ '<@(_script_name)', '<@(_input_page)', '<@(webinspector_files)', '<@(devtools_files)', - '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendStub.js', + '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendStub.js' ], 'search_path': [ '../../WebCore/inspector/front-end', 'src/js', '<(SHARED_INTERMEDIATE_DIR)/webcore', - '<(chromium_src_dir)/v8/tools', ], 'outputs': ['<(PRODUCT_DIR)/resources/inspector/DevTools.js'], 'action': ['python', '<@(_script_name)', '<@(_input_page)', '<@(_search_path)', '<@(_outputs)'], }], }, { + 'target_name': 'concatenated_devtools_css', + 'type': 'none', + 'dependencies': [ + 'devtools_html' + ], + 'sources': ['<(PRODUCT_DIR)/resources/inspector/devTools.css'], + 'actions': [{ + 'action_name': 'concatenate_devtools_css', + 'script_name': 'scripts/concatenate_css_files.py', + 'input_page': '../../WebCore/inspector/front-end/inspector.html', + 'inputs': [ + '<@(_script_name)', + '<@(_input_page)', + '<@(webinspector_files)', + '<@(devtools_files)' + ], + 'search_path': [ + '../../WebCore/inspector/front-end', + 'src/js', + ], + 'outputs': ['<(PRODUCT_DIR)/resources/inspector/devTools.css'], + 'action': ['python', '<@(_script_name)', '<@(_input_page)', '<@(_search_path)', '<@(_outputs)'], + }], + }, + { 'target_name': 'webkit_unit_tests', 'type': 'executable', 'msvs_guid': '7CEFE800-8403-418A-AD6A-2D52C6FC3EAD', diff --git a/WebKit/chromium/features.gypi b/WebKit/chromium/features.gypi index cd6bf20..03e6ce4 100644 --- a/WebKit/chromium/features.gypi +++ b/WebKit/chromium/features.gypi @@ -68,7 +68,6 @@ 'ENABLE_OPENTYPE_SANITIZER=1', 'ENABLE_ORIENTATION_EVENTS=0', 'ENABLE_PROGRESS_TAG=1', - 'ENABLE_RUBY=1', 'ENABLE_SHARED_WORKERS=1', 'ENABLE_SVG=1', 'ENABLE_SVG_ANIMATION=1', diff --git a/WebKit/chromium/public/WebBindings.h b/WebKit/chromium/public/WebBindings.h index 147ce45..cb33781 100644 --- a/WebKit/chromium/public/WebBindings.h +++ b/WebKit/chromium/public/WebBindings.h @@ -32,6 +32,7 @@ #define WebBindings_h #include "WebCommon.h" +#include "WebString.h" #include "WebVector.h" #include <bindings/npruntime.h> @@ -146,6 +147,7 @@ public: WEBKIT_API static bool getElement(NPObject* element, WebElement*); WEBKIT_API static NPObject* makeIntArray(const WebVector<int>&); + WEBKIT_API static NPObject* makeStringArray(const WebVector<WebString>&); // Exceptions ------------------------------------------------------------- diff --git a/WebKit/chromium/public/WebGraphicsContext3D.h b/WebKit/chromium/public/WebGraphicsContext3D.h index 9656887..932004c 100644 --- a/WebKit/chromium/public/WebGraphicsContext3D.h +++ b/WebKit/chromium/public/WebGraphicsContext3D.h @@ -105,11 +105,6 @@ public: // Query whether it is built on top of compliant GLES2 implementation. virtual bool isGLES2Compliant() = 0; - // Query whether it is built on top of GLES2 NPOT strict implementation. - virtual bool isGLES2NPOTStrict() = 0; - // Query whether it is built on top of implementation that generates errors - // on out-of-bounds buffer accesses. - virtual bool isErrorGeneratedOnOutOfBoundsAccesses() = 0; // Helper for software compositing path. Reads back the frame buffer into // the memory region pointed to by "pixels" with size "bufferSize". It is diff --git a/WebKit/chromium/public/WebInputEvent.h b/WebKit/chromium/public/WebInputEvent.h index 26e41a4..581e76c 100644 --- a/WebKit/chromium/public/WebInputEvent.h +++ b/WebKit/chromium/public/WebInputEvent.h @@ -130,6 +130,8 @@ public: NumLockOn = 1 << 10, }; + static const int InputModifiers = ShiftKey | ControlKey | AltKey | MetaKey; + unsigned size; // The size of this structure, for serialization. Type type; int modifiers; diff --git a/WebKit/chromium/public/WebKitClient.h b/WebKit/chromium/public/WebKitClient.h index 09c79c5..7ced7ad 100644 --- a/WebKit/chromium/public/WebKitClient.h +++ b/WebKit/chromium/public/WebKitClient.h @@ -141,6 +141,7 @@ public: // Indexed Database ---------------------------------------------------- virtual WebIDBFactory* idbFactory() { return 0; } + virtual void idbShutdown() { }; virtual void createIDBKeysFromSerializedValuesAndKeyPath(const WebVector<WebSerializedScriptValue>& values, const WebString& keyPath, WebVector<WebIDBKey>& keys) { } diff --git a/WebKit/chromium/public/WebLocalizedString.h b/WebKit/chromium/public/WebLocalizedString.h index 99a7d23..8ab5f8d 100644 --- a/WebKit/chromium/public/WebLocalizedString.h +++ b/WebKit/chromium/public/WebLocalizedString.h @@ -58,6 +58,16 @@ struct WebLocalizedString { AXLinkActionVerb, KeygenMenuHighGradeKeySize, KeygenMenuMediumGradeKeySize, + ValidationValueMissing, + ValidationTypeMismatch, + ValidationTypeMismatchForEmail, + ValidationTypeMismatchForMultipleEmail, + ValidationTypeMismatchForURL, + ValidationPatternMismatch, + ValidationTooLong, + ValidationRangeUnderflow, + ValidationRangeOverflow, + ValidationStepMismatch, }; }; diff --git a/WebKit/chromium/public/WebPerformance.h b/WebKit/chromium/public/WebPerformance.h index 012f2fd..f096ac6 100644 --- a/WebKit/chromium/public/WebPerformance.h +++ b/WebKit/chromium/public/WebPerformance.h @@ -71,7 +71,6 @@ public: WEBKIT_API double connectStart() const; WEBKIT_API double connectEnd() const; WEBKIT_API double requestStart() const; - WEBKIT_API double requestEnd() const; WEBKIT_API double responseStart() const; WEBKIT_API double responseEnd() const; WEBKIT_API double loadEventStart() const; diff --git a/WebKit/chromium/public/WebSettings.h b/WebKit/chromium/public/WebSettings.h index 469db05..fa21551 100644 --- a/WebKit/chromium/public/WebSettings.h +++ b/WebKit/chromium/public/WebSettings.h @@ -82,6 +82,7 @@ public: virtual void setXSSAuditorEnabled(bool) = 0; virtual void setLocalStorageEnabled(bool) = 0; virtual void setEditableLinkBehaviorNeverLive() = 0; + virtual void setFrameFlatteningEnabled(bool) = 0; virtual void setFontRenderingModeNormal() = 0; virtual void setShouldPaintCustomScrollbars(bool) = 0; virtual void setAllowUniversalAccessFromFileURLs(bool) = 0; diff --git a/WebKit/chromium/public/WebSpeechInputControllerMock.h b/WebKit/chromium/public/WebSpeechInputControllerMock.h index 0a7f6f9..31672ba 100644 --- a/WebKit/chromium/public/WebSpeechInputControllerMock.h +++ b/WebKit/chromium/public/WebSpeechInputControllerMock.h @@ -45,6 +45,8 @@ public: virtual ~WebSpeechInputControllerMock() { } virtual void setMockRecognitionResult(const WebString& result, const WebString& language) = 0; + + virtual void clearResults() = 0; }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebURLRequest.h b/WebKit/chromium/public/WebURLRequest.h index c800452..7dd97ca 100644 --- a/WebKit/chromium/public/WebURLRequest.h +++ b/WebKit/chromium/public/WebURLRequest.h @@ -140,6 +140,10 @@ public: WEBKIT_API TargetType targetType() const; WEBKIT_API void setTargetType(TargetType); + // True if the request was user initiated. + WEBKIT_API bool hasUserGesture() const; + WEBKIT_API void setHasUserGesture(bool); + // A consumer controlled value intended to be used to identify the // requestor. WEBKIT_API int requestorID() const; diff --git a/WebKit/chromium/public/WebView.h b/WebKit/chromium/public/WebView.h index ce8e512..d9d72c7 100644 --- a/WebKit/chromium/public/WebView.h +++ b/WebKit/chromium/public/WebView.h @@ -289,7 +289,11 @@ public: // Notifies the WebView that AutoFill suggestions are available for a node. // |uniqueIDs| is a vector of IDs that represent the unique ID of each - // AutoFill profile in the suggestions popup. + // AutoFill profile in the suggestions popup. If a unique ID is 0, then the + // corresponding suggestion comes from Autocomplete rather than AutoFill. + // If a unique ID is negative, then the corresponding "suggestion" is + // actually a user-facing warning, e.g. explaining why AutoFill is + // unavailable for the current form. virtual void applyAutoFillSuggestions( const WebNode&, const WebVector<WebString>& names, diff --git a/WebKit/chromium/public/WebViewClient.h b/WebKit/chromium/public/WebViewClient.h index edd9579..7ce1483 100644 --- a/WebKit/chromium/public/WebViewClient.h +++ b/WebKit/chromium/public/WebViewClient.h @@ -117,6 +117,10 @@ public: virtual void didStartLoading() { } virtual void didStopLoading() { } + // Notification that some progress was made loading the current page. + // loadProgress is a value between 0 (nothing loaded) and 1.0 (frame fully + // loaded). + virtual void didChangeLoadProgress(WebFrame*, double loadProgress) { } // Editing ------------------------------------------------------------- @@ -305,11 +309,13 @@ public: const WebString& value) { } // Informs the browser that the user has accepted an AutoFill suggestion for - // a WebNode. |name| and |label| form a key into the set of AutoFill - // profiles. |index| is an index of the selected suggestion in the list of - // suggestions provided by the client + // a WebNode. |uniqueID| is used as a key into the set of AutoFill profiles, + // and should never be negative. If it is 0, then the suggestion is an + // Autocomplete suggestion; and |value| stores the suggested text. |index| + // is an index of the selected suggestion in the list of suggestions provided + // by the client. virtual void didAcceptAutoFillSuggestion(const WebNode&, - const WebString& name, + const WebString& value, const WebString& label, int uniqueID, unsigned index) { } diff --git a/WebKit/chromium/public/WebWidgetClient.h b/WebKit/chromium/public/WebWidgetClient.h index 9bd553f..373426d 100644 --- a/WebKit/chromium/public/WebWidgetClient.h +++ b/WebKit/chromium/public/WebWidgetClient.h @@ -50,6 +50,9 @@ public: // scrolled by the specified dx and dy amounts. virtual void didScrollRect(int dx, int dy, const WebRect& clipRect) { } + // Called when the compositor enables or disables. + virtual void didActivateAcceleratedCompositing(bool active) { } + // Called when a call to WebWidget::composite is required virtual void scheduleComposite() { } diff --git a/WebKit/chromium/scripts/concatenate_css_files.py b/WebKit/chromium/scripts/concatenate_css_files.py new file mode 100644 index 0000000..0aa5ef3 --- /dev/null +++ b/WebKit/chromium/scripts/concatenate_css_files.py @@ -0,0 +1,117 @@ +#!/usr/bin/env python +# +# Copyright (C) 2010 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# This script concatenates in place CSS files in the order specified +# using <link> tags in a given 'order.html' file. + +from HTMLParser import HTMLParser +from cStringIO import StringIO +import os.path +import sys + + +class OrderedCSSFilesExtractor(HTMLParser): + + def __init__(self, order_html_name): + HTMLParser.__init__(self) + self.ordered_css_files = [] + order_html = open(order_html_name, 'r') + self.feed(order_html.read()) + + def handle_starttag(self, tag, attrs): + if tag == 'link': + attrs_dict = dict(attrs) + if ('type' in attrs_dict and attrs_dict['type'] == 'text/css' and + 'href' in attrs_dict): + self.ordered_css_files.append(attrs_dict['href']) + + +class PathExpander: + + def __init__(self, paths): + self.paths = paths + + def expand(self, filename): + last_path = None + expanded_name = None + for path in self.paths: + fname = "%s/%s" % (path, filename) + if (os.access(fname, os.F_OK)): + if (last_path != None): + raise Exception('Ambiguous file %s: found in %s and %s' % + (filename, last_path, path)) + expanded_name = fname + last_path = path + return expanded_name + + +def main(argv): + + if len(argv) < 3: + print('usage: %s order.html input_source_dir_1 input_source_dir_2 ... ' + 'output_file' % argv[0]) + return 1 + + output_file_name = argv.pop() + input_order_file_name = argv[1] + extractor = OrderedCSSFilesExtractor(input_order_file_name) + # Unconditionally append devTools.css. It will contain concatenated files. + extractor.ordered_css_files.append('devTools.css') + + expander = PathExpander(argv[2:]) + output = StringIO() + + for input_file_name in extractor.ordered_css_files: + full_path = expander.expand(input_file_name) + if (full_path is None): + raise Exception('File %s referenced in %s not found on any source paths, ' + 'check source tree for consistency' % + (input_file_name, input_order_file_name)) + output.write('/* %s */\n\n' % input_file_name) + input_file = open(full_path, 'r') + output.write(input_file.read()) + output.write('\n') + input_file.close() + + output_file = open(output_file_name, 'w') + output_file.write(output.getvalue()) + output_file.close() + output.close() + + # Touch output file directory to make sure that Xcode will copy + # modified resource files. + if sys.platform == 'darwin': + output_dir_name = os.path.dirname(output_file_name) + os.utime(output_dir_name, None) + + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/WebKit/chromium/scripts/concatenate_js_files.py b/WebKit/chromium/scripts/concatenate_js_files.py new file mode 100644 index 0000000..1393f48 --- /dev/null +++ b/WebKit/chromium/scripts/concatenate_js_files.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# +# Copyright (C) 2010 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# This script concatenates in place JS files in the order specified +# using <script> tags in a given 'order.html' file. + +from HTMLParser import HTMLParser +from cStringIO import StringIO +import os.path +import sys + + +class OrderedJSFilesExtractor(HTMLParser): + + def __init__(self, order_html_name): + HTMLParser.__init__(self) + self.ordered_js_files = [] + order_html = open(order_html_name, 'r') + self.feed(order_html.read()) + + def handle_starttag(self, tag, attrs): + if tag == 'script': + attrs_dict = dict(attrs) + if ('type' in attrs_dict and attrs_dict['type'] == 'text/javascript' and 'src' in attrs_dict): + self.ordered_js_files.append(attrs_dict['src']) + + +class PathExpander: + + def __init__(self, paths): + self.paths = paths + + def expand(self, filename): + last_path = None + expanded_name = None + for path in self.paths: + fname = "%s/%s" % (path, filename) + if (os.access(fname, os.F_OK)): + if (last_path != None): + raise Exception('Ambiguous file %s: found in %s and %s' % + (filename, last_path, path)) + expanded_name = fname + last_path = path + return expanded_name + + +def main(argv): + + if len(argv) < 3: + print('usage: %s order.html input_source_dir_1 input_source_dir_2 ... ' + 'output_file' % argv[0]) + return 1 + + output_file_name = argv.pop() + input_order_file_name = argv[1] + extractor = OrderedJSFilesExtractor(input_order_file_name) + extractor.ordered_js_files.append('DevTools.js') + extractor.ordered_js_files.append('Tests.js') + + expander = PathExpander(argv[2:]) + output = StringIO() + + for input_file_name in extractor.ordered_js_files: + full_path = expander.expand(input_file_name) + if (full_path is None): + raise Exception('File %s referenced in %s not found on any source paths, ' + 'check source tree for consistency' % + (input_file_name, input_order_file_name)) + output.write('/* %s */\n\n' % input_file_name) + input_file = open(full_path, 'r') + output.write(input_file.read()) + output.write('\n') + input_file.close() + + output_file = open(output_file_name, 'w') + output_file.write(output.getvalue()) + output_file.close() + output.close() + + # Touch output file directory to make sure that Xcode will copy + # modified resource files. + if sys.platform == 'darwin': + output_dir_name = os.path.dirname(output_file_name) + os.utime(output_dir_name, None) + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/WebKit/chromium/scripts/generate_devtools_html.py b/WebKit/chromium/scripts/generate_devtools_html.py new file mode 100644 index 0000000..b9b5fff --- /dev/null +++ b/WebKit/chromium/scripts/generate_devtools_html.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# +# Copyright (C) 2010 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +import os.path +import sys + + +def GenerateIncludeTag(resource_path): + (dir_name, file_name) = os.path.split(resource_path) + if (file_name.endswith('.js')): + return ' <script type="text/javascript" src="%s"></script>\n' % file_name + elif (file_name.endswith('.css')): + return ' <link rel="stylesheet" type="text/css" href="%s">\n' % file_name + else: + assert resource_path + + +def main(argv): + + if len(argv) < 5: + print('usage: %s ignored inspector_html devtools_html debug' + ' css_and_js_files_list' % argv[0]) + return 1 + + # The first argument is ignored. We put 'webkit.gyp' in the inputs list + # for this script, so every time the list of script gets changed, our html + # file is rebuilt. + inspector_html_name = argv[2] + devtools_html_name = argv[3] + debug = argv[4] != '0' + inspector_html = open(inspector_html_name, 'r') + devtools_html = open(devtools_html_name, 'w') + + for line in inspector_html: + if not debug and '<script ' in line: + continue + if not debug and '<link ' in line: + continue + if '</head>' in line: + if debug: + for resource in argv[5:]: + devtools_html.write(GenerateIncludeTag(resource)) + else: + devtools_html.write(GenerateIncludeTag("devTools.css")) + devtools_html.write(GenerateIncludeTag("DevTools.js")) + devtools_html.write(line) + + devtools_html.close() + inspector_html.close() + + # Touch output file directory to make sure that Xcode will copy + # modified resource files. + if sys.platform == 'darwin': + output_dir_name = os.path.dirname(devtools_html_name) + os.utime(output_dir_name, None) + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp index b14840c..32abd6f 100644 --- a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp +++ b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp @@ -115,10 +115,10 @@ void AutoFillPopupMenuClient::removeSuggestionAtIndex(unsigned listIndex) bool AutoFillPopupMenuClient::canRemoveSuggestionAtIndex(unsigned listIndex) { - // Only allow deletion of items before the separator and those that don't - // have a label (autocomplete). + // Only allow deletion of items before the separator that have unique id 0 + // (i.e. are autocomplete rather than autofill items). int index = convertListIndexToInternalIndex(listIndex); - return m_labels[index].isEmpty() && (m_separatorIndex == -1 || listIndex < static_cast<unsigned>(m_separatorIndex)); + return !m_uniqueIDs[index] && (m_separatorIndex == -1 || listIndex < static_cast<unsigned>(m_separatorIndex)); } void AutoFillPopupMenuClient::valueChanged(unsigned listIndex, bool fireEvents) @@ -194,14 +194,19 @@ String AutoFillPopupMenuClient::itemIcon(unsigned listIndex) const return getIcon(listIndex); } +bool AutoFillPopupMenuClient::itemIsEnabled(unsigned listIndex) const +{ + return !itemIsWarning(listIndex); +} + PopupMenuStyle AutoFillPopupMenuClient::itemStyle(unsigned listIndex) const { - return *m_style; + return itemIsWarning(listIndex) ? *m_warningStyle : *m_regularStyle; } PopupMenuStyle AutoFillPopupMenuClient::menuStyle() const { - return *m_style; + return *m_regularStyle; } int AutoFillPopupMenuClient::clientPaddingLeft() const @@ -239,6 +244,16 @@ bool AutoFillPopupMenuClient::itemIsSeparator(unsigned listIndex) const return (m_separatorIndex != -1 && static_cast<unsigned>(m_separatorIndex) == listIndex); } +bool AutoFillPopupMenuClient::itemIsWarning(unsigned listIndex) const +{ + int index = convertListIndexToInternalIndex(listIndex); + if (index == -1) + return false; + + ASSERT(index >= 0 && static_cast<size_t>(index) < m_uniqueIDs.size()); + return m_uniqueIDs[index] < 0; +} + void AutoFillPopupMenuClient::setTextFromItem(unsigned listIndex) { m_textField->setValue(getSuggestion(listIndex)); @@ -282,19 +297,31 @@ void AutoFillPopupMenuClient::initialize( // AutoFillPopupMenuClient. setSuggestions(names, labels, icons, uniqueIDs, separatorIndex); - FontDescription fontDescription; + FontDescription regularFontDescription; RenderTheme::defaultTheme()->systemFont(CSSValueWebkitControl, - fontDescription); + regularFontDescription); RenderStyle* style = m_textField->computedStyle(); - fontDescription.setComputedSize(style->fontDescription().computedSize()); + regularFontDescription.setComputedSize(style->fontDescription().computedSize()); - Font font(fontDescription, 0, 0); - font.update(textField->document()->styleSelector()->fontSelector()); + Font regularFont(regularFontDescription, 0, 0); + regularFont.update(textField->document()->styleSelector()->fontSelector()); // The direction of text in popup menu is set the same as the direction of // the input element: textField. - m_style.set(new PopupMenuStyle(Color::black, Color::white, font, true, - Length(WebCore::Fixed), - textField->renderer()->style()->direction())); + m_regularStyle.set(new PopupMenuStyle(Color::black, Color::white, regularFont, + true, false, Length(WebCore::Fixed), + textField->renderer()->style()->direction())); + + FontDescription warningFontDescription = regularFont.fontDescription(); + warningFontDescription.setItalic(true); + Font warningFont(warningFontDescription, regularFont.letterSpacing(), regularFont.wordSpacing()); + warningFont.update(regularFont.fontSelector()); + m_warningStyle.set(new PopupMenuStyle(Color::darkGray, + m_regularStyle->backgroundColor(), + warningFont, + m_regularStyle->isVisible(), + m_regularStyle->isDisplayNone(), + m_regularStyle->textIndent(), + m_regularStyle->textDirection())); } void AutoFillPopupMenuClient::setSuggestions(const WebVector<WebString>& names, diff --git a/WebKit/chromium/src/AutoFillPopupMenuClient.h b/WebKit/chromium/src/AutoFillPopupMenuClient.h index a946e34..e3edfd3 100644 --- a/WebKit/chromium/src/AutoFillPopupMenuClient.h +++ b/WebKit/chromium/src/AutoFillPopupMenuClient.h @@ -78,7 +78,7 @@ public: virtual WTF::String itemIcon(unsigned listIndex) const; virtual WTF::String itemToolTip(unsigned lastIndex) const { return WTF::String(); } virtual WTF::String itemAccessibilityText(unsigned lastIndex) const { return WTF::String(); } - virtual bool itemIsEnabled(unsigned listIndex) const { return true; } + virtual bool itemIsEnabled(unsigned listIndex) const; virtual WebCore::PopupMenuStyle itemStyle(unsigned listIndex) const; virtual WebCore::PopupMenuStyle menuStyle() const; virtual int clientInsetLeft() const { return 0; } @@ -130,6 +130,8 @@ private: int getSelectedIndex() const { return m_selectedIndex; } void setSelectedIndex(int index) { m_selectedIndex = index; } + bool itemIsWarning(unsigned listIndex) const; + // The names, labels and icons that make up the contents of the menu items. Vector<WTF::String> m_names; Vector<WTF::String> m_labels; @@ -143,7 +145,8 @@ private: int m_selectedIndex; RefPtr<WebCore::HTMLInputElement> m_textField; - OwnPtr<WebCore::PopupMenuStyle> m_style; + OwnPtr<WebCore::PopupMenuStyle> m_regularStyle; + OwnPtr<WebCore::PopupMenuStyle> m_warningStyle; // DEPRECATED: Will be removed once Autocomplete and AutoFill merge is // complete. diff --git a/WebKit/chromium/src/ChromeClientImpl.cpp b/WebKit/chromium/src/ChromeClientImpl.cpp index 18f7a02..c43a0b0 100644 --- a/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/WebKit/chromium/src/ChromeClientImpl.cpp @@ -841,7 +841,7 @@ PassRefPtr<PopupMenu> ChromeClientImpl::createPopupMenu(PopupMenuClient* client) { if (WebViewImpl::useExternalPopupMenus()) return adoptRef(new ExternalPopupMenu(client, m_webView->client())); - + return adoptRef(new PopupMenuChromium(client)); } diff --git a/WebKit/chromium/src/ChromiumBridge.cpp b/WebKit/chromium/src/ChromiumBridge.cpp index 39d2566..074c982 100644 --- a/WebKit/chromium/src/ChromiumBridge.cpp +++ b/WebKit/chromium/src/ChromiumBridge.cpp @@ -514,6 +514,12 @@ PassRefPtr<IDBFactoryBackendInterface> ChromiumBridge::idbFactory() return IDBFactoryBackendProxy::create(); } +void ChromiumBridge::idbShutdown() +{ + // In the browser process, this shuts down the utility process. In the renderer process, it does nothing. + webKitClient()->idbShutdown(); +} + void ChromiumBridge::createIDBKeysFromSerializedValuesAndKeyPath(const Vector<RefPtr<SerializedScriptValue> >& values, const String& keyPath, Vector<RefPtr<IDBKey> >& keys) { WebVector<WebSerializedScriptValue> webValues = values; diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/WebKit/chromium/src/FrameLoaderClientImpl.cpp index ef28981..9d79599 100644 --- a/WebKit/chromium/src/FrameLoaderClientImpl.cpp +++ b/WebKit/chromium/src/FrameLoaderClientImpl.cpp @@ -51,6 +51,7 @@ #include "PlatformString.h" #include "PluginData.h" #include "PluginDataChromium.h" +#include "ProgressTracker.h" #include "Settings.h" #include "StringExtras.h" #include "WebDataSourceImpl.h" @@ -1010,7 +1011,12 @@ void FrameLoaderClientImpl::postProgressStartedNotification() void FrameLoaderClientImpl::postProgressEstimateChangedNotification() { - // FIXME + WebViewImpl* webview = m_webFrame->viewImpl(); + if (webview && webview->client()) { + webview->client()->didChangeLoadProgress( + m_webFrame, m_webFrame->frame()->page()->progress()->estimatedProgress()); + } + } void FrameLoaderClientImpl::postProgressFinishedNotification() diff --git a/WebKit/chromium/src/GraphicsContext3DChromium.cpp b/WebKit/chromium/src/GraphicsContext3DChromium.cpp index 4d9e40b..8cfe8c0 100644 --- a/WebKit/chromium/src/GraphicsContext3DChromium.cpp +++ b/WebKit/chromium/src/GraphicsContext3DChromium.cpp @@ -365,16 +365,6 @@ bool GraphicsContext3DInternal::isGLES2Compliant() const return m_impl->isGLES2Compliant(); } -bool GraphicsContext3DInternal::isGLES2NPOTStrict() const -{ - return m_impl->isGLES2NPOTStrict(); -} - -bool GraphicsContext3DInternal::isErrorGeneratedOnOutOfBoundsAccesses() const -{ - return m_impl->isErrorGeneratedOnOutOfBoundsAccesses(); -} - DELEGATE_TO_IMPL_1(activeTexture, unsigned long) DELEGATE_TO_IMPL_2(attachShader, Platform3DObject, Platform3DObject) @@ -1051,16 +1041,6 @@ bool GraphicsContext3D::isGLES2Compliant() const return m_internal->isGLES2Compliant(); } -bool GraphicsContext3D::isGLES2NPOTStrict() const -{ - return m_internal->isGLES2NPOTStrict(); -} - -bool GraphicsContext3D::isErrorGeneratedOnOutOfBoundsAccesses() const -{ - return m_internal->isErrorGeneratedOnOutOfBoundsAccesses(); -} - } // namespace WebCore #endif // ENABLE(3D_CANVAS) diff --git a/WebKit/chromium/src/GraphicsContext3DInternal.h b/WebKit/chromium/src/GraphicsContext3DInternal.h index 17163a4..4453d28 100644 --- a/WebKit/chromium/src/GraphicsContext3DInternal.h +++ b/WebKit/chromium/src/GraphicsContext3DInternal.h @@ -75,8 +75,6 @@ public: WebGLLayerChromium* platformLayer() const; #endif bool isGLES2Compliant() const; - bool isGLES2NPOTStrict() const; - bool isErrorGeneratedOnOutOfBoundsAccesses() const; //---------------------------------------------------------------------- // Entry points for WebGL. diff --git a/WebKit/chromium/src/LocalizedStrings.cpp b/WebKit/chromium/src/LocalizedStrings.cpp index fbc35ce..947e732 100644 --- a/WebKit/chromium/src/LocalizedStrings.cpp +++ b/WebKit/chromium/src/LocalizedStrings.cpp @@ -296,44 +296,56 @@ String localizedMediaTimeDescription(float /*time*/) String validationMessageValueMissingText() { - notImplemented(); - return String(); + return query(WebLocalizedString::ValidationValueMissing); } String validationMessageTypeMismatchText() { - notImplemented(); - return String(); + return query(WebLocalizedString::ValidationTypeMismatch); +} + +String validationMessageTypeMismatchForEmailText() +{ + return query(WebLocalizedString::ValidationTypeMismatchForEmail); +} + +String validationMessageTypeMismatchForMultipleEmailText() +{ + return query(WebLocalizedString::ValidationTypeMismatchForMultipleEmail); +} + +String validationMessageTypeMismatchForURLText() +{ + return query(WebLocalizedString::ValidationTypeMismatchForURL); } String validationMessagePatternMismatchText() { - notImplemented(); - return String(); + return query(WebLocalizedString::ValidationPatternMismatch); } -String validationMessageTooLongText() +String validationMessageTooLongText(int, int) { - notImplemented(); - return String(); + // FIXME: pass the arguments. + return query(WebLocalizedString::ValidationTooLong); } -String validationMessageRangeUnderflowText() +String validationMessageRangeUnderflowText(const String&) { - notImplemented(); - return String(); + // FIXME: pass the arguments. + return query(WebLocalizedString::ValidationRangeUnderflow); } -String validationMessageRangeOverflowText() +String validationMessageRangeOverflowText(const String&) { - notImplemented(); - return String(); + // FIXME: pass the arguments. + return query(WebLocalizedString::ValidationRangeOverflow); } -String validationMessageStepMismatchText() +String validationMessageStepMismatchText(const String&, const String&) { - notImplemented(); - return String(); + // FIXME: pass the arguments. + return query(WebLocalizedString::ValidationStepMismatch); } } // namespace WebCore diff --git a/WebKit/chromium/src/WebBindings.cpp b/WebKit/chromium/src/WebBindings.cpp index c25c31b..d0a20d3 100644 --- a/WebKit/chromium/src/WebBindings.cpp +++ b/WebKit/chromium/src/WebBindings.cpp @@ -323,6 +323,17 @@ static NPObject* makeIntArrayImpl(const WebVector<int>& data) return npCreateV8ScriptObject(0, result, window); } +static NPObject* makeStringArrayImpl(const WebVector<WebString>& data) +{ + v8::HandleScope handleScope; + v8::Handle<v8::Array> result = v8::Array::New(data.size()); + for (size_t i = 0; i < data.size(); ++i) + result->Set(i, data[i].data() ? v8::String::New(reinterpret_cast<const uint16_t*>((data[i].data()))) : v8::String::New("")); + + WebCore::DOMWindow* window = WebCore::V8Proxy::retrieveWindow(WebCore::V8Proxy::currentContext()); + return npCreateV8ScriptObject(0, result, window); +} + #endif bool WebBindings::getDragData(NPObject* event, int* eventId, WebDragData* data) @@ -371,6 +382,16 @@ NPObject* WebBindings::makeIntArray(const WebVector<int> & data) #endif } +NPObject* WebBindings::makeStringArray(const WebVector<WebString>& data) +{ +#if USE(V8) + return makeStringArrayImpl(data); +#else + // Not supported on other ports (JSC, etc.). + return 0; +#endif +} + void WebBindings::pushExceptionHandler(ExceptionHandler handler, void* data) { WebCore::pushExceptionHandler(handler, data); diff --git a/WebKit/chromium/src/WebDataSourceImpl.cpp b/WebKit/chromium/src/WebDataSourceImpl.cpp index d5b1d79..65147fa 100644 --- a/WebKit/chromium/src/WebDataSourceImpl.cpp +++ b/WebKit/chromium/src/WebDataSourceImpl.cpp @@ -96,7 +96,7 @@ double WebDataSourceImpl::triggeringEventTime() const return 0.0; // DOMTimeStamp uses units of milliseconds. - return triggeringAction().event()->timeStamp() / 1000.0; + return convertDOMTimeStampToSeconds(triggeringAction().event()->timeStamp()); } WebDataSource::ExtraData* WebDataSourceImpl::extraData() const diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp index 41b8321..adaab61 100644 --- a/WebKit/chromium/src/WebFrameImpl.cpp +++ b/WebKit/chromium/src/WebFrameImpl.cpp @@ -287,11 +287,11 @@ public: { } - virtual void begin(float width) + virtual void begin(float width, float height) { ASSERT(!m_printedPageWidth); m_printedPageWidth = width; - PrintContext::begin(m_printedPageWidth); + PrintContext::begin(m_printedPageWidth, height); } virtual void end() @@ -753,8 +753,9 @@ void WebFrameImpl::bindToWindowObject(const WebString& name, NPObject* object) void WebFrameImpl::executeScript(const WebScriptSource& source) { + TextPosition1 position(WTF::OneBasedNumber::fromOneBasedInt(source.startLine), WTF::OneBasedNumber::base()); m_frame->script()->executeScript( - ScriptSourceCode(source.code, source.url, source.startLine)); + ScriptSourceCode(source.code, source.url, position)); } void WebFrameImpl::executeScriptInIsolatedWorld( @@ -764,8 +765,9 @@ void WebFrameImpl::executeScriptInIsolatedWorld( Vector<ScriptSourceCode> sources; for (unsigned i = 0; i < numSources; ++i) { + TextPosition1 position(WTF::OneBasedNumber::fromOneBasedInt(sourcesIn[i].startLine), WTF::OneBasedNumber::base()); sources.append(ScriptSourceCode( - sourcesIn[i].code, sourcesIn[i].url, sourcesIn[i].startLine)); + sourcesIn[i].code, sourcesIn[i].url, position)); } m_frame->script()->evaluateInIsolatedWorld(worldId, sources, extensionGroup); @@ -817,8 +819,9 @@ void WebFrameImpl::collectGarbage() v8::Handle<v8::Value> WebFrameImpl::executeScriptAndReturnValue( const WebScriptSource& source) { + TextPosition1 position(WTF::OneBasedNumber::fromOneBasedInt(source.startLine), WTF::OneBasedNumber::base()); return m_frame->script()->executeScript( - ScriptSourceCode(source.code, source.url, source.startLine)).v8Value(); + ScriptSourceCode(source.code, source.url, position)).v8Value(); } // Returns the V8 context for this frame, or an empty handle if there is none. @@ -845,7 +848,7 @@ bool WebFrameImpl::insertStyleText( if (!id.isEmpty()) { Element* oldElement = document->getElementById(id); if (oldElement) { - Node* parent = oldElement->parent(); + Node* parent = oldElement->parentNode(); if (!parent) return false; parent->removeChild(oldElement, err); @@ -1283,7 +1286,7 @@ int WebFrameImpl::printBegin(const WebSize& pageSize, int printerDPI, bool *useB FloatRect rect(0, 0, static_cast<float>(pageSize.width), static_cast<float>(pageSize.height)); - m_printContext->begin(rect.width()); + m_printContext->begin(rect.width(), rect.height()); float pageHeight; // We ignore the overlays calculation for now since they are generated in the // browser. pageHeight is actually an output parameter. @@ -2003,7 +2006,7 @@ void WebFrameImpl::setFindEndstateFocusAndSelection() // example, focus links if we have found text within the link. Node* node = m_activeMatch->firstNode(); while (node && !node->isFocusable() && node != frame()->document()) - node = node->parent(); + node = node->parentNode(); if (node && node != frame()->document()) { // Found a focusable parent node. Set focus to it. diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp index 4cb701f..bd070c6 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp @@ -36,6 +36,7 @@ #include "app/gfx/gl/gl_bindings.h" #include "app/gfx/gl/gl_context.h" +#include "app/gfx/gl/gl_implementation.h" #include "NotImplemented.h" #include "WebView.h" #include <wtf/OwnArrayPtr.h> @@ -69,6 +70,10 @@ WebGraphicsContext3DDefaultImpl::VertexAttribPointerState::VertexAttribPointerSt WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl() : m_initialized(false) , m_renderDirectlyToWebView(false) + , m_isGLES2(false) + , m_haveEXTFramebufferObject(false) + , m_haveEXTFramebufferMultisample(false) + , m_haveANGLEFramebufferMultisample(false) , m_texture(0) , m_fbo(0) , m_depthStencilBuffer(0) @@ -166,10 +171,18 @@ bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attribute if (renderDirectlyToWebView) m_attributes.antialias = false; + m_isGLES2 = gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2; + const char* extensions = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)); + m_haveEXTFramebufferObject = strstr(extensions, "GL_EXT_framebuffer_object"); + m_haveEXTFramebufferMultisample = strstr(extensions, "GL_EXT_framebuffer_multisample"); + m_haveANGLEFramebufferMultisample = strstr(extensions, "GL_ANGLE_framebuffer_multisample"); + validateAttributes(); - glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); - glEnable(GL_POINT_SPRITE); + if (!m_isGLES2) { + glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); + glEnable(GL_POINT_SPRITE); + } if (!angleCreateCompilers()) { angleDestroyCompilers(); @@ -187,7 +200,8 @@ void WebGraphicsContext3DDefaultImpl::validateAttributes() const char* extensions = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)); if (m_attributes.stencil) { - if (strstr(extensions, "GL_EXT_packed_depth_stencil")) { + if (strstr(extensions, "GL_OES_packed_depth_stencil") + || strstr(extensions, "GL_EXT_packed_depth_stencil")) { if (!m_attributes.depth) m_attributes.depth = true; } else @@ -201,7 +215,9 @@ void WebGraphicsContext3DDefaultImpl::validateAttributes() if (!strstr(vendor, "NVIDIA")) isValidVendor = false; #endif - if (!isValidVendor || !strstr(extensions, "GL_EXT_framebuffer_multisample")) + if (!(isValidVendor + && (m_haveEXTFramebufferMultisample + || (m_haveANGLEFramebufferMultisample && strstr(extensions, "GL_OES_rgb8_rgba8"))))) m_attributes.antialias = false; // Don't antialias when using Mesa to ensure more reliable testing and @@ -220,7 +236,12 @@ void WebGraphicsContext3DDefaultImpl::resolveMultisampledFramebuffer(unsigned x, if (m_attributes.antialias) { glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO); glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo); - glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR); + if (m_haveEXTFramebufferMultisample) + glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_NEAREST); + else { + ASSERT(m_haveANGLEFramebufferMultisample); + glBlitFramebufferANGLE(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_NEAREST); + } glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO); } } @@ -263,17 +284,7 @@ int WebGraphicsContext3DDefaultImpl::sizeInBytes(int type) bool WebGraphicsContext3DDefaultImpl::isGLES2Compliant() { - return false; -} - -bool WebGraphicsContext3DDefaultImpl::isGLES2NPOTStrict() -{ - return false; -} - -bool WebGraphicsContext3DDefaultImpl::isErrorGeneratedOnOutOfBoundsAccesses() -{ - return false; + return m_isGLES2; } unsigned int WebGraphicsContext3DDefaultImpl::getPlatformTextureId() @@ -328,12 +339,16 @@ void WebGraphicsContext3DDefaultImpl::reshape(int width, int height) } } - GLint internalColorFormat, colorFormat, internalDepthStencilFormat = 0; + GLint internalMultisampledColorFormat, internalColorFormat, colorFormat, internalDepthStencilFormat = 0; if (m_attributes.alpha) { - internalColorFormat = GL_RGBA8; + // GL_RGBA8_OES == GL_RGBA8 + internalMultisampledColorFormat = GL_RGBA8; + internalColorFormat = m_isGLES2 ? GL_RGBA : GL_RGBA8; colorFormat = GL_RGBA; } else { - internalColorFormat = GL_RGB8; + // GL_RGB8_OES == GL_RGB8 + internalMultisampledColorFormat = GL_RGB8; + internalColorFormat = m_isGLES2 ? GL_RGB : GL_RGB8; colorFormat = GL_RGB; } if (m_attributes.stencil || m_attributes.depth) { @@ -341,8 +356,12 @@ void WebGraphicsContext3DDefaultImpl::reshape(int width, int height) // See GraphicsContext3DInternal constructor. if (m_attributes.stencil && m_attributes.depth) internalDepthStencilFormat = GL_DEPTH24_STENCIL8_EXT; - else - internalDepthStencilFormat = GL_DEPTH_COMPONENT; + else { + if (m_isGLES2) + internalDepthStencilFormat = GL_DEPTH_COMPONENT16; + else + internalDepthStencilFormat = GL_DEPTH_COMPONENT; + } } bool mustRestoreFBO = false; @@ -357,11 +376,21 @@ void WebGraphicsContext3DDefaultImpl::reshape(int width, int height) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO); } glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_multisampleColorBuffer); - glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, sampleCount, internalColorFormat, width, height); + if (m_haveEXTFramebufferMultisample) + glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, sampleCount, internalMultisampledColorFormat, width, height); + else { + ASSERT(m_haveANGLEFramebufferMultisample); + glRenderbufferStorageMultisampleANGLE(GL_RENDERBUFFER_EXT, sampleCount, internalMultisampledColorFormat, width, height); + } glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, m_multisampleColorBuffer); if (m_attributes.stencil || m_attributes.depth) { glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_multisampleDepthStencilBuffer); - glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, sampleCount, internalDepthStencilFormat, width, height); + if (m_haveEXTFramebufferMultisample) + glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, sampleCount, internalDepthStencilFormat, width, height); + else { + ASSERT(m_haveANGLEFramebufferMultisample); + glRenderbufferStorageMultisampleANGLE(GL_RENDERBUFFER_EXT, sampleCount, internalDepthStencilFormat, width, height); + } if (m_attributes.stencil) glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_multisampleDepthStencilBuffer); if (m_attributes.depth) @@ -508,9 +537,15 @@ bool WebGraphicsContext3DDefaultImpl::readBackFramebuffer(unsigned char* pixels, mustRestorePackAlignment = true; } - // FIXME: OpenGL ES 2 does not support GL_BGRA so this fails when - // using that backend. - glReadPixels(0, 0, m_cachedWidth, m_cachedHeight, GL_BGRA, GL_UNSIGNED_BYTE, pixels); + if (m_isGLES2) { + // FIXME: consider testing for presence of GL_OES_read_format + // and GL_EXT_read_format_bgra, and using GL_BGRA_EXT here + // directly. + glReadPixels(0, 0, m_cachedWidth, m_cachedHeight, GL_RGBA, GL_UNSIGNED_BYTE, pixels); + for (size_t i = 0; i < bufferSize; i += 4) + std::swap(pixels[i], pixels[i + 2]); + } else + glReadPixels(0, 0, m_cachedWidth, m_cachedHeight, GL_BGRA, GL_UNSIGNED_BYTE, pixels); if (mustRestorePackAlignment) glPixelStorei(GL_PACK_ALIGNMENT, packAlignment); @@ -845,7 +880,7 @@ DELEGATE_TO_GL_1(frontFace, FrontFace, unsigned long) void WebGraphicsContext3DDefaultImpl::generateMipmap(unsigned long target) { makeContextCurrent(); - if (glGenerateMipmapEXT) + if (m_isGLES2 || m_haveEXTFramebufferObject) glGenerateMipmapEXT(target); // FIXME: provide alternative code path? This will be unpleasant // to implement if glGenerateMipmapEXT is not available -- it will @@ -951,11 +986,15 @@ void WebGraphicsContext3DDefaultImpl::getFramebufferAttachmentParameteriv(unsign void WebGraphicsContext3DDefaultImpl::getIntegerv(unsigned long pname, int* value) { + makeContextCurrent(); + if (m_isGLES2) { + glGetIntegerv(pname, value); + return; + } // Need to emulate MAX_FRAGMENT/VERTEX_UNIFORM_VECTORS and MAX_VARYING_VECTORS // because desktop GL's corresponding queries return the number of components // whereas GLES2 return the number of vectors (each vector has 4 components). // Therefore, the value returned by desktop GL needs to be divided by 4. - makeContextCurrent(); switch (pname) { case MAX_FRAGMENT_UNIFORM_VECTORS: glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, value); @@ -1096,10 +1135,10 @@ WebString WebGraphicsContext3DDefaultImpl::getString(unsigned long name) StringBuilder result; result.append(reinterpret_cast<const char*>(glGetString(name))); if (name == GL_EXTENSIONS) { - // GL_CHROMIUM_copy_texture_to_parent_texture requires this - // desktopGL-only function (GLES2 doesn't support it), so - // check for its existence here. - if (glGetTexLevelParameteriv) + // GL_CHROMIUM_copy_texture_to_parent_texture requires the + // desktopGL-only function glGetTexLevelParameteriv (GLES2 + // doesn't support it). + if (!m_isGLES2) result.append(" GL_CHROMIUM_copy_texture_to_parent_texture"); } return WebString(result.toString()); @@ -1551,11 +1590,21 @@ bool WebGraphicsContext3DDefaultImpl::angleValidateShaderSource(ShaderSourceEntr } int length = 0; - ShGetInfo(compiler, SH_OBJECT_CODE_LENGTH, &length); + if (m_isGLES2) { + // ANGLE does not yet have a GLSL ES backend. Therefore if the + // compile succeeds we send the original source down. + length = strlen(entry.source); + if (length > 0) + ++length; // Add null terminator + } else + ShGetInfo(compiler, SH_OBJECT_CODE_LENGTH, &length); if (length > 1) { if (!tryFastMalloc(length * sizeof(char)).getValue(entry.translatedSource)) return false; - ShGetObjectCode(compiler, entry.translatedSource); + if (m_isGLES2) + strncpy(entry.translatedSource, entry.source, length); + else + ShGetObjectCode(compiler, entry.translatedSource); } entry.isValid = true; return true; diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h index c1de77c..e865710 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h @@ -70,8 +70,6 @@ public: virtual int sizeInBytes(int type); virtual bool isGLES2Compliant(); - virtual bool isGLES2NPOTStrict(); - virtual bool isErrorGeneratedOnOutOfBoundsAccesses(); virtual void reshape(int width, int height); @@ -271,6 +269,10 @@ private: WebGraphicsContext3D::Attributes m_attributes; bool m_initialized; bool m_renderDirectlyToWebView; + bool m_isGLES2; + bool m_haveEXTFramebufferObject; + bool m_haveEXTFramebufferMultisample; + bool m_haveANGLEFramebufferMultisample; unsigned int m_texture; unsigned int m_fbo; diff --git a/WebKit/chromium/src/WebImageDecoder.cpp b/WebKit/chromium/src/WebImageDecoder.cpp index 160deee..0cfd458 100644 --- a/WebKit/chromium/src/WebImageDecoder.cpp +++ b/WebKit/chromium/src/WebImageDecoder.cpp @@ -56,10 +56,10 @@ void WebImageDecoder::init(Type type) { switch (type) { case TypeBMP: - m_private = new BMPImageDecoder(true); + m_private = new BMPImageDecoder(true, false); break; case TypeICO: - m_private = new ICOImageDecoder(true); + m_private = new ICOImageDecoder(true, false); break; } } diff --git a/WebKit/chromium/src/WebPerformance.cpp b/WebKit/chromium/src/WebPerformance.cpp index f019793..de9c1f6 100644 --- a/WebKit/chromium/src/WebPerformance.cpp +++ b/WebKit/chromium/src/WebPerformance.cpp @@ -37,6 +37,11 @@ using namespace WebCore; namespace WebKit { +static double millisecondsToSeconds(unsigned long long milliseconds) +{ + return static_cast<double>(milliseconds / 1000.0); +} + void WebPerformance::reset() { m_private.reset(); @@ -50,11 +55,11 @@ void WebPerformance::assign(const WebPerformance& other) WebNavigationType WebPerformance::navigationType() const { switch (m_private->navigation()->type()) { - case Navigation::NAVIGATE: + case PerformanceNavigation::NAVIGATE: return WebNavigationTypeOther; - case Navigation::RELOAD: + case PerformanceNavigation::RELOAD: return WebNavigationTypeReload; - case Navigation::BACK_FORWARD: + case PerformanceNavigation::BACK_FORWARD: return WebNavigationTypeBackForward; } ASSERT_NOT_REACHED(); @@ -63,22 +68,22 @@ WebNavigationType WebPerformance::navigationType() const double WebPerformance::navigationStart() const { - return static_cast<double>(m_private->timing()->navigationStart()); + return millisecondsToSeconds(m_private->timing()->navigationStart()); } double WebPerformance::unloadEventEnd() const { - return static_cast<double>(m_private->timing()->unloadEventEnd()); + return millisecondsToSeconds(m_private->timing()->unloadEventEnd()); } double WebPerformance::redirectStart() const { - return static_cast<double>(m_private->timing()->redirectStart()); + return millisecondsToSeconds(m_private->timing()->redirectStart()); } double WebPerformance::redirectEnd() const { - return static_cast<double>(m_private->timing()->redirectEnd()); + return millisecondsToSeconds(m_private->timing()->redirectEnd()); } unsigned short WebPerformance::redirectCount() const @@ -88,57 +93,52 @@ unsigned short WebPerformance::redirectCount() const double WebPerformance::fetchStart() const { - return static_cast<double>(m_private->timing()->fetchStart()); + return millisecondsToSeconds(m_private->timing()->fetchStart()); } double WebPerformance::domainLookupStart() const { - return static_cast<double>(m_private->timing()->domainLookupStart()); + return millisecondsToSeconds(m_private->timing()->domainLookupStart()); } double WebPerformance::domainLookupEnd() const { - return static_cast<double>(m_private->timing()->domainLookupEnd()); + return millisecondsToSeconds(m_private->timing()->domainLookupEnd()); } double WebPerformance::connectStart() const { - return static_cast<double>(m_private->timing()->connectStart()); + return millisecondsToSeconds(m_private->timing()->connectStart()); } double WebPerformance::connectEnd() const { - return static_cast<double>(m_private->timing()->connectEnd()); + return millisecondsToSeconds(m_private->timing()->connectEnd()); } double WebPerformance::requestStart() const { - return static_cast<double>(m_private->timing()->requestStart()); -} - -double WebPerformance::requestEnd() const -{ - return static_cast<double>(m_private->timing()->requestEnd()); + return millisecondsToSeconds(m_private->timing()->requestStart()); } double WebPerformance::responseStart() const { - return static_cast<double>(m_private->timing()->responseStart()); + return millisecondsToSeconds(m_private->timing()->responseStart()); } double WebPerformance::responseEnd() const { - return static_cast<double>(m_private->timing()->responseEnd()); + return millisecondsToSeconds(m_private->timing()->responseEnd()); } double WebPerformance::loadEventStart() const { - return static_cast<double>(m_private->timing()->loadEventStart()); + return millisecondsToSeconds(m_private->timing()->loadEventStart()); } double WebPerformance::loadEventEnd() const { - return static_cast<double>(m_private->timing()->loadEventEnd()); + return millisecondsToSeconds(m_private->timing()->loadEventEnd()); } WebPerformance::WebPerformance(const PassRefPtr<Performance>& performance) diff --git a/WebKit/chromium/src/WebSettingsImpl.cpp b/WebKit/chromium/src/WebSettingsImpl.cpp index 9953b5c..1bea259 100644 --- a/WebKit/chromium/src/WebSettingsImpl.cpp +++ b/WebKit/chromium/src/WebSettingsImpl.cpp @@ -223,6 +223,11 @@ void WebSettingsImpl::setEditableLinkBehaviorNeverLive() m_settings->setEditableLinkBehavior(WebCore::EditableLinkNeverLive); } +void WebSettingsImpl::setFrameFlatteningEnabled(bool enabled) +{ + m_settings->setFrameFlatteningEnabled(enabled); +} + void WebSettingsImpl::setFontRenderingModeNormal() { // FIXME: If you ever need more behaviors than this, then we should probably diff --git a/WebKit/chromium/src/WebSettingsImpl.h b/WebKit/chromium/src/WebSettingsImpl.h index 6d40b4f..081188f 100644 --- a/WebKit/chromium/src/WebSettingsImpl.h +++ b/WebKit/chromium/src/WebSettingsImpl.h @@ -77,6 +77,7 @@ public: virtual void setXSSAuditorEnabled(bool); virtual void setLocalStorageEnabled(bool); virtual void setEditableLinkBehaviorNeverLive(); + virtual void setFrameFlatteningEnabled(bool); virtual void setFontRenderingModeNormal(); virtual void setShouldPaintCustomScrollbars(bool); virtual void setAllowUniversalAccessFromFileURLs(bool); diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp index ce8eba6..8cf7848 100644 --- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp +++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp @@ -60,6 +60,11 @@ void WebSpeechInputControllerMockImpl::setMockRecognitionResult(const WebString& m_webcoreMock->setRecognitionResult(result, language); } +void WebSpeechInputControllerMockImpl::clearResults() +{ + m_webcoreMock->clearResults(); +} + void WebSpeechInputControllerMockImpl::didCompleteRecording(int requestId) { m_listener->didCompleteRecording(requestId); diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h index 7b50a8b..7680873 100644 --- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h +++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h @@ -63,6 +63,7 @@ public: // WebSpeechInputControllerMock methods. void setMockRecognitionResult(const WebString& result, const WebString& language); + void clearResults(); private: OwnPtr<WebCore::SpeechInputClientMock> m_webcoreMock; diff --git a/WebKit/chromium/src/WebURLRequest.cpp b/WebKit/chromium/src/WebURLRequest.cpp index b243420..7a77ca3 100644 --- a/WebKit/chromium/src/WebURLRequest.cpp +++ b/WebKit/chromium/src/WebURLRequest.cpp @@ -221,6 +221,16 @@ WebURLRequest::TargetType WebURLRequest::targetType() const return static_cast<TargetType>(m_private->m_resourceRequest->targetType()); } +bool WebURLRequest::hasUserGesture() const +{ + return m_private->m_resourceRequest->hasUserGesture(); +} + +void WebURLRequest::setHasUserGesture(bool hasUserGesture) +{ + m_private->m_resourceRequest->setHasUserGesture(hasUserGesture); +} + void WebURLRequest::setTargetType(TargetType targetType) { m_private->m_resourceRequest->setTargetType( diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp index 490c620..6625949 100644 --- a/WebKit/chromium/src/WebViewImpl.cpp +++ b/WebKit/chromium/src/WebViewImpl.cpp @@ -178,7 +178,7 @@ static const PopupContainerSettings autoFillPopupSettings = { false, // acceptOnAbandon true, // loopSelectionNavigation false, // restrictWidthOfListBox (For security reasons show the entire entry - // so the user doesn't enter information it did not intend to.) + // so the user doesn't enter information he did not intend to.) // For suggestions, we use the direction of the input field as the direction // of the popup items. The main reason is to keep the display of items in // drop-down the same as the items in the input field. @@ -571,13 +571,13 @@ bool WebViewImpl::keyEvent(const WebKeyboardEvent& event) WebInputEvent::RawKeyDown; #endif - if (((!event.modifiers && (event.windowsKeyCode == VKEY_APPS)) - || ((event.modifiers == WebInputEvent::ShiftKey) && (event.windowsKeyCode == VKEY_F10))) - && event.type == contextMenuTriggeringEventType) { + bool isUnmodifiedMenuKey = !(event.modifiers & WebInputEvent::InputModifiers) && event.windowsKeyCode == VKEY_APPS; + bool isShiftF10 = event.modifiers == WebInputEvent::ShiftKey && event.windowsKeyCode == VKEY_F10; + if ((isUnmodifiedMenuKey || isShiftF10) && event.type == contextMenuTriggeringEventType) { sendContextMenuEvent(event); return true; } -#endif +#endif // OS(WINDOWS) || OS(LINUX) || OS(FREEBSD) // It's not clear if we should continue after detecting a capslock keypress. // I'll err on the side of continuing, which is the pre-existing behaviour. @@ -936,10 +936,10 @@ void WebViewImpl::resize(const WebSize& newSize) m_client->didInvalidateRect(damagedRect); } -#if USE(ACCELERATED_COMPOSITING) && OS(DARWIN) +#if USE(ACCELERATED_COMPOSITING) if (m_layerRenderer) { - m_layerRenderer->resizeOnscreenContent(WebCore::IntSize(std::max(1, m_size.width), - std::max(1, m_size.height))); + m_layerRenderer->resizeOnscreenContent(IntSize(std::max(1, m_size.width), + std::max(1, m_size.height))); } #endif } @@ -1016,10 +1016,6 @@ void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect) resizeRect.intersect(IntRect(IntPoint(), m_layerRenderer->rootLayerTextureSize())); doPixelReadbackToCanvas(canvas, resizeRect); } - - // Temporarily present so the downstream Chromium renderwidget still renders. - // FIXME: remove this call once the changes to Chromium's renderwidget have landed. - m_layerRenderer->present(); #endif } else { WebFrameImpl* webframe = mainFrameImpl(); @@ -1100,7 +1096,7 @@ bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent) node->dispatchMouseEvent( PlatformMouseEventBuilder(mainFrameImpl()->frameView(), *static_cast<const WebMouseEvent*>(&inputEvent)), - eventType); + eventType, static_cast<const WebMouseEvent*>(&inputEvent)->clickCount); m_currentInputEvent = 0; return true; } @@ -1943,12 +1939,9 @@ void WebViewImpl::applyAutoFillSuggestions( } if (m_autoFillPopupShowing) { - m_autoFillPopupClient->setSuggestions( - names, labels, icons, uniqueIDs, separatorIndex); refreshAutoFillPopup(); } else { - m_autoFillPopup->show(focusedNode->getRect(), - focusedNode->ownerDocument()->view(), 0); + m_autoFillPopup->show(focusedNode->getRect(), focusedNode->ownerDocument()->view(), 0); m_autoFillPopupShowing = true; } @@ -2274,22 +2267,11 @@ void WebViewImpl::setRootGraphicsLayer(WebCore::PlatformLayer* layer) void WebViewImpl::setRootLayerNeedsDisplay() { m_client->scheduleComposite(); - // FIXME: To avoid breaking the downstream Chrome render_widget while downstream - // changes land, we also have to pass a 1x1 invalidate up to the client - { - WebRect damageRect(0, 0, 1, 1); - m_client->didInvalidateRect(damageRect); - } } void WebViewImpl::scrollRootLayerRect(const IntSize& scrollDelta, const IntRect& clipRect) { - // FIXME: To avoid breaking the Chrome render_widget when the new compositor render - // path is not checked in, we must still pass scroll damage up to the client. This - // code will be backed out in a followup CL once the Chromium changes have landed. - m_client->didScrollRect(scrollDelta.width(), scrollDelta.height(), clipRect); - ASSERT(m_layerRenderer); // Compute the damage rect in viewport space. WebFrameImpl* webframe = mainFrameImpl(); @@ -2346,7 +2328,7 @@ void WebViewImpl::scrollRootLayerRect(const IntSize& scrollDelta, const IntRect& // Move the damage innerDamage.move(scrollDelta.width(), scrollDelta.height()); - + // Merge it back into the damaged rect m_rootLayerDirtyRect.unite(innerDamage); } @@ -2356,17 +2338,12 @@ void WebViewImpl::scrollRootLayerRect(const IntSize& scrollDelta, const IntRect& void WebViewImpl::invalidateRootLayerRect(const IntRect& rect) { - // FIXME: To avoid breaking the Chrome render_widget when the new compositor render - // path is not checked in, we must still pass damage up to the client. This - // code will be backed out in a followup CL once the Chromium changes have landed. - m_client->didInvalidateRect(rect); - ASSERT(m_layerRenderer); if (!page()) return; - // FIXME: add a smarter damage aggregation logic and/or unify with + // FIXME: add a smarter damage aggregation logic and/or unify with // LayerChromium's damage logic m_rootLayerDirtyRect.unite(rect); setRootLayerNeedsDisplay(); @@ -2380,16 +2357,23 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) if (!active) { m_isAcceleratedCompositingActive = false; + m_layerRenderer->finish(); // finish all GL rendering before we hide the window? + m_client->didActivateAcceleratedCompositing(false); return; } if (m_layerRenderer) { m_isAcceleratedCompositingActive = true; + m_layerRenderer->resizeOnscreenContent(WebCore::IntSize(std::max(1, m_size.width), + std::max(1, m_size.height))); + + m_client->didActivateAcceleratedCompositing(true); return; } RefPtr<GraphicsContext3D> context = m_temporaryOnscreenGraphicsContext3D.release(); if (!context) { + m_client->didActivateAcceleratedCompositing(true); context = GraphicsContext3D::create(GraphicsContext3D::Attributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); if (context) context->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); @@ -2400,6 +2384,7 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) m_compositorCreationFailed = false; } else { m_isAcceleratedCompositingActive = false; + m_client->didActivateAcceleratedCompositing(false); m_compositorCreationFailed = true; } } diff --git a/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp b/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp index 1e70619..058e947 100644 --- a/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp +++ b/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp @@ -34,13 +34,16 @@ #if ENABLE(FILE_SYSTEM) #include "AsyncFileSystemCallbacks.h" +#include "FileMetadata.h" #include "FileSystem.h" #include "NotImplemented.h" #include "WebFileSystem.h" #include "WebFileSystemCallbacksImpl.h" +#include "WebFileWriter.h" #include "WebKit.h" #include "WebKitClient.h" #include "WebWorkerBase.h" +#include "WorkerAsyncFileWriterChromium.h" #include "WorkerContext.h" #include "WorkerFileSystemCallbacksBridge.h" #include "WorkerScriptController.h" @@ -134,9 +137,76 @@ void WorkerAsyncFileSystemChromium::readDirectory(const String& path, PassOwnPtr createWorkerFileSystemCallbacksBridge(callbacks)->postReadDirectoryToMainThread(m_webFileSystem, path, m_modeForCurrentOperation); } -void WorkerAsyncFileSystemChromium::createWriter(AsyncFileWriterClient*, const String&, PassOwnPtr<AsyncFileSystemCallbacks>) +class WorkerFileWriterHelperCallbacks : public AsyncFileSystemCallbacks { +public: + static PassOwnPtr<WorkerFileWriterHelperCallbacks> create(AsyncFileWriterClient* client, const String& path, WebKit::WebFileSystem* webFileSystem, PassOwnPtr<WebCore::AsyncFileSystemCallbacks> callbacks, WorkerContext* workerContext) + { + return adoptPtr(new WorkerFileWriterHelperCallbacks(client, path, webFileSystem, callbacks, workerContext)); + } + + virtual void didSucceed() + { + ASSERT_NOT_REACHED(); + } + + virtual void didReadMetadata(const FileMetadata& metadata) + { + ASSERT(m_callbacks); + if (metadata.type != FileMetadata::TypeFile || metadata.length < 0) + m_callbacks->didFail(WebKit::WebFileErrorInvalidState); + else { + OwnPtr<WorkerAsyncFileWriterChromium> asyncFileWriterChromium = WorkerAsyncFileWriterChromium::create(m_webFileSystem, m_path, m_workerContext, m_client, WorkerAsyncFileWriterChromium::Asynchronous); + m_callbacks->didCreateFileWriter(asyncFileWriterChromium.release(), metadata.length); + } + } + + virtual void didReadDirectoryEntry(const String& name, bool isDirectory) + { + ASSERT_NOT_REACHED(); + } + + virtual void didReadDirectoryEntries(bool hasMore) + { + ASSERT_NOT_REACHED(); + } + + virtual void didOpenFileSystem(const String&, PassOwnPtr<AsyncFileSystem>) + { + ASSERT_NOT_REACHED(); + } + + // Called when an AsyncFileWrter has been created successfully. + virtual void didCreateFileWriter(PassOwnPtr<AsyncFileWriter>, long long) + { + ASSERT_NOT_REACHED(); + } + + virtual void didFail(int code) + { + ASSERT(m_callbacks); + m_callbacks->didFail(code); + } + +private: + WorkerFileWriterHelperCallbacks(AsyncFileWriterClient* client, const String& path, WebKit::WebFileSystem* webFileSystem, PassOwnPtr<WebCore::AsyncFileSystemCallbacks> callbacks, WorkerContext* workerContext) + : m_client(client) + , m_path(path) + , m_webFileSystem(webFileSystem) + , m_callbacks(callbacks) + , m_workerContext(workerContext) + { + } + + AsyncFileWriterClient* m_client; + String m_path; + WebKit::WebFileSystem* m_webFileSystem; + OwnPtr<WebCore::AsyncFileSystemCallbacks> m_callbacks; + WorkerContext* m_workerContext; +}; + +void WorkerAsyncFileSystemChromium::createWriter(AsyncFileWriterClient* client, const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - notImplemented(); + createWorkerFileSystemCallbacksBridge(WorkerFileWriterHelperCallbacks::create(client, path, m_webFileSystem, callbacks, m_workerContext))->postReadMetadataToMainThread(m_webFileSystem, path, m_modeForCurrentOperation); } PassRefPtr<WorkerFileSystemCallbacksBridge> WorkerAsyncFileSystemChromium::createWorkerFileSystemCallbacksBridge(PassOwnPtr<AsyncFileSystemCallbacks> callbacks) diff --git a/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp b/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp new file mode 100644 index 0000000..8d8e469 --- /dev/null +++ b/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WorkerAsyncFileWriterChromium.h" + +#if ENABLE(FILE_SYSTEM) + +#include "AsyncFileSystem.h" +#include "Blob.h" +#include "ScriptExecutionContext.h" +#include "WebFileSystem.h" +#include "WebFileWriter.h" +#include "WebURL.h" +#include "WebWorkerBase.h" +#include "WorkerContext.h" +#include "WorkerFileWriterCallbacksBridge.h" +#include "WorkerLoaderProxy.h" +#include "WorkerThread.h" +#include <wtf/Assertions.h> + +using namespace WebKit; + +namespace WebCore { + +WorkerAsyncFileWriterChromium::WorkerAsyncFileWriterChromium(WebFileSystem* webFileSystem, const String& path, WorkerContext* workerContext, AsyncFileWriterClient* client, WriterType type) + : m_type(type) +{ + ASSERT(m_type == Asynchronous); // Synchronous is not implemented yet. + + WorkerLoaderProxy* proxy = &workerContext->thread()->workerLoaderProxy(); + m_bridge = WorkerFileWriterCallbacksBridge::create(path, proxy, workerContext, client); +} + +WorkerAsyncFileWriterChromium::~WorkerAsyncFileWriterChromium() +{ + m_bridge->postShutdownToMainThread(m_bridge); +} + +void WorkerAsyncFileWriterChromium::write(long long position, Blob* data) +{ + m_bridge->postWriteToMainThread(position, data->url()); +} + +void WorkerAsyncFileWriterChromium::truncate(long long length) +{ + m_bridge->postTruncateToMainThread(length); +} + +void WorkerAsyncFileWriterChromium::abort() +{ + m_bridge->postAbortToMainThread(); +} + +} + +#endif // ENABLE(FILE_SYSTEM) diff --git a/WebKit/chromium/src/WorkerAsyncFileWriterChromium.h b/WebKit/chromium/src/WorkerAsyncFileWriterChromium.h new file mode 100644 index 0000000..55d8d24 --- /dev/null +++ b/WebKit/chromium/src/WorkerAsyncFileWriterChromium.h @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WorkerAsyncFileWriterChromium_h +#define WorkerAsyncFileWriterChromium_h + +#if ENABLE(FILE_SYSTEM) + +#include "AsyncFileWriter.h" +#include <wtf/PassOwnPtr.h> + +namespace WebKit { + class WebFileSystem; + class WebFileWriter; + class WorkerFileWriterCallbacksBridge; +} + +namespace WTF { + class String; +} +using WTF::String; + +namespace WebCore { + +class AsyncFileSystem; +class AsyncFileWriterClient; +class Blob; +class WorkerContext; + +class WorkerAsyncFileWriterChromium : public AsyncFileWriter { +public: + enum WriterType { + Asynchronous, + Synchronous, + }; + + static PassOwnPtr<WorkerAsyncFileWriterChromium> create(WebKit::WebFileSystem* webFileSystem, const String& path, WorkerContext* workerContext, AsyncFileWriterClient* client, WriterType type) + { + return adoptPtr(new WorkerAsyncFileWriterChromium(webFileSystem, path, workerContext, client, type)); + } + ~WorkerAsyncFileWriterChromium(); + + // FileWriter + virtual void write(long long position, Blob* data); + virtual void truncate(long long length); + virtual void abort(); + +private: + + WorkerAsyncFileWriterChromium(WebKit::WebFileSystem*, const String& path, WorkerContext*, AsyncFileWriterClient*, WriterType); + RefPtr<WebKit::WorkerFileWriterCallbacksBridge> m_bridge; + WriterType m_type; +}; + +} // namespace + +#endif // ENABLE(FILE_SYSTEM) + +#endif // AsyncFileWriterChromium_h diff --git a/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.cpp b/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.cpp new file mode 100644 index 0000000..827c011 --- /dev/null +++ b/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.cpp @@ -0,0 +1,193 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WorkerFileWriterCallbacksBridge.h" + +#if ENABLE(FILE_SYSTEM) + +#include "AsyncFileWriterClient.h" +#include "CrossThreadTask.h" +#include "WebCString.h" +#include "WebFileSystem.h" +#include "WebFileWriter.h" +#include "WebKit.h" +#include "WebKitClient.h" +#include "WebWorkerBase.h" +#include "WorkerContext.h" +#include "WorkerLoaderProxy.h" +#include "WorkerThread.h" +#include <wtf/MainThread.h> +#include <wtf/Threading.h> + +using namespace WebCore; + +namespace WebKit { + +void WorkerFileWriterCallbacksBridge::notifyStop() +{ + ASSERT(m_workerContext->isContextThread()); + m_clientOnWorkerThread = 0; +} + +void WorkerFileWriterCallbacksBridge::postWriteToMainThread(long long position, const KURL& data) +{ + dispatchTaskToMainThread(createCallbackTask(&writeOnMainThread, this, position, data)); +} + +void WorkerFileWriterCallbacksBridge::postTruncateToMainThread(long long length) +{ + dispatchTaskToMainThread(createCallbackTask(&truncateOnMainThread, this, length)); +} + +void WorkerFileWriterCallbacksBridge::postAbortToMainThread() +{ + dispatchTaskToMainThread(createCallbackTask(&abortOnMainThread, this)); +} + +void WorkerFileWriterCallbacksBridge::postShutdownToMainThread(PassRefPtr<WorkerFileWriterCallbacksBridge> bridge) +{ + ASSERT(m_workerContext->isContextThread()); + m_clientOnWorkerThread = 0; + dispatchTaskToMainThread(createCallbackTask(&shutdownOnMainThread, bridge)); +} + +void WorkerFileWriterCallbacksBridge::writeOnMainThread(ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge, long long position, const KURL& data) +{ + bridge->m_writer->write(position, WebURL(data)); +} + +void WorkerFileWriterCallbacksBridge::truncateOnMainThread(ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge, long long length) +{ + bridge->m_writer->truncate(length); +} + +void WorkerFileWriterCallbacksBridge::abortOnMainThread(ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge) +{ + bridge->m_writer->cancel(); +} + +void WorkerFileWriterCallbacksBridge::initOnMainThread(ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge, const String& path) +{ + ASSERT(!bridge->m_writer); + bridge->m_writer = webKitClient()->fileSystem()->createFileWriter(path, bridge.get()); +} + +void WorkerFileWriterCallbacksBridge::shutdownOnMainThread(ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge) +{ + bridge->m_writerDeleted = true; + bridge->m_writer.clear(); +} + +void WorkerFileWriterCallbacksBridge::didWrite(long long bytes, bool complete) +{ + dispatchTaskToWorkerThread(createCallbackTask(&didWriteOnWorkerThread, this, bytes, complete)); +} + +void WorkerFileWriterCallbacksBridge::didFail(WebFileError error) +{ + dispatchTaskToWorkerThread(createCallbackTask(&didFailOnWorkerThread, this, error)); +} + +void WorkerFileWriterCallbacksBridge::didTruncate() +{ + dispatchTaskToWorkerThread(createCallbackTask(&didTruncateOnWorkerThread, this)); +} + +WorkerFileWriterCallbacksBridge::WorkerFileWriterCallbacksBridge(const String& path, WorkerLoaderProxy* proxy, ScriptExecutionContext* scriptExecutionContext, AsyncFileWriterClient* client) + : WorkerContext::Observer(static_cast<WorkerContext*>(scriptExecutionContext)) + , m_proxy(proxy) + , m_workerContext(scriptExecutionContext) + , m_clientOnWorkerThread(client) + , m_writerDeleted(false) +{ + ASSERT(m_workerContext->isContextThread()); + postInitToMainThread(path); +} + +void WorkerFileWriterCallbacksBridge::postInitToMainThread(const String& path) +{ + dispatchTaskToMainThread(createCallbackTask(&initOnMainThread, this, path)); +} + +WorkerFileWriterCallbacksBridge::~WorkerFileWriterCallbacksBridge() +{ + ASSERT(!m_clientOnWorkerThread); + ASSERT(!m_writer); +} + +// We know m_clientOnWorkerThread is still valid because it is only cleared on the context thread, and because we check in runTaskOnWorkerThread before calling any of these methods. +void WorkerFileWriterCallbacksBridge::didWriteOnWorkerThread(ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge, long long length, bool complete) +{ + ASSERT(bridge->m_workerContext->isContextThread()); + bridge->m_clientOnWorkerThread->didWrite(length, complete); +} + +void WorkerFileWriterCallbacksBridge::didFailOnWorkerThread(ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge, WebFileError error) +{ + ASSERT(bridge->m_workerContext->isContextThread()); + bridge->m_clientOnWorkerThread->didFail(static_cast<FileError::ErrorCode>(error)); +} + +void WorkerFileWriterCallbacksBridge::didTruncateOnWorkerThread(ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge) +{ + ASSERT(bridge->m_workerContext->isContextThread()); + bridge->m_clientOnWorkerThread->didTruncate(); +} + +void WorkerFileWriterCallbacksBridge::runTaskOnMainThread(ScriptExecutionContext* scriptExecutionContext, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge, PassOwnPtr<ScriptExecutionContext::Task> taskToRun) +{ + ASSERT(isMainThread()); + if (!bridge->m_writerDeleted) + taskToRun->performTask(scriptExecutionContext); +} + +void WorkerFileWriterCallbacksBridge::runTaskOnWorkerThread(ScriptExecutionContext* scriptExecutionContext, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge, PassOwnPtr<ScriptExecutionContext::Task> taskToRun) +{ + ASSERT(bridge->m_workerContext->isContextThread()); + if (bridge->m_clientOnWorkerThread) + taskToRun->performTask(scriptExecutionContext); +} + +void WorkerFileWriterCallbacksBridge::dispatchTaskToMainThread(PassOwnPtr<ScriptExecutionContext::Task> task) +{ + ASSERT(m_workerContext->isContextThread()); + WebWorkerBase::dispatchTaskToMainThread(createCallbackTask(&runTaskOnMainThread, this, task)); +} + +void WorkerFileWriterCallbacksBridge::dispatchTaskToWorkerThread(PassOwnPtr<ScriptExecutionContext::Task> task) +{ + ASSERT(isMainThread()); + m_proxy->postTaskForModeToWorkerContext(createCallbackTask(&runTaskOnWorkerThread, this, task), WorkerRunLoop::defaultMode()); +} + +} + +#endif // ENABLE(FILE_SYSTEM) diff --git a/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.h b/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.h new file mode 100644 index 0000000..d2e416e --- /dev/null +++ b/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.h @@ -0,0 +1,156 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WorkerFileWriterCallbacksBridge_h +#define WorkerFileWriterCallbacksBridge_h + +#if ENABLE(FILE_SYSTEM) + +#include "WebFileError.h" +#include "WebFileWriterClient.h" +#include "WorkerContext.h" +#include <wtf/PassOwnPtr.h> +#include <wtf/PassRefPtr.h> +#include <wtf/ThreadSafeShared.h> + +namespace WebCore { + class AsyncFileWriterClient; + class KURL; + class WorkerLoaderProxy; +} + +namespace WTF { + class String; +} +using WTF::String; + +namespace WebKit { + +class WebFileSystem; +class WebFileWriter; +class WebFileWriterClient; +class WebWorkerBase; + +// This class is used as a mechanism to bridge calls between threads. +// Calls to a WebFileWriter must happen on the main thread, but they come from +// the context thread. The responses through the WebFileWriterClient interface +// start on the main thread, but must be sent via the worker context thread. +// +// A typical flow for write would look like this: +// Bridge::postWriteToMainThread() on WorkerThread +// --> Bridge::writeOnMainThread() is called on MainThread +// --> WebFileWriter::write() +// This makes an IPC; the actual operation is down in the browser. +// --> Bridge::didWrite is called on MainThread +// --> Bridge::didWriteOnWorkerThread is called on WorkerThread +// This calls the original client (m_clientOnWorkerThread). +// +// The bridge object is refcounted, so that it doesn't get deleted while there +// are cross-thread calls in flight. Each CrossThreadTask carries a reference +// to the bridge, which guarantees that the bridge will still be valid when the +// task is executed. In order to shut down the bridge, the WebFileWriterClient +// should call postShutdownToMainThread before dropping its reference to the +// bridge. This ensures that the WebFileWriter will be cleared on the main +// thread and that no further calls to the WebFileWriterClient will be made. +class WorkerFileWriterCallbacksBridge : public ThreadSafeShared<WorkerFileWriterCallbacksBridge>, public WebCore::WorkerContext::Observer, public WebFileWriterClient { +public: + ~WorkerFileWriterCallbacksBridge(); + + // WorkerContext::Observer method. + virtual void notifyStop(); + + static PassRefPtr<WorkerFileWriterCallbacksBridge> create(const String& path, WebCore::WorkerLoaderProxy* proxy, WebCore::ScriptExecutionContext* workerContext, WebCore::AsyncFileWriterClient* client) + { + return adoptRef(new WorkerFileWriterCallbacksBridge(path, proxy, workerContext, client)); + } + + // Methods that create an instance and post an initial request task to the main thread. They must be called on the worker thread. + void postWriteToMainThread(long long position, const WebCore::KURL& data); + void postTruncateToMainThread(long long length); + void postAbortToMainThread(); + + // The owning WorkerAsyncFileWriterChromium should call this method before dropping its last reference to the bridge, on the context thread. + // The actual deletion of the WorkerFileWriterCallbacksBridge may happen on either the main or context thread, depending on where the last reference goes away; that's safe as long as this is called first. + void postShutdownToMainThread(PassRefPtr<WorkerFileWriterCallbacksBridge>); + + // Callback methods that are called on the main thread. + // These are the implementation of WebKit::WebFileWriterClient. + void didWrite(long long bytes, bool complete); + void didFail(WebFileError); + void didTruncate(); + +private: + WorkerFileWriterCallbacksBridge(const String& path, WebCore::WorkerLoaderProxy*, WebCore::ScriptExecutionContext*, WebCore::AsyncFileWriterClient*); + + void postInitToMainThread(const String& path); + + // Methods that are to be called on the main thread. + static void writeOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge>, long long position, const WebCore::KURL& data); + static void truncateOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge>, long long length); + static void abortOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge>); + static void initOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge>, const String& path); + static void shutdownOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge>); + + // Methods that dispatch to AsyncFileWriterClient on the worker threads. + static void didWriteOnWorkerThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge>, long long length, bool complete); + static void didFailOnWorkerThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge>, WebFileError); + static void didTruncateOnWorkerThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge>); + + // Called on the main thread to run the supplied task. + static void runTaskOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge>, PassOwnPtr<WebCore::ScriptExecutionContext::Task>); + // Called on the worker thread to run the supplied task. + static void runTaskOnWorkerThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge>, PassOwnPtr<WebCore::ScriptExecutionContext::Task>); + + // Called on the worker thread to dispatch to the main thread. + void dispatchTaskToMainThread(PassOwnPtr<WebCore::ScriptExecutionContext::Task>); + // Called on the main thread to dispatch to the worker thread. + void dispatchTaskToWorkerThread(PassOwnPtr<WebCore::ScriptExecutionContext::Task>); + + // Used from the main thread to post tasks to the context thread. + WebCore::WorkerLoaderProxy* m_proxy; + + // Used on the context thread, only to check that we're running on the context thread. + WebCore::ScriptExecutionContext* m_workerContext; + + // Created and destroyed from the main thread. + OwnPtr<WebKit::WebFileWriter> m_writer; + + // Used on the context thread to call back into the client. + WebCore::AsyncFileWriterClient* m_clientOnWorkerThread; + + // Used to indicate that shutdown has started on the main thread, and hence the writer has been deleted. + bool m_writerDeleted; +}; + +} // namespace WebCore + +#endif + +#endif // WorkerFileWriterCallbacksBridge_h diff --git a/WebKit/chromium/src/mac/WebInputEventFactory.mm b/WebKit/chromium/src/mac/WebInputEventFactory.mm index 015409e..55883c9 100644 --- a/WebKit/chromium/src/mac/WebInputEventFactory.mm +++ b/WebKit/chromium/src/mac/WebInputEventFactory.mm @@ -1016,14 +1016,17 @@ WebMouseEvent WebInputEventFactory::mouseEvent(NSEvent* event, NSView* view) break; case NSLeftMouseUp: result.type = WebInputEvent::MouseUp; + result.clickCount = [event clickCount]; result.button = WebMouseEvent::ButtonLeft; break; case NSOtherMouseUp: result.type = WebInputEvent::MouseUp; + result.clickCount = [event clickCount]; result.button = WebMouseEvent::ButtonMiddle; break; case NSRightMouseUp: result.type = WebInputEvent::MouseUp; + result.clickCount = [event clickCount]; result.button = WebMouseEvent::ButtonRight; break; case NSMouseMoved: diff --git a/WebKit/chromium/tests/PopupMenuTest.cpp b/WebKit/chromium/tests/PopupMenuTest.cpp index aef29cf..b68980f 100644 --- a/WebKit/chromium/tests/PopupMenuTest.cpp +++ b/WebKit/chromium/tests/PopupMenuTest.cpp @@ -76,7 +76,7 @@ public: virtual PopupMenuStyle itemStyle(unsigned listIndex) const { Font font(FontPlatformData(12.0, false, false), false); - return PopupMenuStyle(Color::black, Color::white, font, true, Length(), TextDirection()); + return PopupMenuStyle(Color::black, Color::white, font, true, false, Length(), TextDirection()); } virtual PopupMenuStyle menuStyle() const { return itemStyle(0); } virtual int clientInsetLeft() const { return 0; } |