Merge lp:~abreu-alexandre/oxide/add-ua-to-downloadrequested into lp:~oxide-developers/oxide/oxide.trunk

Proposed by Alexandre Abreu
Status: Merged
Merged at revision: 1106
Proposed branch: lp:~abreu-alexandre/oxide/add-ua-to-downloadrequested
Merge into: lp:~oxide-developers/oxide/oxide.trunk
Diff against target: 650 lines (+256/-57)
17 files modified
patches/add-suggested-filename-to-download-starting-resource-delegate.patch (+57/-0)
patches/series (+2/-1)
qt/core/api/oxideqdownloadrequest.cc (+17/-7)
qt/core/api/oxideqdownloadrequest.h (+3/-0)
qt/core/api/oxideqdownloadrequest_p.h (+3/-1)
qt/core/browser/oxide_qt_web_view.cc (+4/-2)
qt/core/browser/oxide_qt_web_view.h (+2/-1)
qt/tests/qmltests/api/tst_WebView_downloadRequested.qml (+41/-0)
qt/tests/qmltests/api/tst_WebView_downloadRequestedAnchor.html (+7/-0)
shared/browser/oxide_browser_context.cc (+11/-1)
shared/browser/oxide_resource_dispatcher_host_delegate.cc (+82/-28)
shared/browser/oxide_resource_dispatcher_host_delegate.h (+15/-11)
shared/browser/oxide_web_view.cc (+4/-2)
shared/browser/oxide_web_view.h (+2/-1)
shared/browser/oxide_web_view_client.cc (+2/-1)
shared/browser/oxide_web_view_client.h (+2/-1)
shared/shared.gyp (+2/-0)
To merge this branch: bzr merge lp:~abreu-alexandre/oxide/add-ua-to-downloadrequested
Reviewer Review Type Date Requested Status
Chris Coulson Approve
Review via email: mp+225864@code.launchpad.net

Commit message

- Expose user agent as part of downloadRequest object
- Remove the chromium patch to add ShouldDownloadUrl,
- Add a must_download flag to the downloadRequest object,
- Add a small patch to chromium to make the download anchor suggested filename work on the context of a DownloadStarting resource delegate (which is absent in chromium). Without it there is no way to have access to the suggested filename in the <a download="name"> tag,

Description of the change

- Expose user agent as part of downloadRequest object
- Remove the chromium patch to add ShouldDownloadUrl,
- Add a must_download flag to the downloadRequest object,
- Add a small patch to chromium to make the download anchor suggested filename work on the context of a DownloadStarting resource delegate (which is absent in chromium). Without it there is no way to have access to the suggested filename in the <a download="name"> tag,

To post a comment you must log in.
647. By Olivier Tilloy

Update the power save blocker to use the new Unity.Screen D-Bus API on touch devices.

648. By Chris Coulson

Support double-tap-to-zoom

649. By Chris Coulson

Now we are not using the GestureRecognizer, tweak ui::ScaleGestureDetector::Config::min_pinch_update_span_delta to get rid of the coarseness when pinching

650. By Chris Coulson

Get rid of a compiler warning

651. By Chris Coulson

Don't generate touch events for stationary touch points

652. By Chris Coulson

Configure the gesture detection to be closer to Android Chrome

653. By Chris Coulson

Synthesize pending touch ACK's when swapping views

654. By Olivier Tilloy

Delay the loading of data until the webview has been initialized.

655. By Chris Coulson

Don't mix up "double tap touch slop" and "double tap slop" from Android's ViewConfiguration when picking Oxide defaults

656. By Chris Coulson

Make IdAllocator non-copyable, and add some comments to it

657. By Chris Coulson

Don't crash on Qt platforms that don't implement QPlatformNativeInterface. As lack of this prevents us from getting a native display handle, also don't allow any GL implementations and guard against accesses to BrowserProcessMain::GetNativeDisplay()

658. By Chris Coulson

Use the --enable-smooth-scrolling flag rather than setting enable_scroll_animator manually

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Thanks for this.

Whilst it looks like this works for the case where a download triggered when we get "Content-Disposition: attachment" in the HTTP response, it probably won't work for downloads that are triggered from other sources (<anchor> download attribute) because net::URLRequest::GetFullRequestHeaders() only works once the request has been started.

In this case, the options are manually working out the user agent string (requires a call in to BrowserContextDelegate) or starting the request (perhaps just sending a HEAD request) and waiting for the response. But there are some issues with this:

- URLRequest is owned by the ResourceDispatcher, so you'd need to create a new one.
- You would also need to provide your own URLRequest::Delegate to drive the request.
- You only want to do this for requests that come via ResourceDispatcherHost::BeginDownload - perhaps checking ResourceRequestInfo::IsDownload()

Is there another mechanism that allows us to intercept and cancel a request once we get the initial response but before it reaches the download manager (where we don't have access to the URLRequest anyway), rather than relying on our extra API on ResourceDispatcherHostDelegate? We're calling this after receiving the initial response in the most common case anyway, so I'm starting to wonder whether this is really the best approach.

659. By Alexandre Abreu

add chrome driver support/build

660. By Chris Coulson

Bump Chromium rev to 37.0.2062.20

661. By Chris Coulson

Bump Chromium rev to 38.0.2096.0

662. By Chris Coulson

Bump Chromium rev to 38.0.2101.0

663. By Chris Coulson

Include the correct UI assets so that the scrollbars work again

664. By Chris Coulson

Add OXIDE_DISABLE_SETUID_SANDBOX and OXIDE_DISABLE_SECCOMP_FILTER_SANDBOX environment variables

665. By Chris Coulson

Assert we have a QGuiApplication on startup

666. By Chris Coulson

Stop using ContentMainRunner for starting the browser code - it messes with process global stuff that is unexpected in a public library (eg, clearing the SIGCHLD handler)

667. By Chris Coulson

Bump Chromium rev to 38.0.2107.2

668. By Chris Coulson

Add USE_GCC_VERSION option for the cross-compile toolchain file

669. By Chris Coulson

Revert r668 because of an unrelated change

670. By Chris Coulson

Add USE_GCC_VERSION option for the cross-compile toolchain file

671. By Chris Coulson

Unbreak fresh builds with the current Chromium version

672. By Chris Coulson

Fix an arm link failure caused by a recent webrtc change

673. By Chris Coulson

Tidy up the inconsistent BrowserProcessMain interface where we have a mixture of static and non-static functions

674. By Chris Coulson

CHECK that CommandLine::Init doesn't fail

675. By Chris Coulson

BrowserMainRunner should really be deleted before AtExitManager - it is in Chrome

676. By Chris Coulson

Remove comment about moving the MessageLoopForUI::Stop call to BrowserMainParts - it's ok where it is

677. By Chris Coulson

Bump Chromium rev to 38.0.2107.3

678. By Chris Coulson

CHECK that SIGCHLD isn't being ignored, and ignore SIGPIPE if the application hasn't overridden the default handler for it

679. By Olivier Tilloy

Ensure files returned by the file picker exist.

680. By Chris Coulson

Bump Chromium rev to 38.0.2114.2

681. By Chris Coulson

Don't send a URL longer than content::GetMaxURLChars() when fetching the override for navigator.userAgent, as this fails to deserialize in the browser process, causing it to abort the renderer

682. By Chris Coulson

Make sure tst_bug1349510 doesn't trigger a different bug (we'll track the issue with FrameHostMsg_OpenURL separately)

683. By Alexandre Abreu

cookie manager api

684. By Alexandre Abreu

Add bind ip to devtools API

685. By Chris Coulson

Bump Chromium rev to 38.0.2121.3

686. By Chris Coulson

Strip down BrowserContextImpl / OTRBrowserContextImpl by introducing 2 new structs for data members shared between a BrowserContext pair (BrowserContextSharedData and BrowserContextSharedIOData), which allows us to drop all of the virtual methods that proxy calls between the 2 BrowserContexts

687. By Chris Coulson

Guard BrowserContext entry points to ensure they are only called on the UI thread, and also return a strong reference from BrowserContext::Create so that ownership is explicit now

688. By Chris Coulson

Use DCHECK_CURRENTLY_ON where appropriate

689. By Alexandre Abreu

Add accept language translation support

690. By Alexandre Abreu

update pos

691. By Chris Coulson

Bump Chromium rev to 38.0.2125.0

692. By Chris Coulson

Build with host_clang == 0

693. By Chris Coulson

Fixes for WebContext + WebContextDelegateWorker threading:
- IODelegate is no longer owned by WebContextAdapterPrivate with a raw pointer in OxideQQuickWebContextPrivate. It is now owned by OxideQQuickWebContextPrivate with a weak pointer in WebContextAdapterPrivate.
- UIThreadController is merged in to OxideQQuickWebContextDelegateWorkerPrivate
- IOThreadController is now accessed via QSharedPointer rather than owning this in OxideQQuickWebContextDelegateWorkerPrivate and accessing it from WebContextIODelegate through a raw pointer. This avoids us having to hold a lock for the entire duration of calls in to the worker on Chromium's IO thread, ensuring that setting a new worker or deleting an existing one will no longer block the UI thread if the IO thread is calling in to the existing worker.
- HelperThreadController is shared between IOThreadController and OxideQQuickWebContextDelegateWorkerPrivate, ensuring it remains alive as long as either the UI thread or IO thread entry points remain accessible.
- Add assertions in various places that we are on the correct thread.

694. By Chris Coulson

Rename run_qmlscene.sh to run_qmlapp.sh and allow it to run any QML app

695. By Chris Coulson

Drop the random operator overloads for allowing bitwise operations on FrameMetadataChangeFlags. Instead, use QFlags in the qml plugin and introduce a new macro for creating bitwise operator overloads for enums (OXIDE_MAKE_ENUM_BITWISE_OPERATORS), partly modelled on Mozilla's MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS

696. By Chris Coulson

Don't leak the default WebPreferences when setting a new one

697. By Chris Coulson

Make revocation checking work by ensuring that NSS has a MessageLoop and URLRequestContext. This is required for Extended Validation to work correctly, and also fixes a bunch of console warnings: "No URLRequestContext for NSS HTTP handler"

698. By Chris Coulson

Bump Chromium rev to 38.0.2125.8

699. By Chris Coulson

Don't leak GeolocationPermissionRequest if there are no handlers on WebView.geolocationPermissionRequested

700. By Chris Coulson

Update for the Chromium GIT migration

701. By Chris Coulson

Revert r700 - it breaks the current checkout and doesn't make it possible to check out 38.0.2125.24 either

