summaryrefslogtreecommitdiffstats
path: root/android_webview/browser
Commit message (Collapse)AuthorAgeFilesLines
* Add more RetainedRef uses where needed.vmpstr2016-03-222-3/+3
| | | | | | | | | | | | | | | | This patch adds RetainedRef uses where they are required. These changes will be required when we remove automatic unwrapping of scoped_refptrs in Bind. Please see the bug for more context. R=tzik@chromium.org, thakis@chromium.org, danakj@chromium.org TBR=boliu@chromium.org, droger@chromium.org, agl@chromium.org BUG=589048 Review URL: https://codereview.chromium.org/1822943002 Cr-Commit-Position: refs/heads/master@{#382639}
* sync compositor: Add output_surface_id plumbingboliu2016-03-2210-37/+181
| | | | | | | | | | | | | | | | | | The output_surface_id is unique for a particular renderer compositor instance. It is used to avoid returning resources from lost context to compositor with new context. Plumb output_surface_id from SynchronousOutputSurface all the way to android_webview::HardwareRenderer. To avoid having to send down a map<id, resource list>, a simpler guarantee is to assume the output_surface_id is increasing, so only need to return resources of with highest output surface id and drop resources other resources. BUG=592744 Review URL: https://codereview.chromium.org/1769913003 Cr-Commit-Position: refs/heads/master@{#382636}
* Bind GrContext to GLES2Interface rather than C GLES interfacebsalomon2016-03-211-34/+1
| | | | | | | | | | CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel BUG=442811 Review URL: https://codereview.chromium.org/1671283002 Cr-Commit-Position: refs/heads/master@{#382393}
* Move fallback tick software draw.tobiasjs2016-03-172-105/+2
| | | | | | | | | | | | | Ideally we want to remove the fallback ticking of webview entirely, but in the interim we should move it to the compositor thread in order to avoid the sync IPC for the software draw as well as the shared memory allocation. BUG=431166 Review URL: https://codereview.chromium.org/1782093002 Cr-Commit-Position: refs/heads/master@{#381688}
* SameSite: Implement 'Strict'/'Lax' attribute parsing.mkwst2016-03-152-3/+3
| | | | | | | | | | | | | | | | | | | | | | | https://tools.ietf.org/html/draft-west-first-party-cookies-06 introduced the notion of "Strict" or "Lax" enforcement of the "SameSite" attribute. This patch implements the infrastructure changes necessary to support that distinction, but does not yet implement the behavioral change (that is, after this patch, `SameSite` will be rejected, while `SameSite=Strict` and `SameSite=Lax` will have the same behavior that `SameSite` alone has today). Most of this patch is occupied with the fairly mechanical process of swapping out a new 'CookieSameSite' enum for the existing boolean in various constructors and setters. The most interesting piece is the change to the storage backend, which now stores 0, 1, or 2 in the database to represent the possible values, rather than 0 or 1 to represent the boolean. BUG=459154 Review URL: https://codereview.chromium.org/1773133002 Cr-Commit-Position: refs/heads/master@{#381201}
* Remove the ability of webpages to specify strings for the onbeforeunload dialog.avi2016-03-113-4/+0
| | | | | | | | | | BUG=587940 TEST=as in bug CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation Review URL: https://codereview.chromium.org/1714573002 Cr-Commit-Position: refs/heads/master@{#380755}
* Get rid of gpu related switches by passing gpu::GpuPreferences via IPC.penghuang2016-03-101-70/+3
| | | | | | | | | | | | BUG=590825 CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel Committed: https://crrev.com/248b114c9d3034964c7259222712dfcccfad8f48 Cr-Commit-Position: refs/heads/master@{#379651} Review URL: https://codereview.chromium.org/1753383003 Cr-Commit-Position: refs/heads/master@{#380320}
* Log whether the ephemerality of the ChannelIDStore and CookieStore are the samenharper2016-03-092-0/+5
| | | | | | | | BUG=548423 Review URL: https://codereview.chromium.org/1745373002 Cr-Commit-Position: refs/heads/master@{#380165}
* aw: Change compositor_id to uint32_tboliu2016-03-098-16/+16
| | | | | | | | | | | To match output_surface_id that's about to be added. Being platform independent doesn't hurt. BUG= Review URL: https://codereview.chromium.org/1776823002 Cr-Commit-Position: refs/heads/master@{#380019}
* Revert of Get rid of gpu related switches by passing gpu::GpuPreferences via ↵simonhatch2016-03-091-3/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | IPC. (patchset #8 id:140001 of https://codereview.chromium.org/1753383003/ ) Reason for revert: Suspecting this is breaking a lot of perf bots. BUG=593045 Original issue's description: > Get rid of gpu related switches by passing gpu::GpuPreferences via IPC. > > BUG=590825 > CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel > > Committed: https://crrev.com/248b114c9d3034964c7259222712dfcccfad8f48 > Cr-Commit-Position: refs/heads/master@{#379651} TBR=piman@chromium.org,boliu@chromium.org,palmer@chromium.org,penghuang@chromium.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=590825 Review URL: https://codereview.chromium.org/1778693002 Cr-Commit-Position: refs/heads/master@{#379993}
* Hook up BeginFrameSource to SurfaceFactoryClient via SurfaceManagerenne2016-03-092-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | SurfaceManager now maintains a dag of surface id namespaces. Optionally, a single BeginFrameSource input can be attached to a single namespace node. Every namespace node also has a SurfaceFactoryClient. This client is informed of a current BeginFrameSource, which is chosen from any BeginFrameSource attached to it or a parent of that node. Any children of that namespace also are able to use that source. SurfaceManager is responsible for picking which source to use, of which it currently just picks the first one until that source goes is removed after which it arbitrarily picks another valid one. In practice, this means that a window moved to another display in ChromeOS will switch its BeginFrameSource after the window is dropped onto the new window. Because the users of this dag all have very different requirements, the ordering of SurfaceFactoryClient registration, namespace hierarchy registration, and BeginFrameSource attaching are not particularly strict. BeginFrameSources, SurfaceFactoryClients, and hierarchies can be registered and unregistered in any order with respect to each other. BUG=401331 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1673783004 Cr-Commit-Position: refs/heads/master@{#379988}
* Get rid of gpu related switches by passing gpu::GpuPreferences via IPC.penghuang2016-03-071-70/+3
| | | | | | | | | BUG=590825 CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel Review URL: https://codereview.chromium.org/1753383003 Cr-Commit-Position: refs/heads/master@{#379651}
* CookieStore: Remove reference counting.mmenke2016-03-075-13/+9
| | | | | | | | | | | | | This has caused a number of issues in the past, and having defined lifecycles for objects makes code easier to reason about and maintain. BUG=472744 TBR=alexclarke@chromium.org, creis@chromium.org Review URL: https://codereview.chromium.org/1701063002 Cr-Commit-Position: refs/heads/master@{#379588}
* [Android WebView] Implement support for Network Information API and enable it.timvolodine2016-03-025-2/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently Network Information API and everything related to the NetworkChangeNotifier is disabled in WebView. This patch implements the required parts to enable Network Information API in WebView. The WebView implementation is based on NetworkChangeNotifier, similar to chrome for Android. However the registration policy is different: 1. whether we listen to network changes depends on the presence of live WebView instances, 2. both the band-width and connectivity changes are propagated, but a reduced network stack is involved as compared to the chrome for android implementation, 3. for backward compatibility invoking setNetworkAvailable() on a webview disables network information api. 4. The embedding application needs to have ACCESS_NETWORK_STATE permission at the time webview process is initialized for the Network Information API to work. BUG=520088, 590383 Committed: https://crrev.com/3673455317898f450211636919c2bef7a8e3fe0f Cr-Commit-Position: refs/heads/master@{#376975} Review URL: https://codereview.chromium.org/1659363003 Cr-Commit-Position: refs/heads/master@{#378807}
* Add a Background Sync Permission Contextnsatragno2016-03-021-0/+2
| | | | | | | | | | | | | | | | | | | This is the second in a series of patches to add a content setting to Background Sync. For a detailed plan, refer to https://goo.gl/9U8fKh This change adds the permission context for background sync. No behavoiur change happens yet, as the permission is granted by default and no UI is exposed to the user. Additionally, it has not been hooked to the Background Sync Manager. Original, 'big picture' patch: crrev.com/1673303002 BUG=564052 TEST=BackgroundSyncPermissionContextTest.* Review URL: https://codereview.chromium.org/1698323002 Cr-Commit-Position: refs/heads/master@{#378646}
* Add ntlm to the list of auth protocolssgurun2016-03-021-1/+2
| | | | | | | | BUG=590689 Review URL: https://codereview.chromium.org/1754013002 Cr-Commit-Position: refs/heads/master@{#378638}
* mojo: Sketch a profile application.erg2016-03-021-0/+1
| | | | | | | | | | | | | | | | This application is bound to an individual profile data dir. While it isn't yet sandboxed to that location, that's our long term intention with this design. This application colocates the Profile service and the LevelDB service so that these will be in the same process. The way we register a Browser Context to a user id works for now, but will need to be redone once we start spawning processes for the Profile. BUG=585587 Review URL: https://codereview.chromium.org/1741953002 Cr-Commit-Position: refs/heads/master@{#378620}
* Use GpuPreferences to avoid directly accessing switches in gpu related codepenghuang2016-02-291-3/+84
| | | | | | | | | BUG=586369 CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel Review URL: https://codereview.chromium.org/1716813002 Cr-Commit-Position: refs/heads/master@{#378305}
* tracing: Make ConvertableToTraceFormat move-onlyprimiano2016-02-292-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary. This CL: - Makes TraceEvent ownership a move-only scoped_ptr. - Makes ConvertableToTraceFormat (CTTF) itself move-only scoped_ptr. - Updates all the codebase that uses CTTF in TRACE_EVENT macros to use move-only semantics. Background: Historically ConvertableToTraceFormat (CTTF) was RefCounted. The main reason seems to be supporting monitoring mode (now deprecated) where tracing needed to copy TraceEvents without flushing the TraceLog. Not what monitoring mode is gone, there is no reason why TraceEvent(s) should not be move-only. Unfortunately CTTF being RefCounted exposed that implementation detail to its public interface. Fortunately, most of the codebase doesn't care about the fact that CTTF is RefCounted. The only exceptions are: 1. Memory-infra heap profiler {StackFrame,TypeInfo}Deduplicator 2. cc::Layer DebugInfo 1) Is addressed creating a proxy class which delegates the CTTF methods to the duplicators inside MDSessionState. Essentially it makes the CTTF metadata events shared co-owners of the MDSessionState. 2) After an offline chat with danakj@, it seems OK to make DebugInfo(s) moved scoped_ptr (as opposite as copied), moving the ownership to the active layer and keeping a raw ptr into the pending layer. BUG=559117 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel TBR=thakis,jochen,tbarzic,mnaganov,skyostil Review URL: https://codereview.chromium.org/1717283003 Cr-Commit-Position: refs/heads/master@{#378263}
* Revert of [Android WebView] Implement support for Network Information API ↵sgurun2016-02-275-210/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and enable it. (patchset #6 id:100001 of https://codereview.chromium.org/1659363003/ ) Reason for revert: caused crbug/590383 Original issue's description: > [Android WebView] Implement support for Network Information API and enable it. > > Currently Network Information API and everything related to the > NetworkChangeNotifier is disabled in WebView. This patch implements > the required parts to enable Network Information API in WebView. > > The WebView implementation is based on NetworkChangeNotifier, > similar to chrome for Android. However the registration policy > is different: > 1. whether we listen to network changes depends on the presence > of live WebView instances, > 2. both the band-width and connectivity changes are propagated, > but a reduced network stack is involved as compared to the chrome > for android implementation, > 3. for backward compatibility invoking setNetworkAvailable() on a > webview disables network information api. > > BUG=520088 > > Committed: https://crrev.com/3673455317898f450211636919c2bef7a8e3fe0f > Cr-Commit-Position: refs/heads/master@{#376975} TBR=torne@chromium.org,pauljensen@chromium.org,timvolodine@chromium.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=520088 Review URL: https://codereview.chromium.org/1745663003 Cr-Commit-Position: refs/heads/master@{#378061}
* Remove CookieStore::GetCookieMonster.mmenke2016-02-253-6/+0
| | | | | | | | | | | | A bunch of CookieStore consumers were depending on CookieMonster instead of CookieStore. Now that they've been fixed, remove GetCookieMonster to avoid any such dependencies from cropping up in the future. BUG=579653 Review URL: https://codereview.chromium.org/1697003002 Cr-Commit-Position: refs/heads/master@{#377629}
* Add a cross-thread wrapper around Android Webview's CookieStore.mmenke2016-02-258-16/+553
| | | | | | | | | | | | | | | | | | | Android Webview needs to be able to call into its CookieStore on a thread other than the IOThread. Since we're trying to make the CookieStore non-threadsafe, that means we need a CookieStore wrapper to be used by the network stack to access the real CookieStore on another thread. This CL also modifies CookieManager to lazily create the CookieStore on the correct thread. This both allows us to get rid of the last GetCookieMonster call, and will make making the CookieStore non-thread-safe easier. BUG=579653, 579260 Review URL: https://codereview.chromium.org/1693903002 Cr-Commit-Position: refs/heads/master@{#377596}
* [Android WebView] Update IoThreadClientThrottle to include requests from ↵timvolodine2016-02-241-7/+14
| | | | | | | | | | | | | | | Service Workers. This patch makes sure to take into account ServiceWorkerWebSettings (e.g. setBlockNetworkLoads()) when throttling URLRequests originating from Service Workers. BUG=566027 TEST=https://timvolodine.github.io/service-worker-test/ (manual) Review URL: https://codereview.chromium.org/1730513003 Cr-Commit-Position: refs/heads/master@{#377331}
* base: Stop overloading ReadFileToString()hashimoto2016-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | With the existing code, base::Bind(&base::ReadFileToString) doesn't compile because the compiler cannot infer the argument's type (2-argument version or 3-argument version). base::Bind<bool(*)(const base::FilePath&, std::string*)>(&base::ReadFileToString) compiles but it doesn't look desirable. As our style guide discourages function overloading(*), rename the 3-argument version (added in http://crrev.com/157593005) to stop overloading. *https://google.github.io/styleguide/cppguide.html#Function_Overloading BUG=None TBR=sgurun@chromium.org for android_webview, derat@chromium.org for chromeos/accelerometer, bartfab@chromium.org for components/policy, dsinclair@chromium.org for components/tracing, estade@chromium.org for content/browser/webui, sergeyu@chromium.org for remoting Review URL: https://codereview.chromium.org/1719983005 Cr-Commit-Position: refs/heads/master@{#377209}
* net: move IsLocalhost() function into url_util.htfarina2016-02-231-1/+0
| | | | | | | | | | | | | | This patch moves the last function in net_util.h into url_util.h. We are moving it there because it also operates on a URL part (host). BUG=488531 TEST=net_unittests --gtest_filter=UrlUtilTest.IsLocalhost R=eroman@chromium.org TBR=darin@chromium.org Review URL: https://codereview.chromium.org/1726693002 Cr-Commit-Position: refs/heads/master@{#377115}
* [Android WebView] Implement support for Network Information API and enable it.timvolodine2016-02-235-2/+210
| | | | | | | | | | | | | | | | | | | | | | | Currently Network Information API and everything related to the NetworkChangeNotifier is disabled in WebView. This patch implements the required parts to enable Network Information API in WebView. The WebView implementation is based on NetworkChangeNotifier, similar to chrome for Android. However the registration policy is different: 1. whether we listen to network changes depends on the presence of live WebView instances, 2. both the band-width and connectivity changes are propagated, but a reduced network stack is involved as compared to the chrome for android implementation, 3. for backward compatibility invoking setNetworkAvailable() on a webview disables network information api. BUG=520088 Review URL: https://codereview.chromium.org/1659363003 Cr-Commit-Position: refs/heads/master@{#376975}
* Provide a way to distinguish URLRequests originating from Service Workers.timvolodine2016-02-191-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch annotates URLRequests with user data in order to be able to distinguish requests coming from Service Workers. The Service Worker requests can originate from 2 places: 1. from a service_worker_context_client in the renderer - e.g. fetches from service workers 2. from service_worker_write_to_cache_job in the browser - for imports and script loads Because item 1 happens in the renderer it requires IPC modification which is part of this patch as well. Currently the possibility to distinguish between service worker and regular requests is needed for correctly dispatching intercepting callbacks in WebView. In particular we make sure that AwRequestInterceptor::MaybeInterceptRequest dispatches the callback on the appropriate io_thread_client. BUG=566027 Review URL: https://codereview.chromium.org/1683743002 Cr-Commit-Position: refs/heads/master@{#376520}
* Remove user_gesture parameters from content::PermissionManager interface.mlamouri2016-02-192-4/+0
| | | | | | | | | | | | | | | | | | The user gesture information was required by the permission bubble code. With bug 545476 fixed, this is no longer needed. This CL is the second CL in a suite of three CL that remove the passing of the user gesture information from the renderer process content layer to the browser process chrome layer: 1. https://codereview.chromium.org/1695943002 2. <this> 3. https://codereview.chromium.org/1696883004 BUG=423770 TBR=wez@chromium.org (blimp/ trivial changes) Review URL: https://codereview.chromium.org/1695953002 Cr-Commit-Position: refs/heads/master@{#376420}
* Rename some AccessToken types for readability.mvanouwerkerk2016-02-171-4/+4
| | | | | | | | | | | * AccessTokenSet to AccessTokenMap (it is a map!) * LoadAccessTokensCallbackType to LoadAccessTokensCallback TBR=alokp,torne Review URL: https://codereview.chromium.org/1705433002 Cr-Commit-Position: refs/heads/master@{#375937}
* Remove the last long from Android IPCs.jam2016-02-091-1/+2
| | | | | | | | | | This is split off from https://codereview.chromium.org/1619363002/. After this change, we can remove the long traits on Android which is not compatible with 32 and 64 bit processes communicating. BUG=581409 Review URL: https://codereview.chromium.org/1678593002 Cr-Commit-Position: refs/heads/master@{#374314}
* Clear incognito preferences on destroying incognito profile.dvadym2016-02-051-0/+1
| | | | | | | | | | Tests are not added, since it's not final version yet. BUG=444283 Review URL: https://codereview.chromium.org/1643203002 Cr-Commit-Position: refs/heads/master@{#373804}
* Remove an unused long in worker_messages.h.jam2016-02-032-2/+0
| | | | | | | | | | The motivation is to remove longs in IPC messages, since they're not safe to send between 32 and 64 bit processes. BUG=581409 Review URL: https://codereview.chromium.org/1667853003 Cr-Commit-Position: refs/heads/master@{#373335}
* Delete base/prefs and update callers to use components.brettw2016-02-035-8/+8
| | | | | | | | | | | | | | | | | | | | | | | Deletes the forwarding headers in base/prefs. Updates the remaining users of base/prefs includes to use components/prefs. Sort headers in updated files. Move PrefServiceFactory out of the base namespace. Update users. Update all preprocessor stuff in components/prefs to change BASE_PREFS_ to COMPONENTS_PREFS_. Add components/prefs to DEPS file of directories where checkdeps fails after the update. BUG=583034 Reland of http://crrev.com/1662523004#ps40001 with fix. TBR=estade@chromium.org Review URL: https://codereview.chromium.org/1668463002 Cr-Commit-Position: refs/heads/master@{#373197}
* Revert of Delete base/prefs and update callers to use components. (patchset ↵msw2016-02-035-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #3 id:40001 of https://codereview.chromium.org/1662523004/ ) Reason for revert: Broke Win Builder compile: https://build.chromium.org/p/chromium.win/builders/Win%20Builder/builds/19463/steps/compile/logs/stdio Original issue's description: > Delete base/prefs and update callers to use components. > > Deletes the forwarding headers in base/prefs. > > Updates the remaining users of base/prefs includes to use components/prefs. > Sort headers in updated files. > > Move PrefServiceFactory out of the base namespace. Update users. > > Update all preprocessor stuff in components/prefs to change BASE_PREFS_ to > COMPONENTS_PREFS_. > > Add components/prefs to DEPS file of directories where checkdeps fails after > the update. > > BUG=583034 > > Committed: https://crrev.com/1f5feb7e317e3c257090858e950273b64a2e31ef > Cr-Commit-Position: refs/heads/master@{#373105} TBR=estade@chromium.org,brettw@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=583034 Review URL: https://codereview.chromium.org/1662843002 Cr-Commit-Position: refs/heads/master@{#373115}
* Delete base/prefs and update callers to use components.brettw2016-02-035-8/+8
| | | | | | | | | | | | | | | | | | | | | Deletes the forwarding headers in base/prefs. Updates the remaining users of base/prefs includes to use components/prefs. Sort headers in updated files. Move PrefServiceFactory out of the base namespace. Update users. Update all preprocessor stuff in components/prefs to change BASE_PREFS_ to COMPONENTS_PREFS_. Add components/prefs to DEPS file of directories where checkdeps fails after the update. BUG=583034 Review URL: https://codereview.chromium.org/1662523004 Cr-Commit-Position: refs/heads/master@{#373105}
* aw: Fix setting background colorboliu2016-01-251-2/+2
| | | | | | | | | | | Follow up to r369480. Use the main frame routing number for setting background color IPC. BUG=580765 Review URL: https://codereview.chromium.org/1622913002 Cr-Commit-Position: refs/heads/master@{#371332}
* Make URLRequestJob::SetStatus private.mmenke2016-01-221-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent CLs have already made it so URLRequestJob itself calls the method itself whenever necessary, except when URLRequestJob::Start is being called, where subclasses were still expected to invoke it. Most of them were failing to do so, but since nothing cares about the state after start, and little distinguished between ERR_IO_PENDING and SUCCESS, everything was still working. URLRequest now sets its status itself before it starts a URLRequestJob. This CL also makes the URLRequest consistently have a status of ERR_IO_PENDING when it's doing something - there were a number of paths where this wasn't previously the case. The state machine changes also coincidentally fix issue 575213, which regressed in https://codereview.chromium.org/1467603002, so this CL includes a test for that fix. In the future, I'd really like to get rid of URLRequestJob::SetStatus, and have URLRequests manage their own status. BUG=564250,575213 TBR=jianli@chromium.org, phajdan.jr@chromium.org Review URL: https://codereview.chromium.org/1563633002 Cr-Commit-Position: refs/heads/master@{#371072}
* Add TokenBinding plumbing.sgurun2016-01-223-1/+201
| | | | | | | | | | | BUG=558776 This is the first CL to create the plumbing. It does not have support for conversion from ECPrivateKey to KeyPair yet. Review URL: https://codereview.chromium.org/1550403002 Cr-Commit-Position: refs/heads/master@{#371016}
* [Android WebView] Implement initial settings and callback support fortimvolodine2016-01-222-7/+28
| | | | | | | | | | | | | | | | | | | | | | | | Service Workers. Service Workers are not tied to AwContents as regular webviews are and therefore do not invoke callbacks provided in WebViewClient and WebChromeClient. This patch provides initial implementation of AwServiceWorkerClient, AwServiceWorkerSettings and related infrastructure. In particular it implements the shouldInterceptRequest callback mechanism for service worker related requests. The callback is invoked when a service worker script is registered and also for network fetches from within the service worker script. This patch also contains a fix for TestWebServer to make it work with service workers. BUG=566027 Review URL: https://codereview.chromium.org/1544863002 Cr-Commit-Position: refs/heads/master@{#370998}
* Change mojo enums to be scoped enums in the generated C++ bindings.sammc2016-01-211-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Some mojo enums were previously not proper enums: they were constants for bitfields. These have been replaced by const int32s in the mojoms: - mus.mojom.EventFlags - mus.mojom.MouseEventFlags - mus.mojom.ResizeBehavior - mus.mojom.WindowTree.AccessPolicy Some mojo enum values now conflict with macros (mostly on Windows) and needed to change: - mus.mojom.Cursor.NULL became CURSOR_NULL (again) - mus.mojom.KeyboardCode.DELETE became DELETE_KEY - mus.mojom.WindowManagerErrorCode.ERROR_ACCESS_DENIED became ACCESS_DENIED - device.usb.TransferDirection.IN became INBOUND - device.usb.TransferDirection.OUT became OUTBOUND - device.usb.TransferStatus.ERROR became TRANSFER_ERROR - device.NFCRecordType.OPAQUE became OPAQUE_RECORD - media.interfaces.Decryptor.Status.ERROR became DECRYPTION_ERROR - skia.AlphaType.OPAQUE became ALPHA_TYPE_OPAQUE Review URL: https://codereview.chromium.org/1527183003 Cr-Commit-Position: refs/heads/master@{#370632}
* Fix race condition-y Finalize w/ extreme predjudicepaulmiller2016-01-206-26/+16
| | | | | | | | | | | | | | | | There's potential a race condition between Finalize and InitializeWithGUID, if the browser context decides to call Finalize before GetOrCreateGUID has finished. But Finalize will never actually be called anyway, nor is it needed, so remove it along with the unused WebView versions of PostMainMessageLoopRun. Also fix up threading comments and add some more threading DCHECKs. BUG=546754 Review URL: https://codereview.chromium.org/1584483004 Cr-Commit-Position: refs/heads/master@{#370431}
* aw: SetICUDefaultLocale on start upboliu2016-01-161-0/+2
| | | | | | | | | Similar to implementation in ChromeBrowserMainParts::PreCreateThreadsImpl Review URL: https://codereview.chromium.org/1589143005 Cr-Commit-Position: refs/heads/master@{#369910}
* Configure WebView metrics client log sourcepaulmiller2016-01-141-6/+3
| | | | | | | | | | ...now that we have the new ANDROID_WEBVIEW log on the server side. BUG=546754 Review URL: https://codereview.chromium.org/1584933003 Cr-Commit-Position: refs/heads/master@{#369566}
* Make sure only frames in the current frame tree send IPC to AwRenderViewHostExthush2016-01-142-21/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are 3 IPC messages from Renderer to Browser in question: 1) AwViewHostMsg_DocumentHasImagesResponse 2) AwViewHostMsg_UpdateHitTestData 3) AwViewHostMsg_OnContentsSizeChanged 1) This is a response to an IPC from browser (AwViewMsg_DocumentHasImages) to do a query on the document of the main frame as the current implementation. This CL matches that implementation. 2) This IPC can come from blink changing focused node, or as a response to Browser doing hit test at a specific location (AwContents::RequestNewHitTestResultAt). It could be from a main frame or a subframe of the current frame tree, because the focused node could be anywhere. 3) This is sent from main frame whenever its content size changed. This CL moves logic around these IPC messages into AwRenderFrameExt (a RenderFrameObserver). Other logic in AwRenderViewExt remains, until RenderView is removed. BUG=570906 Review URL: https://codereview.chromium.org/1564613002 Cr-Commit-Position: refs/heads/master@{#369480}
* Keep per-app GUID for WebView Metricspaulmiller2016-01-133-4/+60
| | | | | | | | BUG=546754 Review URL: https://codereview.chromium.org/1563093005 Cr-Commit-Position: refs/heads/master@{#369213}
* Revert 3 CLs for shouldOverrideUrlLoading implementation.gsennton2016-01-123-4/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | Since https://codereview.chromium.org/1424263003 does not handle overriding about:blank loads (or rather, about:blank loads are handled synchronously and can thus be finished before we have a chance to override them) we cannot land that patch without potentially breaking lots of apps using WebView. The second CL being reverted is a fix for the first one to post didStopLoad and didFailLoad in the correct order. The third CL being reverted here is a small change removing code that is not used by https://codereview.chromium.org/1424263003 but is used now that we revert that CL. This reverts commit bae3ff13e6959b713b872df3c4a734d6a1ea01ad. This reverts commit e1da704f67f34022b7aaf3afe277c86217844114. This reverts commit c002c7ea9c5a3dbeb665e4070d852e6724d1ff86. TBR=palmer@chromium.org,jam@chromium.org BUG=325351,462306 Review URL: https://codereview.chromium.org/1530183004 Cr-Commit-Position: refs/heads/master@{#368849}
* Implement external stencil for Android WebViewboliu2016-01-098-61/+100
| | | | | | | | | | | | | | Add an OutputSurface::ApplyExternalStencil method. Android WebView implements this method on the render thread and applies the stencil parameters read in functor, through the command buffer client. BUG=574570 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1564703005 Cr-Commit-Position: refs/heads/master@{#368468}
* Let HandleExternalProtocol use a WebContents callback rather than RVIDcsharrison2016-01-082-7/+9
| | | | | | | | | | It ends up referring to a tab_id, which is better to come off the WebContents itself. BUG=392171 Review URL: https://codereview.chromium.org/1533073005 Cr-Commit-Position: refs/heads/master@{#368336}
* Distinguish in the browser between renderer crashes and killsmnaganov2016-01-083-3/+26
| | | | | | | | | | | | | | | | Use a pipe between a browser and a renderer, where the renderer writes something in case of a termination from a catchable signal. In case when the renderer is killed by the low memory killer, nothing gets written into the pipe. The browser then terminates itself in a fashion similar to the renderer. BUG=546009 Review URL: https://codereview.chromium.org/1525023003 Cr-Commit-Position: refs/heads/master@{#368251}
* aw: Set root surface quad to non-transparentboliu2016-01-051-1/+1
| | | | | | | | | | | | | | This root surface quad should not draw anything by itself, but simply references surface containing child frame. Setting it to transparent causes GLRenderer to incorrectly do a glClear, which is not desired. This also avoids the DCHECK failure in the bug. BUG=474822 Review URL: https://codereview.chromium.org/1558303002 Cr-Commit-Position: refs/heads/master@{#367672}