702. By Chris Coulson

Update for the Chromium GIT migration

703. By Chris Coulson

Make sure we fetch branch heads

704. By Chris Coulson

Bump depot_tools to 8f93f79bcee79072a70cf9c8c392ad140f0cecf1

705. By Chris Coulson

Bump Chromium rev to 38.0.2125.24

706. By Chris Coulson

Add WebView.securityStatus, WebView.blockedContent, WebView.setCanTemporarilyDisplayInsecureContent, WebView.setCanTemporarilyRunInsecureContent, SecurityStatus, CertificateError and SslCertificate API's. I'm still working on tests for these API's, but this shouldn't block webbrowser-app work

707. By Chris Coulson

Fix various issues with the CookieManager code:
- getNextRequestId() always returns zero
- getNextRequestId() depends on undefined beahviour (signed integer overflow)
- CookieMonster calls the callbacks synchronously if nothing needs to be loaded from permanent storage. This means that the behaviour of setting one cookie and waiting for the callback to run before setting the next causes the stack to grow depending on the amount of cookies being set (and also means lots of reentry). Rework it to prevent this behaviour.
- Ensure that the responses at the API level always do happen asynchronously.
- Setting a session cookie always fails because the undefined expiry date gets interpreted as a date far in the past, so Chromium considers the cookie expired.
- Ensure that session cookies returned from the API don't have an expiry date way in the past.

There are a few minor changes to the API too:
- CookieManager.gotCookies does not return a status code now. The only possible errors when reading cookies occur synchronously (ie, the CookieStore is unavailable), so the API just returns an invalid request ID now.
- The addition of CookieManager.getCookies(), which allows you to retrieve all cookies for a URL.
- The expirationdate attribute now works with the built-in Date type rather than having to give it the expiry in milliseconds since the epoch.

The tests have been improved as well to actually test the various cases rather than just calling in to the API and making sure we get a response back

708. By Chris Coulson

Set the gettext domain to oxide-qt rather than oxide

709. By Chris Coulson

Bump qt version to 1.3

710. By Chris Coulson

Bump Chromium rev to 39.0.2138.3

711. By Chris Coulson

Some minor tweaks to the CookieManager API:
- Bring back setNetworkCookies as this is being used from C++ code in webbrowser-app. Note that the url parameter is no longer a QString though (it's a QUrl)
- Remove the status parameter entirely from the response to setCookies/setNetworkCookies - the problem with this is that it provides no way to know which cookies failed and which ones were set successfully. Instead, replace it by a new parameter (failedCookies) which returns a list of cookies that failed to set.
- Having setCookies + cookiesSet and getCookies + gotCookies is a bit confusing. These are now changed to setCookies + setCookiesResponse and getCookies + getCookiesResponse.

712. By Chris Coulson

Add back support for ms since epoch for the expirationdate, as well as ISO8601 strings

713. By Chris Coulson

Clear the temporary mixed content blocker settings for navigations that aren't within the same page (ie, where more than the URL fragment changes) and aren't due to a content-initiated reload. The last one is needed to avoid ending up in an infinite loop

714. By Chris Coulson

Don't initialize NSS with a user DB

715. By Chris Coulson

Add CookieManager.deleteAllCookies and use this in place of clear-test-cookies-hack.py

716. By Chris Coulson

Get rid of run-qmltests.cmake - just use run_qmlapp.sh for this instead

717. By Chris Coulson

Add @run-at document-start to TestUtilsSlave.js to hopefully fix some random test failures that look like a race

718. By Chris Coulson

Bump Chromium rev to 39.0.2145.4

719. By Chris Coulson

Split the event loop implementation in runtests.py in to its own module

720. By Chris Coulson

Tidy up the cmake files a bit. The include files are gone - they aren't needed anyway and it wasn't really obvious where new variables should go. The changes also fix a problem where running cmake in a cross-compile set up with a cache file already seems to fail

721. By Chris Coulson

Give each test its own datadir. Should hopefully fix LP: #1278315

722. By Chris Coulson

Split the HTTP server in to its own module

723. By Chris Coulson

Move mock plugin to out/plugins

724. By Chris Coulson

OxideQQuickGlobals -> OxideQQuickGlobal

725. By Chris Coulson

Add tests for WebView.securityStatus, SecurityStatus and SslCertificate

726. By Chris Coulson

Add some tests for navigating away from a HTTPS URL

727. By Chris Coulson

ssl-api => ssl

728. By Chris Coulson

Revert accidental commit

729. By Chris Coulson

Split the certificate tests in to their own test

730. By Chris Coulson

Remove bogus chunk from patch

731. By Chris Coulson

Verify the certificate fingerprint in tst_SecurityStatus.qml. Whilst we test the SslCertificate API in a separate test, SslCertificate objects have 2 sources in Oxide and we should verify that both of these create them correctly

732. By Chris Coulson

Add tests for CertificateError

733. By Chris Coulson

Revert accidental change again

734. By Chris Coulson

Add tests for WebPreferences.can{Display,Run}InsecureContent

735. By Chris Coulson

Make sure we add some checks for WebView.blockedContent

736. By Chris Coulson

Ensure WebView.blockedContent is set appropriately after a reload

737. By Chris Coulson

Add tests for WebView.setCanTemporarily{Display,Run}InsecureContent() API's

738. By Chris Coulson

B'ah, I keep committing this change

739. By Chris Coulson

Fix a nullptr deref with non-overridable certificate errors

740. By Chris Coulson

Make all subframe and subresource SSL errors non-overridable, as overriding them currently doesn't always result in the security status API indicating a degraded security level

741. By Chris Coulson

Add WebContext.hostMappingRules API and add a set of mappings in TestWebContext. This allows us to load content from different domains (that get mapped to localhost), and made it possible to discover bug 1368385

742. By Chris Coulson

Test SecurityStatus for insecure content in subframes

743. By Chris Coulson

Merge tst_CertificateError_allow/tst_CertificateError_denial

744. By Chris Coulson

Test CertificateError.isCancelled

745. By Chris Coulson

Sigh...

746. By Chris Coulson

Test the mixed content preferences with subframes

747. By Chris Coulson

Add subframe tests for the mixed content override

748. By Chris Coulson

Fix a regression on clean builds introduced by r720

749. By Chris Coulson

Append to QML2_IMPORT_PATH, as Qt adds these in order to the import path list, and the most recently added is used first

750. By Chris Coulson

Fix various issues with make package

751. By Chris Coulson

Fix a rounding error when calculating the view size in DIP which results in one axis overflowing by a pixel and the other axis underflowing by a pixel

752. By Chris Coulson

Back out r751 because it breaks window.screen{X,Y}

753. By Chris Coulson

Fix a rounding error when calculating the view size in DIP which results in one axis overflowing by a pixel and the other axis underflowing by a pixel

754. By Alexandre Abreu

Make the gesttext domain oxide-qt a proper define

755. By Chris Coulson

Bump Chromium rev to 39.0.2159.4

756. By Chris Coulson

Fix undefined variable error when running cmake

757. By Chris Coulson

Auto scroll the focused editable node in to view when the input method appears

758. By Chris Coulson

Make sure we can set domain cookies

759. By Chris Coulson

Deprecate WebView.loadingChanged, introduce WebView.loadEvent for delivering LoadEvents and WebView.loadingStateChanged for notifying of changes to WebView.loading

760. By Chris Coulson

Add LoadEvent.TypeCommitted, as this is when the security origin of the page changes. It could be useful for clearing any context an application might, related to the security origin of the page

761. By Chris Coulson

Don't save "cachedir = None" in .client.cfg when --cache-dir isn't specified, as it breaks checkouts

762. By Olivier Tilloy

Disable touch editing (i.e. prevent long presses from triggering a word selection), as we currently don’t have a selection API to interact with the selected word.

763. By Chris Coulson

Fix compiler warning in oxide_pepper_talk_host.cc

764. By Chris Coulson

Chromium's base::Time measures time since the Windows epoch, whereas QDateTime expects time since the Unix epoch. Fix this, and make sure that the tests are correct

765. By Chris Coulson

Setting WebView.url doesn't result in a signal immediately, because we don't get a notification from Chromium when the visible URL changes because of a browser-initiated pending navigation. Also, add a test to ensure that WebView.url doesn't indicate the pending URL for content-initiated navigations - which could be used for urlbar spoofing in the browser

766. By Chris Coulson

When adopting a WebContents, make sure we sync its state properly with the state of the WebView. Also make sure that the focus state is synchrnonized correctly with the renderer

767. By Chris Coulson

Turn on accelerated 2d canvas on Krillin

768. By Chris Coulson

Add missing file

769. By Chris Coulson

Store the cache stats to disk as soon as a fresh cache is created

770. By Olivier Tilloy

Shield ourselves against location sources that return invalid values for attributes (horizontal accuracy, vertical accuracy, speed).
Chromium silently fails to deliver a position update if the horizontal accuracy is NaN.

771. By Chris Coulson

Bump Chromium rev to 39.0.2166.2

772. By Chris Coulson

Fix a memory leak introduced in r686 (the call to DevToolsHttpHandler::Stop got deleted when refactoring the BrowserContext classes)

773. By Olivier Tilloy

Fix a typo in a unit test.

774. By Olivier Tilloy

Add a crash unit test for bug #1352952.

775. By Chris Coulson

Split public classes out of the QML plugin in to a new shared library. This is a prerequisite for exposing a C++ API

776. By Chris Coulson

Add a hack to unbreak make package

777. By Chris Coulson

Bump Chromium rev to 39.0.2171.2

778. By Chris Coulson

Bump Chromium rev to 39.0.2171.7

779. By Chris Coulson

Add a QAbstractEventDispatcher implementation that can be attached to threads created by Chromium, which don't otherwise have a Qt event loop. Our implementation basically just delegates to Chromium's message loop, and uses that to dispatch Qt tasks. This allows us to use Qt features such as timers, postEvent and QSocketNotifier on threads that weren't created by Qt. In addition to this:
- Attach our QAbstractEventDispatcher implementation to Chromium's IO thread and geolocation thread
- Kill the dedicated helper thread we created for WebContextDelegateWorker. This can all be handled directly on Chromium's IO thread now
- Kill the helper thread we created for geolocation, and split the location handling between Chromium's geolocation thread and IO thread. The reason we don't do it all on the geolocation thread is that it doesn't have an IO message pump, and so we can't use QSocketNotifier on it

780. By Chris Coulson

Bump Chromium rev to 39.0.2171.13

781. By Chris Coulson

Fix some debug mode ThreadChecker aborts

782. By Chris Coulson

Give each WebView its own context, to fix some debug mode aborts

783. By Chris Coulson

The renderer aborts in debug mode when hiding a webview because the compositor pending swaps count goes negative. This must work by magic in release mode

784. By Alexandre Abreu

Add redirection API

785. By Olivier Tilloy

Do not check whether the input method is currently visible in WebView::SetInputPanelVisibility(…),
to avoid a possible race condition: if hide() and show() are called very quickly in a row, when show() is called the hide() request might not have completed yet, and isVisible() could return true.

786. By Alexandre Abreu

Add content script injection into main world

787. By Chris Coulson

Add support for custom URL schemes

788. By Chris Coulson

Make the custom URL scheme handling debug-clean

789. By Chris Coulson

Only emit LoadEvent.TypeRedirected for the new loadEvent signal

790. By Chris Coulson

Bump qt version to 1.4.0

791. By Chris Coulson

Bump Chromium rev to 40.0.2182.3

792. By Chris Coulson

Move WebContentsDelegate back from WebViewContentsHelper to WebView. The idea of this was that we could have a delegate before the WebView is created, but we currently aren't doing anything that requires this and it makes things far too complicated. If we need a delegate in the future before a WebView is created, we can always attach WebViewContentsHelper as a delegate temporarily, and have it implement the logic it requires whilst there is no WebView

793. By Chris Coulson

Remove unused code related to setting the user agent string

794. By Chris Coulson

Factor the WebView <-> RWHV interface out in to a new class, and make it a private base class of WebView. This makes the interface private without having RWHV as a friend of WebView

795. By Chris Coulson

Begin to clean up qt/core/glue, starting with WebContext. As of today, it's not really clear where to put code so this is the start of an attempt to clear that up. Essentially, the *Adapter classes are just meant to be a conduit between the QML plugin and an equivalent class in qt/core/browser. Nothing else should consume the *Adapter classes (we do this in a few places), and code generally belongs in qt/core/browser (we have it split quite inconsistently today)

796. By Chris Coulson

Split more code out of qt/core/glue and move it in to qt/core/browser

797. By Chris Coulson

Use tcmalloc in the renderer process, and install the handler for base::allocator::ReleaseFreeMemory(), which gets called in renderers with no visible views

798. By Chris Coulson

Bump Chromium rev to 40.0.2188.2

799. By Olivier Tilloy

Ignore SelectionChanged() notification when the selection is invalid.

800. By Chris Coulson

Fix warning when processing GPU blacklist

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

This can now be reviwed again

801. By Chris Coulson

Change FINAL -> final and OVERRIDE -> override, as Google are removing these defines now that Chromium requires a C++11 capable compiler

802. By Chris Coulson

As we require C++11 for the Chromium bits, require it for the other parts as well and stop using Q_DECL_FINAL everywhere except in what will eventually be public headers

803. By Chris Coulson

Fold InputMethodListener in to WebView

804. By Chris Coulson

Fix a build failure. It only works locally because I still have oxide_qt_web_view.moc in my build tree

805. By Chris Coulson

Fix some sign-compare warnings

806. By Chris Coulson

Move the call to CollectContextGraphicsInfo in to Oxide rather than patching it in to another codepath in Chromium

807. By Chris Coulson

URLRequest's created outside of ResourceDispatcherHost don't have a ResourceRequestInfo. Just ignore these for now

808. By Chris Coulson

Revert r807 because it doesn't build

809. By Chris Coulson

URLRequest's created outside of ResourceDispatcherHost don't have a ResourceRequestInfo. Just ignore these for now

810. By Chris Coulson

Bump Chromium rev to 40.0.2194.2

811. By Chris Coulson

Fix some case issues with the custom URL scheme handler

812. By Chris Coulson

Support component builds

813. By Chris Coulson

Revert r812, as it doesn't build the Ozone backend (although the build does still seem to work here)

814. By Chris Coulson

Support component builds

815. By Chris Coulson

Revert a change in the last merge because it breaks cross-builds

816. By Chris Coulson

Fix some more sign-compare warnings

817. By Chris Coulson

Stop leaking V8 contexts

818. By Olivier Tilloy

Delegate unhandled URL schemes to the system.

819. By Chris Coulson

Merge gpu-thread-shim + shared-gl-resources-with-embedder.patch

820. By Olivier Tilloy

Fix typo.

821. By Chris Coulson

Add WebView.prepareToClose, WebView.prepareToCloseResponse and WebView.closeRequested APIs

822. By Chris Coulson

Move IsTouchSupported() to PlatformIntegration

823. By Chris Coulson

Move GetNativeDisplay() and GetDefaultScreenInfo() to PlatformIntegration

824. By Chris Coulson

Follow up from the last change - make sure we block all GL on Qt platforms that don't allow us to determine the native display handle

825. By Chris Coulson

Move the GL share context accessor to PlatformIntegration, and also streamline how this is passed to Chromium to reduce the size of the gpu-thread-shim patch

826. By Chris Coulson

IsPlatformX11() is not used now

827. By Chris Coulson

Fix the linker flags so that gcc isn't specifying the path to the bundled build of binutils

828. By Chris Coulson

Get rid of ContentMainDelegate::GetNSSDbPath

829. By Chris Coulson

Use PlatformIntegration to create the UI message pump

830. By Chris Coulson

Get rid of IOThread::Delegate and BrowserMainParts::Delegate, and route everything through PlatformIntegration

831. By Chris Coulson

Get rid of the custom signal on OxideQQuickWebContextPrivate and just use QObject::destroyed

832. By Chris Coulson

Hopefully fix an intermittent failure

833. By Chris Coulson

WebPreferences is leaked if we delete a WebView without ever accessing the preferences

834. By Chris Coulson

Get rid of ContentBrowserClient::CreateWebPreferences(), clean up preferences ownership a bit and add some more tests to check the behaviour of WebView.preferences (including testing that WebViews inherit their opener's preferences)

835. By Chris Coulson

Proxy OverrideSystemLocationProvider through PlatformIntegration

836. By Chris Coulson

Get rid of the ContentMainDelegate and ContentBrowserClient implementations from qt/

837. By Chris Coulson

Rename PlatformIntegration to BrowserPlatformIntegration (we'll almost certainly have a RendererPlatformIntegration at some point), and introduce PlatformDelegate

838. By Chris Coulson

Get rid of some uses of ContentClient::GetInstance from Oxide code

839. By Chris Coulson

Remove the last user of ContentClient::GetInstance()

840. By Chris Coulson

Bump Chromium rev to 40.0.2209.0

841. By Chris Coulson

Fix return type for flags propertes on SecurityStatus (doesn't affect the QML API)

842. By Chris Coulson

Add an experimental API for changing the process model (currently untested - it only exists for unbreaking single process mode. Please don't use it yet)

843. By Chris Coulson

Allow other Chromium process models to be selected, add an environment variable (OXIDE_PROCESS_MODEL), and add a warning for unsupported process models

844. By Chris Coulson

Add missing enums

845. By Chris Coulson

Fix arm build

846. By Chris Coulson

Fix a shutdown hang introduced by r838

847. By Chris Coulson

Make the UserScriptSlave destructor private

848. By Chris Coulson

In multi-process mode, a RenderProcessHost is deleted when there are no more objects in the browser process using it. However, in single-process mode there is a single RPH representing the in-process render-thread, which lives until the process dies. This means that we need to keep the BrowserContext alive too, to avoid use-after-free crashes

849. By Chris Coulson

Fix a nullptr deref on mobile

850. By Chris Coulson

Fix a crash when typing

851. By Chris Coulson

Get rid of a reinterpret_cast

852. By Chris Coulson

Make Oxide.processModel authoritative (ie, OXIDE_PROCESS_MODEL only sets the default)

853. By Chris Coulson

Get rid of GetBrowserProcessMainInstance

854. By Chris Coulson

Consolidate the startup-related state in to one class

855. By Chris Coulson

Make WebView.context read-only in single-process mode. In single-process mode, it is not possible to have mutliple WebContexts, so all WebViews will use the default context. However, if single-process is selected from the OXIDE_PROCESS_MODEL environment variable, allow the first application created WebContext to become the default context (so that "WebView { context: WebContext {} }" would still work

856. By Chris Coulson

Add revision metadata for recently added APIs

857. By Chris Coulson

Bump Chromium rev to 40.0.2214.5

858. By Chris Coulson

Disable WebView.incognito in single-process mode - it won't work anyway

859. By Chris Coulson

Don't create an OTR context unnecessarily

860. By Chris Coulson

OxideQQuickGlobal shouldn't be a real singleton - each QQmlEngine assumes ownership of it

861. By Chris Coulson

Don't run the API tests twice (with/without a profile directory). Instead, add a "persistent" property to TestWebContext and allow individual tests to opt out of persistent storage

862. By Chris Coulson

Don't subclass PowerSaveBlockerImpl, as our implementation is never created

863. By Olivier Tilloy

Monitor application state changes, and update PowerSaveBlocker state accordingly
(remove the screen dim lock when the app goes into the background, and restore it when it comes to the foreground).

864. By Chris Coulson

Bump Chromium rev to 40.0.2214.6

865. By Chris Coulson

Don't require cups-config

866. By Chris Coulson

Limit the maximum decoded image size on mobile

867. By Chris Coulson

Revert r866, as it had some other unfinished changes

868. By Chris Coulson

Limit the maximum decoded image size on mobile

869. By Chris Coulson

Gesture detector settings are in DIP units, so don't apply a scale to them. Also, tweak the gesture fling curve (probably needs further refinement)

870. By Chris Coulson

Bump Chromium rev to 40.0.2214.10

871. By Olivier Tilloy

Do not assume the cookie returned by com.canonical.Unity.Screen.keepDisplayOn is > 0
(the very first call actually returns 0, and each subsequent call increments the cookie by 1).

872. By Olivier Tilloy

Expose an API to save/restore the current state of a webview.

873. By Alexandre Abreu

Fix issue with devtools target type

874. By Alexandre Abreu

Fix pt-BR.po and oxide mo inconsistent naming

875. By Chris Coulson

Default to pinch virtual-viewport on mobile (same as Android now)

876. By Chris Coulson

Drop the explicit --disable-gpu-rasterization flag - the blacklist takes care of disabling this globally on linux. Add "OXIDE_IGNORE_GPU_BLACKLIST" environment variable for disabling the blacklist - useful for testing GPU rasterization on the phone, which is totally awesome

877. By Olivier Tilloy

Do not notify the IM extension if the current input method type is none.

878. By Chris Coulson

Update qt version to 1.5.0

879. By Chris Coulson

Bump Chromium rev to 41.0.2224.3

880. By Chris Coulson

Bump Chromium rev to 41.0.2236.0

881. By Chris Coulson

Fix the condition for setting WEBRTC_DETECT_ARM_NEON

882. By Chris Coulson

Remove fuzz from power_save_blocker.patch

883. By Chris Coulson

Ship v8 natives data files

884. By Chris Coulson

Tidy up LoadEvent's for failed loads

885. By Chris Coulson

Call QDesktopServices::openUrl on the UI thread. Even though QDesktopServices is thread safe, it uses QMetaObject::invokeMethod in direct mode making it quite difficult to interact with correctly when using setUrlHandler. Also, fix up tests to not provide dummy handlers in order to force load failures

886. By Chris Coulson

Version LoadEvent.isError

887. By Chris Coulson

Bump Chromium rev to 41.0.2243.0

888. By Chris Coulson

Rename CompositorSoftwareOutputDevice::current_frame_ to CompositorSoftwareOutputDevice::backing_frame_

889. By Chris Coulson

Collapse CompositorThreadProxy and CompositorThreadProxyBase

890. By Chris Coulson

Drop the refcount check from CompositorThreadProxy::DidSwapCompositorFrame - always reclaim the resources for returned frames. It should be a bug for consumer to return frames that are still in use

891. By Chris Coulson

Handle the frontbuffer being deleted on the compositor thread when posting the swap frame to the main thread. This can happen when, eg, hiding a webview (when we delete the LayerTreeHost)

892. By Chris Coulson

r890 requires that CompositorFrameHandle is a RefCountedThreadSafe

893. By Chris Coulson

Actually, add back the refcount check dropped from r890. As CompositorFrameHandle isn't meant to be thread safe, we should ensure that the compositor owns the object at this point before passing it to the compositor thread

894. By Chris Coulson

Add a typedef for the frame handle vector in CompositorThreadProxy

895. By Chris Coulson

Stop using non-const references in CompositorThreadProxy

896. By Chris Coulson

Move the CompositorThreadProxy check from the compositor thread to the UI thread, as it is already for ReclaimResourcesForFrame

897. By Chris Coulson

Stack allocate CompositorFrameAck on the compositor thread in the ReclaimResourcesForFrame path

898. By Chris Coulson

Clean up the GPU thread shim

899. By Chris Coulson

Add a UA stylesheet that sets a minimum viewport width (active on non-desktop form factors), set to the same width as Chrome for Android

900. By Chris Coulson

Only inject the viewport UA override if there is no viewport meta tag, else we end up setting min-width: 980px everywhere (which breaks sites that behave correctly). There is still an edge case that is broken here - if the viewport meta tag is added or removed dynamically then the layout will break

901. By Chris Coulson

Add LocationBarController API, which allows embedders to opt in to having the renderer compositor calculate the UI position. This will be used by the browser to animate the locationbar when scrolling

902. By Chris Coulson

Various fixes in CompositorUtils:
- Don't pass TextureRef between threads, as it's not thread safe. In particular, don't add a reference to it on the GPU thread and then post it to the UI thread with a task that may not ever run (eg, at shutdown).
- Keep all TextureRef's in a map in CompositorUtils, as this allows us to release them all at shutdown in the case where we create a new one after the UI thread has stopped processing tasks. This and the above fix should fix bug 1337506.
- The client ID passed to TextureRef is not the ID of the client process, but the client-side resource ID of the texture (which we don't have, because we don't use the client API). Just pass 0 to this

903. By Chris Coulson

Bump Chromium rev to 41.0.2267.0

904. By Chris Coulson

Make CertificateError.cancelled work correctly

905. By Chris Coulson

Don't fire TypeCommitted LoadEvents for subframes

906. By Chris Coulson

Fix build with Qt >= 5.4

907. By Chris Coulson

Revert r906, as it's incomplete

908. By Chris Coulson

Fix build with Qt >= 5.4

909. By Chris Coulson

Fix a build failure on new checkouts

910. By Chris Coulson

Bump Chromium rev to 41.0.2272.2

911. By Chris Coulson

Bump Chromium rev to 41.0.2272.3

912. By Chris Coulson

Refactor WebFrame around RenderFrameHost rather than FrameTreeNode, although we can't get rid of our use of FrameTreeNode just yet. Plus other fixes

913. By Chris Coulson

Drop the NULL checks on root_frame_

914. By Chris Coulson

Ensure V8 snapshot is loaded in the browser process, so single-process mode works

915. By Chris Coulson

Add experimental support for playing audio via mediahub on mobile

916. By Chris Coulson

Switch NULL to nullptr

917. By Chris Coulson

Merge shared/base and qt/core/base with shared/common and qt/core/common. It's never really been clear how the directories are different

918. By Chris Coulson

Rename shared/gl to shared/gpu and qt/core/gl to qt/core/gpu, as this is GPU-thread stuff in the same way that everything in shared/browser is browser-process stuff

919. By Chris Coulson

Move the contents of shared/media to shared/browser/media, as it's not meant to be used outside of the browser process

920. By Chris Coulson

Fix build failure introduced by r919

921. By Chris Coulson

Avoid storing a raw pointer to WebView in classes in shared/browser/media - these classes outlive WebView on shutdown, creating potential use-after-free bugs. Instead, use WebView::FromRenderFrameHost (the code already ensures that the pointer to RenderFrameHost remains valid)

922. By Chris Coulson

Introduce WebContentsUnloader - a singleton for taking ownership of and unloading WebContents. This fixes the previous mess where we used WebViewContentsHelper for this, temporarily creating an ownership loop that we had to manually unlink. It also means we stop abusing BrowserProcessMain for tracking pending unloads

923. By Chris Coulson

Add a brief description of WebContentsUnloader

924. By Chris Coulson

Get rid of ScopedNewContentsHolder - it's not clear that it's actually needed anymore

925. By Alexandre Abreu

fix compile issues

926. By Alexandre Abreu

fix compile issues

927. By Alexandre Abreu

Stub the quota permission context to avoid crashes when e.g. storage quota is requested.

928. By Chris Coulson

Remove unused functionality from PermissionRequestManager and related classes, particularly now that CertificateError has been split out

929. By Chris Coulson

Make geolocation permission request cancellation work for subframes

930. By Chris Coulson

Oops - add missing file!

931. By Chris Coulson

Fix a runtime link failure on arm

932. By Chris Coulson

Add AndroidProperties singleton and use this in place of the EGL vendor check when determining the form factor. It will also be used for the GPU blacklisting

933. By Chris Coulson

DCHECK that Android system properties are available when accessing them

934. By Chris Coulson

Drop the libandroid-properties dependency on non-arm

935. By Chris Coulson

Bump Chromium rev to 41.0.2272.12

936. By Chris Coulson

Spoof Android for the purposes of GPU feature blacklisting on Ubuntu phone. This enables accelerated 2d canvas on all devices where it is enabled for Chrome on Android. Also explicitly enable GPU rasterization on krillin

937. By Chris Coulson

Drop the USE_LIBPCI conditionals - we don't want this to be optional

938. By Chris Coulson

Back out the part of r936 that turns on GPU rasterization on Krillin, as it results in some image corruption on Google

939. By Chris Coulson

Convert the fix for bug 1402975 to a small Blink patch instead. The problem with the previous approach is that Blink doesn't export a concept of UA stylesheets, meaning we have to check whether a site uses the viewport meta tag before deciding whether to inject the additional stylesheet. This approach is broken for dynamic sites that could add/remove the viewport meta tag or change the width from javascript

940. By Chris Coulson

Correctly update screen geometry when the device orientation changes. Fixes a bug where videos in Youtube do not resize correctly when changing orientation

941. By Chris Coulson

Use QScreen::angleBetween rather than implementing our own calculation

942. By Chris Coulson

Bump Chromium rev to 41.0.2272.16

943. By Chris Coulson

Bump qt version to 1.6

944. By Chris Coulson

Clean up how the GL implementation is selected, and add some environment variables for disabling GPU compositing and disabling GPU features entirely

945. By Chris Coulson

Don't pass --enable-pinch-virtual-viewport, as it's the default everywhere in Chromium now

946. By Chris Coulson

Use net::URLRequest::IsHandledProtocol for checking if a scheme is one of the built-ins

947. By Chris Coulson

Bump Chromium rev to 42.0.2288.4

948. By Chris Coulson

Bump Chromium rev to 42.0.2288.6

949. By Chris Coulson

We don't build on anything older than Qt 5.2.1, so drop support entirely for < Qt 5.2.0

950. By Chris Coulson

Don't build oxideqmlscene by default on Qt5.3 or newer and retire it entirely when building on Qt5.4. It was only ever added as a way to test compositing in Oxide when qmlscene didn't support setting up a shared GL context

951. By Chris Coulson

Always remove inactive touch points from the current touch state when we process a new touch event

952. By Chris Coulson

Ensure we load the Android GPU blacklist on the phone

953. By Chris Coulson

Ensure that we don't suppress all touchmove events that are part of a sequence that hasn't been preventDefault'ed

954. By Chris Coulson

Adapt to behaviour change in handling of QVariants from QML to C++ in Qt 5.4

955. By Chris Coulson

Bump Chromium rev to 42.0.2300.0

956. By Chris Coulson

Fix LocationBarController regression from canary

957. By Chris Coulson

Work around intermitted tst_WebContext_sessionCookies.qml test failure

958. By Chris Coulson

Enable GPU driver bug workarounds

959. By Chris Coulson

Revert r958 - it turns out to be not needed

960. By Chris Coulson

Keep the environment variable to disable GPU driver bug workarounds

961. By Chris Coulson

Only disable context robustness when a shared context is provided

962. By Chris Coulson

Bump Chromium rev to 42.0.2305.0

963. By Chris Coulson

base::ThreadCheckerImpl is not copyable

964. By Chris Coulson

Implement CollectGpuID

965. By Chris Coulson

Don't statically link base in to oxide-renderer just to call SetReleaseFreeMemoryFunction. As the ReleaseFreeMemory is called from the other copy of base in oxide core, it's not even guaranteed that this arragement works and is definitely a bug. Instead, expose an API to oxide-core to allow oxide-renderer to set the function without depending on base

966. By Chris Coulson

Fix some debug-mode build failures

967. By Chris Coulson

Bump Chromium rev to 42.0.2305.3

968. By Chris Coulson

Make gfx_x11 a static_library rather than a component, to fix a link failure in component builds

969. By Chris Coulson

Temporary fix for ARM builds whilst we wait for webrtc commit c52dfbe2

970. By Chris Coulson

ozone depends on events_devices

971. By Chris Coulson

Fix component build link failures

972. By Chris Coulson

Fix the output of make package to work properly in component builds

973. By Chris Coulson

Allow IO when constructing net::HttpCache, as it makes use of base::CPU which does IO on arm

974. By Chris Coulson

Add the webui resources to oxide.pak

975. By Chris Coulson

Fixes to media-hub audio playback

976. By Chris Coulson

Add environment variable to turn on GPU service logging

977. By Chris Coulson

Add USE_SYSTEM_PROTOBUF build option. Using the system protobuf is necessary in component builds where Oxide is loaded by an application that has already loaded the system protobuf (ie, any Mir client) and the system protobuf is at a different version to the in-tree version

978. By Chris Coulson

Drop the NOTREACHED from MotionEvent::GetButtonState - it gets called during cloning

979. By Chris Coulson

Fix some more debug aborts

980. By Chris Coulson

Fix a crash in debug mode when recovering from a renderer crash

981. By Chris Coulson

Fix renderer crash in debug mode when the location bar height is zero

982. By Chris Coulson

Bump Chromium rev to 42.0.2311.4

983. By Chris Coulson

Add strings required for webui

984. By Chris Coulson

Drop a spurious DCHECK that fires sometimes when the render process dies

985. By Chris Coulson

Fix a divide-by-zero in TopControlsManager when the location bar height is set to zero

986. By Chris Coulson

Add a workaround for networks where http://invalid/ actually exists

987. By Chris Coulson

Use http://invalid/ for tests that expect a failed load, as this is guaranteed to be reliable now

988. By Chris Coulson

Use fading scrollbars on mobile

989. By Chris Coulson

Use a thinner overlay scrollbar on mobile

990. By Chris Coulson

Bump Chromium rev to 42.0.2311.11

991. By Chris Coulson

Add OXIDE_ENABLE_GPU_DEBUGGING environment variable

992. By Chris Coulson

Revert r981 - the crash is fixed a different way in r985

993. By Chris Coulson

When using pinch-viewport, hide the outer-viewport scrollbars for the main frame and only show the inner-viewport scrollbars that stick to the device viewport. Note that this breaks overlay scrollbars and pinch-viewport on the desktop, but there was never a way to enable those without recompiling anyway

994. By Alexandre Abreu

media::IsConcreteSupportedKeySystem has been removed upstream, fix the associated build issue

995. By Chris Coulson

Add a patch to enable accelerated canvas on Krillin again, since upstream consolidated the blacklist entries for acclerated canvas / GPU rasterization

996. By Chris Coulson

ToCertError should never return CERT_OK - the 2 conditions under which it did should actually never happen, so just remove those conditions and always fall back to CERT_ERROR_GENERIC

997. By Chris Coulson

Map ERR_CERT_VALIDITY_TOO_LONG to CERT_ERROR_INVALID. Note, we can't test for this because the validity length checks are only done for certificates that are chained to the built-in roots

998. By Chris Coulson

Handle a lost context when dropping texture references from CompositorUtilsImpl

999. By Alexandre Abreu

Fix sendMessageNoReply crash

1000. By Olivier Tilloy

Add a unit test to verify that restoring the state of a navigation that had triggered an error triggers the error again.
Also update an existing test to verify that reloading a page that had triggered an error generates the same sequence of load events.

1001. By Chris Coulson

Bump Chromium rev to 42.0.2311.15

1002. By Chris Coulson

Explicitly disallow calls to CompositorUtils::CreateGLFrameHandle once shutdown has begun

1003. By Chris Coulson

Be careful when posting tasks to the UI thread as they may not run, in which case the pending tasks will be deleted at shutdown. This causes shutdown crashes when those tasks reference classes that assume that Chromium is running

1004. By Chris Coulson

Tidy up the linker settings a bit:
- Now we depend on GCC 4.8, we can use -fuse-ld=gold.
- Don't remove -Wl,--reduce-memory-overheads from ldflags - it doesn't appear to be added by Chromium now.
- Don't use -Wl,--no-map-whole-files when the host is arm - gold defaults to this on 32-bit architectures anyway.
- Don't use -Wl,--no-keep-memory - this is BFD specific

1005. By Chris Coulson

Disable webcore debug symbols and link with --no-keep-files-mapped on native x86 builds because of linker OOM

1006. By Chris Coulson

r1005 should not be applied to component builds

1007. By Chris Coulson

Bump Chromium rev to 42.0.2311.22

1008. By Chris Coulson

Set the pulse audio media role so that audio output can take part in pulse level stream arbitration

1009. By Chris Coulson

Disable the GPU shader cache

1010. By Chris Coulson

Clean up GPU shader cache on upgrade

1011. By Olivier Tilloy

Add WebContext.maxCacheSizeHint property.

1012. By Chris Coulson

Bump Qt version to 1.7 and Chromium rev to 43.0.2327.5

1013. By Chris Coulson

Fix a regression with the mixed content blocking

1014. By Chris Coulson

Use DEB_BUILD_MULTIARCH rather than DEB_BUILD_GNU_TYPE for Ubuntu cross-builds to fix an issue on i386 hosts

1015. By Alexandre Abreu

Fix build

1016. By Chris Coulson

Implement ContentBrowserClient::GetApplicationLocale

1017. By Chris Coulson

Add an EGLImage compositing path for when share groups aren't reliable, and improve synchronization between the WebView compositor and UI compositor

1018. By Chris Coulson

Update native_web_keyboard.patch

1019. By Chris Coulson

Bump Chromium rev to 43.0.2342.2

1020. By Chris Coulson

Bug: #1431484

1021. By Chris Coulson

Don't pass a non-X11 display handle to xlib

1022. By Chris Coulson

Enable GPU raster + accelerated canvas on Arale

1023. By Michael Sheldon

Disable showing the keyboard if the currently focused node isn't editable.

1024. By Maxim Ermilov

fix build with qt 5.2

1025. By Chris Coulson

Recognize "mirserver" as a valid ubuntu platform type, and use the GLES2 implementation in that case.

1026. By Chris Coulson

Bump Chromium rev to 43.0.2357.2

1027. By Olivier Tilloy

LP: #1441777

1028. By Chris Coulson

Fix out-of-bounds read in CompositorOutputSurfaceGL

1029. By Chris Coulson

Clean up the interfaces in qt/core/glue. Hopefully this will make it more obvious where to place new code (ie, only interfaces in qt/core/glue now)

1030. By Chris Coulson

Bump Chromium rev to 43.0.2357.10

1031. By Chris Coulson

Set the minimum page scale to 0.25 on mobile (the default is 1, which is fine for desktop)

1032. By Chris Coulson

Fix crash when accessing ScriptMessage.frame if the frame has disappeared

1033. By Chris Coulson

Stack allocate the objects passed to WebContextDelegateWorker

1034. By Chris Coulson

Improve network callback tests

1035. By Chris Coulson

Use a ResourceThrottle for intercepting redirects

1036. By Chris Coulson

Added EGLFS QPA support

1037. By Olivier Tilloy

Use the simple backend for the network cache.

1038. By Chris Coulson

Bump Chromium rev to 43.0.2357.18

1039. By Chris Coulson

Add LocationBarController.show(), LocationBarController.hide() and LocationBarController.animated

1040. By Chris Coulson

Bump Chromium rev to 44.0.2369.0 and Qt version to 1.8

1041. By Chris Coulson

Don't allow QObjects to be passed to WebContextDelegateWorker

1042. By Alexandre Abreu

tweak pak deps

1043. By Alexandre Abreu

update the blink resource name

1044. By Alexandre Abreu

fix build & mediahub link

1045. By Chris Coulson

GPU canvas + raster is enabled on Krillin in Chrome now, so we don't need a patch

1046. By Chris Coulson

Fix a parse error in the GPU blacklist

1047. By Chris Coulson

Make chrome://tracing/ work

1048. By Chris Coulson

Tidy up the navigator.userAgent override mechanism - an empty string is no override. The extra bool is redundant

1049. By Chris Coulson

Fix a test failure

1050. By Chris Coulson

Fix handling of JS values wrapped in QVariants with Qt 5.4

1051. By Chris Coulson

Add OxideQPermissionRequest::origin (effectively undeprecating OxideQGeolocationPermissionRequest::origin), given that recent changes in Chromium mean we get an origin in most cases. Let's use origin for all request types

1052. By Chris Coulson

Bump Chromium rev to 44.0.2376.0

1053. By Chris Coulson

Replace remaining uses of USE_NSS with USE_NSS_CERTS

1054. By Chris Coulson

The webview compositor shouldn't be unthrottled

1055. By Chris Coulson

Disable one-copy rasterizer on the phone - it's currently disabled on Android anyway

1056. By Chris Coulson

Fix a memory corruption when the visibilty of a webview is changed

1057. By Chris Coulson

Don't crash when the frame tree is torn down during a process swap

1058. By Olivier Tilloy

Fix a crash when a popup menu is dismissed twice (by calling accept() and then cancel() on it).

1059. By Olivier Tilloy

Fix a crash when a JS dialog is dismissed twice (by calling accept() and then reject() on it).

1060. By Chris Coulson

Process all descendents in WebView::FrameDeleted, rather than just the immediate children

1061. By Chris Coulson

Don't disable share-group usage if virtualized GL contexts are enabled on desktop. This sucks, as we can't really know why virtualized contexts are enabled - if it's due to performance issues, then using share-groups is ok (and better than the alternative - software compositing). If it's because of driver bugs / crashes, then we're screwed. We need to do this now because Chromium cananry enables virtualized contexts globally on desktop Linux

1062. By Chris Coulson

Don't run unload handlers on webviews that are script closed. Also, beef up the tests to catch this and work a bit more reliably

1063. By Chris Coulson

Bump Chromium rev to 44.0.2391.0

1064. By Olivier Tilloy

Add a WebView::webProcessStatus property to notify embedders when the renderer process crashed or was killed.

1065. By Chris Coulson

Add WebView.mediaAccessPermissionRequested API

1066. By Chris Coulson

Make comments more accurate

1067. By Chris Coulson

FrameTreeNode::frame_tree_node_id is an int rather than int64_t

1068. By Chris Coulson

Remove a workaround for the old browser headerbar, used when scrolling the focused editable node in to view

1069. By Alexandre Abreu

Prevent a shutdown deadlock if the render process is killed whilst waiting for the close ACK

1070. By Chris Coulson

When deleting a WebContext, ensure that the service worker context is shut down to release references on the RenderProcessHost

1071. By Chris Coulson

Don't leak BrowserContext

1072. By Chris Coulson

Fix test failure in tst_OxideGlobal - it seems that the displayName doesn't have extra characters on some machines

1073. By Chris Coulson

Ensure we correctly shut down the OTR BrowserContext

1074. By Chris Coulson

Move gesture detection to RWHV, keep MotionEvent tracking on WebView (so that we keep it in sync with incoming touch events), and reset the gesture pipeline when navigating to a new page

1075. By Chris Coulson

Refactor ownership model of BrowserContext, and discard the OTR BrowserContext as soon as all incognito webviews using it have been deleted

1076. By Chris Coulson

Actually fix tst_OxideGlobal.qml

1077. By Chris Coulson

Don't create multiple WebContexts pointing at the same path in tst_UnloadHandlers.qml

1078. By Riccardo Padovani

Add LoadEvent.httpStatusCode property

1079. By Chris Coulson

Bump Chromium rev to 44.0.2398.0

1080. By Chris Coulson

Revert a couple of changes that shouldn't have landed

1081. By Chris Coulson

Initialize handle_ for all Proxy objects

1082. By Chris Coulson

Flush profile data when the application goes in to the background

1083. By Chris Coulson

Generate a synthetic Suspended state on the phone

1084. By Chris Coulson

Remove spurious printf

1085. By Chris Coulson

Bump Chromium rev to 44.0.2403.0

1086. By Chris Coulson

Bump Chromium rev to 44.0.2403.4

1087. By Chris Coulson

Add a client interface for WebView, and implement that in qt/. This is the start of an attempt to split functionality out of WebView in to smaller classes

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

I've left some comments inline for this

review: Needs Fixing
1088. By Ugo Riboni

Add WebView.findController API

1089. By Chris Coulson

Revert r1041 for causing LP: #1455371

1090. By Chris Coulson

Bump Chromium rev to 44.0.2403.9

1091. By Chris Coulson

Remove the implementation of MessageLoop::TaskObserver from MessagePump - this fails in canary because there is no MessageLoop when MessagePump is constructed. Also remove the MessageLoopForUI class, which was always a bit of a mess

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

updated,

about your comment on the request->Cancel(), things get automatically cleanup. The requested gets started ResourceLoader::StartRequest -> StartRequestInternal -> ResourceLoader::OnResponseStarted -> ResponseCompleted, and it gets "unwrapped" from there to CallDidFinishLoading etc.

1092. By Chris Coulson

DCHECK that the PowerSaveBlocker factory exists, given that it's set unconditionally in BrowserMainParts. It should never be null

1093. By Alexandre Abreu

Add clipboard support

1094. By Olivier Tilloy

Support for context menus.

1095. By Chris Coulson

Bump qt version to 1.9

1096. By Chris Coulson

Fix issues with mouse event handling, so that text selection works correctly

1097. By Chris Coulson

Move event / screen utils bits from common/ to browser/, where they belong

1098. By Chris Coulson

Kill the hidden input Item inside WebView

1099. By Chris Coulson

Stub out RenderViewHostDelegateView::StartDragging to cancel all drag starts, else the renderer hangs indefinitely

1100. By Chris Coulson

Bump Chromium rev to 45.0.2415.0

1101. By Chris Coulson

Clean up MessagePump a bit:
- Refactor code that runs a task in to a separate function
- Keep track of when we've posted a work event to avoid posting lots of them
- When scheduling missed delayed work, defer to ScheduleWork so that we don't post another task if work is already scheduled

1102. By Chris Coulson

Fix arm build regression

1103. By Chris Coulson

Enable run-time NEON detection in components that support it (eg, skia)

Revision history for this message
Chris Coulson (chrisccoulson) :
review: Approve
1104. By Alexandre Abreu

Expose user agent as part of downloadRequest

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'patches/add-suggested-filename-to-download-starting-resource-delegate.patch'
2--- patches/add-suggested-filename-to-download-starting-resource-delegate.patch 1970-01-01 00:00:00 +0000
3+++ patches/add-suggested-filename-to-download-starting-resource-delegate.patch 2015-05-29 18:04:20 +0000
4@@ -0,0 +1,57 @@
5+diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
6+index 9968e6a..f464773 100644
7+--- a/content/browser/loader/resource_dispatcher_host_impl.cc
8++++ b/content/browser/loader/resource_dispatcher_host_impl.cc
9+@@ -23,6 +23,7 @@
10+ #include "base/metrics/sparse_histogram.h"
11+ #include "base/profiler/scoped_tracker.h"
12+ #include "base/stl_util.h"
13++#include "base/strings/utf_string_conversions.h"
14+ #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
15+ #include "base/time/time.h"
16+ #include "content/browser/appcache/appcache_interceptor.h"
17+@@ -708,6 +725,11 @@ ResourceDispatcherHostImpl::CreateResourceHandlerForDownload(
18+ uint32 id,
19+ scoped_ptr<DownloadSaveInfo> save_info,
20+ const DownloadUrlParameters::OnStartedCallback& started_cb) {
21++ std::string suggested_filename;
22++ // The logic is suggested in download_save_info.h
23++ suggested_filename =
24++ save_info->file_path.empty() ? base::UTF16ToUTF8(save_info->suggested_name)
25++ : save_info->file_path.value();
26+ scoped_ptr<ResourceHandler> handler(
27+ new DownloadResourceHandler(id, request, started_cb, save_info.Pass()));
28+ if (delegate_) {
29+@@ -718,7 +740,7 @@ ResourceDispatcherHostImpl::CreateResourceHandlerForDownload(
30+ delegate_->DownloadStarting(
31+ request, request_info->GetContext(), request_info->GetChildID(),
32+ request_info->GetRouteID(), request_info->GetRequestID(),
33+- is_content_initiated, must_download, &throttles);
34++ is_content_initiated, must_download, suggested_filename, &throttles);
35+ if (!throttles.empty()) {
36+ handler.reset(
37+ new ThrottlingResourceHandler(
38+diff --git a/content/public/browser/resource_dispatcher_host_delegate.cc b/content/public/browser/resource_dispatcher_host_delegate.cc
39+index 40a4d98..b7a9ad9 100644
40+--- a/content/public/browser/resource_dispatcher_host_delegate.cc
41++++ b/content/public/browser/resource_dispatcher_host_delegate.cc
42+@@ -32,6 +32,7 @@ void ResourceDispatcherHostDelegate::DownloadStarting(
43+ int request_id,
44+ bool is_content_initiated,
45+ bool must_download,
46++ const std::string& suggested_filename,
47+ ScopedVector<ResourceThrottle>* throttles) {
48+ }
49+
50+diff --git a/content/public/browser/resource_dispatcher_host_delegate.h b/content/public/browser/resource_dispatcher_host_delegate.h
51+index 8bc3084..11205f4 100644
52+--- a/content/public/browser/resource_dispatcher_host_delegate.h
53++++ b/content/public/browser/resource_dispatcher_host_delegate.h
54+@@ -62,6 +63,7 @@ class CONTENT_EXPORT ResourceDispatcherHostDelegate {
55+ int request_id,
56+ bool is_content_initiated,
57+ bool must_download,
58++ const std::string& suggested_filename,
59+ ScopedVector<ResourceThrottle>* throttles);
60+
61+ // Creates a ResourceDispatcherHostLoginDelegate that asks the user for a
62
63=== modified file 'patches/series'
64--- patches/series 2015-05-29 15:18:09 +0000
65+++ patches/series 2015-05-29 18:04:20 +0000
66@@ -17,7 +17,6 @@
67 dont-initialize-gl-more-than-once.patch
68 expose-extra-properties-for-should-create-webcontents.patch
69 disable-default-network-location-provider.patch
70-add-should-download-url-to-resource-dispatcher-host.patch
71 load-nss-without-user-db.patch
72 store-cache-stats-at-startup.patch
73 export-content-switches.patch
74@@ -35,3 +34,5 @@
75 disable-optional-neon-for-openmax.patch
76 implement-webrtc-get-cpu-features-arm.patch
77 enable-optional-neon-for-skia.patch
78+add-suggested-filename-to-download-starting-resource-delegate.patch
79+
80
81=== modified file 'qt/core/api/oxideqdownloadrequest.cc'
82--- qt/core/api/oxideqdownloadrequest.cc 2014-06-27 18:46:12 +0000
83+++ qt/core/api/oxideqdownloadrequest.cc 2015-05-29 18:04:20 +0000
84@@ -31,13 +31,15 @@
85 const bool shouldPrompt,
86 const QString& suggestedFilename,
87 const QStringList& cookies,
88- const QString& referrer)
89+ const QString& referrer,
90+ const QString& userAgent)
91 : url_(url),
92 mime_type_(mimeType),
93 should_prompt_(shouldPrompt),
94 suggested_filename_(suggestedFilename),
95 cookies_(cookies),
96- referrer_(referrer) {}
97+ referrer_(referrer),
98+ user_agent_(userAgent) {}
99
100 OxideQDownloadRequestPrivate::~OxideQDownloadRequestPrivate() {}
101
102@@ -48,14 +50,16 @@
103 const QString& suggestedFilename,
104 const QString& cookies,
105 const QString& referrer,
106+ const QString& userAgent,
107 QObject* parent) :
108 QObject(parent),
109 d_ptr(new OxideQDownloadRequestPrivate(url,
110- mimeType,
111- shouldPrompt,
112- suggestedFilename,
113- cookies.split(kCookieListDelimiter, QString::SkipEmptyParts),
114- referrer)) {
115+ mimeType,
116+ shouldPrompt,
117+ suggestedFilename,
118+ cookies.split(kCookieListDelimiter, QString::SkipEmptyParts),
119+ referrer,
120+ userAgent)) {
121 }
122
123 OxideQDownloadRequest::~OxideQDownloadRequest() {}
124@@ -96,3 +100,9 @@
125 return d->referrer_;
126 }
127
128+QString OxideQDownloadRequest::userAgent() const {
129+ Q_D(const OxideQDownloadRequest);
130+
131+ return d->user_agent_;
132+}
133+
134
135=== modified file 'qt/core/api/oxideqdownloadrequest.h'
136--- qt/core/api/oxideqdownloadrequest.h 2014-06-17 02:04:25 +0000
137+++ qt/core/api/oxideqdownloadrequest.h 2015-05-29 18:04:20 +0000
138@@ -36,6 +36,7 @@
139 Q_PROPERTY(QString suggestedFilename READ suggestedFilename CONSTANT)
140 Q_PROPERTY(QStringList cookies READ cookies CONSTANT)
141 Q_PROPERTY(QString referrer READ referrer CONSTANT)
142+ Q_PROPERTY(QString userAgent READ userAgent CONSTANT)
143
144 Q_DECLARE_PRIVATE(OxideQDownloadRequest)
145 Q_DISABLE_COPY(OxideQDownloadRequest)
146@@ -48,6 +49,7 @@
147 const QString& suggestedFilename,
148 const QString& cookies,
149 const QString& referrer,
150+ const QString& userAgent,
151 QObject* parent = 0);
152 virtual ~OxideQDownloadRequest();
153
154@@ -57,6 +59,7 @@
155 QString suggestedFilename() const;
156 QStringList cookies() const;
157 QString referrer() const;
158+ QString userAgent() const;
159
160 private:
161
162
163=== modified file 'qt/core/api/oxideqdownloadrequest_p.h'
164--- qt/core/api/oxideqdownloadrequest_p.h 2014-06-17 02:04:25 +0000
165+++ qt/core/api/oxideqdownloadrequest_p.h 2015-05-29 18:04:20 +0000
166@@ -33,7 +33,8 @@
167 const bool shouldPrompt,
168 const QString& suggestedFilename,
169 const QStringList& cookies,
170- const QString& referrer);
171+ const QString& referrer,
172+ const QString& userAgent);
173 virtual ~OxideQDownloadRequestPrivate();
174
175 private:
176@@ -45,6 +46,7 @@
177 QString suggested_filename_;
178 QStringList cookies_;
179 QString referrer_;
180+ QString user_agent_;
181 };
182
183 #endif // _OXIDE_QT_CORE_API_DOWNLOAD_REQUEST_P_H_
184
185=== modified file 'qt/core/browser/oxide_qt_web_view.cc'
186--- qt/core/browser/oxide_qt_web_view.cc 2015-05-28 23:51:39 +0000
187+++ qt/core/browser/oxide_qt_web_view.cc 2015-05-29 18:04:20 +0000
188@@ -745,14 +745,16 @@
189 const bool should_prompt,
190 const base::string16& suggested_filename,
191 const std::string& cookies,
192- const std::string& referrer) {
193+ const std::string& referrer,
194+ const std::string& user_agent) {
195 OxideQDownloadRequest download_request(
196 QUrl(QString::fromStdString(url.spec())),
197 QString::fromStdString(mime_type),
198 should_prompt,
199 QString::fromStdString(base::UTF16ToUTF8(suggested_filename)),
200 QString::fromStdString(cookies),
201- QString::fromStdString(referrer));
202+ QString::fromStdString(referrer),
203+ QString::fromStdString(user_agent));
204
205 client_->DownloadRequested(&download_request);
206 }
207
208=== modified file 'qt/core/browser/oxide_qt_web_view.h'
209--- qt/core/browser/oxide_qt_web_view.h 2015-05-28 23:51:39 +0000
210+++ qt/core/browser/oxide_qt_web_view.h 2015-05-29 18:04:20 +0000
211@@ -142,7 +142,8 @@
212 const bool should_prompt,
213 const base::string16& suggested_filename,
214 const std::string& cookies,
215- const std::string& referrer) override;
216+ const std::string& referrer,
217+ const std::string& user_agent) override;
218 bool ShouldHandleNavigation(const GURL& url,
219 WindowOpenDisposition disposition,
220 bool user_gesture) override;
221
222=== modified file 'qt/tests/qmltests/api/tst_WebView_downloadRequested.qml'
223--- qt/tests/qmltests/api/tst_WebView_downloadRequested.qml 2014-09-11 20:15:31 +0000
224+++ qt/tests/qmltests/api/tst_WebView_downloadRequested.qml 2015-05-29 18:04:20 +0000
225@@ -14,6 +14,11 @@
226 property var latestCookies
227 property string latestMimeType: ""
228 property string latestReferrer: ""
229+ property string latestUserAgent: ""
230+
231+ context.userAgentOverrideDelegate: WebContextDelegateWorker {
232+ source: Qt.resolvedUrl("tst_WebView_downloadRequested.js");
233+ }
234
235 onDownloadRequested: {
236 latestDownloadUrl = request.url;
237@@ -21,6 +26,16 @@
238 latestMimeType = request.mimeType;
239 latestSuggestedFilename = request.suggestedFilename;
240 latestReferrer = request.referrer;
241+ latestUserAgent = request.userAgent;
242+ }
243+
244+ function cleanLatestData() {
245+ latestDownloadUrl = "";
246+ latestCookies = "";
247+ latestMimeType = "";
248+ latestSuggestedFilename = "";
249+ latestReferrer = "";
250+ latestUserAgent = "";
251 }
252
253 SignalSpy {
254@@ -35,6 +50,7 @@
255
256 function init() {
257 spy.clear();
258+ cleanLatestData();
259 }
260
261 function test_WebView_downloadRequestWithContentDisposition() {
262@@ -48,6 +64,31 @@
263 compare(webView.latestSuggestedFilename, "001.html")
264 }
265
266+ function test_WebView_downloadRequestWithContentDispositionWithUserAgentOverride() {
267+ webView.url = "http://testsuite/tst_WebView_downloadRequested.py?override"
268+ verify(webView.waitForLoadStopped(),
269+ "Timed out waiting for a successful load");
270+
271+ compare(spy.count, 1)
272+ compare(webView.latestMimeType, "text/html")
273+ compare(webView.latestCookies, "foo=bar, bar=bazz")
274+ compare(webView.latestSuggestedFilename, "001.html")
275+ compare(webView.latestUserAgent, "Override download user agent string");
276+ }
277+
278+ function test_WebView_downloadAnchorRequest() {
279+ webView.url = "http://testsuite/tst_WebView_downloadRequestedAnchor.html"
280+ verify(webView.waitForLoadSucceeded(),
281+ "Timed out waiting for a successful load");
282+
283+ var r = webView.getTestApi().getBoundingClientRectForSelector("#content");
284+ mouseClick(webView, r.x + r.width / 2, r.y + r.height / 2, Qt.LeftButton);
285+ spy.wait();
286+
287+ compare(spy.count, 1)
288+ compare(webView.latestSuggestedFilename, "MyDownload")
289+ }
290+
291 function test_WebView_downloadRequestUnhandledMimeType() {
292 webView.url = "http://testsuite/tst_WebView_downloadRequestedUnhandledMimeType.py"
293 verify(webView.waitForLoadStopped(),
294
295=== added file 'qt/tests/qmltests/api/tst_WebView_downloadRequestedAnchor.html'
296--- qt/tests/qmltests/api/tst_WebView_downloadRequestedAnchor.html 1970-01-01 00:00:00 +0000
297+++ qt/tests/qmltests/api/tst_WebView_downloadRequestedAnchor.html 2015-05-29 18:04:20 +0000
298@@ -0,0 +1,7 @@
299+<html>
300+<body>
301+</body>
302+<div>
303+<a id="content" href="http://testsuite/empty.html" download="MyDownload">download me</a>
304+</div>
305+</html>
306
307=== modified file 'shared/browser/oxide_browser_context.cc'
308--- shared/browser/oxide_browser_context.cc 2015-05-27 20:56:59 +0000
309+++ shared/browser/oxide_browser_context.cc 2015-05-29 18:04:20 +0000
310@@ -71,6 +71,7 @@
311 #include "oxide_browser_context_observer.h"
312 #include "oxide_browser_process_main.h"
313 #include "oxide_devtools_http_handler_delegate.h"
314+#include "oxide_download_manager_delegate.h"
315 #include "oxide_http_user_agent_settings.h"
316 #include "oxide_io_thread.h"
317 #include "oxide_network_delegate.h"
318@@ -106,6 +107,9 @@
319 const char kDevtoolsDefaultServerIp[] = "127.0.0.1";
320 const int kBackLog = 1;
321
322+const char kDownloadManagerDelegateKeyName[] =
323+ "OxideDownloadManagerDelegateKeyName";
324+
325 void CleanupOldCacheDir(const base::FilePath& path) {
326 if (!base::DirectoryExists(path)) {
327 return;
328@@ -791,7 +795,13 @@
329
330 content::DownloadManagerDelegate*
331 BrowserContext::GetDownloadManagerDelegate() {
332- return nullptr;
333+ // The embedder owns the delegate, dont transfer ownership.
334+ if (!GetUserData(kDownloadManagerDelegateKeyName)) {
335+ SetUserData(kDownloadManagerDelegateKeyName
336+ , new DownloadManagerDelegate());
337+ }
338+ return static_cast<oxide::DownloadManagerDelegate*>(
339+ GetUserData(kDownloadManagerDelegateKeyName));
340 }
341
342 content::BrowserPluginGuestManager* BrowserContext::GetGuestManager() {
343
344=== modified file 'shared/browser/oxide_resource_dispatcher_host_delegate.cc'
345--- shared/browser/oxide_resource_dispatcher_host_delegate.cc 2015-05-08 14:32:55 +0000
346+++ shared/browser/oxide_resource_dispatcher_host_delegate.cc 2015-05-29 18:04:20 +0000
347@@ -20,15 +20,20 @@
348 #include "base/bind.h"
349 #include "base/callback.h"
350 #include "base/logging.h"
351+#include "base/strings/utf_string_conversions.h"
352 #include "content/public/browser/browser_thread.h"
353 #include "content/public/browser/render_view_host.h"
354 #include "content/public/browser/resource_context.h"
355 #include "content/public/common/referrer.h"
356 #include "net/cookies/cookie_monster.h"
357+#include "net/http/http_content_disposition.h"
358+#include "net/http/http_request_headers.h"
359+#include "net/http/http_response_headers.h"
360 #include "net/url_request/url_request_context.h"
361 #include "url/gurl.h"
362
363 #include "oxide_browser_context.h"
364+#include "oxide_browser_context_delegate.h"
365 #include "oxide_browser_platform_integration.h"
366 #include "oxide_redirection_intercept_throttle.h"
367 #include "oxide_web_view.h"
368@@ -44,8 +49,57 @@
369 std::string mime_type;
370 int render_process_id;
371 int render_view_id;
372+ std::string user_agent;
373 };
374
375+void ResourceDispatcherHostDelegate::DownloadStarting(
376+ net::URLRequest* request,
377+ content::ResourceContext* resource_context,
378+ int child_id,
379+ int route_id,
380+ int request_id,
381+ bool is_content_initiated,
382+ bool must_download,
383+ const std::string& suggested_filename,
384+ ScopedVector<content::ResourceThrottle>* throttles) {
385+ std::string suggested_name = suggested_filename;
386+ std::string mime_type;
387+
388+ net::HttpResponseHeaders* response_headers = request->response_headers();
389+ if (response_headers) {
390+ if (suggested_name.empty()) {
391+ std::string disposition;
392+ response_headers->GetNormalizedHeader(
393+ "content-disposition",
394+ &disposition);
395+ net::HttpContentDisposition content_disposition(disposition, std::string());
396+ suggested_name = content_disposition.filename();
397+ }
398+
399+ response_headers->GetMimeType(&mime_type);
400+ }
401+ request->Cancel();
402+
403+ // POST request cannot be repeated in general, so prevent client from
404+ // retrying the same request, even if it is with a GET.
405+ if ("GET" == request->method()) {
406+ content::Referrer referrer;
407+ referrer.url = GURL(request->referrer());
408+ DispatchDownloadRequest(
409+ request->url(),
410+ request->first_party_for_cookies(),
411+ is_content_initiated,
412+ base::UTF8ToUTF16(suggested_name),
413+ false,
414+ referrer,
415+ mime_type,
416+ child_id,
417+ route_id,
418+ resource_context,
419+ request);
420+ }
421+}
422+
423 void ResourceDispatcherHostDelegate::DispatchDownloadRequest(
424 const GURL& url,
425 const GURL& first_party_url,
426@@ -56,9 +110,13 @@
427 const std::string& mime_type,
428 int render_process_id,
429 int render_view_id,
430- content::ResourceContext* resource_context) {
431+ content::ResourceContext* resource_context,
432+ net::URLRequest* url_request) {
433 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
434
435+ BrowserContextIOData* io_data =
436+ BrowserContextIOData::FromResourceContext(resource_context);
437+
438 DownloadRequestParams params;
439 params.url = url;
440 params.is_content_initiated = is_content_initiated;
441@@ -69,10 +127,28 @@
442 params.render_process_id = render_process_id;
443 params.render_view_id = render_view_id;
444
445- BrowserContextIOData* io_data =
446- BrowserContextIOData::FromResourceContext(resource_context);
447+ net::HttpRequestHeaders headers;
448+ std::string user_agent;
449+ if (url_request->is_pending()) {
450+ url_request->extra_request_headers().GetHeader(
451+ net::HttpRequestHeaders::kUserAgent, &params.user_agent);
452+ } else if (io_data->GetDelegate().get()) {
453+ scoped_refptr<BrowserContextDelegate> delegate(
454+ BrowserContextIOData::FromResourceContext(resource_context)->GetDelegate());
455+ if (delegate.get()) {
456+ params.user_agent = delegate->GetUserAgentOverride(url);
457+ }
458+ }
459+ if (params.user_agent.empty()) {
460+ params.user_agent = io_data->GetUserAgent();
461+ }
462
463- if (io_data && io_data->CanAccessCookies(url, first_party_url, false)) {
464+ if (url_request->is_pending()) {
465+ std::string cookies;
466+ url_request->extra_request_headers().GetHeader(
467+ net::HttpRequestHeaders::kCookie, &cookies);
468+ DispatchDownloadRequestWithCookies(params, cookies);
469+ } else if (io_data && io_data->CanAccessCookies(url, first_party_url, false)) {
470 net::CookieStore* cookie_store =
471 GetCookieStoreForContext(resource_context);
472 if (cookie_store) {
473@@ -122,7 +198,8 @@
474 params.use_prompt,
475 params.suggested_name,
476 cookies,
477- params.referrer.spec());
478+ params.referrer.spec(),
479+ params.user_agent);
480 }
481
482 net::CookieStore* ResourceDispatcherHostDelegate::GetCookieStoreForContext(
483@@ -152,29 +229,6 @@
484 return BrowserPlatformIntegration::GetInstance()->LaunchURLExternally(url);
485 }
486
487-bool ResourceDispatcherHostDelegate::ShouldDownloadUrl(const GURL& url,
488- const GURL& first_party_url,
489- bool is_content_initiated,
490- const base::string16& suggested_name,
491- const bool use_prompt,
492- const content::Referrer& referrer,
493- const std::string& mime_type,
494- int render_process_id,
495- int render_view_id,
496- content::ResourceContext* resource_context) {
497- DispatchDownloadRequest(url,
498- first_party_url,
499- is_content_initiated,
500- suggested_name,
501- use_prompt,
502- referrer,
503- mime_type,
504- render_process_id,
505- render_view_id,
506- resource_context);
507- return false;
508-}
509-
510 ResourceDispatcherHostDelegate::ResourceDispatcherHostDelegate() {}
511
512 ResourceDispatcherHostDelegate::~ResourceDispatcherHostDelegate() {}
513
514=== modified file 'shared/browser/oxide_resource_dispatcher_host_delegate.h'
515--- shared/browser/oxide_resource_dispatcher_host_delegate.h 2015-05-08 14:32:55 +0000
516+++ shared/browser/oxide_resource_dispatcher_host_delegate.h 2015-05-29 18:04:20 +0000
517@@ -23,6 +23,7 @@
518
519 namespace content {
520 class ResourceContext;
521+class ResourceThrottle;
522 struct Referrer;
523 }
524
525@@ -36,9 +37,21 @@
526 class ResourceDispatcherHostDelegate
527 : public content::ResourceDispatcherHostDelegate {
528 public:
529+
530 ResourceDispatcherHostDelegate();
531 ~ResourceDispatcherHostDelegate() override;
532
533+ void DownloadStarting(
534+ net::URLRequest* request,
535+ content::ResourceContext* resource_context,
536+ int child_id,
537+ int route_id,
538+ int request_id,
539+ bool is_content_initiated,
540+ bool must_download,
541+ const std::string& suggested_filename,
542+ ScopedVector<content::ResourceThrottle>* throttles) override;
543+
544 private:
545 struct DownloadRequestParams;
546
547@@ -51,7 +64,8 @@
548 const std::string& mime_type,
549 int render_process_id,
550 int render_view_id,
551- content::ResourceContext* resource_context);
552+ content::ResourceContext* resource_context,
553+ net::URLRequest* url_request);
554
555 static void DispatchDownloadRequestWithCookies(
556 const DownloadRequestParams& params,
557@@ -73,16 +87,6 @@
558 bool is_main_frame,
559 ui::PageTransition page_transition,
560 bool has_user_gesture) override;
561- bool ShouldDownloadUrl(const GURL& url,
562- const GURL& first_party_url,
563- bool is_content_initiated,
564- const base::string16& suggested_name,
565- const bool use_prompt,
566- const content::Referrer& referrer,
567- const std::string& mime_type,
568- int render_process_id,
569- int render_view_id,
570- content::ResourceContext* resource_context) override;
571
572 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostDelegate);
573 };
574
575=== modified file 'shared/browser/oxide_web_view.cc'
576--- shared/browser/oxide_web_view.cc 2015-05-28 23:51:39 +0000
577+++ shared/browser/oxide_web_view.cc 2015-05-29 18:04:20 +0000
578@@ -2158,13 +2158,15 @@
579 const bool should_prompt,
580 const base::string16& suggested_filename,
581 const std::string& cookies,
582- const std::string& referrer) {
583+ const std::string& referrer,
584+ const std::string& user_agent) {
585 client_->DownloadRequested(url,
586 mime_type,
587 should_prompt,
588 suggested_filename,
589 cookies,
590- referrer);
591+ referrer,
592+ user_agent);
593 }
594
595 CompositorFrameHandle* WebView::GetCompositorFrameHandle() const {
596
597=== modified file 'shared/browser/oxide_web_view.h'
598--- shared/browser/oxide_web_view.h 2015-05-27 20:56:59 +0000
599+++ shared/browser/oxide_web_view.h 2015-05-29 18:04:20 +0000
600@@ -317,7 +317,8 @@
601 const bool should_prompt,
602 const base::string16& suggested_filename,
603 const std::string& cookies,
604- const std::string& referrer);
605+ const std::string& referrer,
606+ const std::string& user_agent);
607
608 CompositorFrameHandle* GetCompositorFrameHandle() const;
609 void DidCommitCompositorFrame();
610
611=== modified file 'shared/browser/oxide_web_view_client.cc'
612--- shared/browser/oxide_web_view_client.cc 2015-05-28 23:51:39 +0000
613+++ shared/browser/oxide_web_view_client.cc 2015-05-29 18:04:20 +0000
614@@ -110,7 +110,8 @@
615 const bool should_prompt,
616 const base::string16& suggested_filename,
617 const std::string& cookies,
618- const std::string& referrer) {}
619+ const std::string& referrer,
620+ const std::string& user_agent) {}
621
622 bool WebViewClient::ShouldHandleNavigation(const GURL& url,
623 WindowOpenDisposition disposition,
624
625=== modified file 'shared/browser/oxide_web_view_client.h'
626--- shared/browser/oxide_web_view_client.h 2015-05-28 23:51:39 +0000
627+++ shared/browser/oxide_web_view_client.h 2015-05-29 18:04:20 +0000
628@@ -159,7 +159,8 @@
629 const bool should_prompt,
630 const base::string16& suggested_filename,
631 const std::string& cookies,
632- const std::string& referrer);
633+ const std::string& referrer,
634+ const std::string& user_agent);
635
636 virtual bool ShouldHandleNavigation(const GURL& url,
637 WindowOpenDisposition disposition,
638
639=== modified file 'shared/shared.gyp'
640--- shared/shared.gyp 2015-05-28 23:51:39 +0000
641+++ shared/shared.gyp 2015-05-29 18:04:20 +0000
642@@ -319,6 +319,8 @@
643 'browser/oxide_content_types.h',
644 'browser/oxide_devtools_http_handler_delegate.cc',
645 'browser/oxide_devtools_http_handler_delegate.h',
646+ 'browser/oxide_download_manager_delegate.cc',
647+ 'browser/oxide_download_manager_delegate.h',
648 'browser/oxide_event_utils.cc',
649 'browser/oxide_event_utils.h',
650 'browser/oxide_file_picker.cc',

Subscribers

People subscribed via source and target branches