dom/ipc/BrowserChild.cpp
author Matt Woodrow <mwoodrow@mozilla.com>
Sun, 05 Sep 2021 22:36:45 +0000 (2021-09-05)
changeset 591057 1b49e7328ae43c6565d167f4c391430575097fd3
parent 591040 06213402f850853c04405fc60157bff3f2b1fde4
child 592822 19478f86e1de3d4b78ef238bc81c09b5bb0c44cf
permissions -rw-r--r--
Bug 1727682 - Make WebRenderLayerManager not inherit LayerManager. r=jrmuizel Differential Revision: https://phabricator.services.mozilla.com/D124433
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
242171
bd079aadd3feeee3f9b9f73c5e0bc4bd6a870722 Bug 1152551, part 2 - Fix mode lines in dom/. r=jst
Andrew McCreight <continuation@gmail.com>
parents: 240886
diff changeset
     1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
bd079aadd3feeee3f9b9f73c5e0bc4bd6a870722 Bug 1152551, part 2 - Fix mode lines in dom/. r=jst
Andrew McCreight <continuation@gmail.com>
parents: 240886
diff changeset
     2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
94475
Gervase Markham <gerv@gerv.net>
parents: 94400
diff changeset
     3
/* This Source Code Form is subject to the terms of the Mozilla Public
Gervase Markham <gerv@gerv.net>
parents: 94400
diff changeset
     4
 * License, v. 2.0. If a copy of the MPL was not distributed with this
Gervase Markham <gerv@gerv.net>
parents: 94400
diff changeset
     5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
     6
99610
4a58089672882ca7f22e9866d2becf90afced9d5 Bug 745148, part 9: Hook up the pieces and enable direct compositor. r=roc
Chris Jones <jones.chris.g@gmail.com>
parents: 99607
diff changeset
     7
#include "base/basictypes.h"
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
     8
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
     9
#include "BrowserChild.h"
101204
4048c64af6de6c36e592300e9b44ba500635559f Bug 759427 - 'Multiprocess blob support for MessageManager and IndexedDB'. r=smaug+janv+khuey (rs=sicking for nsBlobURI changes).
Ben Turner <bent.mozilla@gmail.com>
parents: 101064
diff changeset
    10
246331
76fdd1a7e61da8051f8149d175f74c651e4e5f8e bug 1167295 - manage PDocAccessible with PBrowser instead of PContent r=smaug
Trevor Saunders <tbsaunde@tbsaunde.org>
parents: 245937
diff changeset
    11
#ifdef ACCESSIBILITY
454520
5f4630838d46dd81dadb13220a4af0da9e23a619 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
Ehsan Akhgari <ehsan@mozilla.com>
parents: 453757
diff changeset
    12
#  include "mozilla/a11y/DocAccessibleChild.h"
246331
76fdd1a7e61da8051f8149d175f74c651e4e5f8e bug 1167295 - manage PDocAccessible with PBrowser instead of PContent r=smaug
Trevor Saunders <tbsaunde@tbsaunde.org>
parents: 245937
diff changeset
    13
#endif
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    14
#include <algorithm>
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    15
#include <utility>
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    16
470936
47813ecb1f4e0244ded2f7b938430bf52c927751 Bug 1534395 - Rename TabParent to BrowserParent. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470247
diff changeset
    17
#include "BrowserParent.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    18
#include "ContentChild.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    19
#include "DocumentInlines.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    20
#include "EventStateManager.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    21
#include "Layers.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    22
#include "MMPrinter.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    23
#include "PermissionMessageUtils.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    24
#include "PuppetWidget.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    25
#include "StructuredCloneData.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    26
#include "UnitTransforms.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    27
#include "Units.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    28
#include "VRManagerChild.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    29
#include "ipc/nsGUIEventIPC.h"
432541
ab5ac052f221b03e0700351ec6534160b38b106c Bug 1484421 - Move JSON-related functionality into js/public/JSON.h that isn't #include'd in jsapi.h. r=jandem
Jeff Walden <jwalden@mit.edu>
parents: 432214
diff changeset
    30
#include "js/JSON.h"
579527
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
    31
#include "mozilla/Assertions.h"
499362
0d1ad0f881d163541c3d01bc0ddc3b89c8a48dc2 Bug 1561227 Part 2: Define and fire an internal event when BrowserChild has finished resizing. r=botond,emilio
Brad Werth <bwerth@mozilla.com>
parents: 499078
diff changeset
    32
#include "mozilla/AsyncEventDispatcher.h"
579527
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
    33
#include "mozilla/BasePrincipal.h"
103787
3925750b682fb35b7bd639c6a1b031adda991ecf Bug 781725: Refactor TabChild to allow pre-created instances, and then use a pre-created instance to pre-load and compile BrowserElementChild.js. r=smaug
Chris Jones <jones.chris.g@gmail.com>
parents: 103563
diff changeset
    34
#include "mozilla/ClearOnShutdown.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    35
#include "mozilla/EventForwards.h"
173865
84f11c295ae334c5b3c070abf6a568a7a3ba9c09 Bug 981261 part.5 Rename nsEventListenerManager to mozilla::EventListenerManager r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 173771
diff changeset
    36
#include "mozilla/EventListenerManager.h"
558319
93fabad45659d172b723c9606215d3acaab54df1 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Simon Giesecke <sgiesecke@mozilla.com>
parents: 558193
diff changeset
    37
#include "mozilla/HoldDropJSObjects.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    38
#include "mozilla/IMEStateManager.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    39
#include "mozilla/LookAndFeel.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    40
#include "mozilla/MouseEvents.h"
579527
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
    41
#include "mozilla/NullPrincipal.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    42
#include "mozilla/Preferences.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    43
#include "mozilla/PresShell.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    44
#include "mozilla/ProcessHangMonitor.h"
567595
14358973739cbd590dac55abb23d78f6409e7ef8 Bug 1691589 - Reduce reliance on GeckoProfiler.h when only labels (and maybe markers) are needed - r=necko-reviewers,geckoview-reviewers,sg,agi,florian
Gerald Squelart <gsquelart@mozilla.com>
parents: 567519
diff changeset
    45
#include "mozilla/ProfilerLabels.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    46
#include "mozilla/ResultExtensions.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    47
#include "mozilla/ScopeExit.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    48
#include "mozilla/Services.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    49
#include "mozilla/StaticPrefs_dom.h"
548923
7502521982a7b5318bb7a8edc738218613f75fdd Bug 1662410 - Part 1: Fix usage of ChildSHistory.legacySHistory . r=peterv
Andreas Farre <farre@mozilla.com>
parents: 548036
diff changeset
    50
#include "mozilla/StaticPrefs_fission.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    51
#include "mozilla/StaticPrefs_layout.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    52
#include "mozilla/StaticPtr.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    53
#include "mozilla/Telemetry.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    54
#include "mozilla/TextEvents.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    55
#include "mozilla/TouchEvents.h"
550506
67ac8857fac01cc71040fff423bc7c92105728cc Bug 1667656 - Use ostream operator instead of AppendToString for PointTyped. r=mattwoodrow
Kartikaya Gupta <kgupta@mozilla.com>
parents: 550295
diff changeset
    56
#include "mozilla/ToString.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    57
#include "mozilla/Unused.h"
549579
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
    58
#include "mozilla/dom/AutoPrintEventDispatcher.h"
494290
205690af863019dc3e68bc26523130468c8a899b Bug 1570115 - Allow Actors to implement WebBrowserChrome. r=kmag,snorp
Agi Sferro <agi@sferro.dev>
parents: 492764
diff changeset
    59
#include "mozilla/dom/BrowserBridgeChild.h"
408055
5ab74cd16594f58974e3db83e19f89492250b71f Bug 1444686 part 3. Get rid of nsIDOMDataTransfer::Get/SetMozCursor. r=mystor
Boris Zbarsky <bzbarsky@mit.edu>
parents: 406869
diff changeset
    60
#include "mozilla/dom/DataTransfer.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    61
#include "mozilla/dom/DocGroup.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    62
#include "mozilla/dom/Element.h"
414727
6567a1d09c3923142b3c151cc6c6896cd4a78276 Bug 1455055 part 1. Convert nsIDOMEventListener to taking an Event, not an nsIDOMEvent. r=masayuki
Boris Zbarsky <bzbarsky@mit.edu>
parents: 413143
diff changeset
    63
#include "mozilla/dom/Event.h"
494290
205690af863019dc3e68bc26523130468c8a899b Bug 1570115 - Allow Actors to implement WebBrowserChrome. r=kmag,snorp
Agi Sferro <agi@sferro.dev>
parents: 492764
diff changeset
    64
#include "mozilla/dom/JSWindowActorChild.h"
453414
6ae543902cdaaec070a77dd5f554db6b02fde2b1 Bug 1513241: Update loadURI interface and pass a loadURIOptions dictionary from frontend to docshell loads. r=bz
Christoph Kerschbaumer <ckerschb@christophkerschbaumer.com>
parents: 452502
diff changeset
    65
#include "mozilla/dom/LoadURIOptionsBinding.h"
409299
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
    66
#include "mozilla/dom/MessageManagerBinding.h"
408949
3073cf6d1124f9427bd8fb71f1a6478202a6baa6 Bug 1446711 part 7. Switch the nsIDOMMouseEvent::MOZ_SOURCE_* constants over to MouseEventBinding. r=qdot
Boris Zbarsky <bzbarsky@mit.edu>
parents: 408509
diff changeset
    67
#include "mozilla/dom/MouseEventBinding.h"
452278
4f9080815cc8e2198230df3f1c7ca18ac97c47f1 Bug 1353867 - Change WindowProxy type. r=bzbarsky
Peter Van der Beken <peterv@propagandism.org>
parents: 452195
diff changeset
    68
#include "mozilla/dom/Nullable.h"
494290
205690af863019dc3e68bc26523130468c8a899b Bug 1570115 - Allow Actors to implement WebBrowserChrome. r=kmag,snorp
Agi Sferro <agi@sferro.dev>
parents: 492764
diff changeset
    69
#include "mozilla/dom/PBrowser.h"
360837
d2370b6a03e89aff5cecb43dada104f887df04bd Bug 1345361 - PaymentRequest constructor implementation. r=baku
Eden Chuang <echuang@mozilla.com>
parents: 360733
diff changeset
    70
#include "mozilla/dom/PaymentRequestChild.h"
558319
93fabad45659d172b723c9606215d3acaab54df1 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Simon Giesecke <sgiesecke@mozilla.com>
parents: 558193
diff changeset
    71
#include "mozilla/dom/PointerEventHandler.h"
573215
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
    72
#include "mozilla/dom/SessionStoreChangeListener.h"
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
    73
#include "mozilla/dom/SessionStoreDataCollector.h"
494290
205690af863019dc3e68bc26523130468c8a899b Bug 1570115 - Allow Actors to implement WebBrowserChrome. r=kmag,snorp
Agi Sferro <agi@sferro.dev>
parents: 492764
diff changeset
    74
#include "mozilla/dom/SessionStoreListener.h"
573215
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
    75
#include "mozilla/dom/SessionStoreUtils.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    76
#include "mozilla/dom/WindowGlobalChild.h"
452278
4f9080815cc8e2198230df3f1c7ca18ac97c47f1 Bug 1353867 - Change WindowProxy type. r=bzbarsky
Peter Van der Beken <peterv@propagandism.org>
parents: 452195
diff changeset
    77
#include "mozilla/dom/WindowProxyHolder.h"
440001
d393cf125c13a93eb22e353da552377bb57eeb9e Bug 1475139 part 11 - Add CrossProcessPaint implementation. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 439095
diff changeset
    78
#include "mozilla/gfx/CrossProcessPaint.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    79
#include "mozilla/gfx/Matrix.h"
465755
96da9d241051d222bdd693bdb519d058a013b59c Bug 1441308 - Core renderroot splitting changes r=kats,sotaro
Doug Thayer <dothayer@mozilla.com>
parents: 465589
diff changeset
    80
#include "mozilla/gfx/gfxVars.h"
582401
0e8903c33b67b52cb0cc0c6d42581fef0958ca21 Bug 1715144 - Part 1: Stop adding /ipc/glue to LOCAL_INCLUDES when including chromium-config.mozbuild, r=ipc-reviewers,necko-reviewers,mccr8,valentin
Nika Layzell <nika@thelayzells.com>
parents: 582377
diff changeset
    81
#include "mozilla/ipc/BackgroundChild.h"
478771
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
    82
#include "mozilla/ipc/BackgroundUtils.h"
559023
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
    83
#include "mozilla/ipc/PBackgroundChild.h"
275571
ed645e64d66616906fdfd0a652894ed0f4f5ea5e Bug 1116478 - Open web content handlers in the proper tab in e10s. r=billm
Blake Kaplan <mrbkap@gmail.com>
parents: 275417
diff changeset
    84
#include "mozilla/ipc/URIUtils.h"
179121
f9963d292e664987233bc8edced1e91cf43fb3d4 Bug 995411 - Move various pieces of APZ code into gfx/layers/apz. r=jrmuizel,botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 178699
diff changeset
    85
#include "mozilla/layers/APZCCallbackHelper.h"
325289
1d9ec0ad1388284030757003dbffa93bcaf9c0e0 Bug 1320817 - Move child process PAPZ initialization into TabChild::InitRenderingState. r=kats
Ryan Hunt <rhunt@eqrion.net>
parents: 325156
diff changeset
    86
#include "mozilla/layers/APZCTreeManagerChild.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    87
#include "mozilla/layers/APZChild.h"
228802
135a4238353508358d7403da886e88df7bdd17ce Bug 1127066 - Extract an APZEventState class from TabChild. r=kats
Botond Ballo <botond@mozilla.com>
parents: 228800
diff changeset
    88
#include "mozilla/layers/APZEventState.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    89
#include "mozilla/layers/CompositorBridgeChild.h"
311194
b0d9956e125145216bf1c88890280f9730393b5f Bug 1289650 - Convert APZChild into a wrapper around GeckoContentController. r=kats
Ryan Hunt <rhunt@mozilla.com>
parents: 311191
diff changeset
    90
#include "mozilla/layers/ContentProcessController.h"
255263
4b0ef3b98b72dad40666062030043d10cac5e267 Bug 1131359 - Port the double-tap-to-zoom functionality of BrowserElementPanning.js to C++. r=kats
Botond Ballo <botond@mozilla.com>
parents: 254329
diff changeset
    91
#include "mozilla/layers/DoubleTapToZoom.h"
325289
1d9ec0ad1388284030757003dbffa93bcaf9c0e0 Bug 1320817 - Move child process PAPZ initialization into TabChild::InitRenderingState. r=kats
Ryan Hunt <rhunt@eqrion.net>
parents: 325156
diff changeset
    92
#include "mozilla/layers/IAPZCTreeManager.h"
136220
5ac656c40652e04ef462da379197d9d4efb0a78e Bug 871150 - Call IdentifyTextureHost on ImageBridgeChild so that we create appropriate textures for the compositor. r=nical
Matt Woodrow <mwoodrow@mozilla.com>
parents: 136118
diff changeset
    93
#include "mozilla/layers/ImageBridgeChild.h"
266697
f69028be4a423c5c56fc7101b33e921a3e4c2c28 Bug 1199885 - Part 9.5: Make the mouse events APZC aware. r=kats
Benoit Girard <b56girard@gmail.com>
parents: 265159
diff changeset
    94
#include "mozilla/layers/InputAPZContext.h"
341823
50dd0b8e139f152b7c3a7d68b70f139319035fd8 Bug 1317774 - Add non-gfx code needed to use WebRender in gecko. r=gfx
Mozilla Graphics Team <graphics@mozilla.com>
parents: 322595
diff changeset
    95
#include "mozilla/layers/WebRenderLayerManager.h"
467868
1ba9a2cebf1252ffc1af89e3e978cf4b47fcb46e Bug 1510569 - Filter TabChild nsIWebProgress events through a nsBrowserFilter r=kmag
Barret Rennie <barret@brennie.ca>
parents: 466778
diff changeset
    96
#include "nsBrowserStatusFilter.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    97
#include "nsColorPickerProxy.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    98
#include "nsCommandParams.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
    99
#include "nsContentPermissionHelper.h"
99610
4a58089672882ca7f22e9866d2becf90afced9d5 Bug 745148, part 9: Hook up the pieces and enable direct compositor. r=roc
Chris Jones <jones.chris.g@gmail.com>
parents: 99607
diff changeset
   100
#include "nsContentUtils.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
   101
#include "nsDeviceContext.h"
201151
35535bbbd6d1cbd88b7beff611830158c0df9818 Bug 1054901 - Add AsyncPanZoomStarted/Stopped notifications to scroll observers. r=roc
peter chang <pchang@mozilla.com>
parents: 201105
diff changeset
   102
#include "nsDocShell.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
   103
#include "nsDocShellLoadState.h"
99610
4a58089672882ca7f22e9866d2becf90afced9d5 Bug 745148, part 9: Hook up the pieces and enable direct compositor. r=roc
Chris Jones <jones.chris.g@gmail.com>
parents: 99607
diff changeset
   104
#include "nsEmbedCID.h"
117956
236eec8d205db0804b2b204dd4b72e5d26db44c6 Fixing bug 821710. Send the tab URL for B2G browser content crashes. r=ted
Chris Jones <jones.chris.g@gmail.com>
parents: 117600
diff changeset
   105
#include "nsExceptionHandler.h"
169202
3e38ac18ab846e1971de5c96bb8c612edaeef540 Bug 910384 - Change nsFilePickerProxy to be asynchronous and add a proper IPDL protocol for it. r=jdm
Tom Schuster <evilpies@gmail.com>
parents: 168894
diff changeset
   106
#include "nsFilePickerProxy.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
   107
#include "nsFocusManager.h"
299557
5ffffa9906f34339a4ac4f6bdb895af83f31ff79 Bug 1274937: Add outer window ID argument to nsFrameLoader::Print to allow printing of frames. r=jimm
Bob Owen <bobowencode@gmail.com>
parents: 299248
diff changeset
   108
#include "nsGlobalWindow.h"
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   109
#include "nsIBaseWindow.h"
189876
68ef4eeae5de700d0596552fe72ecfdc29454f59 Bug 989501 - Part 2: When content in an e10s tab requests a new window be opened, forward that call to the TabParent, and have the TabParent pass itself in when creating the new window. r=smaug.
Mike Conley <mconley@mozilla.com>
parents: 188075
diff changeset
   110
#include "nsIBrowserDOMWindow.h"
455444
712eb70b540a195fb7435e3f390eb44dbe792840 Bug 1520879 - Port the onContentBlockingEvent notifications inside WebProgressChild.jsm to C++; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 454520
diff changeset
   111
#include "nsIClassifiedChannel.h"
50566
5936477a4dc8394382784261680ac0aa3cf947c2 Bug 536301 - e10s HTTPS: securityInfo. r=jduell, sr=kaie
Honza Bambas <honzab.moz@firemni.cz>
parents: 50357
diff changeset
   112
#include "nsIDocShell.h"
216992
ac55dd11daec941a7341ddfc6310ca39e4089cd0 Bug 918288 - Follow-up to fix non-unified build bustage. r=me
Kartikaya Gupta <kgupta@mozilla.com>
parents: 216991
diff changeset
   113
#include "nsIFrame.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
   114
#include "nsILoadContext.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
   115
#include "nsISHEntry.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
   116
#include "nsISHistory.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
   117
#include "nsIScriptError.h"
505801
d235a06ca6bee8e27b6cad159d8aa00e75b3ca20 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
Gabriele Svelto <gsvelto@mozilla.com>
parents: 505597
diff changeset
   118
#include "nsISecureBrowserUI.h"
46771
cd86e0ea3d2d549a5a7a7c3ca066e4b4fd39a3ea Bug 51470 - [E10s] The tab browser should inform the chrome process during navigation. r=smaug,
Benedict Hsieh <bhsieh@mozilla.com>
parents: 46761
diff changeset
   119
#include "nsIURI.h"
478771
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
   120
#include "nsIURIMutator.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
   121
#include "nsIWeakReferenceUtils.h"
99610
4a58089672882ca7f22e9866d2becf90afced9d5 Bug 745148, part 9: Hook up the pieces and enable direct compositor. r=roc
Chris Jones <jones.chris.g@gmail.com>
parents: 99607
diff changeset
   122
#include "nsIWebBrowser.h"
4a58089672882ca7f22e9866d2becf90afced9d5 Bug 745148, part 9: Hook up the pieces and enable direct compositor. r=roc
Chris Jones <jones.chris.g@gmail.com>
parents: 99607
diff changeset
   123
#include "nsIWebProgress.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
   124
#include "nsLayoutUtils.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
   125
#include "nsNetUtil.h"
522791
fde2d124a1b15877570390c7c69f5fcf6770640d Bug 1616353 - Part 7.2: Create and use nsOpenWindowInfo types in nsWindowWatcher logic, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522787
diff changeset
   126
#include "nsIOpenWindowInfo.h"
99610
4a58089672882ca7f22e9866d2becf90afced9d5 Bug 745148, part 9: Hook up the pieces and enable direct compositor. r=roc
Chris Jones <jones.chris.g@gmail.com>
parents: 99607
diff changeset
   127
#include "nsPIDOMWindow.h"
46683
416375517820bf550a6bf64a0d5a4ba729eb6d97 Bug 542242 - E10s, content process event handlers, r=jst, r=bsmedberg
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46682
diff changeset
   128
#include "nsPIWindowRoot.h"
382970
9e7267c06e4e7fb037e539809b409519ea3d63c0 Bug 1399707 - Make entries in TabChild::sActiveTabs and EventLoopActivation::mEventGroups unique. r=billm
Bevis Tseng <btseng@mozilla.com>
parents: 382678
diff changeset
   129
#include "nsPointerHashKeys.h"
99892
19b28e14df61d51ff1666b1a64ca44a26e093231 Bug 750977: Implement glue code for asynchronous panning/zooming. r=jlebar,roc,vingtetun
Chris Jones <jones.chris.g@gmail.com>
parents: 99867
diff changeset
   130
#include "nsPrintfCString.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
   131
#include "nsQueryActor.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
   132
#include "nsQueryObject.h"
543344
c199c6518db4691648b0f4c64c2138d28a9a6065 Bug 1656117 - Reduce include dependencies on nsRefreshDriver.h. r=mstange
Simon Giesecke <sgiesecke@mozilla.com>
parents: 543279
diff changeset
   133
#include "nsRefreshDriver.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
   134
#include "nsSandboxFlags.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
   135
#include "nsString.h"
382970
9e7267c06e4e7fb037e539809b409519ea3d63c0 Bug 1399707 - Make entries in TabChild::sActiveTabs and EventLoopActivation::mEventGroups unique. r=billm
Bevis Tseng <btseng@mozilla.com>
parents: 382678
diff changeset
   136
#include "nsTHashtable.h"
374472
734914d289e0b0a58061d6fb85589c04645c22ee Bug 1351148 Part2: Add a priority queue for input events. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 374251
diff changeset
   137
#include "nsThreadManager.h"
99610
4a58089672882ca7f22e9866d2becf90afced9d5 Bug 745148, part 9: Hook up the pieces and enable direct compositor. r=roc
Chris Jones <jones.chris.g@gmail.com>
parents: 99607
diff changeset
   138
#include "nsThreadUtils.h"
314336
cfcd8c4f3a36b958002010a9c6d461a7769996d5 Bug 1279086 - Allow painting for tab switch when JS is running (r=dvander,mconley,mrbkap)
Bill McCloskey <billm@mozilla.com>
parents: 314305
diff changeset
   139
#include "nsViewManager.h"
510810
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
   140
#include "nsViewportInfo.h"
81ae47660566a29c5395432886e4fd9a403eac97 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 510807
diff changeset
   141
#include "nsWebBrowser.h"
189876
68ef4eeae5de700d0596552fe72ecfdc29454f59 Bug 989501 - Part 2: When content in an e10s tab requests a new window be opened, forward that call to the TabParent, and have the TabParent pass itself in when creating the new window. r=smaug.
Mike Conley <mconley@mozilla.com>
parents: 188075
diff changeset
   142
#include "nsWindowWatcher.h"
550543
9e97625c96156fd70f015763abc84ad89faf3dbb Bug 1667449 - Hide fission.sessionHistoryInParent pref getter behind a function r=peterv
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 550506
diff changeset
   143
#include "nsIXULRuntime.h"
170128
02959a932fb7886d002f86cb29bc4ce57ac5c146 Bug 963294 - [e10s] Implement a proxy for the color picker. r=jdm
Tom Schuster <evilpies@gmail.com>
parents: 170123
diff changeset
   144
559023
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
   145
#ifdef MOZ_WAYLAND
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
   146
#  include "nsAppRunner.h"
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
   147
#endif
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
   148
297525
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
   149
#ifdef NS_PRINTING
454520
5f4630838d46dd81dadb13220a4af0da9e23a619 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
Ehsan Akhgari <ehsan@mozilla.com>
parents: 453757
diff changeset
   150
#  include "nsIPrintSession.h"
5f4630838d46dd81dadb13220a4af0da9e23a619 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
Ehsan Akhgari <ehsan@mozilla.com>
parents: 453757
diff changeset
   151
#  include "nsIPrintSettings.h"
5f4630838d46dd81dadb13220a4af0da9e23a619 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
Ehsan Akhgari <ehsan@mozilla.com>
parents: 453757
diff changeset
   152
#  include "nsIPrintSettingsService.h"
5f4630838d46dd81dadb13220a4af0da9e23a619 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
Ehsan Akhgari <ehsan@mozilla.com>
parents: 453757
diff changeset
   153
#  include "nsIWebBrowserPrint.h"
297525
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
   154
#endif
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
   155
515284
4a846dab4279600eb5d640f6fcaf8caf6aaeaf7f Bug 1617565 - Convert additional compile-conditional logging bits to MOZ_LOG. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 514172
diff changeset
   156
static mozilla::LazyLogModule sApzChildLog("apz.child");
198141
a21244068b7f012343ff2172a960fcba817aa2dc Bug 1042959 - Ensure that we always use the actual old screen size in HandlePossibleViewportChange. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 198043
diff changeset
   157
101204
4048c64af6de6c36e592300e9b44ba500635559f Bug 759427 - 'Multiprocess blob support for MessageManager and IndexedDB'. r=smaug+janv+khuey (rs=sicking for nsBlobURI changes).
Ben Turner <bent.mozilla@gmail.com>
parents: 101064
diff changeset
   158
using namespace mozilla;
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   159
using namespace mozilla::dom;
108491
e393ae7353c068fa8f0cacf7f714ae7ae7a3096a Bug 776832 - Add a scriptable API to assert app permissions through messagemanager. r=smaug
Philipp von Weitershausen <philipp@weitershausen.de>
parents: 108481
diff changeset
   160
using namespace mozilla::dom::ipc;
56521
9f99e62fefb62c840fc3bc883498fefbada45aa4 Bug 606279, part 2: Use more concise types in PDocumentRenderer. r=joe
Chris Jones <jones.chris.g@gmail.com>
parents: 56520
diff changeset
   161
using namespace mozilla::ipc;
54019
9dfdccfd5bdcd2f100c8f1a88e61a429398498bf Bug 570620, part o: Connect the dots to enable drawing remote frames for <browser remote>: create the frame on the content side, insert a display item for it in compositor-side SubdocFrame, and use IPC-enabled layer managers to make it all work. r=mats sr=roc
Chris Jones <jones.chris.g@gmail.com>
parents: 54018
diff changeset
   162
using namespace mozilla::layers;
54018
e5bb865360bcaa9bf1ce13d0c91decacf537b4c5 Bug 570620, part n: Hook layout/ipc into the build system, and integrate PRenderFrame into the PBrowser family. sr=bsmedberg
Chris Jones <jones.chris.g@gmail.com>
parents: 54009
diff changeset
   163
using namespace mozilla::layout;
102055
61d8207c4fa3b31c9823661980daa47136ebf8eb Bug 719320 part.1 Add DOM3 WheelEvent r=smaug, sr=jst
Masayuki Nakano <masayuki@d-toybox.com>
parents: 101926
diff changeset
   164
using namespace mozilla::widget;
303720
b8f47976eb5aa814e28278ce5ab71d75b2ff5b57 Bug 1256339 - Collapse the different Handle*Tap functions in GeckoContentController into a single API. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 303623
diff changeset
   165
using mozilla::layers::GeckoContentController;
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   166
180485
6c1c7e45c90289a0875b74f82f39e7ecf6a65af3 Bug 900908 - Part 3: Change uses of numbered macros in nsIClassInfoImpl.h/nsISupportsImpl.h to the variadic variants. r=froydnj
Birunthan Mohanathas <birunthan@mohanathas.com>
parents: 180435
diff changeset
   167
NS_IMPL_ISUPPORTS(ContentListener, nsIDOMEventListener)
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   168
108591
1bf3d3d3cbe0a30567cfe7475ce9863b21c46ecf Bug 746502: Add support for <meta name=viewport> on B2G/async panning and zooming r=cjones,smaug
Doug Sherk <dsherk2@mozilla.com>
parents: 108590
diff changeset
   169
static const char BEFORE_FIRST_PAINT[] = "before-first-paint";
1bf3d3d3cbe0a30567cfe7475ce9863b21c46ecf Bug 746502: Add support for <meta name=viewport> on B2G/async panning and zooming r=cjones,smaug
Doug Sherk <dsherk2@mozilla.com>
parents: 108590
diff changeset
   170
582091
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
   171
static uint32_t sConsecutiveTouchMoveCount = 0;
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
   172
588191
d56957d4c13bd057e45737933a62c800a6f1ec88 Bug 1723050 - Part 16: Replace typedef by using in dom/ipc/ r=mccr8
Kagami Sascha Rosylight <krosylight@mozilla.com>
parents: 587869
diff changeset
   173
using BrowserChildMap = nsTHashMap<nsUint64HashKey, BrowserChild*>;
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   174
static BrowserChildMap* sBrowserChildren;
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   175
StaticMutex sBrowserChildrenMutex;
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   176
477553
d58a62d0b10da0f0bca2563ab57733228da96fa5 Bug 1556557 - Remove BrowserChildBase. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 477551
diff changeset
   177
already_AddRefed<Document> BrowserChild::GetTopLevelDocument() const {
452446
f0a91d36587266d7454a450c6044d573664fbed5 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 452279
diff changeset
   178
  nsCOMPtr<Document> doc;
418181
237b7b5faa03ae808f71a5cfb8f7f6920d64941f Bug 1460940 - Clean up most remaining C++-side uses of nsIDOMDocument. r=bz
Adrian Wielgosik <adrian.wielgosik@gmail.com>
parents: 415781
diff changeset
   179
  WebNavigation()->GetDocument(getter_AddRefs(doc));
175119
daada068c02fe87b991ae6a7aa23ce377143de56 Bug 985817 - Move some TabChild functionality into base class to be reusable in Embedlite implementation. r=kats
Tatiana Meshkova <tanya.meshkova@gmail.com>
parents: 174866
diff changeset
   180
  return doc.forget();
daada068c02fe87b991ae6a7aa23ce377143de56 Bug 985817 - Move some TabChild functionality into base class to be reusable in Embedlite implementation. r=kats
Tatiana Meshkova <tanya.meshkova@gmail.com>
parents: 174866
diff changeset
   181
}
daada068c02fe87b991ae6a7aa23ce377143de56 Bug 985817 - Move some TabChild functionality into base class to be reusable in Embedlite implementation. r=kats
Tatiana Meshkova <tanya.meshkova@gmail.com>
parents: 174866
diff changeset
   182
477553
d58a62d0b10da0f0bca2563ab57733228da96fa5 Bug 1556557 - Remove BrowserChildBase. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 477551
diff changeset
   183
PresShell* BrowserChild::GetTopLevelPresShell() const {
469386
148e810b01d22b00e254c445dda2f659534103a7 Bug 1542664 - Make TabChild use mozilla::PresShell directly rather than via nsIPresShell r=nika
Masayuki Nakano <masayuki@d-toybox.com>
parents: 469371
diff changeset
   184
  if (RefPtr<Document> doc = GetTopLevelDocument()) {
148e810b01d22b00e254c445dda2f659534103a7 Bug 1542664 - Make TabChild use mozilla::PresShell directly rather than via nsIPresShell r=nika
Masayuki Nakano <masayuki@d-toybox.com>
parents: 469371
diff changeset
   185
    return doc->GetPresShell();
239374
98d34adf1d56f0c992b2824ce3e901a04ecb9e3a Bug 1152479 - Do not use layout-related nsIDOMWindowUtils APIs from C++ APZ code. r=kats
Botond Ballo <botond@mozilla.com>
parents: 239373
diff changeset
   186
  }
469386
148e810b01d22b00e254c445dda2f659534103a7 Bug 1542664 - Make TabChild use mozilla::PresShell directly rather than via nsIPresShell r=nika
Masayuki Nakano <masayuki@d-toybox.com>
parents: 469371
diff changeset
   187
  return nullptr;
239374
98d34adf1d56f0c992b2824ce3e901a04ecb9e3a Bug 1152479 - Do not use layout-related nsIDOMWindowUtils APIs from C++ APZ code. r=kats
Botond Ballo <botond@mozilla.com>
parents: 239373
diff changeset
   188
}
98d34adf1d56f0c992b2824ce3e901a04ecb9e3a Bug 1152479 - Do not use layout-related nsIDOMWindowUtils APIs from C++ APZ code. r=kats
Botond Ballo <botond@mozilla.com>
parents: 239373
diff changeset
   189
477553
d58a62d0b10da0f0bca2563ab57733228da96fa5 Bug 1556557 - Remove BrowserChildBase. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 477551
diff changeset
   190
bool BrowserChild::UpdateFrame(const RepaintRequest& aRequest) {
444295
ad0782d7c503f33cfb554d08dedc96287e1ed3f2 Bug 1504220 - Move ScrollableLayerGuid, ViewID, ZoomConstraints from FrameMetrics.h r=botond
Ryan Hunt <rhunt@eqrion.net>
parents: 443830
diff changeset
   191
  MOZ_ASSERT(aRequest.GetScrollId() != ScrollableLayerGuid::NULL_SCROLL_ID);
442907
d73aa682bf9a50db1252dc9c7e7874078073ebfd Bug 1453425 - Add RepaintRequest for use of FrameMetrics in repaint requests. r=botond
Ryan Hunt <rhunt@eqrion.net>
parents: 442063
diff changeset
   192
d73aa682bf9a50db1252dc9c7e7874078073ebfd Bug 1453425 - Add RepaintRequest for use of FrameMetrics in repaint requests. r=botond
Ryan Hunt <rhunt@eqrion.net>
parents: 442063
diff changeset
   193
  if (aRequest.IsRootContent()) {
469386
148e810b01d22b00e254c445dda2f659534103a7 Bug 1542664 - Make TabChild use mozilla::PresShell directly rather than via nsIPresShell r=nika
Masayuki Nakano <masayuki@d-toybox.com>
parents: 469371
diff changeset
   194
    if (PresShell* presShell = GetTopLevelPresShell()) {
239374
98d34adf1d56f0c992b2824ce3e901a04ecb9e3a Bug 1152479 - Do not use layout-related nsIDOMWindowUtils APIs from C++ APZ code. r=kats
Botond Ballo <botond@mozilla.com>
parents: 239373
diff changeset
   195
      // Guard against stale updates (updates meant for a pres shell which
98d34adf1d56f0c992b2824ce3e901a04ecb9e3a Bug 1152479 - Do not use layout-related nsIDOMWindowUtils APIs from C++ APZ code. r=kats
Botond Ballo <botond@mozilla.com>
parents: 239373
diff changeset
   196
      // has since been torn down and destroyed).
469386
148e810b01d22b00e254c445dda2f659534103a7 Bug 1542664 - Make TabChild use mozilla::PresShell directly rather than via nsIPresShell r=nika
Masayuki Nakano <masayuki@d-toybox.com>
parents: 469371
diff changeset
   197
      if (aRequest.GetPresShellId() == presShell->GetPresShellId()) {
534027
46e56d5d462811d45a562c8c736a79ad287ff8dc Bug 1643381 - Inline ProcessUpdateFrame and remove stale declaration. r=tnikkel
Kartikaya Gupta <kgupta@mozilla.com>
parents: 533663
diff changeset
   198
        APZCCallbackHelper::UpdateRootFrame(aRequest);
239374
98d34adf1d56f0c992b2824ce3e901a04ecb9e3a Bug 1152479 - Do not use layout-related nsIDOMWindowUtils APIs from C++ APZ code. r=kats
Botond Ballo <botond@mozilla.com>
parents: 239373
diff changeset
   199
        return true;
98d34adf1d56f0c992b2824ce3e901a04ecb9e3a Bug 1152479 - Do not use layout-related nsIDOMWindowUtils APIs from C++ APZ code. r=kats
Botond Ballo <botond@mozilla.com>
parents: 239373
diff changeset
   200
      }
175119
daada068c02fe87b991ae6a7aa23ce377143de56 Bug 985817 - Move some TabChild functionality into base class to be reusable in Embedlite implementation. r=kats
Tatiana Meshkova <tanya.meshkova@gmail.com>
parents: 174866
diff changeset
   201
    }
daada068c02fe87b991ae6a7aa23ce377143de56 Bug 985817 - Move some TabChild functionality into base class to be reusable in Embedlite implementation. r=kats
Tatiana Meshkova <tanya.meshkova@gmail.com>
parents: 174866
diff changeset
   202
  } else {
442907
d73aa682bf9a50db1252dc9c7e7874078073ebfd Bug 1453425 - Add RepaintRequest for use of FrameMetrics in repaint requests. r=botond
Ryan Hunt <rhunt@eqrion.net>
parents: 442063
diff changeset
   203
    // aRequest.mIsRoot is false, so we are trying to update a subframe.
175119
daada068c02fe87b991ae6a7aa23ce377143de56 Bug 985817 - Move some TabChild functionality into base class to be reusable in Embedlite implementation. r=kats
Tatiana Meshkova <tanya.meshkova@gmail.com>
parents: 174866
diff changeset
   204
    // This requires special handling.
442907
d73aa682bf9a50db1252dc9c7e7874078073ebfd Bug 1453425 - Add RepaintRequest for use of FrameMetrics in repaint requests. r=botond
Ryan Hunt <rhunt@eqrion.net>
parents: 442063
diff changeset
   205
    APZCCallbackHelper::UpdateSubFrame(aRequest);
248968
24bd667a035aaccda1318b33ceb51e6e6bf588a4 Bug 1163572 - Modify UpdateSubFrame to automatically figure out the nsIContent from the scrollId. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 248967
diff changeset
   206
    return true;
175119
daada068c02fe87b991ae6a7aa23ce377143de56 Bug 985817 - Move some TabChild functionality into base class to be reusable in Embedlite implementation. r=kats
Tatiana Meshkova <tanya.meshkova@gmail.com>
parents: 174866
diff changeset
   207
  }
daada068c02fe87b991ae6a7aa23ce377143de56 Bug 985817 - Move some TabChild functionality into base class to be reusable in Embedlite implementation. r=kats
Tatiana Meshkova <tanya.meshkova@gmail.com>
parents: 174866
diff changeset
   208
  return true;
daada068c02fe87b991ae6a7aa23ce377143de56 Bug 985817 - Move some TabChild functionality into base class to be reusable in Embedlite implementation. r=kats
Tatiana Meshkova <tanya.meshkova@gmail.com>
parents: 174866
diff changeset
   209
}
daada068c02fe87b991ae6a7aa23ce377143de56 Bug 985817 - Move some TabChild functionality into base class to be reusable in Embedlite implementation. r=kats
Tatiana Meshkova <tanya.meshkova@gmail.com>
parents: 174866
diff changeset
   210
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   211
NS_IMETHODIMP
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   212
ContentListener::HandleEvent(Event* aEvent) {
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   213
  RemoteDOMEvent remoteEvent;
414732
491b4ebcc48a57315d0e19b31e99d8a62f911f5e Bug 1455055 part 6. Clean up HandleEvent implementations in dom. r=masayuki
Boris Zbarsky <bzbarsky@mit.edu>
parents: 414727
diff changeset
   214
  remoteEvent.mEvent = aEvent;
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   215
  NS_ENSURE_STATE(remoteEvent.mEvent);
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   216
  mBrowserChild->SendEvent(remoteEvent);
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   217
  return NS_OK;
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   218
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   219
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   220
class BrowserChild::DelayedDeleteRunnable final : public Runnable,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   221
                                                  public nsIRunnablePriority {
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   222
  RefPtr<BrowserChild> mBrowserChild;
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   223
561647
4f64228de0b3f8d7f516e776660848944c0027d7 Bug 1682866 - Always use normal priority for DelayedDeleteRunnable r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 561367
diff changeset
   224
  // In order to try that this runnable runs after everything that could
4f64228de0b3f8d7f516e776660848944c0027d7 Bug 1682866 - Always use normal priority for DelayedDeleteRunnable r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 561367
diff changeset
   225
  // possibly touch this tab, we send it through the event queue twice.
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   226
  bool mReadyToDelete = false;
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   227
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   228
 public:
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   229
  explicit DelayedDeleteRunnable(BrowserChild* aBrowserChild)
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   230
      : Runnable("BrowserChild::DelayedDeleteRunnable"),
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   231
        mBrowserChild(aBrowserChild) {
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   232
    MOZ_ASSERT(NS_IsMainThread());
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   233
    MOZ_ASSERT(aBrowserChild);
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   234
  }
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   235
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   236
  NS_DECL_ISUPPORTS_INHERITED
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   237
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   238
 private:
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   239
  ~DelayedDeleteRunnable() {
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   240
    MOZ_ASSERT(NS_IsMainThread());
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   241
    MOZ_ASSERT(!mBrowserChild);
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   242
  }
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   243
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   244
  NS_IMETHOD GetPriority(uint32_t* aPriority) override {
561647
4f64228de0b3f8d7f516e776660848944c0027d7 Bug 1682866 - Always use normal priority for DelayedDeleteRunnable r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 561367
diff changeset
   245
    *aPriority = nsIRunnablePriority::PRIORITY_NORMAL;
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   246
    return NS_OK;
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   247
  }
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   248
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   249
  NS_IMETHOD
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   250
  Run() override {
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   251
    MOZ_ASSERT(NS_IsMainThread());
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   252
    MOZ_ASSERT(mBrowserChild);
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   253
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   254
    if (!mReadyToDelete) {
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   255
      // This time run this runnable at input priority.
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   256
      mReadyToDelete = true;
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   257
      MOZ_ALWAYS_SUCCEEDS(NS_DispatchToCurrentThread(this));
375355
36ef70762b74b3c6b8bd0f26c57ab4b54467f64b Bug 1382922 - Refactor event queue to allow multiple implementations (r=erahm)
Bill McCloskey <billm@mozilla.com>
parents: 374472
diff changeset
   258
      return NS_OK;
36ef70762b74b3c6b8bd0f26c57ab4b54467f64b Bug 1382922 - Refactor event queue to allow multiple implementations (r=erahm)
Bill McCloskey <billm@mozilla.com>
parents: 374472
diff changeset
   259
    }
36ef70762b74b3c6b8bd0f26c57ab4b54467f64b Bug 1382922 - Refactor event queue to allow multiple implementations (r=erahm)
Bill McCloskey <billm@mozilla.com>
parents: 374472
diff changeset
   260
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   261
    // Check in case ActorDestroy was called after RecvDestroy message.
515950
954d5a7490a36c05b8f07e0caaa782c7eb0a2ed5 Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown
Andrew McCreight <continuation@gmail.com>
parents: 515838
diff changeset
   262
    if (mBrowserChild->IPCOpen()) {
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   263
      Unused << PBrowserChild::Send__delete__(mBrowserChild);
216945
2cae53b8f3f43f3a2f4feba43ed4856fc71a8437 Bug 1037625 - Allow child processes to respond to 'inner-window-destroyed' notifications without possibly killing the process. r-khuey.
Ben Turner <bent.mozilla@gmail.com>
parents: 215946
diff changeset
   264
    }
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   265
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   266
    mBrowserChild = nullptr;
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   267
    return NS_OK;
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   268
  }
216945
2cae53b8f3f43f3a2f4feba43ed4856fc71a8437 Bug 1037625 - Allow child processes to respond to 'inner-window-destroyed' notifications without possibly killing the process. r-khuey.
Ben Turner <bent.mozilla@gmail.com>
parents: 215946
diff changeset
   269
};
2cae53b8f3f43f3a2f4feba43ed4856fc71a8437 Bug 1037625 - Allow child processes to respond to 'inner-window-destroyed' notifications without possibly killing the process. r-khuey.
Ben Turner <bent.mozilla@gmail.com>
parents: 215946
diff changeset
   270
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   271
NS_IMPL_ISUPPORTS_INHERITED(BrowserChild::DelayedDeleteRunnable, Runnable,
375355
36ef70762b74b3c6b8bd0f26c57ab4b54467f64b Bug 1382922 - Refactor event queue to allow multiple implementations (r=erahm)
Bill McCloskey <billm@mozilla.com>
parents: 374472
diff changeset
   272
                            nsIRunnablePriority)
36ef70762b74b3c6b8bd0f26c57ab4b54467f64b Bug 1382922 - Refactor event queue to allow multiple implementations (r=erahm)
Bill McCloskey <billm@mozilla.com>
parents: 374472
diff changeset
   273
227649
31fde84fdb6440557c4eedf568eba6628b94510e Bug 1129311 - Don't use sNestedTabChildMap directly. r=smaug
Kan-Ru Chen (陳侃如) <kanru@kanru.info>
parents: 226977
diff changeset
   274
namespace {
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   275
std::map<TabId, RefPtr<BrowserChild>>& NestedBrowserChildMap() {
188075
96ddd6ea6abd60f775438e232e3161940ed92c01 Bug 879475 - Part 006. Fix http auth prompts for nested content processes r=honzab
"Kan-Ru Chen (陳侃如)" <kanru@kanru.info>
parents: 188071
diff changeset
   276
  MOZ_ASSERT(NS_IsMainThread());
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   277
  static std::map<TabId, RefPtr<BrowserChild>> sNestedBrowserChildMap;
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   278
  return sNestedBrowserChildMap;
188075
96ddd6ea6abd60f775438e232e3161940ed92c01 Bug 879475 - Part 006. Fix http auth prompts for nested content processes r=honzab
"Kan-Ru Chen (陳侃如)" <kanru@kanru.info>
parents: 188071
diff changeset
   279
}
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   280
}  // namespace
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   281
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   282
already_AddRefed<BrowserChild> BrowserChild::FindBrowserChild(
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   283
    const TabId& aTabId) {
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   284
  auto iter = NestedBrowserChildMap().find(aTabId);
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   285
  if (iter == NestedBrowserChildMap().end()) {
227649
31fde84fdb6440557c4eedf568eba6628b94510e Bug 1129311 - Don't use sNestedTabChildMap directly. r=smaug
Kan-Ru Chen (陳侃如) <kanru@kanru.info>
parents: 226977
diff changeset
   286
    return nullptr;
31fde84fdb6440557c4eedf568eba6628b94510e Bug 1129311 - Don't use sNestedTabChildMap directly. r=smaug
Kan-Ru Chen (陳侃如) <kanru@kanru.info>
parents: 226977
diff changeset
   287
  }
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   288
  RefPtr<BrowserChild> browserChild = iter->second;
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   289
  return browserChild.forget();
227649
31fde84fdb6440557c4eedf568eba6628b94510e Bug 1129311 - Don't use sNestedTabChildMap directly. r=smaug
Kan-Ru Chen (陳侃如) <kanru@kanru.info>
parents: 226977
diff changeset
   290
}
188075
96ddd6ea6abd60f775438e232e3161940ed92c01 Bug 879475 - Part 006. Fix http auth prompts for nested content processes r=honzab
"Kan-Ru Chen (陳侃如)" <kanru@kanru.info>
parents: 188071
diff changeset
   291
461887
f41cee9bf14931b453838d1bbcbda528e3b064e8 Bug 1523969 part 6 - Move method definition inline comments to new line in 'dom/'. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 460971
diff changeset
   292
/*static*/
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   293
already_AddRefed<BrowserChild> BrowserChild::Create(
522676
36b0646e86498662e770756ad54b1fd648a82184 Bug 1620594 - Part 7: Remove TabGroup and SystemGroup. r=nika,bas
Andreas Farre <farre@mozilla.com>
parents: 522673
diff changeset
   294
    ContentChild* aManager, const TabId& aTabId, const TabContext& aContext,
36b0646e86498662e770756ad54b1fd648a82184 Bug 1620594 - Part 7: Remove TabGroup and SystemGroup. r=nika,bas
Andreas Farre <farre@mozilla.com>
parents: 522673
diff changeset
   295
    BrowsingContext* aBrowsingContext, uint32_t aChromeFlags,
36b0646e86498662e770756ad54b1fd648a82184 Bug 1620594 - Part 7: Remove TabGroup and SystemGroup. r=nika,bas
Andreas Farre <farre@mozilla.com>
parents: 522673
diff changeset
   296
    bool aIsTopLevel) {
36b0646e86498662e770756ad54b1fd648a82184 Bug 1620594 - Part 7: Remove TabGroup and SystemGroup. r=nika,bas
Andreas Farre <farre@mozilla.com>
parents: 522673
diff changeset
   297
  RefPtr<BrowserChild> iframe = new BrowserChild(
36b0646e86498662e770756ad54b1fd648a82184 Bug 1620594 - Part 7: Remove TabGroup and SystemGroup. r=nika,bas
Andreas Farre <farre@mozilla.com>
parents: 522673
diff changeset
   298
      aManager, aTabId, aContext, aBrowsingContext, aChromeFlags, aIsTopLevel);
352939
cf2268ecf05dbd556d1e9f54ecfea44e48ab1f19 Bug 1354249 - Use same TabGroup as original tab for print preview (r=mystor)
Bill McCloskey <billm@mozilla.com>
parents: 352557
diff changeset
   299
  return iframe.forget();
103787
3925750b682fb35b7bd639c6a1b031adda991ecf Bug 781725: Refactor TabChild to allow pre-created instances, and then use a pre-created instance to pre-load and compile BrowserElementChild.js. r=smaug
Chris Jones <jones.chris.g@gmail.com>
parents: 103563
diff changeset
   300
}
3925750b682fb35b7bd639c6a1b031adda991ecf Bug 781725: Refactor TabChild to allow pre-created instances, and then use a pre-created instance to pre-load and compile BrowserElementChild.js. r=smaug
Chris Jones <jones.chris.g@gmail.com>
parents: 103563
diff changeset
   301
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   302
BrowserChild::BrowserChild(ContentChild* aManager, const TabId& aTabId,
522676
36b0646e86498662e770756ad54b1fd648a82184 Bug 1620594 - Part 7: Remove TabGroup and SystemGroup. r=nika,bas
Andreas Farre <farre@mozilla.com>
parents: 522673
diff changeset
   303
                           const TabContext& aContext,
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   304
                           BrowsingContext* aBrowsingContext,
476562
7eac769c7c134f53366f9195ecf15589b8d401ff Bug 1519546, part 5 - Add mIsTopLevel flag for tracking the root PBrowser actor in a remote browser. r=farre
Ryan Hunt <rhunt@eqrion.net>
parents: 476561
diff changeset
   305
                           uint32_t aChromeFlags, bool aIsTopLevel)
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   306
    : TabContext(aContext),
477553
d58a62d0b10da0f0bca2563ab57733228da96fa5 Bug 1556557 - Remove BrowserChildBase. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 477551
diff changeset
   307
      mBrowserChildMessageManager(nullptr),
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   308
      mManager(aManager),
464035
a95dcf86a9b094e68f5783501325ad3e338f7a46 Bug 1529684 - Part 2: Create BrowsingContext for remote browsers in parent, r=farre
Nika Layzell <nika@thelayzells.com>
parents: 463734
diff changeset
   309
      mBrowsingContext(aBrowsingContext),
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   310
      mChromeFlags(aChromeFlags),
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   311
      mMaxTouchPoints(0),
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   312
      mLayersId{0},
476560
b186cb12283e5293e98e21b1cb0d4ca6fcdb0776 Bug 1519546, part 3 - Add EffectsInfo and store in BrowserChild. r=farre
Ryan Hunt <rhunt@eqrion.net>
parents: 476543
diff changeset
   313
      mEffectsInfo{EffectsInfo::FullyHidden()},
584790
49c60a0b4565926424dea786b69b772ecc9e3f92 Bug 1717983 - Pack bool fields better in BrowserChild. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584789
diff changeset
   314
      mOrientation(hal::eScreenOrientation_PortraitPrimary),
49c60a0b4565926424dea786b69b772ecc9e3f92 Bug 1717983 - Pack bool fields better in BrowserChild. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584789
diff changeset
   315
      mDynamicToolbarMaxHeight(0),
49c60a0b4565926424dea786b69b772ecc9e3f92 Bug 1717983 - Pack bool fields better in BrowserChild. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584789
diff changeset
   316
      mUniqueId(aTabId),
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   317
      mDidFakeShow(false),
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   318
      mTriedBrowserInit(false),
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   319
      mIgnoreKeyPressEvent(false),
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   320
      mHasValidInnerSize(false),
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   321
      mDestroyed(false),
476562
7eac769c7c134f53366f9195ecf15589b8d401ff Bug 1519546, part 5 - Add mIsTopLevel flag for tracking the root PBrowser actor in a remote browser. r=farre
Ryan Hunt <rhunt@eqrion.net>
parents: 476561
diff changeset
   322
      mIsTopLevel(aIsTopLevel),
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   323
      mHasSiblings(false),
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   324
      mIsTransparent(false),
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   325
      mIPCOpen(false),
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   326
      mDidSetRealShowInfo(false),
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   327
      mDidLoadURLInit(false),
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   328
      mSkipKeyPress(false),
583086
20c1ef91fc108f15d23c5108662b542c37938311 Bug 1709460 - Add a flag representing whether mEffectsInfo has been set or not. r=tnikkel
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 582925
diff changeset
   329
      mDidSetEffectsInfo(false),
584790
49c60a0b4565926424dea786b69b772ecc9e3f92 Bug 1717983 - Pack bool fields better in BrowserChild. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584789
diff changeset
   330
      mShouldSendWebProgressEventsToParent(false),
49c60a0b4565926424dea786b69b772ecc9e3f92 Bug 1717983 - Pack bool fields better in BrowserChild. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584789
diff changeset
   331
      mRenderLayers(true),
49c60a0b4565926424dea786b69b772ecc9e3f92 Bug 1717983 - Pack bool fields better in BrowserChild. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584789
diff changeset
   332
      mIsPreservingLayers(false),
49c60a0b4565926424dea786b69b772ecc9e3f92 Bug 1717983 - Pack bool fields better in BrowserChild. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584789
diff changeset
   333
      mPendingDocShellIsActive(false),
49c60a0b4565926424dea786b69b772ecc9e3f92 Bug 1717983 - Pack bool fields better in BrowserChild. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584789
diff changeset
   334
      mPendingDocShellReceivedMessage(false),
49c60a0b4565926424dea786b69b772ecc9e3f92 Bug 1717983 - Pack bool fields better in BrowserChild. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584789
diff changeset
   335
      mPendingRenderLayers(false),
49c60a0b4565926424dea786b69b772ecc9e3f92 Bug 1717983 - Pack bool fields better in BrowserChild. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584789
diff changeset
   336
      mPendingRenderLayersReceivedMessage(false),
475425
7718aebfcc5203dd29e5e7609aca8aa8ff1e446c Bug 1510569 - Only forward nsIWebProgress events to the BrowserParent after the WebProgressChild has loaded r=kmag,mconley
Barret Rennie <barret@brennie.ca>
parents: 475093
diff changeset
   337
      mLayersObserverEpoch{1},
314457
345334eff0212ecb78a29a65c62b1e95d0279f3a Bug 1297549: Part 2 - Propagate changes in tab native window down to content for a11y; r=jimm
Aaron Klotz <aklotz@mozilla.com>
parents: 314346
diff changeset
   338
#if defined(XP_WIN) && defined(ACCESSIBILITY)
475425
7718aebfcc5203dd29e5e7609aca8aa8ff1e446c Bug 1510569 - Only forward nsIWebProgress events to the BrowserParent after the WebProgressChild has loaded r=kmag,mconley
Barret Rennie <barret@brennie.ca>
parents: 475093
diff changeset
   339
      mNativeWindowHandle(0),
314457
345334eff0212ecb78a29a65c62b1e95d0279f3a Bug 1297549: Part 2 - Propagate changes in tab native window down to content for a11y; r=jimm
Aaron Klotz <aklotz@mozilla.com>
parents: 314346
diff changeset
   340
#endif
355960
2a2e5e6b3091dba33ba8f041c302b76f27d8a868 Bug 1359129 - Use the most recent RootDocAccessible when delaying DocAccessibleChild messages. r=aklotz
David Parks <dparks@mozilla.com>
parents: 355834
diff changeset
   341
#if defined(ACCESSIBILITY)
475425
7718aebfcc5203dd29e5e7609aca8aa8ff1e446c Bug 1510569 - Only forward nsIWebProgress events to the BrowserParent after the WebProgressChild has loaded r=kmag,mconley
Barret Rennie <barret@brennie.ca>
parents: 475093
diff changeset
   342
      mTopLevelDocAccessibleChild(nullptr),
355960
2a2e5e6b3091dba33ba8f041c302b76f27d8a868 Bug 1359129 - Use the most recent RootDocAccessible when delaying DocAccessibleChild messages. r=aklotz
David Parks <dparks@mozilla.com>
parents: 355834
diff changeset
   343
#endif
475425
7718aebfcc5203dd29e5e7609aca8aa8ff1e446c Bug 1510569 - Only forward nsIWebProgress events to the BrowserParent after the WebProgressChild has loaded r=kmag,mconley
Barret Rennie <barret@brennie.ca>
parents: 475093
diff changeset
   344
      mPendingLayersObserverEpoch{0},
7718aebfcc5203dd29e5e7609aca8aa8ff1e446c Bug 1510569 - Only forward nsIWebProgress events to the BrowserParent after the WebProgressChild has loaded r=kmag,mconley
Barret Rennie <barret@brennie.ca>
parents: 475093
diff changeset
   345
      mPendingDocShellBlockers(0),
576540
6146005a6108ae226ac6b4ccd7b9c945a57e3734 Bug 1706051 - Remove some IPC messages that are unused. r=smaug
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 576458
diff changeset
   346
      mCancelContentJSEpoch(0) {
389655
d8d3d54dea296868349f5cb1819392a239ac552a Bug 1401379 - Part 6: Cycle collect nsWebBrowser, r=smaug
Nika Layzell <nika@thelayzells.com>
parents: 389528
diff changeset
   347
  mozilla::HoldJSObjects(this);
d8d3d54dea296868349f5cb1819392a239ac552a Bug 1401379 - Part 6: Cycle collect nsWebBrowser, r=smaug
Nika Layzell <nika@thelayzells.com>
parents: 389528
diff changeset
   348
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   349
  nsWeakPtr weakPtrThis(do_GetWeakReference(
470937
9998ccf0c05f87940376b736fb587355acf03c2c Bug 1534395 - Rename nsITabChild to nsIBrowserChild. r=nika,mconley
Ryan Hunt <rhunt@eqrion.net>
parents: 470936
diff changeset
   350
      static_cast<nsIBrowserChild*>(this)));  // for capture by the lambda
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   351
  mSetAllowedTouchBehaviorCallback =
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   352
      [weakPtrThis](uint64_t aInputBlockId,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   353
                    const nsTArray<TouchBehaviorFlags>& aFlags) {
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   354
        if (nsCOMPtr<nsIBrowserChild> browserChild =
470937
9998ccf0c05f87940376b736fb587355acf03c2c Bug 1534395 - Rename nsITabChild to nsIBrowserChild. r=nika,mconley
Ryan Hunt <rhunt@eqrion.net>
parents: 470936
diff changeset
   355
                do_QueryReferent(weakPtrThis)) {
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   356
          static_cast<BrowserChild*>(browserChild.get())
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   357
              ->SetAllowedTouchBehavior(aInputBlockId, aFlags);
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   358
        }
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   359
      };
262100
25e572cce005e1f9d7a4805d6c398dea5b1ff797 Bug 1202312 - Use mozilla::Function for the SetAllowedTouchBehavior callback. r=kats
Botond Ballo <botond@mozilla.com>
parents: 261877
diff changeset
   360
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   361
  // preloaded BrowserChild should not be added to child map
213163
01b25915ca374d803fa2e98f1dc47a9b59c007bf Bug 1020172 - Patch 2: Manage TabParent in chrome process - v14. r=khuey
Kershaw Chang <kechang@mozilla.com>
parents: 212708
diff changeset
   362
  if (mUniqueId) {
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   363
    MOZ_ASSERT(NestedBrowserChildMap().find(mUniqueId) ==
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   364
               NestedBrowserChildMap().end());
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   365
    NestedBrowserChildMap()[mUniqueId] = this;
213163
01b25915ca374d803fa2e98f1dc47a9b59c007bf Bug 1020172 - Patch 2: Manage TabParent in chrome process - v14. r=khuey
Kershaw Chang <kechang@mozilla.com>
parents: 212708
diff changeset
   366
  }
588638
1d86ded611924c3c2460d4898451b1f238ca336a Bug 1688878 - Use StaticPrefs for dom.event.coalesce_mouse_move pref; r=smaug
Edgar Chen <echen@mozilla.com>
parents: 588592
diff changeset
   367
  mCoalesceMouseMoveEvents = StaticPrefs::dom_events_coalesce_mousemove();
375979
64edaaccec973cd3b0d2aeea1f565d65e8614ea3 Bug 1361067 Part2: Coalesce mouse move events to be once per refresh cycle. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375978
diff changeset
   368
  if (mCoalesceMouseMoveEvents) {
64edaaccec973cd3b0d2aeea1f565d65e8614ea3 Bug 1361067 Part2: Coalesce mouse move events to be once per refresh cycle. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375978
diff changeset
   369
    mCoalescedMouseEventFlusher = new CoalescedMouseMoveFlusher(this);
64edaaccec973cd3b0d2aeea1f565d65e8614ea3 Bug 1361067 Part2: Coalesce mouse move events to be once per refresh cycle. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375978
diff changeset
   370
  }
582091
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
   371
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
   372
  if (StaticPrefs::dom_events_coalesce_touchmove()) {
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
   373
    mCoalescedTouchMoveEventFlusher = new CoalescedTouchMoveFlusher(this);
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
   374
  }
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   375
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   376
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   377
const CompositorOptions& BrowserChild::GetCompositorOptions() const {
390136
2dbd4a1032d06a74b5afa9883c49ee3aa3ad236d Bug 1390741 - Use BasicCompositor if widget type does not support acceleration r=aosmond,kats
sotaro <sotaro.ikeda.g@gmail.com>
parents: 389655
diff changeset
   378
  // If you're calling this before mCompositorOptions is set, well.. don't.
2dbd4a1032d06a74b5afa9883c49ee3aa3ad236d Bug 1390741 - Use BasicCompositor if widget type does not support acceleration r=aosmond,kats
sotaro <sotaro.ikeda.g@gmail.com>
parents: 389655
diff changeset
   379
  MOZ_ASSERT(mCompositorOptions);
2dbd4a1032d06a74b5afa9883c49ee3aa3ad236d Bug 1390741 - Use BasicCompositor if widget type does not support acceleration r=aosmond,kats
sotaro <sotaro.ikeda.g@gmail.com>
parents: 389655
diff changeset
   380
  return mCompositorOptions.ref();
2dbd4a1032d06a74b5afa9883c49ee3aa3ad236d Bug 1390741 - Use BasicCompositor if widget type does not support acceleration r=aosmond,kats
sotaro <sotaro.ikeda.g@gmail.com>
parents: 389655
diff changeset
   381
}
2dbd4a1032d06a74b5afa9883c49ee3aa3ad236d Bug 1390741 - Use BasicCompositor if widget type does not support acceleration r=aosmond,kats
sotaro <sotaro.ikeda.g@gmail.com>
parents: 389655
diff changeset
   382
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   383
bool BrowserChild::AsyncPanZoomEnabled() const {
366935
7cc250ff4f6eea2e264906f78dbd9f5be67f3dbe Bug 1370089 - Assume APZ is enabled in TabChild if we are queried before we have the compositor options. r=dvander a=bustage
Kartikaya Gupta <kgupta@mozilla.com>
parents: 366862
diff changeset
   384
  // This might get called by the TouchEvent::PrefEnabled code before we have
7cc250ff4f6eea2e264906f78dbd9f5be67f3dbe Bug 1370089 - Assume APZ is enabled in TabChild if we are queried before we have the compositor options. r=dvander a=bustage
Kartikaya Gupta <kgupta@mozilla.com>
parents: 366862
diff changeset
   385
  // mCompositorOptions populated (bug 1370089). In that case we just assume
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   386
  // APZ is enabled because we're in a content process (because BrowserChild)
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   387
  // and APZ is probably going to be enabled here since e10s is enabled.
366935
7cc250ff4f6eea2e264906f78dbd9f5be67f3dbe Bug 1370089 - Assume APZ is enabled in TabChild if we are queried before we have the compositor options. r=dvander a=bustage
Kartikaya Gupta <kgupta@mozilla.com>
parents: 366862
diff changeset
   388
  return mCompositorOptions ? mCompositorOptions->UseAPZ() : true;
329205
cfebe97561fb3c35c99776cb5deaa7607fdf0b21 Bug 1330037 - Propagate the CompositorOptions over to TabChild and keep a copy there. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 329164
diff changeset
   389
}
cfebe97561fb3c35c99776cb5deaa7607fdf0b21 Bug 1330037 - Propagate the CompositorOptions over to TabChild and keep a copy there. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 329164
diff changeset
   390
108591
1bf3d3d3cbe0a30567cfe7475ce9863b21c46ecf Bug 746502: Add support for <meta name=viewport> on B2G/async panning and zooming r=cjones,smaug
Doug Sherk <dsherk2@mozilla.com>
parents: 108590
diff changeset
   391
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   392
BrowserChild::Observe(nsISupports* aSubject, const char* aTopic,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   393
                      const char16_t* aData) {
255263
4b0ef3b98b72dad40666062030043d10cac5e267 Bug 1131359 - Port the double-tap-to-zoom functionality of BrowserElementPanning.js to C++. r=kats
Botond Ballo <botond@mozilla.com>
parents: 254329
diff changeset
   394
  if (!strcmp(aTopic, BEFORE_FIRST_PAINT)) {
247190
a509c974aa1f07e07b650c18c4dbc91a1e84336b Use widgets for APZ checks, rather than gfxPrefs. (bug 1162064, r=kats,mstange)
David Anderson <danderson@mozilla.com>
parents: 246551
diff changeset
   395
    if (AsyncPanZoomEnabled()) {
452446
f0a91d36587266d7454a450c6044d573664fbed5 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 452279
diff changeset
   396
      nsCOMPtr<Document> subject(do_QueryInterface(aSubject));
469386
148e810b01d22b00e254c445dda2f659534103a7 Bug 1542664 - Make TabChild use mozilla::PresShell directly rather than via nsIPresShell r=nika
Masayuki Nakano <masayuki@d-toybox.com>
parents: 469371
diff changeset
   397
      nsCOMPtr<Document> doc(GetTopLevelDocument());
108591
1bf3d3d3cbe0a30567cfe7475ce9863b21c46ecf Bug 746502: Add support for <meta name=viewport> on B2G/async panning and zooming r=cjones,smaug
Doug Sherk <dsherk2@mozilla.com>
parents: 108590
diff changeset
   398
583087
07272d29f97f3c9ba954a62717ed96fcfb6e88b8 Bug 1709460 - Try to initialize a displayport base for OOP iframe's root scroller with its visible rect. r=tnikkel
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 583086
diff changeset
   399
      if (subject == doc) {
466778
f529b394cb111fff7e16028f063f3b8c3b96b225 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
Masayuki Nakano <masayuki@d-toybox.com>
parents: 466754
diff changeset
   400
        RefPtr<PresShell> presShell = doc->GetPresShell();
f529b394cb111fff7e16028f063f3b8c3b96b225 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
Masayuki Nakano <masayuki@d-toybox.com>
parents: 466754
diff changeset
   401
        if (presShell) {
f529b394cb111fff7e16028f063f3b8c3b96b225 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
Masayuki Nakano <masayuki@d-toybox.com>
parents: 466754
diff changeset
   402
          presShell->SetIsFirstPaint(true);
239374
98d34adf1d56f0c992b2824ce3e901a04ecb9e3a Bug 1152479 - Do not use layout-related nsIDOMWindowUtils APIs from C++ APZ code. r=kats
Botond Ballo <botond@mozilla.com>
parents: 239373
diff changeset
   403
        }
108591
1bf3d3d3cbe0a30567cfe7475ce9863b21c46ecf Bug 746502: Add support for <meta name=viewport> on B2G/async panning and zooming r=cjones,smaug
Doug Sherk <dsherk2@mozilla.com>
parents: 108590
diff changeset
   404
466778
f529b394cb111fff7e16028f063f3b8c3b96b225 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
Masayuki Nakano <masayuki@d-toybox.com>
parents: 466754
diff changeset
   405
        APZCCallbackHelper::InitializeRootDisplayport(presShell);
108591
1bf3d3d3cbe0a30567cfe7475ce9863b21c46ecf Bug 746502: Add support for <meta name=viewport> on B2G/async panning and zooming r=cjones,smaug
Doug Sherk <dsherk2@mozilla.com>
parents: 108590
diff changeset
   406
      }
1bf3d3d3cbe0a30567cfe7475ce9863b21c46ecf Bug 746502: Add support for <meta name=viewport> on B2G/async panning and zooming r=cjones,smaug
Doug Sherk <dsherk2@mozilla.com>
parents: 108590
diff changeset
   407
    }
1bf3d3d3cbe0a30567cfe7475ce9863b21c46ecf Bug 746502: Add support for <meta name=viewport> on B2G/async panning and zooming r=cjones,smaug
Doug Sherk <dsherk2@mozilla.com>
parents: 108590
diff changeset
   408
  }
1bf3d3d3cbe0a30567cfe7475ce9863b21c46ecf Bug 746502: Add support for <meta name=viewport> on B2G/async panning and zooming r=cjones,smaug
Doug Sherk <dsherk2@mozilla.com>
parents: 108590
diff changeset
   409
1bf3d3d3cbe0a30567cfe7475ce9863b21c46ecf Bug 746502: Add support for <meta name=viewport> on B2G/async panning and zooming r=cjones,smaug
Doug Sherk <dsherk2@mozilla.com>
parents: 108590
diff changeset
   410
  return NS_OK;
1bf3d3d3cbe0a30567cfe7475ce9863b21c46ecf Bug 746502: Add support for <meta name=viewport> on B2G/async panning and zooming r=cjones,smaug
Doug Sherk <dsherk2@mozilla.com>
parents: 108590
diff changeset
   411
}
1bf3d3d3cbe0a30567cfe7475ce9863b21c46ecf Bug 746502: Add support for <meta name=viewport> on B2G/async panning and zooming r=cjones,smaug
Doug Sherk <dsherk2@mozilla.com>
parents: 108590
diff changeset
   412
472824
7748746bf2feda8edd0cabfdaff88b7faf059ad5 Bug 1548568 - Cleanup to remove unused guid parameter in callback. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 472823
diff changeset
   413
void BrowserChild::ContentReceivedInputBlock(uint64_t aInputBlockId,
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   414
                                             bool aPreventDefault) const {
311191
12b61fd41c9947ac45df8789acd711c57d1657f4 Bug 1289650 - Use PAPZCTreeManager in content process instead of PAPZ. r=kats
Ryan Hunt <rhunt@mozilla.com>
parents: 311044
diff changeset
   415
  if (mApzcTreeManager) {
12b61fd41c9947ac45df8789acd711c57d1657f4 Bug 1289650 - Use PAPZCTreeManager in content process instead of PAPZ. r=kats
Ryan Hunt <rhunt@mozilla.com>
parents: 311044
diff changeset
   416
    mApzcTreeManager->ContentReceivedInputBlock(aInputBlockId, aPreventDefault);
284580
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
   417
  }
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
   418
}
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
   419
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   420
void BrowserChild::SetTargetAPZC(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   421
    uint64_t aInputBlockId,
520787
5916b41d10e9c8e6731db02a1611a4b28c1c25ba Bug 1622360 - Remove SLGuidAndRenderRoot and convert remaining uses to ScrollableLayerGuid. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 520370
diff changeset
   422
    const nsTArray<ScrollableLayerGuid>& aTargets) const {
311191
12b61fd41c9947ac45df8789acd711c57d1657f4 Bug 1289650 - Use PAPZCTreeManager in content process instead of PAPZ. r=kats
Ryan Hunt <rhunt@mozilla.com>
parents: 311044
diff changeset
   423
  if (mApzcTreeManager) {
12b61fd41c9947ac45df8789acd711c57d1657f4 Bug 1289650 - Use PAPZCTreeManager in content process instead of PAPZ. r=kats
Ryan Hunt <rhunt@mozilla.com>
parents: 311044
diff changeset
   424
    mApzcTreeManager->SetTargetAPZC(aInputBlockId, aTargets);
284580
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
   425
  }
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
   426
}
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
   427
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   428
void BrowserChild::SetAllowedTouchBehavior(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   429
    uint64_t aInputBlockId,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   430
    const nsTArray<TouchBehaviorFlags>& aTargets) const {
311191
12b61fd41c9947ac45df8789acd711c57d1657f4 Bug 1289650 - Use PAPZCTreeManager in content process instead of PAPZ. r=kats
Ryan Hunt <rhunt@mozilla.com>
parents: 311044
diff changeset
   431
  if (mApzcTreeManager) {
12b61fd41c9947ac45df8789acd711c57d1657f4 Bug 1289650 - Use PAPZCTreeManager in content process instead of PAPZ. r=kats
Ryan Hunt <rhunt@mozilla.com>
parents: 311044
diff changeset
   432
    mApzcTreeManager->SetAllowedTouchBehavior(aInputBlockId, aTargets);
284580
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
   433
  }
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
   434
}
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
   435
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   436
bool BrowserChild::DoUpdateZoomConstraints(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   437
    const uint32_t& aPresShellId, const ViewID& aViewId,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   438
    const Maybe<ZoomConstraints>& aConstraints) {
429684
ba650b0c1208cf9a94586abe90737a00a2b0240b Bug 1479277 - Don't try to send APZ messages after teardown. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 429191
diff changeset
   439
  if (!mApzcTreeManager || mDestroyed) {
284580
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
   440
    return false;
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
   441
  }
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
   442
520787
5916b41d10e9c8e6731db02a1611a4b28c1c25ba Bug 1622360 - Remove SLGuidAndRenderRoot and convert remaining uses to ScrollableLayerGuid. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 520370
diff changeset
   443
  ScrollableLayerGuid guid =
5916b41d10e9c8e6731db02a1611a4b28c1c25ba Bug 1622360 - Remove SLGuidAndRenderRoot and convert remaining uses to ScrollableLayerGuid. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 520370
diff changeset
   444
      ScrollableLayerGuid(mLayersId, aPresShellId, aViewId);
311191
12b61fd41c9947ac45df8789acd711c57d1657f4 Bug 1289650 - Use PAPZCTreeManager in content process instead of PAPZ. r=kats
Ryan Hunt <rhunt@mozilla.com>
parents: 311044
diff changeset
   445
12b61fd41c9947ac45df8789acd711c57d1657f4 Bug 1289650 - Use PAPZCTreeManager in content process instead of PAPZ. r=kats
Ryan Hunt <rhunt@mozilla.com>
parents: 311044
diff changeset
   446
  mApzcTreeManager->UpdateZoomConstraints(guid, aConstraints);
12b61fd41c9947ac45df8789acd711c57d1657f4 Bug 1289650 - Use PAPZCTreeManager in content process instead of PAPZ. r=kats
Ryan Hunt <rhunt@mozilla.com>
parents: 311044
diff changeset
   447
  return true;
108591
1bf3d3d3cbe0a30567cfe7475ce9863b21c46ecf Bug 746502: Add support for <meta name=viewport> on B2G/async panning and zooming r=cjones,smaug
Doug Sherk <dsherk2@mozilla.com>
parents: 108590
diff changeset
   448
}
1bf3d3d3cbe0a30567cfe7475ce9863b21c46ecf Bug 746502: Add support for <meta name=viewport> on B2G/async panning and zooming r=cjones,smaug
Doug Sherk <dsherk2@mozilla.com>
parents: 108590
diff changeset
   449
487027
5926b3ea192f54f4a107d6c98c029332f13666af Bug 1523638 - Part 5: Create a WindowGlobal actor during normal PBrowser construction, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 487022
diff changeset
   450
nsresult BrowserChild::Init(mozIDOMWindowProxy* aParent,
5926b3ea192f54f4a107d6c98c029332f13666af Bug 1523638 - Part 5: Create a WindowGlobal actor during normal PBrowser construction, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 487022
diff changeset
   451
                            WindowGlobalChild* aInitialWindowChild) {
5926b3ea192f54f4a107d6c98c029332f13666af Bug 1523638 - Part 5: Create a WindowGlobal actor during normal PBrowser construction, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 487022
diff changeset
   452
  MOZ_ASSERT_IF(aInitialWindowChild,
5926b3ea192f54f4a107d6c98c029332f13666af Bug 1523638 - Part 5: Create a WindowGlobal actor during normal PBrowser construction, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 487022
diff changeset
   453
                aInitialWindowChild->BrowsingContext() == mBrowsingContext);
352939
cf2268ecf05dbd556d1e9f54ecfea44e48ab1f19 Bug 1354249 - Use same TabGroup as original tab for print preview (r=mystor)
Bill McCloskey <billm@mozilla.com>
parents: 352557
diff changeset
   454
249318
daefa5ea5f981ca4a0026be825c9eda09d815f90 Bug 1175383 TabChild should store PuppetWidget as is rather than as nsIWidget r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 248968
diff changeset
   455
  nsCOMPtr<nsIWidget> widget = nsIWidget::CreatePuppetWidget(this);
daefa5ea5f981ca4a0026be825c9eda09d815f90 Bug 1175383 TabChild should store PuppetWidget as is rather than as nsIWidget r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 248968
diff changeset
   456
  mPuppetWidget = static_cast<PuppetWidget*>(widget.get());
daefa5ea5f981ca4a0026be825c9eda09d815f90 Bug 1175383 TabChild should store PuppetWidget as is rather than as nsIWidget r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 248968
diff changeset
   457
  if (!mPuppetWidget) {
103787
3925750b682fb35b7bd639c6a1b031adda991ecf Bug 781725: Refactor TabChild to allow pre-created instances, and then use a pre-created instance to pre-load and compile BrowserElementChild.js. r=smaug
Chris Jones <jones.chris.g@gmail.com>
parents: 103563
diff changeset
   458
    NS_ERROR("couldn't create fake widget");
104661
090511685ed4ceed095dc3f2d14d5c93932737ff Bug 788645 - TabChild::Init returns bool instead of nsresult; r=smaug
Aryeh Gregor <ayg@aryeh.name>
parents: 104309
diff changeset
   459
    return NS_ERROR_FAILURE;
103787
3925750b682fb35b7bd639c6a1b031adda991ecf Bug 781725: Refactor TabChild to allow pre-created instances, and then use a pre-created instance to pre-load and compile BrowserElementChild.js. r=smaug
Chris Jones <jones.chris.g@gmail.com>
parents: 103563
diff changeset
   460
  }
448211
cb9dec83210d452c015b5608a3ea76c72ebbe777 Bug 1502330 - Create BrowsingContext with passed opener. r=qdot
Andreas Farre <farre@mozilla.com>
parents: 447675
diff changeset
   461
  mPuppetWidget->InfallibleCreate(nullptr,
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   462
                                  nullptr,  // no parents
448211
cb9dec83210d452c015b5608a3ea76c72ebbe777 Bug 1502330 - Create BrowsingContext with passed opener. r=qdot
Andreas Farre <farre@mozilla.com>
parents: 447675
diff changeset
   463
                                  LayoutDeviceIntRect(0, 0, 0, 0),
487027
5926b3ea192f54f4a107d6c98c029332f13666af Bug 1523638 - Part 5: Create a WindowGlobal actor during normal PBrowser construction, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 487022
diff changeset
   464
                                  nullptr);  // HandleWidgetEvent
103787
3925750b682fb35b7bd639c6a1b031adda991ecf Bug 781725: Refactor TabChild to allow pre-created instances, and then use a pre-created instance to pre-load and compile BrowserElementChild.js. r=smaug
Chris Jones <jones.chris.g@gmail.com>
parents: 103563
diff changeset
   465
528742
8e5d97fb8238ad23f0ff3efe8d07593695231ca6 Bug 1633820 - Part 4: Remove OriginAttributes from TabContext, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 528708
diff changeset
   466
  mWebBrowser = nsWebBrowser::Create(this, mPuppetWidget, mBrowsingContext,
8e5d97fb8238ad23f0ff3efe8d07593695231ca6 Bug 1633820 - Part 4: Remove OriginAttributes from TabContext, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 528708
diff changeset
   467
                                     aInitialWindowChild);
448211
cb9dec83210d452c015b5608a3ea76c72ebbe777 Bug 1502330 - Create BrowsingContext with passed opener. r=qdot
Andreas Farre <farre@mozilla.com>
parents: 447675
diff changeset
   468
  nsIWebBrowser* webBrowser = mWebBrowser;
cb9dec83210d452c015b5608a3ea76c72ebbe777 Bug 1502330 - Create BrowsingContext with passed opener. r=qdot
Andreas Farre <farre@mozilla.com>
parents: 447675
diff changeset
   469
cb9dec83210d452c015b5608a3ea76c72ebbe777 Bug 1502330 - Create BrowsingContext with passed opener. r=qdot
Andreas Farre <farre@mozilla.com>
parents: 447675
diff changeset
   470
  mWebNav = do_QueryInterface(webBrowser);
cb9dec83210d452c015b5608a3ea76c72ebbe777 Bug 1502330 - Create BrowsingContext with passed opener. r=qdot
Andreas Farre <farre@mozilla.com>
parents: 447675
diff changeset
   471
  NS_ASSERTION(mWebNav, "nsWebBrowser doesn't implement nsIWebNavigation?");
103787
3925750b682fb35b7bd639c6a1b031adda991ecf Bug 781725: Refactor TabChild to allow pre-created instances, and then use a pre-created instance to pre-load and compile BrowserElementChild.js. r=smaug
Chris Jones <jones.chris.g@gmail.com>
parents: 103563
diff changeset
   472
3925750b682fb35b7bd639c6a1b031adda991ecf Bug 781725: Refactor TabChild to allow pre-created instances, and then use a pre-created instance to pre-load and compile BrowserElementChild.js. r=smaug
Chris Jones <jones.chris.g@gmail.com>
parents: 103563
diff changeset
   473
  // IPC uses a WebBrowser object for which DNS prefetching is turned off
3925750b682fb35b7bd639c6a1b031adda991ecf Bug 781725: Refactor TabChild to allow pre-created instances, and then use a pre-created instance to pre-load and compile BrowserElementChild.js. r=smaug
Chris Jones <jones.chris.g@gmail.com>
parents: 103563
diff changeset
   474
  // by default. But here we really want it, so enable it explicitly
430497
796b4331f06a3324b893b15ec28a5d8626440e42 Bug 1480643 - Remove nsIWebBrowserSetup; r=nika
Kyle Machulis <kyle@nonpolynomial.com>
parents: 430136
diff changeset
   475
  mWebBrowser->SetAllowDNSPrefetch(true);
101899
986a9cafa237ab8b46ea3cc6e5bff270f4ff64fa Bug 775447: Properly count number of touch listeners in AsyncPanZoomController r=cjones
Doug Sherk <dsherk2@mozilla.com>
parents: 101842
diff changeset
   476
175119
daada068c02fe87b991ae6a7aa23ce377143de56 Bug 985817 - Move some TabChild functionality into base class to be reusable in Embedlite implementation. r=kats
Tatiana Meshkova <tanya.meshkova@gmail.com>
parents: 174866
diff changeset
   477
  nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
108591
1bf3d3d3cbe0a30567cfe7475ce9863b21c46ecf Bug 746502: Add support for <meta name=viewport> on B2G/async panning and zooming r=cjones,smaug
Doug Sherk <dsherk2@mozilla.com>
parents: 108590
diff changeset
   478
  MOZ_ASSERT(docShell);
131097
9189df8e7d74503a6055b9d0b2dc3075c3f0b04f Bug 841495 - Implement background page thumbnail service (part 1: propagate private-browsing state from parent docshell to remote docshell). r=smaug
Drew Willcoxon <adw@mozilla.com>
parents: 131073
diff changeset
   479
467868
1ba9a2cebf1252ffc1af89e3e978cf4b47fcb46e Bug 1510569 - Filter TabChild nsIWebProgress events through a nsBrowserFilter r=kmag
Barret Rennie <barret@brennie.ca>
parents: 466778
diff changeset
   480
  mStatusFilter = new nsBrowserStatusFilter();
1ba9a2cebf1252ffc1af89e3e978cf4b47fcb46e Bug 1510569 - Filter TabChild nsIWebProgress events through a nsBrowserFilter r=kmag
Barret Rennie <barret@brennie.ca>
parents: 466778
diff changeset
   481
490456
e27459aad2c9c752b01c197f2039b0b3ba8c8e41 Bug 1510569 - Port onSecurityChange from WebProgressChild.jsm to C++; remove WebProgressChild r=Ehsan,ochameau
Barret Rennie <barret@brennie.ca>
parents: 490447
diff changeset
   482
  nsresult rv =
e27459aad2c9c752b01c197f2039b0b3ba8c8e41 Bug 1510569 - Port onSecurityChange from WebProgressChild.jsm to C++; remove WebProgressChild r=Ehsan,ochameau
Barret Rennie <barret@brennie.ca>
parents: 490447
diff changeset
   483
      mStatusFilter->AddProgressListener(this, nsIWebProgress::NOTIFY_ALL);
455444
712eb70b540a195fb7435e3f390eb44dbe792840 Bug 1520879 - Port the onContentBlockingEvent notifications inside WebProgressChild.jsm to C++; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 454520
diff changeset
   484
  NS_ENSURE_SUCCESS(rv, rv);
467868
1ba9a2cebf1252ffc1af89e3e978cf4b47fcb46e Bug 1510569 - Filter TabChild nsIWebProgress events through a nsBrowserFilter r=kmag
Barret Rennie <barret@brennie.ca>
parents: 466778
diff changeset
   485
1ba9a2cebf1252ffc1af89e3e978cf4b47fcb46e Bug 1510569 - Filter TabChild nsIWebProgress events through a nsBrowserFilter r=kmag
Barret Rennie <barret@brennie.ca>
parents: 466778
diff changeset
   486
  {
1ba9a2cebf1252ffc1af89e3e978cf4b47fcb46e Bug 1510569 - Filter TabChild nsIWebProgress events through a nsBrowserFilter r=kmag
Barret Rennie <barret@brennie.ca>
parents: 466778
diff changeset
   487
    nsCOMPtr<nsIWebProgress> webProgress = do_QueryInterface(docShell);
490456
e27459aad2c9c752b01c197f2039b0b3ba8c8e41 Bug 1510569 - Port onSecurityChange from WebProgressChild.jsm to C++; remove WebProgressChild r=Ehsan,ochameau
Barret Rennie <barret@brennie.ca>
parents: 490447
diff changeset
   488
    rv = webProgress->AddProgressListener(mStatusFilter,
e27459aad2c9c752b01c197f2039b0b3ba8c8e41 Bug 1510569 - Port onSecurityChange from WebProgressChild.jsm to C++; remove WebProgressChild r=Ehsan,ochameau
Barret Rennie <barret@brennie.ca>
parents: 490447
diff changeset
   489
                                          nsIWebProgress::NOTIFY_ALL);
467868
1ba9a2cebf1252ffc1af89e3e978cf4b47fcb46e Bug 1510569 - Filter TabChild nsIWebProgress events through a nsBrowserFilter r=kmag
Barret Rennie <barret@brennie.ca>
parents: 466778
diff changeset
   490
    NS_ENSURE_SUCCESS(rv, rv);
1ba9a2cebf1252ffc1af89e3e978cf4b47fcb46e Bug 1510569 - Filter TabChild nsIWebProgress events through a nsBrowserFilter r=kmag
Barret Rennie <barret@brennie.ca>
parents: 466778
diff changeset
   491
  }
455444
712eb70b540a195fb7435e3f390eb44dbe792840 Bug 1520879 - Port the onContentBlockingEvent notifications inside WebProgressChild.jsm to C++; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 454520
diff changeset
   492
522787
50aa16aa36fb3b808d4116377db79bdc6faaa6fe Bug 1616353 - Part 6.3: Replace many nsILoadContext mutators with assertions, r=smaug
Nika Layzell <nika@thelayzells.com>
parents: 522781
diff changeset
   493
#ifdef DEBUG
175119
daada068c02fe87b991ae6a7aa23ce377143de56 Bug 985817 - Move some TabChild functionality into base class to be reusable in Embedlite implementation. r=kats
Tatiana Meshkova <tanya.meshkova@gmail.com>
parents: 174866
diff changeset
   494
  nsCOMPtr<nsILoadContext> loadContext = do_GetInterface(WebNavigation());
131097
9189df8e7d74503a6055b9d0b2dc3075c3f0b04f Bug 841495 - Implement background page thumbnail service (part 1: propagate private-browsing state from parent docshell to remote docshell). r=smaug
Drew Willcoxon <adw@mozilla.com>
parents: 131073
diff changeset
   495
  MOZ_ASSERT(loadContext);
522787
50aa16aa36fb3b808d4116377db79bdc6faaa6fe Bug 1616353 - Part 6.3: Replace many nsILoadContext mutators with assertions, r=smaug
Nika Layzell <nika@thelayzells.com>
parents: 522781
diff changeset
   496
  MOZ_ASSERT(loadContext->UseRemoteTabs() ==
50aa16aa36fb3b808d4116377db79bdc6faaa6fe Bug 1616353 - Part 6.3: Replace many nsILoadContext mutators with assertions, r=smaug
Nika Layzell <nika@thelayzells.com>
parents: 522781
diff changeset
   497
             !!(mChromeFlags & nsIWebBrowserChrome::CHROME_REMOTE_WINDOW));
50aa16aa36fb3b808d4116377db79bdc6faaa6fe Bug 1616353 - Part 6.3: Replace many nsILoadContext mutators with assertions, r=smaug
Nika Layzell <nika@thelayzells.com>
parents: 522781
diff changeset
   498
  MOZ_ASSERT(loadContext->UseRemoteSubframes() ==
50aa16aa36fb3b808d4116377db79bdc6faaa6fe Bug 1616353 - Part 6.3: Replace many nsILoadContext mutators with assertions, r=smaug
Nika Layzell <nika@thelayzells.com>
parents: 522781
diff changeset
   499
             !!(mChromeFlags & nsIWebBrowserChrome::CHROME_FISSION_WINDOW));
50aa16aa36fb3b808d4116377db79bdc6faaa6fe Bug 1616353 - Part 6.3: Replace many nsILoadContext mutators with assertions, r=smaug
Nika Layzell <nika@thelayzells.com>
parents: 522781
diff changeset
   500
#endif  // defined(DEBUG)
131097
9189df8e7d74503a6055b9d0b2dc3075c3f0b04f Bug 841495 - Implement background page thumbnail service (part 1: propagate private-browsing state from parent docshell to remote docshell). r=smaug
Drew Willcoxon <adw@mozilla.com>
parents: 131073
diff changeset
   501
178541
84f879f9cdc3563e3a600431ed882ea3a5d7789d Bug 992778 - Set docshell.chromeEventHandler in child processes. r=bz
Alexandre Poirot <poirot.alex@gmail.com>
parents: 178416
diff changeset
   502
  // Few lines before, baseWindow->Create() will end up creating a new
84f879f9cdc3563e3a600431ed882ea3a5d7789d Bug 992778 - Set docshell.chromeEventHandler in child processes. r=bz
Alexandre Poirot <poirot.alex@gmail.com>
parents: 178416
diff changeset
   503
  // window root in nsGlobalWindow::SetDocShell.
84f879f9cdc3563e3a600431ed882ea3a5d7789d Bug 992778 - Set docshell.chromeEventHandler in child processes. r=bz
Alexandre Poirot <poirot.alex@gmail.com>
parents: 178416
diff changeset
   504
  // Then this chrome event handler, will be inherited to inner windows.
84f879f9cdc3563e3a600431ed882ea3a5d7789d Bug 992778 - Set docshell.chromeEventHandler in child processes. r=bz
Alexandre Poirot <poirot.alex@gmail.com>
parents: 178416
diff changeset
   505
  // We want to also set it to the docshell so that inner windows
84f879f9cdc3563e3a600431ed882ea3a5d7789d Bug 992778 - Set docshell.chromeEventHandler in child processes. r=bz
Alexandre Poirot <poirot.alex@gmail.com>
parents: 178416
diff changeset
   506
  // and any code that has access to the docshell
84f879f9cdc3563e3a600431ed882ea3a5d7789d Bug 992778 - Set docshell.chromeEventHandler in child processes. r=bz
Alexandre Poirot <poirot.alex@gmail.com>
parents: 178416
diff changeset
   507
  // can all listen to the same chrome event handler.
84f879f9cdc3563e3a600431ed882ea3a5d7789d Bug 992778 - Set docshell.chromeEventHandler in child processes. r=bz
Alexandre Poirot <poirot.alex@gmail.com>
parents: 178416
diff changeset
   508
  // XXX: ideally, we would set a chrome event handler earlier,
84f879f9cdc3563e3a600431ed882ea3a5d7789d Bug 992778 - Set docshell.chromeEventHandler in child processes. r=bz
Alexandre Poirot <poirot.alex@gmail.com>
parents: 178416
diff changeset
   509
  // and all windows, even the root one, will use the docshell one.
282426
e22b3043887ed36bf2c634c2924a7c8d39d226b1 Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug
Kyle Huey <khuey@kylehuey.com>
parents: 282389
diff changeset
   510
  nsCOMPtr<nsPIDOMWindowOuter> window = do_GetInterface(WebNavigation());
178541
84f879f9cdc3563e3a600431ed882ea3a5d7789d Bug 992778 - Set docshell.chromeEventHandler in child processes. r=bz
Alexandre Poirot <poirot.alex@gmail.com>
parents: 178416
diff changeset
   511
  NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
431226
674c721d44fee8c4edd243312cbc73f81122e5d0 Bug 1481645 - Remove some redundant uses of do_QueryInterface. r=bzbarsky
Adrian Wielgosik <adrian.wielgosik@gmail.com>
parents: 430929
diff changeset
   512
  nsCOMPtr<EventTarget> chromeHandler = window->GetChromeEventHandler();
178541
84f879f9cdc3563e3a600431ed882ea3a5d7789d Bug 992778 - Set docshell.chromeEventHandler in child processes. r=bz
Alexandre Poirot <poirot.alex@gmail.com>
parents: 178416
diff changeset
   513
  docShell->SetChromeEventHandler(chromeHandler);
84f879f9cdc3563e3a600431ed882ea3a5d7789d Bug 992778 - Set docshell.chromeEventHandler in child processes. r=bz
Alexandre Poirot <poirot.alex@gmail.com>
parents: 178416
diff changeset
   514
307721
2b634a956b26a13a71ed05937b8b78542c8c1aac Bug 1262930 - Skip ShouldShowFocusRing check during TabChild::Init() if no inner window is available. r=khuey
Ben Tian <btian@mozilla.com>
parents: 307363
diff changeset
   515
  if (window->GetCurrentInnerWindow()) {
476652
8d2dcfb9a9b65fefb90354d5208eef08df60a96d Bug 1545499 - Remove dead code for threading accelerator state. r=NeilDeakin
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 476591
diff changeset
   516
    window->SetKeyboardIndicators(ShowFocusRings());
307721
2b634a956b26a13a71ed05937b8b78542c8c1aac Bug 1262930 - Skip ShouldShowFocusRing check during TabChild::Init() if no inner window is available. r=khuey
Ben Tian <btian@mozilla.com>
parents: 307363
diff changeset
   517
  } else {
2b634a956b26a13a71ed05937b8b78542c8c1aac Bug 1262930 - Skip ShouldShowFocusRing check during TabChild::Init() if no inner window is available. r=khuey
Ben Tian <btian@mozilla.com>
parents: 307363
diff changeset
   518
    // Skip ShouldShowFocusRing check if no inner window is available
476652
8d2dcfb9a9b65fefb90354d5208eef08df60a96d Bug 1545499 - Remove dead code for threading accelerator state. r=NeilDeakin
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 476591
diff changeset
   519
    window->SetInitialKeyboardIndicators(ShowFocusRings());
307721
2b634a956b26a13a71ed05937b8b78542c8c1aac Bug 1262930 - Skip ShouldShowFocusRing check during TabChild::Init() if no inner window is available. r=khuey
Ben Tian <btian@mozilla.com>
parents: 307363
diff changeset
   520
  }
301335
435c691340a05280302417b3ba150a317cc16c08 Bug 1174798, propagate keyboard indicator state down to child processes, r=smaug
Neil Deakin <neil@mozilla.com>
parents: 300956
diff changeset
   521
497651
ec7d3f3eab2a93292bac9b31dd890977a7f0b6e6 Bug 1576714 - Don't update scrollbar visibility for non-top-level remote browsers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 497470
diff changeset
   522
  // Window scrollbar flags only affect top level remote frames, not fission
ec7d3f3eab2a93292bac9b31dd890977a7f0b6e6 Bug 1576714 - Don't update scrollbar visibility for non-top-level remote browsers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 497470
diff changeset
   523
  // frames.
ec7d3f3eab2a93292bac9b31dd890977a7f0b6e6 Bug 1576714 - Don't update scrollbar visibility for non-top-level remote browsers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 497470
diff changeset
   524
  if (mIsTopLevel) {
ec7d3f3eab2a93292bac9b31dd890977a7f0b6e6 Bug 1576714 - Don't update scrollbar visibility for non-top-level remote browsers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 497470
diff changeset
   525
    nsContentUtils::SetScrollbarsVisibility(
544287
e7058f34ca94445aa671fddb4548a9afe7a70cb5 Bug 1639328 - Make sure BrowserChilds for OOP iframes start in a consistent state. r=smaug
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 544197
diff changeset
   526
        docShell, !!(mChromeFlags & nsIWebBrowserChrome::CHROME_SCROLLBARS));
497651
ec7d3f3eab2a93292bac9b31dd890977a7f0b6e6 Bug 1576714 - Don't update scrollbar visibility for non-top-level remote browsers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 497470
diff changeset
   527
  }
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   528
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   529
  nsWeakPtr weakPtrThis = do_GetWeakReference(
470937
9998ccf0c05f87940376b736fb587355acf03c2c Bug 1534395 - Rename nsITabChild to nsIBrowserChild. r=nika,mconley
Ryan Hunt <rhunt@eqrion.net>
parents: 470936
diff changeset
   530
      static_cast<nsIBrowserChild*>(this));  // for capture by the lambda
262101
fbfb900230fe46a08c37aa9e4d5ac74f61228d38 Bug 1202312 - Use mozilla::Function for the ContentReceivedInputBlock callback. r=kats
Botond Ballo <botond@mozilla.com>
parents: 262100
diff changeset
   531
  ContentReceivedInputBlockCallback callback(
472824
7748746bf2feda8edd0cabfdaff88b7faf059ad5 Bug 1548568 - Cleanup to remove unused guid parameter in callback. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 472823
diff changeset
   532
      [weakPtrThis](uint64_t aInputBlockId, bool aPreventDefault) {
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   533
        if (nsCOMPtr<nsIBrowserChild> browserChild =
470937
9998ccf0c05f87940376b736fb587355acf03c2c Bug 1534395 - Rename nsITabChild to nsIBrowserChild. r=nika,mconley
Ryan Hunt <rhunt@eqrion.net>
parents: 470936
diff changeset
   534
                do_QueryReferent(weakPtrThis)) {
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   535
          static_cast<BrowserChild*>(browserChild.get())
472824
7748746bf2feda8edd0cabfdaff88b7faf059ad5 Bug 1548568 - Cleanup to remove unused guid parameter in callback. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 472823
diff changeset
   536
              ->ContentReceivedInputBlock(aInputBlockId, aPreventDefault);
262101
fbfb900230fe46a08c37aa9e4d5ac74f61228d38 Bug 1202312 - Use mozilla::Function for the ContentReceivedInputBlock callback. r=kats
Botond Ballo <botond@mozilla.com>
parents: 262100
diff changeset
   537
        }
fbfb900230fe46a08c37aa9e4d5ac74f61228d38 Bug 1202312 - Use mozilla::Function for the ContentReceivedInputBlock callback. r=kats
Botond Ballo <botond@mozilla.com>
parents: 262100
diff changeset
   538
      });
420862
b54db66223586b4e04f5cb926fccdacf8a176b91 Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 419219
diff changeset
   539
  mAPZEventState = new APZEventState(mPuppetWidget, std::move(callback));
228802
135a4238353508358d7403da886e88df7bdd17ce Bug 1127066 - Extract an APZEventState class from TabChild. r=kats
Botond Ballo <botond@mozilla.com>
parents: 228800
diff changeset
   540
448450
9bfe29337ffe3d93cd060077e2e999e72bb9b7cf Backed out 13 changesets (bug 1500948, bug 1509362, bug 1509591, bug 1448426, bug 1500949, bug 1487249, bug 1509930, bug 1500950, bug 1500944) for causing crashes and assertion failures on PBackgroundParent.cpp:696 CLOSED TREE
arthur.iakab <aiakab@mozilla.com>
parents: 448446
diff changeset
   541
  mIPCOpen = true;
9bfe29337ffe3d93cd060077e2e999e72bb9b7cf Backed out 13 changesets (bug 1500948, bug 1509362, bug 1509591, bug 1448426, bug 1500949, bug 1487249, bug 1509930, bug 1500950, bug 1500944) for causing crashes and assertion failures on PBackgroundParent.cpp:696 CLOSED TREE
arthur.iakab <aiakab@mozilla.com>
parents: 448446
diff changeset
   542
573215
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
   543
  if constexpr (SessionStoreUtils::NATIVE_LISTENER) {
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
   544
    mSessionStoreListener = new TabListener(docShell, nullptr);
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
   545
    rv = mSessionStoreListener->Init();
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
   546
    NS_ENSURE_SUCCESS(rv, rv);
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
   547
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
   548
    mSessionStoreChangeListener =
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
   549
        SessionStoreChangeListener::Create(mBrowsingContext);
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
   550
  }
544287
e7058f34ca94445aa671fddb4548a9afe7a70cb5 Bug 1639328 - Make sure BrowserChilds for OOP iframes start in a consistent state. r=smaug
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 544197
diff changeset
   551
e7058f34ca94445aa671fddb4548a9afe7a70cb5 Bug 1639328 - Make sure BrowserChilds for OOP iframes start in a consistent state. r=smaug
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 544197
diff changeset
   552
  // We've all set up, make sure our visibility state is consistent. This is
e7058f34ca94445aa671fddb4548a9afe7a70cb5 Bug 1639328 - Make sure BrowserChilds for OOP iframes start in a consistent state. r=smaug
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 544197
diff changeset
   553
  // important for OOP iframes, which start off as hidden.
e7058f34ca94445aa671fddb4548a9afe7a70cb5 Bug 1639328 - Make sure BrowserChilds for OOP iframes start in a consistent state. r=smaug
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 544197
diff changeset
   554
  UpdateVisibility();
e7058f34ca94445aa671fddb4548a9afe7a70cb5 Bug 1639328 - Make sure BrowserChilds for OOP iframes start in a consistent state. r=smaug
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 544197
diff changeset
   555
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   556
  return NS_OK;
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   557
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   558
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   559
NS_IMPL_CYCLE_COLLECTION_CLASS(BrowserChild)
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   560
477553
d58a62d0b10da0f0bca2563ab57733228da96fa5 Bug 1556557 - Remove BrowserChildBase. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 477551
diff changeset
   561
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(BrowserChild)
d58a62d0b10da0f0bca2563ab57733228da96fa5 Bug 1556557 - Remove BrowserChildBase. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 477551
diff changeset
   562
  NS_IMPL_CYCLE_COLLECTION_UNLINK(mBrowserChildMessageManager)
d58a62d0b10da0f0bca2563ab57733228da96fa5 Bug 1556557 - Remove BrowserChildBase. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 477551
diff changeset
   563
  tmp->nsMessageManagerScriptExecutor::Unlink();
467868
1ba9a2cebf1252ffc1af89e3e978cf4b47fcb46e Bug 1510569 - Filter TabChild nsIWebProgress events through a nsBrowserFilter r=kmag
Barret Rennie <barret@brennie.ca>
parents: 466778
diff changeset
   564
  NS_IMPL_CYCLE_COLLECTION_UNLINK(mStatusFilter)
389655
d8d3d54dea296868349f5cb1819392a239ac552a Bug 1401379 - Part 6: Cycle collect nsWebBrowser, r=smaug
Nika Layzell <nika@thelayzells.com>
parents: 389528
diff changeset
   565
  NS_IMPL_CYCLE_COLLECTION_UNLINK(mWebNav)
464046
97c2ee22169c641e88278fd0801abfc18db6c43f Bug 1532661 - Part 6: Clean up BrowsingContext references more reliably, r=farre
Nika Layzell <nika@thelayzells.com>
parents: 464036
diff changeset
   566
  NS_IMPL_CYCLE_COLLECTION_UNLINK(mBrowsingContext)
573215
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
   567
  NS_IMPL_CYCLE_COLLECTION_UNLINK(mSessionStoreListener)
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
   568
  NS_IMPL_CYCLE_COLLECTION_UNLINK(mSessionStoreChangeListener)
515516
1c7a70ea55e881a42d6bbe2375945f8b532edbb5 Bug 1535617: Part 2 - Clear weak references for most cycle collected objects on unlink. r=mccr8
Kris Maglione <maglione.k@gmail.com>
parents: 515492
diff changeset
   569
  NS_IMPL_CYCLE_COLLECTION_UNLINK_WEAK_REFERENCE
389655
d8d3d54dea296868349f5cb1819392a239ac552a Bug 1401379 - Part 6: Cycle collect nsWebBrowser, r=smaug
Nika Layzell <nika@thelayzells.com>
parents: 389528
diff changeset
   570
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
d8d3d54dea296868349f5cb1819392a239ac552a Bug 1401379 - Part 6: Cycle collect nsWebBrowser, r=smaug
Nika Layzell <nika@thelayzells.com>
parents: 389528
diff changeset
   571
477553
d58a62d0b10da0f0bca2563ab57733228da96fa5 Bug 1556557 - Remove BrowserChildBase. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 477551
diff changeset
   572
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(BrowserChild)
d58a62d0b10da0f0bca2563ab57733228da96fa5 Bug 1556557 - Remove BrowserChildBase. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 477551
diff changeset
   573
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBrowserChildMessageManager)
467868
1ba9a2cebf1252ffc1af89e3e978cf4b47fcb46e Bug 1510569 - Filter TabChild nsIWebProgress events through a nsBrowserFilter r=kmag
Barret Rennie <barret@brennie.ca>
parents: 466778
diff changeset
   574
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStatusFilter)
389655
d8d3d54dea296868349f5cb1819392a239ac552a Bug 1401379 - Part 6: Cycle collect nsWebBrowser, r=smaug
Nika Layzell <nika@thelayzells.com>
parents: 389528
diff changeset
   575
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWebNav)
464046
97c2ee22169c641e88278fd0801abfc18db6c43f Bug 1532661 - Part 6: Clean up BrowsingContext references more reliably, r=farre
Nika Layzell <nika@thelayzells.com>
parents: 464036
diff changeset
   576
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBrowsingContext)
573215
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
   577
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSessionStoreListener)
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
   578
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSessionStoreChangeListener)
389655
d8d3d54dea296868349f5cb1819392a239ac552a Bug 1401379 - Part 6: Cycle collect nsWebBrowser, r=smaug
Nika Layzell <nika@thelayzells.com>
parents: 389528
diff changeset
   579
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
d8d3d54dea296868349f5cb1819392a239ac552a Bug 1401379 - Part 6: Cycle collect nsWebBrowser, r=smaug
Nika Layzell <nika@thelayzells.com>
parents: 389528
diff changeset
   580
477553
d58a62d0b10da0f0bca2563ab57733228da96fa5 Bug 1556557 - Remove BrowserChildBase. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 477551
diff changeset
   581
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(BrowserChild)
d58a62d0b10da0f0bca2563ab57733228da96fa5 Bug 1556557 - Remove BrowserChildBase. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 477551
diff changeset
   582
  tmp->nsMessageManagerScriptExecutor::Trace(aCallbacks, aClosure);
389655
d8d3d54dea296868349f5cb1819392a239ac552a Bug 1401379 - Part 6: Cycle collect nsWebBrowser, r=smaug
Nika Layzell <nika@thelayzells.com>
parents: 389528
diff changeset
   583
NS_IMPL_CYCLE_COLLECTION_TRACE_END
d8d3d54dea296868349f5cb1819392a239ac552a Bug 1401379 - Part 6: Cycle collect nsWebBrowser, r=smaug
Nika Layzell <nika@thelayzells.com>
parents: 389528
diff changeset
   584
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   585
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(BrowserChild)
46871
8f48671284853f1e031fbe48de1aed6801de2eaf Bug 548847 - [E10s] forward modal (chrome) dialogs from content to chrome, r=jst
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46870
diff changeset
   586
  NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome)
8f48671284853f1e031fbe48de1aed6801de2eaf Bug 548847 - [E10s] forward modal (chrome) dialogs from content to chrome, r=jst
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46870
diff changeset
   587
  NS_INTERFACE_MAP_ENTRY(nsIEmbeddingSiteWindow)
8f48671284853f1e031fbe48de1aed6801de2eaf Bug 548847 - [E10s] forward modal (chrome) dialogs from content to chrome, r=jst
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46870
diff changeset
   588
  NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChromeFocus)
8f48671284853f1e031fbe48de1aed6801de2eaf Bug 548847 - [E10s] forward modal (chrome) dialogs from content to chrome, r=jst
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46870
diff changeset
   589
  NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
8f48671284853f1e031fbe48de1aed6801de2eaf Bug 548847 - [E10s] forward modal (chrome) dialogs from content to chrome, r=jst
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46870
diff changeset
   590
  NS_INTERFACE_MAP_ENTRY(nsIWindowProvider)
470937
9998ccf0c05f87940376b736fb587355acf03c2c Bug 1534395 - Rename nsITabChild to nsIBrowserChild. r=nika,mconley
Ryan Hunt <rhunt@eqrion.net>
parents: 470936
diff changeset
   591
  NS_INTERFACE_MAP_ENTRY(nsIBrowserChild)
108591
1bf3d3d3cbe0a30567cfe7475ce9863b21c46ecf Bug 746502: Add support for <meta name=viewport> on B2G/async panning and zooming r=cjones,smaug
Doug Sherk <dsherk2@mozilla.com>
parents: 108590
diff changeset
   592
  NS_INTERFACE_MAP_ENTRY(nsIObserver)
175844
d91f49580ec82187515b25da7578b3b8c0f4ca73 Bug 514280 Remove concrete classes from interface maps r=bsmedberg
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 175601
diff changeset
   593
  NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
164753
a1877d97194db90c2a4e5cf7f6470c7b4d8b8feb Bug 938904 - [e10s] Make tooltips work (r=smaug,enn)
Bill McCloskey <wmccloskey@mozilla.com>
parents: 163723
diff changeset
   594
  NS_INTERFACE_MAP_ENTRY(nsITooltipListener)
455444
712eb70b540a195fb7435e3f390eb44dbe792840 Bug 1520879 - Port the onContentBlockingEvent notifications inside WebProgressChild.jsm to C++; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 454520
diff changeset
   595
  NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener)
490457
ca4611846475b8a2bd2032a1a963b07cec6539f5 Bug 1510569 - Add nsIWebProgressListener2 to BrowserChild's interface map r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 490456
diff changeset
   596
  NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener2)
477553
d58a62d0b10da0f0bca2563ab57733228da96fa5 Bug 1556557 - Remove BrowserChildBase. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 477551
diff changeset
   597
  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIBrowserChild)
d58a62d0b10da0f0bca2563ab57733228da96fa5 Bug 1556557 - Remove BrowserChildBase. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 477551
diff changeset
   598
NS_INTERFACE_MAP_END
d58a62d0b10da0f0bca2563ab57733228da96fa5 Bug 1556557 - Remove BrowserChildBase. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 477551
diff changeset
   599
d58a62d0b10da0f0bca2563ab57733228da96fa5 Bug 1556557 - Remove BrowserChildBase. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 477551
diff changeset
   600
NS_IMPL_CYCLE_COLLECTING_ADDREF(BrowserChild)
d58a62d0b10da0f0bca2563ab57733228da96fa5 Bug 1556557 - Remove BrowserChildBase. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 477551
diff changeset
   601
NS_IMPL_CYCLE_COLLECTING_RELEASE(BrowserChild)
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   602
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   603
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   604
BrowserChild::GetChromeFlags(uint32_t* aChromeFlags) {
47934
bfba1780141db46360e119075bd52ea55a0ab8ee Bug 559534: Forward nsIXULWindow.chromeFlags to remote tabs. sr=bsmedberg
Chris Jones <jones.chris.g@gmail.com>
parents: 47933
diff changeset
   605
  *aChromeFlags = mChromeFlags;
bfba1780141db46360e119075bd52ea55a0ab8ee Bug 559534: Forward nsIXULWindow.chromeFlags to remote tabs. sr=bsmedberg
Chris Jones <jones.chris.g@gmail.com>
parents: 47933
diff changeset
   606
  return NS_OK;
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   607
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   608
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   609
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   610
BrowserChild::SetChromeFlags(uint32_t aChromeFlags) {
279164
212862056b4793bd6f6743a8d830823177b6ec83 Bug 1230385, part 2 - Use NS_WARNING in unimplemented TabChild methods. r=billm
Andrew McCreight <continuation@gmail.com>
parents: 279105
diff changeset
   611
  NS_WARNING("trying to SetChromeFlags from content process?");
57131
f3f9c6b6e30a8342de1fe494043c21839e7ade8b Bug 575657 - [e10s] TabChild should use NS_NOTREACHED in addition to NS_ERROR_NOT_IMPLEMENTED r=doug.turner a=approval2.0
Mike Kristoffersen <mkristoffersen@mozilla.com>
parents: 56785
diff changeset
   612
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   613
  return NS_ERROR_NOT_IMPLEMENTED;
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   614
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   615
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   616
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   617
BrowserChild::RemoteSizeShellTo(int32_t aWidth, int32_t aHeight,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   618
                                int32_t aShellItemWidth,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   619
                                int32_t aShellItemHeight) {
296981
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   620
  nsCOMPtr<nsIDocShell> ourDocShell = do_GetInterface(WebNavigation());
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   621
  nsCOMPtr<nsIBaseWindow> docShellAsWin(do_QueryInterface(ourDocShell));
399118
eb8c89d823a6036963332c14e878ff48292c5915 Bug 1420902 - Bail out of RemoteSizeShellTo if the docShell has gone away. r=mystor
Mike Conley <mconley@mozilla.com>
parents: 398594
diff changeset
   622
  NS_ENSURE_STATE(docShellAsWin);
eb8c89d823a6036963332c14e878ff48292c5915 Bug 1420902 - Bail out of RemoteSizeShellTo if the docShell has gone away. r=mystor
Mike Conley <mconley@mozilla.com>
parents: 398594
diff changeset
   623
296981
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   624
  int32_t width, height;
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   625
  docShellAsWin->GetSize(&width, &height);
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   626
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   627
  uint32_t flags = 0;
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   628
  if (width == aWidth) {
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   629
    flags |= nsIEmbeddingSiteWindow::DIM_FLAGS_IGNORE_CX;
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   630
  }
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   631
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   632
  if (height == aHeight) {
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   633
    flags |= nsIEmbeddingSiteWindow::DIM_FLAGS_IGNORE_CY;
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   634
  }
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   635
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   636
  bool sent = SendSizeShellTo(flags, aWidth, aHeight, aShellItemWidth,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   637
                              aShellItemHeight);
296981
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   638
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   639
  return sent ? NS_OK : NS_ERROR_FAILURE;
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   640
}
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   641
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   642
NS_IMETHODIMP
473998
1274c074caef1fb327fad2d59bda256e5029e5e2 Bug 1550930 part 3. Stop using [array] for nsIDroppedLinkHandler.dropLinks. r=NeilDeakin
Boris Zbarsky <bzbarsky@mit.edu>
parents: 473810
diff changeset
   643
BrowserChild::RemoteDropLinks(
1274c074caef1fb327fad2d59bda256e5029e5e2 Bug 1550930 part 3. Stop using [array] for nsIDroppedLinkHandler.dropLinks. r=NeilDeakin
Boris Zbarsky <bzbarsky@mit.edu>
parents: 473810
diff changeset
   644
    const nsTArray<RefPtr<nsIDroppedLinkItem>>& aLinks) {
314592
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   645
  nsTArray<nsString> linksArray;
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   646
  nsresult rv = NS_OK;
473998
1274c074caef1fb327fad2d59bda256e5029e5e2 Bug 1550930 part 3. Stop using [array] for nsIDroppedLinkHandler.dropLinks. r=NeilDeakin
Boris Zbarsky <bzbarsky@mit.edu>
parents: 473810
diff changeset
   647
  for (nsIDroppedLinkItem* link : aLinks) {
314592
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   648
    nsString tmp;
473998
1274c074caef1fb327fad2d59bda256e5029e5e2 Bug 1550930 part 3. Stop using [array] for nsIDroppedLinkHandler.dropLinks. r=NeilDeakin
Boris Zbarsky <bzbarsky@mit.edu>
parents: 473810
diff changeset
   649
    rv = link->GetUrl(tmp);
314592
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   650
    if (NS_FAILED(rv)) {
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   651
      return rv;
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   652
    }
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   653
    linksArray.AppendElement(tmp);
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   654
473998
1274c074caef1fb327fad2d59bda256e5029e5e2 Bug 1550930 part 3. Stop using [array] for nsIDroppedLinkHandler.dropLinks. r=NeilDeakin
Boris Zbarsky <bzbarsky@mit.edu>
parents: 473810
diff changeset
   655
    rv = link->GetName(tmp);
314592
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   656
    if (NS_FAILED(rv)) {
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   657
      return rv;
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   658
    }
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   659
    linksArray.AppendElement(tmp);
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   660
473998
1274c074caef1fb327fad2d59bda256e5029e5e2 Bug 1550930 part 3. Stop using [array] for nsIDroppedLinkHandler.dropLinks. r=NeilDeakin
Boris Zbarsky <bzbarsky@mit.edu>
parents: 473810
diff changeset
   661
    rv = link->GetType(tmp);
314592
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   662
    if (NS_FAILED(rv)) {
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   663
      return rv;
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   664
    }
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   665
    linksArray.AppendElement(tmp);
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   666
  }
362687
de0c74d43a7ced6355c87840fda55061869a05ca Bug 1369014: Do not pass explicitly pass a triggeringPrincipal within nsDocShellTreeOwner::HandleEvent. r=smaug
Christoph Kerschbaumer <ckerschb@christophkerschbaumer.com>
parents: 361256
diff changeset
   667
  bool sent = SendDropLinks(linksArray);
314592
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   668
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   669
  return sent ? NS_OK : NS_ERROR_FAILURE;
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   670
}
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   671
978a6615d7cce1d5970fd014c72ec474dfa02629 Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped on remote content area. r=enndeakin
Tooru Fujisawa <arai_a@mac.com>
parents: 314457
diff changeset
   672
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   673
BrowserChild::ShowAsModal() {
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   674
  NS_WARNING("BrowserChild::ShowAsModal not supported in BrowserChild");
57131
f3f9c6b6e30a8342de1fe494043c21839e7ade8b Bug 575657 - [e10s] TabChild should use NS_NOTREACHED in addition to NS_ERROR_NOT_IMPLEMENTED r=doug.turner a=approval2.0
Mike Kristoffersen <mkristoffersen@mozilla.com>
parents: 56785
diff changeset
   675
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   676
  return NS_ERROR_NOT_IMPLEMENTED;
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   677
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   678
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   679
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   680
BrowserChild::IsWindowModal(bool* aRetVal) {
78840
ec7577dec4fceef0ac2717416d9c48289402d935 Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Ehsan Akhgari <ehsan@mozilla.com>
parents: 78469
diff changeset
   681
  *aRetVal = false;
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   682
  return NS_OK;
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   683
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   684
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   685
NS_IMETHODIMP
505597
5515a235a19e0ddd271a4c3f6d84a7ea2a3a7d16 Bug 1455716 - Followup to fix review comments. r=bzbarsky
Masatoshi Kimura <VYV03354@nifty.ne.jp>
parents: 505467
diff changeset
   686
BrowserChild::SetLinkStatus(const nsAString& aStatusText) {
444785
2ab481124e1aef887083b5076029974db8294f59 Bug 1503655 part 3 - Remove PRenderFrame protocol without functional changes. r=kats
Ryan Hunt <rhunt@eqrion.net>
parents: 444784
diff changeset
   687
  // We can only send the status after the ipc machinery is set up
2ab481124e1aef887083b5076029974db8294f59 Bug 1503655 part 3 - Remove PRenderFrame protocol without functional changes. r=kats
Ryan Hunt <rhunt@eqrion.net>
parents: 444784
diff changeset
   688
  if (IPCOpen()) {
505597
5515a235a19e0ddd271a4c3f6d84a7ea2a3a7d16 Bug 1455716 - Followup to fix review comments. r=bzbarsky
Masatoshi Kimura <VYV03354@nifty.ne.jp>
parents: 505467
diff changeset
   689
    SendSetLinkStatus(nsString(aStatusText));
444785
2ab481124e1aef887083b5076029974db8294f59 Bug 1503655 part 3 - Remove PRenderFrame protocol without functional changes. r=kats
Ryan Hunt <rhunt@eqrion.net>
parents: 444784
diff changeset
   690
  }
73337
1ad3b39977f14742622aefa82c12d240cae2bd22 Bug 669823: SetStatusWithContext() is reached. Defer deeper discussion about status handling to bug 617804. r=bsmedberg
Chris Jones <jones.chris.g@gmail.com>
parents: 72947
diff changeset
   691
  return NS_OK;
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   692
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   693
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   694
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   695
BrowserChild::SetDimensions(uint32_t aFlags, int32_t aX, int32_t aY,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   696
                            int32_t aCx, int32_t aCy) {
296981
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   697
  // The parent is in charge of the dimension changes. If JS code wants to
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   698
  // change the dimensions (moveTo, screenX, etc.) we send a message to the
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   699
  // parent about the new requested dimension, the parent does the resize/move
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   700
  // then send a message to the child to update itself. For APIs like screenX
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   701
  // this function is called with the current value for the non-changed values.
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   702
  // In a series of calls like window.screenX = 10; window.screenY = 10; for
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   703
  // the second call, since screenX is not yet updated we might accidentally
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   704
  // reset back screenX to it's old value. To avoid this if a parameter did not
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   705
  // change we want the parent to ignore its value.
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   706
  int32_t x, y, cx, cy;
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   707
  GetDimensions(aFlags, &x, &y, &cx, &cy);
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   708
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   709
  if (x == aX) {
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   710
    aFlags |= nsIEmbeddingSiteWindow::DIM_FLAGS_IGNORE_X;
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   711
  }
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   712
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   713
  if (y == aY) {
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   714
    aFlags |= nsIEmbeddingSiteWindow::DIM_FLAGS_IGNORE_Y;
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   715
  }
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   716
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   717
  if (cx == aCx) {
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   718
    aFlags |= nsIEmbeddingSiteWindow::DIM_FLAGS_IGNORE_CX;
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   719
  }
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   720
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   721
  if (cy == aCy) {
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   722
    aFlags |= nsIEmbeddingSiteWindow::DIM_FLAGS_IGNORE_CY;
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   723
  }
ada37e72623d1c4e5d5bd80f9d889efeb7ea559e Bug 1255138 - Window resize support from JS for e10s. r=mconley
Gabor Krizsanits <gkrizsanits@mozilla.com>
parents: 296009
diff changeset
   724
506209
c15fd9b7ccb7e2348030c43e7033d7abf6089361 Bug 1557587 - part 1: Make `BrowserParent::RecvSetDimensions()` adjust given value with current scale r=jfkthame
Masayuki Nakano <masayuki@d-toybox.com>
parents: 505801
diff changeset
   725
  double scale = mPuppetWidget ? mPuppetWidget->GetDefaultScale().scale : 1.0;
c15fd9b7ccb7e2348030c43e7033d7abf6089361 Bug 1557587 - part 1: Make `BrowserParent::RecvSetDimensions()` adjust given value with current scale r=jfkthame
Masayuki Nakano <masayuki@d-toybox.com>
parents: 505801
diff changeset
   726
c15fd9b7ccb7e2348030c43e7033d7abf6089361 Bug 1557587 - part 1: Make `BrowserParent::RecvSetDimensions()` adjust given value with current scale r=jfkthame
Masayuki Nakano <masayuki@d-toybox.com>
parents: 505801
diff changeset
   727
  Unused << SendSetDimensions(aFlags, aX, aY, aCx, aCy, scale);
224546
50981656f6b73297765ff09742804d2db1cb7ddc Bug 1082127 - Implement TabChild::SetDimensions so that window.moveTo/resizeTo work with e10s r=smaug
George Wright <george@mozilla.com>
parents: 224532
diff changeset
   728
50981656f6b73297765ff09742804d2db1cb7ddc Bug 1082127 - Implement TabChild::SetDimensions so that window.moveTo/resizeTo work with e10s r=smaug
George Wright <george@mozilla.com>
parents: 224532
diff changeset
   729
  return NS_OK;
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   730
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   731
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   732
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   733
BrowserChild::GetDimensions(uint32_t aFlags, int32_t* aX, int32_t* aY,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   734
                            int32_t* aCx, int32_t* aCy) {
248782
eec75d3d0344987dd38941ac23d4d7ac420d5ddb Bug 1125325 - Make TabParent/TabChild UpdateDimensions messages aware of the display scale. r=kats
David Parks <davidp99@gmail.com>
parents: 248198
diff changeset
   735
  ScreenIntRect rect = GetOuterRect();
72947
5c4fe292a2404e2857acf1b7b9796d1d05790023 Bug 648250 - image based navigational bar is useless in remote Fennec (window.outerWidth throws js errors). r=Olli.Pettay
Oleg Romashin <romaxa@gmail.com>
parents: 72876
diff changeset
   736
  if (aX) {
404432
92d362925563bf9dfb056255d5d018a84c63bc44 Backed out changeset 38577c007450 (bug 1424371) for Marionett test failure on testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py. CLOSED TREE
Dorel Luca <dluca@mozilla.com>
parents: 404430
diff changeset
   737
    *aX = rect.x;
72947
5c4fe292a2404e2857acf1b7b9796d1d05790023 Bug 648250 - image based navigational bar is useless in remote Fennec (window.outerWidth throws js errors). r=Olli.Pettay
Oleg Romashin <romaxa@gmail.com>
parents: 72876
diff changeset
   738
  }
5c4fe292a2404e2857acf1b7b9796d1d05790023 Bug 648250 - image based navigational bar is useless in remote Fennec (window.outerWidth throws js errors). r=Olli.Pettay
Oleg Romashin <romaxa@gmail.com>
parents: 72876
diff changeset
   739
  if (aY) {
404432
92d362925563bf9dfb056255d5d018a84c63bc44 Backed out changeset 38577c007450 (bug 1424371) for Marionett test failure on testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py. CLOSED TREE
Dorel Luca <dluca@mozilla.com>
parents: 404430
diff changeset
   740
    *aY = rect.y;
72947
5c4fe292a2404e2857acf1b7b9796d1d05790023 Bug 648250 - image based navigational bar is useless in remote Fennec (window.outerWidth throws js errors). r=Olli.Pettay
Oleg Romashin <romaxa@gmail.com>
parents: 72876
diff changeset
   741
  }
5c4fe292a2404e2857acf1b7b9796d1d05790023 Bug 648250 - image based navigational bar is useless in remote Fennec (window.outerWidth throws js errors). r=Olli.Pettay
Oleg Romashin <romaxa@gmail.com>
parents: 72876
diff changeset
   742
  if (aCx) {
404432
92d362925563bf9dfb056255d5d018a84c63bc44 Backed out changeset 38577c007450 (bug 1424371) for Marionett test failure on testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py. CLOSED TREE
Dorel Luca <dluca@mozilla.com>
parents: 404430
diff changeset
   743
    *aCx = rect.width;
72947
5c4fe292a2404e2857acf1b7b9796d1d05790023 Bug 648250 - image based navigational bar is useless in remote Fennec (window.outerWidth throws js errors). r=Olli.Pettay
Oleg Romashin <romaxa@gmail.com>
parents: 72876
diff changeset
   744
  }
5c4fe292a2404e2857acf1b7b9796d1d05790023 Bug 648250 - image based navigational bar is useless in remote Fennec (window.outerWidth throws js errors). r=Olli.Pettay
Oleg Romashin <romaxa@gmail.com>
parents: 72876
diff changeset
   745
  if (aCy) {
404432
92d362925563bf9dfb056255d5d018a84c63bc44 Backed out changeset 38577c007450 (bug 1424371) for Marionett test failure on testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py. CLOSED TREE
Dorel Luca <dluca@mozilla.com>
parents: 404430
diff changeset
   746
    *aCy = rect.height;
72947
5c4fe292a2404e2857acf1b7b9796d1d05790023 Bug 648250 - image based navigational bar is useless in remote Fennec (window.outerWidth throws js errors). r=Olli.Pettay
Oleg Romashin <romaxa@gmail.com>
parents: 72876
diff changeset
   747
  }
57131
f3f9c6b6e30a8342de1fe494043c21839e7ade8b Bug 575657 - [e10s] TabChild should use NS_NOTREACHED in addition to NS_ERROR_NOT_IMPLEMENTED r=doug.turner a=approval2.0
Mike Kristoffersen <mkristoffersen@mozilla.com>
parents: 56785
diff changeset
   748
72947
5c4fe292a2404e2857acf1b7b9796d1d05790023 Bug 648250 - image based navigational bar is useless in remote Fennec (window.outerWidth throws js errors). r=Olli.Pettay
Oleg Romashin <romaxa@gmail.com>
parents: 72876
diff changeset
   749
  return NS_OK;
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   750
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   751
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   752
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   753
BrowserChild::GetVisibility(bool* aVisibility) {
78840
ec7577dec4fceef0ac2717416d9c48289402d935 Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Ehsan Akhgari <ehsan@mozilla.com>
parents: 78469
diff changeset
   754
  *aVisibility = true;
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   755
  return NS_OK;
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   756
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   757
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   758
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   759
BrowserChild::SetVisibility(bool aVisibility) {
72545
9d3abcd6161d23939c442a878e9e6b72895d40ac Bug 583976. Part 4 pre - some clean up and adjustments to enable needs-focus tests for OOP content. r=cjones
Felipe Gomes <felipc@gmail.com>
parents: 72544
diff changeset
   760
  // should the platform support this? Bug 666365
9d3abcd6161d23939c442a878e9e6b72895d40ac Bug 583976. Part 4 pre - some clean up and adjustments to enable needs-focus tests for OOP content. r=cjones
Felipe Gomes <felipc@gmail.com>
parents: 72544
diff changeset
   761
  return NS_OK;
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   762
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   763
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   764
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   765
BrowserChild::GetTitle(nsAString& aTitle) {
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   766
  NS_WARNING("BrowserChild::GetTitle not supported in BrowserChild");
57131
f3f9c6b6e30a8342de1fe494043c21839e7ade8b Bug 575657 - [e10s] TabChild should use NS_NOTREACHED in addition to NS_ERROR_NOT_IMPLEMENTED r=doug.turner a=approval2.0
Mike Kristoffersen <mkristoffersen@mozilla.com>
parents: 56785
diff changeset
   767
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   768
  return NS_ERROR_NOT_IMPLEMENTED;
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   769
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   770
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   771
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   772
BrowserChild::SetTitle(const nsAString& aTitle) {
141569
1ff572d74e730a719aa57de55f2d05e12cc5df5f Bug 617804 - Note that SetTitle is implemeneted by JS. rs=felipe
Tom Schuster <evilpies@gmail.com>
parents: 141331
diff changeset
   773
  // JavaScript sends the "DOMTitleChanged" event to the parent
1ff572d74e730a719aa57de55f2d05e12cc5df5f Bug 617804 - Note that SetTitle is implemeneted by JS. rs=felipe
Tom Schuster <evilpies@gmail.com>
parents: 141331
diff changeset
   774
  // via the message manager.
59843
53958cd8b5284d887f71b459dc024d25407ae5bf Bug 617804, part 1: Change bogus NOTREACHED() assertions. r=bsmedberg a=a
Chris Jones <jones.chris.g@gmail.com>
parents: 58164
diff changeset
   775
  return NS_OK;
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   776
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   777
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   778
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   779
BrowserChild::GetSiteWindow(void** aSiteWindow) {
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   780
  NS_WARNING("BrowserChild::GetSiteWindow not supported in BrowserChild");
57131
f3f9c6b6e30a8342de1fe494043c21839e7ade8b Bug 575657 - [e10s] TabChild should use NS_NOTREACHED in addition to NS_ERROR_NOT_IMPLEMENTED r=doug.turner a=approval2.0
Mike Kristoffersen <mkristoffersen@mozilla.com>
parents: 56785
diff changeset
   781
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   782
  return NS_ERROR_NOT_IMPLEMENTED;
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   783
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   784
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   785
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   786
BrowserChild::Blur() { return NS_ERROR_NOT_IMPLEMENTED; }
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   787
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   788
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   789
BrowserChild::FocusNextElement(bool aForDocumentNavigation) {
252595
cf5cb1d5802ea1f3ec6a2af1178c8c2a95f0f400 Bug 1132518, make document navigation with F6/Shift+F6 work in e10s. This combines the document and tab navigation mechanisms together, r=smaug
Neil Deakin <neil@mozilla.com>
parents: 252510
diff changeset
   790
  SendMoveFocus(true, aForDocumentNavigation);
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   791
  return NS_OK;
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   792
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   793
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   794
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   795
BrowserChild::FocusPrevElement(bool aForDocumentNavigation) {
252595
cf5cb1d5802ea1f3ec6a2af1178c8c2a95f0f400 Bug 1132518, make document navigation with F6/Shift+F6 work in e10s. This combines the document and tab navigation mechanisms together, r=smaug
Neil Deakin <neil@mozilla.com>
parents: 252510
diff changeset
   796
  SendMoveFocus(false, aForDocumentNavigation);
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   797
  return NS_OK;
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   798
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   799
46489
5d75d1ef28c1647e8b43950a5136ac2020c22866 Bug 516747 part 1; make TabChild hand things out via nsIInterfaceRequestor. r=bsmedberg
Boris Zbarsky <bzbarsky@mit.edu>
parents: 36269
diff changeset
   800
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   801
BrowserChild::GetInterface(const nsIID& aIID, void** aSink) {
588592
d3a4322fecf612ea22e026e8570599dccbcd5643 Bug 1724748 - Add nsITopLevelNavigationDelegate to allow JSWindowActorChilds to allow/deny top-level navigations. r=smaug
Mike Conley <mconley@mozilla.com>
parents: 588191
diff changeset
   802
  if (aIID.Equals(NS_GET_IID(nsITopLevelNavigationDelegate))) {
d3a4322fecf612ea22e026e8570599dccbcd5643 Bug 1724748 - Add nsITopLevelNavigationDelegate to allow JSWindowActorChilds to allow/deny top-level navigations. r=smaug
Mike Conley <mconley@mozilla.com>
parents: 588191
diff changeset
   803
    nsCOMPtr<nsITopLevelNavigationDelegate> delegate =
d3a4322fecf612ea22e026e8570599dccbcd5643 Bug 1724748 - Add nsITopLevelNavigationDelegate to allow JSWindowActorChilds to allow/deny top-level navigations. r=smaug
Mike Conley <mconley@mozilla.com>
parents: 588191
diff changeset
   804
        GetTopLevelNavigationDelegate();
d3a4322fecf612ea22e026e8570599dccbcd5643 Bug 1724748 - Add nsITopLevelNavigationDelegate to allow JSWindowActorChilds to allow/deny top-level navigations. r=smaug
Mike Conley <mconley@mozilla.com>
parents: 588191
diff changeset
   805
    if (delegate) {
d3a4322fecf612ea22e026e8570599dccbcd5643 Bug 1724748 - Add nsITopLevelNavigationDelegate to allow JSWindowActorChilds to allow/deny top-level navigations. r=smaug
Mike Conley <mconley@mozilla.com>
parents: 588191
diff changeset
   806
      delegate.forget(aSink);
d3a4322fecf612ea22e026e8570599dccbcd5643 Bug 1724748 - Add nsITopLevelNavigationDelegate to allow JSWindowActorChilds to allow/deny top-level navigations. r=smaug
Mike Conley <mconley@mozilla.com>
parents: 588191
diff changeset
   807
      return NS_OK;
d3a4322fecf612ea22e026e8570599dccbcd5643 Bug 1724748 - Add nsITopLevelNavigationDelegate to allow JSWindowActorChilds to allow/deny top-level navigations. r=smaug
Mike Conley <mconley@mozilla.com>
parents: 588191
diff changeset
   808
    }
d3a4322fecf612ea22e026e8570599dccbcd5643 Bug 1724748 - Add nsITopLevelNavigationDelegate to allow JSWindowActorChilds to allow/deny top-level navigations. r=smaug
Mike Conley <mconley@mozilla.com>
parents: 588191
diff changeset
   809
  }
d3a4322fecf612ea22e026e8570599dccbcd5643 Bug 1724748 - Add nsITopLevelNavigationDelegate to allow JSWindowActorChilds to allow/deny top-level navigations. r=smaug
Mike Conley <mconley@mozilla.com>
parents: 588191
diff changeset
   810
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   811
  // XXXbz should we restrict the set of interfaces we hand out here?
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   812
  // See bug 537429
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   813
  return QueryInterface(aIID, aSink);
46489
5d75d1ef28c1647e8b43950a5136ac2020c22866 Bug 516747 part 1; make TabChild hand things out via nsIInterfaceRequestor. r=bsmedberg
Boris Zbarsky <bzbarsky@mit.edu>
parents: 36269
diff changeset
   814
}
5d75d1ef28c1647e8b43950a5136ac2020c22866 Bug 516747 part 1; make TabChild hand things out via nsIInterfaceRequestor. r=bsmedberg
Boris Zbarsky <bzbarsky@mit.edu>
parents: 36269
diff changeset
   815
46491
1e25778852f220a9f3540a54cf5abf2ddbdbe835 Bug 516747 part 3. Make TabChild and TabParent cooperate on window opening at least to the extent of doing all window opens in new tabs. r=bsmedberg
Boris Zbarsky <bzbarsky@mit.edu>
parents: 46489
diff changeset
   816
NS_IMETHODIMP
522791
fde2d124a1b15877570390c7c69f5fcf6770640d Bug 1616353 - Part 7.2: Create and use nsOpenWindowInfo types in nsWindowWatcher logic, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522787
diff changeset
   817
BrowserChild::ProvideWindow(nsIOpenWindowInfo* aOpenWindowInfo,
fde2d124a1b15877570390c7c69f5fcf6770640d Bug 1616353 - Part 7.2: Create and use nsOpenWindowInfo types in nsWindowWatcher logic, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522787
diff changeset
   818
                            uint32_t aChromeFlags, bool aCalledFromJS,
fde2d124a1b15877570390c7c69f5fcf6770640d Bug 1616353 - Part 7.2: Create and use nsOpenWindowInfo types in nsWindowWatcher logic, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522787
diff changeset
   819
                            bool aWidthSpecified, nsIURI* aURI,
fde2d124a1b15877570390c7c69f5fcf6770640d Bug 1616353 - Part 7.2: Create and use nsOpenWindowInfo types in nsWindowWatcher logic, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522787
diff changeset
   820
                            const nsAString& aName, const nsACString& aFeatures,
fde2d124a1b15877570390c7c69f5fcf6770640d Bug 1616353 - Part 7.2: Create and use nsOpenWindowInfo types in nsWindowWatcher logic, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522787
diff changeset
   821
                            bool aForceNoOpener, bool aForceNoReferrer,
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   822
                            nsDocShellLoadState* aLoadState, bool* aWindowIsNew,
486028
36f7623a522be695e4ea589bedf8ce70a5294b58 Bug 1561015: Part 1 - Use BrowsingContext in window provider APIs. r=bzbarsky,mossop
Kris Maglione <maglione.k@gmail.com>
parents: 485954
diff changeset
   823
                            BrowsingContext** aReturn) {
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   824
  *aReturn = nullptr;
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   825
522791
fde2d124a1b15877570390c7c69f5fcf6770640d Bug 1616353 - Part 7.2: Create and use nsOpenWindowInfo types in nsWindowWatcher logic, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522787
diff changeset
   826
  RefPtr<BrowsingContext> parent = aOpenWindowInfo->GetParent();
fde2d124a1b15877570390c7c69f5fcf6770640d Bug 1616353 - Part 7.2: Create and use nsOpenWindowInfo types in nsWindowWatcher logic, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522787
diff changeset
   827
522799
d974c814ab4d97cc5d4f4a08b5a6ca5bf97f3b73 Bug 1616353 - Part 10.1: Remove special handling of window.open in mozbrowser, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522791
diff changeset
   828
  int32_t openLocation = nsWindowWatcher::GetWindowOpenLocation(
546159
93e3344dd1f7454dc46c1553dd05e5e3bc78c349 Bug 1636728 - Centralize printing entry points in nsGlobalWindowOuter, and move cloning out of nsPrintJob. r=jwatt,geckoview-reviewers,smaug,agi
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 545310
diff changeset
   829
      parent->GetDOMWindow(), aChromeFlags, aCalledFromJS, aWidthSpecified,
93e3344dd1f7454dc46c1553dd05e5e3bc78c349 Bug 1636728 - Centralize printing entry points in nsGlobalWindowOuter, and move cloning out of nsPrintJob. r=jwatt,geckoview-reviewers,smaug,agi
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 545310
diff changeset
   830
      aOpenWindowInfo->GetIsForPrinting());
522799
d974c814ab4d97cc5d4f4a08b5a6ca5bf97f3b73 Bug 1616353 - Part 10.1: Remove special handling of window.open in mozbrowser, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522791
diff changeset
   831
d974c814ab4d97cc5d4f4a08b5a6ca5bf97f3b73 Bug 1616353 - Part 10.1: Remove special handling of window.open in mozbrowser, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522791
diff changeset
   832
  // If it turns out we're opening in the current browser, just hand over the
d974c814ab4d97cc5d4f4a08b5a6ca5bf97f3b73 Bug 1616353 - Part 10.1: Remove special handling of window.open in mozbrowser, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522791
diff changeset
   833
  // current browser's docshell.
d974c814ab4d97cc5d4f4a08b5a6ca5bf97f3b73 Bug 1616353 - Part 10.1: Remove special handling of window.open in mozbrowser, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522791
diff changeset
   834
  if (openLocation == nsIBrowserDOMWindow::OPEN_CURRENTWINDOW) {
d974c814ab4d97cc5d4f4a08b5a6ca5bf97f3b73 Bug 1616353 - Part 10.1: Remove special handling of window.open in mozbrowser, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522791
diff changeset
   835
    nsCOMPtr<nsIWebBrowser> browser = do_GetInterface(WebNavigation());
d974c814ab4d97cc5d4f4a08b5a6ca5bf97f3b73 Bug 1616353 - Part 10.1: Remove special handling of window.open in mozbrowser, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522791
diff changeset
   836
    *aWindowIsNew = false;
d974c814ab4d97cc5d4f4a08b5a6ca5bf97f3b73 Bug 1616353 - Part 10.1: Remove special handling of window.open in mozbrowser, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522791
diff changeset
   837
d974c814ab4d97cc5d4f4a08b5a6ca5bf97f3b73 Bug 1616353 - Part 10.1: Remove special handling of window.open in mozbrowser, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522791
diff changeset
   838
    nsCOMPtr<mozIDOMWindowProxy> win;
d974c814ab4d97cc5d4f4a08b5a6ca5bf97f3b73 Bug 1616353 - Part 10.1: Remove special handling of window.open in mozbrowser, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522791
diff changeset
   839
    MOZ_TRY(browser->GetContentDOMWindow(getter_AddRefs(win)));
d974c814ab4d97cc5d4f4a08b5a6ca5bf97f3b73 Bug 1616353 - Part 10.1: Remove special handling of window.open in mozbrowser, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522791
diff changeset
   840
d974c814ab4d97cc5d4f4a08b5a6ca5bf97f3b73 Bug 1616353 - Part 10.1: Remove special handling of window.open in mozbrowser, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522791
diff changeset
   841
    RefPtr<BrowsingContext> bc(
d974c814ab4d97cc5d4f4a08b5a6ca5bf97f3b73 Bug 1616353 - Part 10.1: Remove special handling of window.open in mozbrowser, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522791
diff changeset
   842
        nsPIDOMWindowOuter::From(win)->GetBrowsingContext());
d974c814ab4d97cc5d4f4a08b5a6ca5bf97f3b73 Bug 1616353 - Part 10.1: Remove special handling of window.open in mozbrowser, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522791
diff changeset
   843
    bc.forget(aReturn);
d974c814ab4d97cc5d4f4a08b5a6ca5bf97f3b73 Bug 1616353 - Part 10.1: Remove special handling of window.open in mozbrowser, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522791
diff changeset
   844
    return NS_OK;
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   845
  }
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   846
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   847
  // Note that ProvideWindowCommon may return NS_ERROR_ABORT if the
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   848
  // open window call was canceled.  It's important that we pass this error
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   849
  // code back to our caller.
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   850
  ContentChild* cc = ContentChild::GetSingleton();
522799
d974c814ab4d97cc5d4f4a08b5a6ca5bf97f3b73 Bug 1616353 - Part 10.1: Remove special handling of window.open in mozbrowser, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 522791
diff changeset
   851
  return cc->ProvideWindowCommon(this, aOpenWindowInfo, aChromeFlags,
519543
bf0e49a9ceffb337517dccdedf99c78c819de87a Bug 1507375 - Restrict the controllability of UI parts visibility with features parameter of window.open. r=smaug
Tooru Fujisawa <arai_a@mac.com>
parents: 519526
diff changeset
   852
                                 aCalledFromJS, aWidthSpecified, aURI, aName,
bf0e49a9ceffb337517dccdedf99c78c819de87a Bug 1507375 - Restrict the controllability of UI parts visibility with features parameter of window.open. r=smaug
Tooru Fujisawa <arai_a@mac.com>
parents: 519526
diff changeset
   853
                                 aFeatures, aForceNoOpener, aForceNoReferrer,
bf0e49a9ceffb337517dccdedf99c78c819de87a Bug 1507375 - Restrict the controllability of UI parts visibility with features parameter of window.open. r=smaug
Tooru Fujisawa <arai_a@mac.com>
parents: 519526
diff changeset
   854
                                 aLoadState, aWindowIsNew, aReturn);
96532
65a425a98e860afa7132473dbf6a2f6868374b92 Bug 742944 - Part 4: Handle window.open in <iframe mozbrowser>. r=bz, cjones
Justin Lebar <justin.lebar@gmail.com>
parents: 96331
diff changeset
   855
}
65a425a98e860afa7132473dbf6a2f6868374b92 Bug 742944 - Part 4: Handle window.open in <iframe mozbrowser>. r=bz, cjones
Justin Lebar <justin.lebar@gmail.com>
parents: 96331
diff changeset
   856
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   857
void BrowserChild::DestroyWindow() {
486649
3011b29e256265bb4f5a9f53feb070b834f1922e Bug 1571502: Don't leak TabGroups which have never had windows joined to them. r=nika
Kris Maglione <maglione.k@gmail.com>
parents: 486028
diff changeset
   858
  mBrowsingContext = nullptr;
3011b29e256265bb4f5a9f53feb070b834f1922e Bug 1571502: Don't leak TabGroups which have never had windows joined to them. r=nika
Kris Maglione <maglione.k@gmail.com>
parents: 486028
diff changeset
   859
467868
1ba9a2cebf1252ffc1af89e3e978cf4b47fcb46e Bug 1510569 - Filter TabChild nsIWebProgress events through a nsBrowserFilter r=kmag
Barret Rennie <barret@brennie.ca>
parents: 466778
diff changeset
   860
  if (mStatusFilter) {
1ba9a2cebf1252ffc1af89e3e978cf4b47fcb46e Bug 1510569 - Filter TabChild nsIWebProgress events through a nsBrowserFilter r=kmag
Barret Rennie <barret@brennie.ca>
parents: 466778
diff changeset
   861
    if (nsCOMPtr<nsIWebProgress> webProgress =
1ba9a2cebf1252ffc1af89e3e978cf4b47fcb46e Bug 1510569 - Filter TabChild nsIWebProgress events through a nsBrowserFilter r=kmag
Barret Rennie <barret@brennie.ca>
parents: 466778
diff changeset
   862
            do_QueryInterface(WebNavigation())) {
1ba9a2cebf1252ffc1af89e3e978cf4b47fcb46e Bug 1510569 - Filter TabChild nsIWebProgress events through a nsBrowserFilter r=kmag
Barret Rennie <barret@brennie.ca>
parents: 466778
diff changeset
   863
      webProgress->RemoveProgressListener(mStatusFilter);
1ba9a2cebf1252ffc1af89e3e978cf4b47fcb46e Bug 1510569 - Filter TabChild nsIWebProgress events through a nsBrowserFilter r=kmag
Barret Rennie <barret@brennie.ca>
parents: 466778
diff changeset
   864
    }
1ba9a2cebf1252ffc1af89e3e978cf4b47fcb46e Bug 1510569 - Filter TabChild nsIWebProgress events through a nsBrowserFilter r=kmag
Barret Rennie <barret@brennie.ca>
parents: 466778
diff changeset
   865
1ba9a2cebf1252ffc1af89e3e978cf4b47fcb46e Bug 1510569 - Filter TabChild nsIWebProgress events through a nsBrowserFilter r=kmag
Barret Rennie <barret@brennie.ca>
parents: 466778
diff changeset
   866
    mStatusFilter->RemoveProgressListener(this);
1ba9a2cebf1252ffc1af89e3e978cf4b47fcb46e Bug 1510569 - Filter TabChild nsIWebProgress events through a nsBrowserFilter r=kmag
Barret Rennie <barret@brennie.ca>
parents: 466778
diff changeset
   867
    mStatusFilter = nullptr;
1ba9a2cebf1252ffc1af89e3e978cf4b47fcb46e Bug 1510569 - Filter TabChild nsIWebProgress events through a nsBrowserFilter r=kmag
Barret Rennie <barret@brennie.ca>
parents: 466778
diff changeset
   868
  }
1ba9a2cebf1252ffc1af89e3e978cf4b47fcb46e Bug 1510569 - Filter TabChild nsIWebProgress events through a nsBrowserFilter r=kmag
Barret Rennie <barret@brennie.ca>
parents: 466778
diff changeset
   869
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   870
  if (mCoalescedMouseEventFlusher) {
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   871
    mCoalescedMouseEventFlusher->RemoveObserver();
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   872
    mCoalescedMouseEventFlusher = nullptr;
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   873
  }
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   874
582091
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
   875
  if (mCoalescedTouchMoveEventFlusher) {
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
   876
    mCoalescedTouchMoveEventFlusher->RemoveObserver();
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
   877
    mCoalescedTouchMoveEventFlusher = nullptr;
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
   878
  }
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
   879
472766
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
   880
  if (mSessionStoreListener) {
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
   881
    mSessionStoreListener->RemoveListeners();
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
   882
    mSessionStoreListener = nullptr;
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
   883
  }
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
   884
573215
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
   885
  if (mSessionStoreChangeListener) {
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
   886
    mSessionStoreChangeListener->Stop();
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
   887
    mSessionStoreChangeListener = nullptr;
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
   888
  }
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
   889
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   890
  // In case we don't have chance to process all entries, clean all data in
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   891
  // the queue.
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   892
  while (mToBeDispatchedMouseData.GetSize() > 0) {
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   893
    UniquePtr<CoalescedMouseData> data(
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   894
        static_cast<CoalescedMouseData*>(mToBeDispatchedMouseData.PopFront()));
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   895
    data.reset();
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   896
  }
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   897
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   898
  nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(WebNavigation());
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   899
  if (baseWindow) baseWindow->Destroy();
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   900
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   901
  if (mPuppetWidget) {
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   902
    mPuppetWidget->Destroy();
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   903
  }
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   904
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   905
  mLayersConnected = Nothing();
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   906
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   907
  if (mLayersId.IsValid()) {
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   908
    StaticMutexAutoLock lock(sBrowserChildrenMutex);
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   909
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   910
    MOZ_ASSERT(sBrowserChildren);
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   911
    sBrowserChildren->Remove(uint64_t(mLayersId));
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   912
    if (!sBrowserChildren->Count()) {
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   913
      delete sBrowserChildren;
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   914
      sBrowserChildren = nullptr;
375979
64edaaccec973cd3b0d2aeea1f565d65e8614ea3 Bug 1361067 Part2: Coalesce mouse move events to be once per refresh cycle. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375978
diff changeset
   915
    }
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   916
    mLayersId = layers::LayersId{0};
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
   917
  }
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   918
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   919
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   920
void BrowserChild::ActorDestroy(ActorDestroyReason why) {
448450
9bfe29337ffe3d93cd060077e2e999e72bb9b7cf Backed out 13 changesets (bug 1500948, bug 1509362, bug 1509591, bug 1448426, bug 1500949, bug 1487249, bug 1509930, bug 1500950, bug 1500944) for causing crashes and assertion failures on PBackgroundParent.cpp:696 CLOSED TREE
arthur.iakab <aiakab@mozilla.com>
parents: 448446
diff changeset
   921
  mIPCOpen = false;
9bfe29337ffe3d93cd060077e2e999e72bb9b7cf Backed out 13 changesets (bug 1500948, bug 1509362, bug 1509591, bug 1448426, bug 1500949, bug 1487249, bug 1509930, bug 1500950, bug 1500944) for causing crashes and assertion failures on PBackgroundParent.cpp:696 CLOSED TREE
arthur.iakab <aiakab@mozilla.com>
parents: 448446
diff changeset
   922
207352
dccf72f5459d2756ce12c61f7b7d65a75733b78c Bug 1060526 - Call DestroyWindow() in TabChild::ActorDestroy(). r=smaug
Andrew McCreight <continuation@gmail.com>
parents: 207099
diff changeset
   923
  DestroyWindow();
dccf72f5459d2756ce12c61f7b7d65a75733b78c Bug 1060526 - Call DestroyWindow() in TabChild::ActorDestroy(). r=smaug
Andrew McCreight <continuation@gmail.com>
parents: 207099
diff changeset
   924
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   925
  if (mBrowserChildMessageManager) {
329755
d75f6cff73c834f8226da39a8599cc3c82cedc8b Bug 1331193 Make TabChild handle a nullptr mMessageManager. r=smaug
Ben Kelly <ben@wanderview.com>
parents: 329641
diff changeset
   926
    // We should have a message manager if the global is alive, but it
d75f6cff73c834f8226da39a8599cc3c82cedc8b Bug 1331193 Make TabChild handle a nullptr mMessageManager. r=smaug
Ben Kelly <ben@wanderview.com>
parents: 329641
diff changeset
   927
    // seems sometimes we don't.  Assert in aurora/nightly, but don't
d75f6cff73c834f8226da39a8599cc3c82cedc8b Bug 1331193 Make TabChild handle a nullptr mMessageManager. r=smaug
Ben Kelly <ben@wanderview.com>
parents: 329641
diff changeset
   928
    // crash in release builds.
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   929
    MOZ_DIAGNOSTIC_ASSERT(mBrowserChildMessageManager->GetMessageManager());
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   930
    if (mBrowserChildMessageManager->GetMessageManager()) {
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   931
      // The messageManager relays messages via the BrowserChild which
329755
d75f6cff73c834f8226da39a8599cc3c82cedc8b Bug 1331193 Make TabChild handle a nullptr mMessageManager. r=smaug
Ben Kelly <ben@wanderview.com>
parents: 329641
diff changeset
   932
      // no longer exists.
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   933
      mBrowserChildMessageManager->DisconnectMessageManager();
329755
d75f6cff73c834f8226da39a8599cc3c82cedc8b Bug 1331193 Make TabChild handle a nullptr mMessageManager. r=smaug
Ben Kelly <ben@wanderview.com>
parents: 329641
diff changeset
   934
    }
74131
8c6c251baaec5f0c01fe2221e0230c17032e290c Bug 648484, parts 3, 3.1, and 3.2: Allow passing a "backend hint" to GetLayerManager() to request a non-default layer manager backend. Deal with failure to hook up shadow layers. sr=roc
Chris Jones <jones.chris.g@gmail.com>
parents: 73394
diff changeset
   935
  }
201022
8ba7b3cb3aff2636bff902bbc16bfbaa5610712c Bug 974242 - Registry and handle FullZoomChange chrome event in TabChild. r=tn, r=kats
C.J. Ku <cku@mozilla.com>
parents: 199665
diff changeset
   936
213163
01b25915ca374d803fa2e98f1dc47a9b59c007bf Bug 1020172 - Patch 2: Manage TabParent in chrome process - v14. r=khuey
Kershaw Chang <kechang@mozilla.com>
parents: 212708
diff changeset
   937
  if (GetTabId() != 0) {
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   938
    NestedBrowserChildMap().erase(GetTabId());
188075
96ddd6ea6abd60f775438e232e3161940ed92c01 Bug 879475 - Part 006. Fix http auth prompts for nested content processes r=honzab
"Kan-Ru Chen (陳侃如)" <kanru@kanru.info>
parents: 188071
diff changeset
   939
  }
48158
3433d89bbea949a12ad9f1efc26479ddf2df999c Bug 579959 - TabChild used after Send__delete__. r=Olli.Pettay
Josh Matthews <josh@joshmatthews.net>
parents: 47934
diff changeset
   940
}
3433d89bbea949a12ad9f1efc26479ddf2df999c Bug 579959 - TabChild used after Send__delete__. r=Olli.Pettay
Josh Matthews <josh@joshmatthews.net>
parents: 47934
diff changeset
   941
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   942
BrowserChild::~BrowserChild() {
477553
d58a62d0b10da0f0bca2563ab57733228da96fa5 Bug 1556557 - Remove BrowserChildBase. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 477551
diff changeset
   943
  mAnonymousGlobalScopes.Clear();
376917
7f426b4432ff060878c2238d60e04c11b1b2b97d Bug 1383333 - Keep track of foreground TabChildren (r=kanru)
Bill McCloskey <billm@mozilla.com>
parents: 376315
diff changeset
   944
319715
97f2b5e98b9c923239278815c0ee0a67389602a9 Bug 1276553 - Part 4: Implement frameloader level GroupedSHistory. r=smaug
Samael Wang <freesamael@gmail.com>
parents: 318982
diff changeset
   945
  DestroyWindow();
97f2b5e98b9c923239278815c0ee0a67389602a9 Bug 1276553 - Part 4: Implement frameloader level GroupedSHistory. r=smaug
Samael Wang <freesamael@gmail.com>
parents: 318982
diff changeset
   946
97f2b5e98b9c923239278815c0ee0a67389602a9 Bug 1276553 - Part 4: Implement frameloader level GroupedSHistory. r=smaug
Samael Wang <freesamael@gmail.com>
parents: 318982
diff changeset
   947
  nsCOMPtr<nsIWebBrowser> webBrowser = do_QueryInterface(WebNavigation());
97f2b5e98b9c923239278815c0ee0a67389602a9 Bug 1276553 - Part 4: Implement frameloader level GroupedSHistory. r=smaug
Samael Wang <freesamael@gmail.com>
parents: 318982
diff changeset
   948
  if (webBrowser) {
97f2b5e98b9c923239278815c0ee0a67389602a9 Bug 1276553 - Part 4: Implement frameloader level GroupedSHistory. r=smaug
Samael Wang <freesamael@gmail.com>
parents: 318982
diff changeset
   949
    webBrowser->SetContainerWindow(nullptr);
97f2b5e98b9c923239278815c0ee0a67389602a9 Bug 1276553 - Part 4: Implement frameloader level GroupedSHistory. r=smaug
Samael Wang <freesamael@gmail.com>
parents: 318982
diff changeset
   950
  }
97f2b5e98b9c923239278815c0ee0a67389602a9 Bug 1276553 - Part 4: Implement frameloader level GroupedSHistory. r=smaug
Samael Wang <freesamael@gmail.com>
parents: 318982
diff changeset
   951
389655
d8d3d54dea296868349f5cb1819392a239ac552a Bug 1401379 - Part 6: Cycle collect nsWebBrowser, r=smaug
Nika Layzell <nika@thelayzells.com>
parents: 389528
diff changeset
   952
  mozilla::DropJSObjects(this);
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   953
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
   954
573913
e1fd1fa67a6554ae8dc206a6fed9e5405a0bf778 Bug 1699721 - Part 2: Track BrowserParent lifecycles during process switches, r=kmag
Nika Layzell <nika@thelayzells.com>
parents: 573899
diff changeset
   955
mozilla::ipc::IPCResult BrowserChild::RecvWillChangeProcess() {
520080
c491157486775555a61d748ccbbc054988aacae9 Bug 1614259 - Ensure BrowisngContexts are detached when nsDocShell is destroyed, r=farre
Nika Layzell <nika@thelayzells.com>
parents: 519606
diff changeset
   956
  if (mWebBrowser) {
c491157486775555a61d748ccbbc054988aacae9 Bug 1614259 - Ensure BrowisngContexts are detached when nsDocShell is destroyed, r=farre
Nika Layzell <nika@thelayzells.com>
parents: 519606
diff changeset
   957
    mWebBrowser->SetWillChangeProcess();
473810
91db28a0bc41d47ecfabba24ea9f8d51023e0a71 Bug 1540839 - Add ability to preserve browsing contexts between FrameLoaders; r=nika
Kyle Machulis <kyle@nonpolynomial.com>
parents: 473705
diff changeset
   958
  }
91db28a0bc41d47ecfabba24ea9f8d51023e0a71 Bug 1540839 - Add ability to preserve browsing contexts between FrameLoaders; r=nika
Kyle Machulis <kyle@nonpolynomial.com>
parents: 473705
diff changeset
   959
  return IPC_OK();
91db28a0bc41d47ecfabba24ea9f8d51023e0a71 Bug 1540839 - Add ability to preserve browsing contexts between FrameLoaders; r=nika
Kyle Machulis <kyle@nonpolynomial.com>
parents: 473705
diff changeset
   960
}
91db28a0bc41d47ecfabba24ea9f8d51023e0a71 Bug 1540839 - Add ability to preserve browsing contexts between FrameLoaders; r=nika
Kyle Machulis <kyle@nonpolynomial.com>
parents: 473705
diff changeset
   961
530950
5cf6e62ea26befe090114c51306f69a7fbb56a14 Bug 1639195 - Part 1: Make BrowserChild::RecvLoadURL() to use the correct triggering princpal. r=ckerschb,mattwoodrow
Tim Huang <tihuang@mozilla.com>
parents: 530528
diff changeset
   962
mozilla::ipc::IPCResult BrowserChild::RecvLoadURL(
546845
6064f8676546dabb489adb40fb4690be209cf1f8 Bug 1589102 - Part 1: Enable about:srcdoc loads via DocumentChannel, r=mattwoodrow
Anny Gakhokidze <agakhokidze@mozilla.com>
parents: 546159
diff changeset
   963
    nsDocShellLoadState* aLoadState, const ParentShowInfo& aInfo) {
288816
70b8ca40c0913faed7e84d94a210159ef6f5c9c0 Bug 1253307 - Use a better function to load web handler apps in e10s. r=billm/mconley
Blake Kaplan <mrbkap@gmail.com>
parents: 288640
diff changeset
   964
  if (!mDidLoadURLInit) {
70b8ca40c0913faed7e84d94a210159ef6f5c9c0 Bug 1253307 - Use a better function to load web handler apps in e10s. r=billm/mconley
Blake Kaplan <mrbkap@gmail.com>
parents: 288640
diff changeset
   965
    mDidLoadURLInit = true;
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
   966
    if (!InitBrowserChildMessageManager()) {
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
   967
      return IPC_FAIL_NO_REASON(this);
237917
714eed0515ff2fda076486aaf911a0d7fac44457 Bug 1121905 - Reorder frame loading sequence to send content process the URL earlier. r=kanru
Ting-Yu Chou <janus926@gmail.com>
parents: 237088
diff changeset
   968
    }
714eed0515ff2fda076486aaf911a0d7fac44457 Bug 1121905 - Reorder frame loading sequence to send content process the URL earlier. r=kanru
Ting-Yu Chou <janus926@gmail.com>
parents: 237088
diff changeset
   969
508841
1798281cc4dfb3099cd1beaedddb0724e9529083 Bug 1606659 - Make Browser*::Show take two arguments, one from the parent process, one from the owner of the frame. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 508642
diff changeset
   970
    ApplyParentShowInfo(aInfo);
288816
70b8ca40c0913faed7e84d94a210159ef6f5c9c0 Bug 1253307 - Use a better function to load web handler apps in e10s. r=billm/mconley
Blake Kaplan <mrbkap@gmail.com>
parents: 288640
diff changeset
   971
  }
546845
6064f8676546dabb489adb40fb4690be209cf1f8 Bug 1589102 - Part 1: Enable about:srcdoc loads via DocumentChannel, r=mattwoodrow
Anny Gakhokidze <agakhokidze@mozilla.com>
parents: 546159
diff changeset
   972
  nsAutoCString spec;
6064f8676546dabb489adb40fb4690be209cf1f8 Bug 1589102 - Part 1: Enable about:srcdoc loads via DocumentChannel, r=mattwoodrow
Anny Gakhokidze <agakhokidze@mozilla.com>
parents: 546159
diff changeset
   973
  aLoadState->URI()->GetSpec(spec);
46761
e483a5868df5e65597a28f846e81286a233a6801 Bug 516522 - CPOW: Cross-Process (JavaScript) Object Wrapper. r=mrbkap r=bent sr=jst
Ben Newman <bnewman@mozilla.com>
parents: 46756
diff changeset
   974
469854
2418f3bd2940a5d824ae841690dad8102a20ff39 Bug 1543786 - Ensure that we revoke a top frame's storage access when it is navigated away; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 469834
diff changeset
   975
  nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
546845
6064f8676546dabb489adb40fb4690be209cf1f8 Bug 1589102 - Part 1: Enable about:srcdoc loads via DocumentChannel, r=mattwoodrow
Anny Gakhokidze <agakhokidze@mozilla.com>
parents: 546159
diff changeset
   976
  MOZ_ASSERT(docShell);
6064f8676546dabb489adb40fb4690be209cf1f8 Bug 1589102 - Part 1: Enable about:srcdoc loads via DocumentChannel, r=mattwoodrow
Anny Gakhokidze <agakhokidze@mozilla.com>
parents: 546159
diff changeset
   977
  if (!docShell) {
6064f8676546dabb489adb40fb4690be209cf1f8 Bug 1589102 - Part 1: Enable about:srcdoc loads via DocumentChannel, r=mattwoodrow
Anny Gakhokidze <agakhokidze@mozilla.com>
parents: 546159
diff changeset
   978
    NS_WARNING("WebNavigation does not have a docshell");
554276
4e663d42d459b27a98ce9866744c44f77378eee2 Bug 1672444 - Null-check docShell in BrowserChild::RecvLoadURL, r=annyG
Nika Layzell <nika@thelayzells.com>
parents: 552635
diff changeset
   979
    return IPC_OK();
469854
2418f3bd2940a5d824ae841690dad8102a20ff39 Bug 1543786 - Ensure that we revoke a top frame's storage access when it is navigated away; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 469834
diff changeset
   980
  }
546845
6064f8676546dabb489adb40fb4690be209cf1f8 Bug 1589102 - Part 1: Enable about:srcdoc loads via DocumentChannel, r=mattwoodrow
Anny Gakhokidze <agakhokidze@mozilla.com>
parents: 546159
diff changeset
   981
  docShell->LoadURI(aLoadState, true);
6064f8676546dabb489adb40fb4690be209cf1f8 Bug 1589102 - Part 1: Enable about:srcdoc loads via DocumentChannel, r=mattwoodrow
Anny Gakhokidze <agakhokidze@mozilla.com>
parents: 546159
diff changeset
   982
6064f8676546dabb489adb40fb4690be209cf1f8 Bug 1589102 - Part 1: Enable about:srcdoc loads via DocumentChannel, r=mattwoodrow
Anny Gakhokidze <agakhokidze@mozilla.com>
parents: 546159
diff changeset
   983
  nsDocShell::Cast(docShell)->MaybeClearStorageAccessFlag();
6064f8676546dabb489adb40fb4690be209cf1f8 Bug 1589102 - Part 1: Enable about:srcdoc loads via DocumentChannel, r=mattwoodrow
Anny Gakhokidze <agakhokidze@mozilla.com>
parents: 546159
diff changeset
   984
6064f8676546dabb489adb40fb4690be209cf1f8 Bug 1589102 - Part 1: Enable about:srcdoc loads via DocumentChannel, r=mattwoodrow
Anny Gakhokidze <agakhokidze@mozilla.com>
parents: 546159
diff changeset
   985
  CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::URL, spec);
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
   986
  return IPC_OK();
275571
ed645e64d66616906fdfd0a652894ed0f4f5ea5e Bug 1116478 - Open web content handlers in the proper tab in e10s. r=billm
Blake Kaplan <mrbkap@gmail.com>
parents: 275417
diff changeset
   987
}
ed645e64d66616906fdfd0a652894ed0f4f5ea5e Bug 1116478 - Open web content handlers in the proper tab in e10s. r=billm
Blake Kaplan <mrbkap@gmail.com>
parents: 275417
diff changeset
   988
579527
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
   989
mozilla::ipc::IPCResult BrowserChild::RecvCreateAboutBlankContentViewer(
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
   990
    nsIPrincipal* aPrincipal, nsIPrincipal* aPartitionedPrincipal) {
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
   991
  if (aPrincipal->GetIsExpandedPrincipal() ||
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
   992
      aPartitionedPrincipal->GetIsExpandedPrincipal()) {
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
   993
    return IPC_FAIL(this, "Cannot create document with an expanded principal");
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
   994
  }
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
   995
  if (aPrincipal->IsSystemPrincipal() ||
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
   996
      aPartitionedPrincipal->IsSystemPrincipal()) {
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
   997
    MOZ_ASSERT_UNREACHABLE(
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
   998
        "Cannot use CreateAboutBlankContentViewer to create system principal "
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
   999
        "document in content");
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1000
    return IPC_OK();
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1001
  }
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1002
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1003
  nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1004
  if (!docShell) {
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1005
    MOZ_ASSERT_UNREACHABLE("WebNavigation does not have a docshell");
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1006
    return IPC_OK();
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1007
  }
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1008
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1009
  nsCOMPtr<nsIURI> currentURI;
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1010
  MOZ_ALWAYS_SUCCEEDS(
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1011
      WebNavigation()->GetCurrentURI(getter_AddRefs(currentURI)));
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1012
  if (!currentURI || !NS_IsAboutBlank(currentURI)) {
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1013
    NS_WARNING("Can't create a ContentViewer unless on about:blank");
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1014
    return IPC_OK();
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1015
  }
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1016
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1017
  docShell->CreateAboutBlankContentViewer(aPrincipal, aPartitionedPrincipal,
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1018
                                          nullptr);
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1019
  return IPC_OK();
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1020
}
b05b428e7a280cd0d096ca8b4f9db5287cfdf5f5 Bug 1708254 - Move CreateAboutBlankContentViewer logic into platform, r=Gijs
Nika Layzell <nika@thelayzells.com>
parents: 579275
diff changeset
  1021
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1022
mozilla::ipc::IPCResult BrowserChild::RecvResumeLoad(
508841
1798281cc4dfb3099cd1beaedddb0724e9529083 Bug 1606659 - Make Browser*::Show take two arguments, one from the parent process, one from the owner of the frame. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 508642
diff changeset
  1023
    const uint64_t& aPendingSwitchID, const ParentShowInfo& aInfo) {
469834
0cbd910e402f47426a04cd404b798be1c9b0a52f Bug 1539163 - Part 1: support resuming load after process switch, r=qdot
Nika Layzell <nika@thelayzells.com>
parents: 469832
diff changeset
  1024
  if (!mDidLoadURLInit) {
0cbd910e402f47426a04cd404b798be1c9b0a52f Bug 1539163 - Part 1: support resuming load after process switch, r=qdot
Nika Layzell <nika@thelayzells.com>
parents: 469832
diff changeset
  1025
    mDidLoadURLInit = true;
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1026
    if (!InitBrowserChildMessageManager()) {
469834
0cbd910e402f47426a04cd404b798be1c9b0a52f Bug 1539163 - Part 1: support resuming load after process switch, r=qdot
Nika Layzell <nika@thelayzells.com>
parents: 469832
diff changeset
  1027
      return IPC_FAIL_NO_REASON(this);
0cbd910e402f47426a04cd404b798be1c9b0a52f Bug 1539163 - Part 1: support resuming load after process switch, r=qdot
Nika Layzell <nika@thelayzells.com>
parents: 469832
diff changeset
  1028
    }
0cbd910e402f47426a04cd404b798be1c9b0a52f Bug 1539163 - Part 1: support resuming load after process switch, r=qdot
Nika Layzell <nika@thelayzells.com>
parents: 469832
diff changeset
  1029
508841
1798281cc4dfb3099cd1beaedddb0724e9529083 Bug 1606659 - Make Browser*::Show take two arguments, one from the parent process, one from the owner of the frame. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 508642
diff changeset
  1030
    ApplyParentShowInfo(aInfo);
469834
0cbd910e402f47426a04cd404b798be1c9b0a52f Bug 1539163 - Part 1: support resuming load after process switch, r=qdot
Nika Layzell <nika@thelayzells.com>
parents: 469832
diff changeset
  1031
  }
0cbd910e402f47426a04cd404b798be1c9b0a52f Bug 1539163 - Part 1: support resuming load after process switch, r=qdot
Nika Layzell <nika@thelayzells.com>
parents: 469832
diff changeset
  1032
0cbd910e402f47426a04cd404b798be1c9b0a52f Bug 1539163 - Part 1: support resuming load after process switch, r=qdot
Nika Layzell <nika@thelayzells.com>
parents: 469832
diff changeset
  1033
  nsresult rv = WebNavigation()->ResumeRedirectedLoad(aPendingSwitchID, -1);
0cbd910e402f47426a04cd404b798be1c9b0a52f Bug 1539163 - Part 1: support resuming load after process switch, r=qdot
Nika Layzell <nika@thelayzells.com>
parents: 469832
diff changeset
  1034
  if (NS_FAILED(rv)) {
0cbd910e402f47426a04cd404b798be1c9b0a52f Bug 1539163 - Part 1: support resuming load after process switch, r=qdot
Nika Layzell <nika@thelayzells.com>
parents: 469832
diff changeset
  1035
    NS_WARNING("WebNavigation()->ResumeRedirectedLoad failed");
0cbd910e402f47426a04cd404b798be1c9b0a52f Bug 1539163 - Part 1: support resuming load after process switch, r=qdot
Nika Layzell <nika@thelayzells.com>
parents: 469832
diff changeset
  1036
  }
0cbd910e402f47426a04cd404b798be1c9b0a52f Bug 1539163 - Part 1: support resuming load after process switch, r=qdot
Nika Layzell <nika@thelayzells.com>
parents: 469832
diff changeset
  1037
0cbd910e402f47426a04cd404b798be1c9b0a52f Bug 1539163 - Part 1: support resuming load after process switch, r=qdot
Nika Layzell <nika@thelayzells.com>
parents: 469832
diff changeset
  1038
  return IPC_OK();
0cbd910e402f47426a04cd404b798be1c9b0a52f Bug 1539163 - Part 1: support resuming load after process switch, r=qdot
Nika Layzell <nika@thelayzells.com>
parents: 469832
diff changeset
  1039
}
0cbd910e402f47426a04cd404b798be1c9b0a52f Bug 1539163 - Part 1: support resuming load after process switch, r=qdot
Nika Layzell <nika@thelayzells.com>
parents: 469832
diff changeset
  1040
586692
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1041
nsresult BrowserChild::CloneDocumentTreeIntoSelf(
582911
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1042
    const MaybeDiscarded<BrowsingContext>& aSourceBC,
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1043
    const embedding::PrintData& aPrintData) {
582925
57328f12e67aafad12fd1f062fddf48b41120a4f Bug 1699837 - Follow-up: Fix --disable-printing builds.
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582911
diff changeset
  1044
#ifdef NS_PRINTING
549579
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1045
  if (NS_WARN_IF(aSourceBC.IsNullOrDiscarded())) {
586692
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1046
    return NS_ERROR_FAILURE;
549579
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1047
  }
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1048
  nsCOMPtr<Document> sourceDocument = aSourceBC.get()->GetDocument();
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1049
  if (NS_WARN_IF(!sourceDocument)) {
586692
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1050
    return NS_ERROR_FAILURE;
549579
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1051
  }
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1052
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1053
  nsCOMPtr<nsIDocShell> ourDocShell = do_GetInterface(WebNavigation());
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1054
  if (NS_WARN_IF(!ourDocShell)) {
586692
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1055
    return NS_ERROR_FAILURE;
549579
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1056
  }
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1057
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1058
  nsCOMPtr<nsIContentViewer> cv;
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1059
  ourDocShell->GetContentViewer(getter_AddRefs(cv));
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1060
  if (NS_WARN_IF(!cv)) {
586692
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1061
    return NS_ERROR_FAILURE;
549579
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1062
  }
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1063
582911
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1064
  nsCOMPtr<nsIPrintSettingsService> printSettingsSvc =
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1065
      do_GetService("@mozilla.org/gfx/printsettings-service;1");
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1066
  if (NS_WARN_IF(!printSettingsSvc)) {
586692
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1067
    return NS_ERROR_FAILURE;
582911
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1068
  }
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1069
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1070
  nsCOMPtr<nsIPrintSettings> printSettings;
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1071
  nsresult rv =
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1072
      printSettingsSvc->GetNewPrintSettings(getter_AddRefs(printSettings));
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1073
  if (NS_WARN_IF(NS_FAILED(rv))) {
586692
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1074
    return rv;
582911
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1075
  }
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1076
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1077
  printSettingsSvc->DeserializeToPrintSettings(aPrintData, printSettings);
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1078
549579
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1079
  RefPtr<Document> clone;
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1080
  {
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1081
    AutoPrintEventDispatcher dispatcher(*sourceDocument);
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1082
    nsAutoScriptBlocker scriptBlocker;
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1083
    bool hasInProcessCallbacks = false;
582911
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1084
    clone = sourceDocument->CreateStaticClone(ourDocShell, cv, printSettings,
549579
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1085
                                              &hasInProcessCallbacks);
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1086
    if (NS_WARN_IF(!clone)) {
586692
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1087
      return NS_ERROR_FAILURE;
549579
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1088
    }
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1089
  }
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1090
586692
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1091
  rv = UpdateRemotePrintSettings(aPrintData);
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1092
  if (NS_FAILED(rv)) {
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1093
    return rv;
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1094
  }
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1095
582925
57328f12e67aafad12fd1f062fddf48b41120a4f Bug 1699837 - Follow-up: Fix --disable-printing builds.
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582911
diff changeset
  1096
#endif
586692
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1097
  return NS_OK;
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1098
}
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1099
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1100
mozilla::ipc::IPCResult BrowserChild::RecvCloneDocumentTreeIntoSelf(
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1101
    const MaybeDiscarded<BrowsingContext>& aSourceBC,
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1102
    const embedding::PrintData& aPrintData,
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1103
    CloneDocumentTreeIntoSelfResolver&& aResolve) {
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1104
  nsresult rv = NS_OK;
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1105
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1106
#ifdef NS_PRINTING
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1107
  rv = CloneDocumentTreeIntoSelf(aSourceBC, aPrintData);
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1108
#endif
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1109
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1110
  aResolve(NS_SUCCEEDED(rv));
582911
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1111
  return IPC_OK();
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1112
}
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1113
586692
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1114
nsresult BrowserChild::UpdateRemotePrintSettings(
582911
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1115
    const embedding::PrintData& aPrintData) {
582925
57328f12e67aafad12fd1f062fddf48b41120a4f Bug 1699837 - Follow-up: Fix --disable-printing builds.
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582911
diff changeset
  1116
#ifdef NS_PRINTING
582911
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1117
  nsCOMPtr<nsIDocShell> ourDocShell = do_GetInterface(WebNavigation());
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1118
  if (NS_WARN_IF(!ourDocShell)) {
586692
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1119
    return NS_ERROR_FAILURE;
582911
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1120
  }
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1121
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1122
  RefPtr<Document> doc = ourDocShell->GetExtantDocument();
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1123
  if (NS_WARN_IF(!doc) || NS_WARN_IF(!doc->IsStaticDocument())) {
586692
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1124
    return NS_ERROR_FAILURE;
582911
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1125
  }
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1126
585083
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1127
  RefPtr<BrowsingContext> bc = ourDocShell->GetBrowsingContext();
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1128
  if (NS_WARN_IF(!bc)) {
586692
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1129
    return NS_ERROR_FAILURE;
582911
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1130
  }
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1131
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1132
  nsCOMPtr<nsIPrintSettingsService> printSettingsSvc =
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1133
      do_GetService("@mozilla.org/gfx/printsettings-service;1");
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1134
  if (NS_WARN_IF(!printSettingsSvc)) {
586692
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1135
    return NS_ERROR_FAILURE;
582911
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1136
  }
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1137
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1138
  nsCOMPtr<nsIPrintSettings> printSettings;
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1139
  nsresult rv =
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1140
      printSettingsSvc->GetNewPrintSettings(getter_AddRefs(printSettings));
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1141
  if (NS_WARN_IF(NS_FAILED(rv))) {
586692
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1142
    return rv;
582911
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1143
  }
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1144
30c1f5e41d17d943baed2d3aa9c0c462ef9de46d Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582834
diff changeset
  1145
  printSettingsSvc->DeserializeToPrintSettings(aPrintData, printSettings);
585083
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1146
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1147
  bc->PreOrderWalk([&](BrowsingContext* aBc) {
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1148
    if (nsCOMPtr<nsIDocShell> inProcess = aBc->GetDocShell()) {
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1149
      nsCOMPtr<nsIContentViewer> cv;
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1150
      inProcess->GetContentViewer(getter_AddRefs(cv));
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1151
      if (NS_WARN_IF(!cv)) {
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1152
        return BrowsingContext::WalkFlag::Skip;
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1153
      }
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1154
      // The CanRunScript analysis is not smart enough to see across
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1155
      // the std::function PreOrderWalk uses, so we cheat a bit here, but it is
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1156
      // fine because PreOrderWalk does deal with arbitrary script changing the
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1157
      // BC tree, and our code above is simple enough and keeps strong refs to
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1158
      // everything.
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1159
      ([&]() MOZ_CAN_RUN_SCRIPT_BOUNDARY {
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1160
        cv->SetPrintSettingsForSubdocument(printSettings);
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1161
      }());
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1162
    } else if (RefPtr<BrowserBridgeChild> remoteChild =
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1163
                   BrowserBridgeChild::GetFrom(aBc->GetEmbedderElement())) {
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1164
      Unused << remoteChild->SendUpdateRemotePrintSettings(aPrintData);
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1165
      return BrowsingContext::WalkFlag::Skip;
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1166
    }
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1167
    return BrowsingContext::WalkFlag::Next;
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1168
  });
582925
57328f12e67aafad12fd1f062fddf48b41120a4f Bug 1699837 - Follow-up: Fix --disable-printing builds.
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 582911
diff changeset
  1169
#endif
585083
690e37acebe860e71883f09190c143e3684e0b69 Bug 1716537 - Propagate print setting updates to remote sub-subdocuments as well. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 585026
diff changeset
  1170
586692
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1171
  return NS_OK;
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1172
}
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1173
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1174
mozilla::ipc::IPCResult BrowserChild::RecvUpdateRemotePrintSettings(
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1175
    const embedding::PrintData& aPrintData) {
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1176
#ifdef NS_PRINTING
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1177
  UpdateRemotePrintSettings(aPrintData);
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1178
#endif
3c5186df3677d2ad1a71335929d01832250d8e27 Bug 1695806 - Make CloneDocumentTreeIntoSelf return a MozPromise to be able to wait for its completion. r=mattwoodrow
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 586492
diff changeset
  1179
549579
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1180
  return IPC_OK();
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1181
}
713a1bb30a6dec7df47f9c31806fdfd368810e36 Bug 1557645 - Clone OOP iframes in the right process. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 548923
diff changeset
  1182
508841
1798281cc4dfb3099cd1beaedddb0724e9529083 Bug 1606659 - Make Browser*::Show take two arguments, one from the parent process, one from the owner of the frame. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 508642
diff changeset
  1183
void BrowserChild::DoFakeShow(const ParentShowInfo& aParentShowInfo) {
509918
05639d6591b3251c31fdaf5fe5d37dd162009a8b Bug 1588791 - Make fission iframes honor and deal with the scrolling attribute. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 509887
diff changeset
  1184
  OwnerShowInfo ownerInfo{ScreenIntSize(), ScrollbarPreference::Auto,
558193
35f3e90b365788ba92a19cdd540d9cc3a989607d Bug 1585070 - move nsPIDOMWindowOuter::mIsActive to BrowsingContext. r=kmag
Steven MacLeod <steven@smacleod.ca>
parents: 557477
diff changeset
  1185
                          nsSizeMode_Normal};
508841
1798281cc4dfb3099cd1beaedddb0724e9529083 Bug 1606659 - Make Browser*::Show take two arguments, one from the parent process, one from the owner of the frame. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 508642
diff changeset
  1186
  RecvShow(aParentShowInfo, ownerInfo);
96532
65a425a98e860afa7132473dbf6a2f6868374b92 Bug 742944 - Part 4: Handle window.open in <iframe mozbrowser>. r=bz, cjones
Justin Lebar <justin.lebar@gmail.com>
parents: 96331
diff changeset
  1187
  mDidFakeShow = true;
65a425a98e860afa7132473dbf6a2f6868374b92 Bug 742944 - Part 4: Handle window.open in <iframe mozbrowser>. r=bz, cjones
Justin Lebar <justin.lebar@gmail.com>
parents: 96331
diff changeset
  1188
}
65a425a98e860afa7132473dbf6a2f6868374b92 Bug 742944 - Part 4: Handle window.open in <iframe mozbrowser>. r=bz, cjones
Justin Lebar <justin.lebar@gmail.com>
parents: 96331
diff changeset
  1189
508841
1798281cc4dfb3099cd1beaedddb0724e9529083 Bug 1606659 - Make Browser*::Show take two arguments, one from the parent process, one from the owner of the frame. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 508642
diff changeset
  1190
void BrowserChild::ApplyParentShowInfo(const ParentShowInfo& aInfo) {
369874
b43d89d13360fcdbee0a034eebc308e67c71cf52 Bug 1350643 - Part 7: Remove sync GetDPI/DefaultScale/WidgetRounding. Use primary screen's value until RecvShow. r=kanru
Samael Wang <freesamael@gmail.com>
parents: 369574
diff changeset
  1191
  // Even if we already set real show info, the dpi / rounding & scale may still
470936
47813ecb1f4e0244ded2f7b938430bf52c927751 Bug 1534395 - Rename TabParent to BrowserParent. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470247
diff changeset
  1192
  // be invalid (if BrowserParent wasn't able to get widget it would just send
47813ecb1f4e0244ded2f7b938430bf52c927751 Bug 1534395 - Rename TabParent to BrowserParent. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470247
diff changeset
  1193
  // 0). So better to always set up-to-date values here.
369874
b43d89d13360fcdbee0a034eebc308e67c71cf52 Bug 1350643 - Part 7: Remove sync GetDPI/DefaultScale/WidgetRounding. Use primary screen's value until RecvShow. r=kanru
Samael Wang <freesamael@gmail.com>
parents: 369574
diff changeset
  1194
  if (aInfo.dpi() > 0) {
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1195
    mPuppetWidget->UpdateBackingScaleCache(aInfo.dpi(), aInfo.widgetRounding(),
369874
b43d89d13360fcdbee0a034eebc308e67c71cf52 Bug 1350643 - Part 7: Remove sync GetDPI/DefaultScale/WidgetRounding. Use primary screen's value until RecvShow. r=kanru
Samael Wang <freesamael@gmail.com>
parents: 369574
diff changeset
  1196
                                           aInfo.defaultScale());
b43d89d13360fcdbee0a034eebc308e67c71cf52 Bug 1350643 - Part 7: Remove sync GetDPI/DefaultScale/WidgetRounding. Use primary screen's value until RecvShow. r=kanru
Samael Wang <freesamael@gmail.com>
parents: 369574
diff changeset
  1197
  }
b43d89d13360fcdbee0a034eebc308e67c71cf52 Bug 1350643 - Part 7: Remove sync GetDPI/DefaultScale/WidgetRounding. Use primary screen's value until RecvShow. r=kanru
Samael Wang <freesamael@gmail.com>
parents: 369574
diff changeset
  1198
270453
b9453b7c7fcec539219ca360efcf51197fd28f5b Bug 1191724, ensure private browser flag is set on docshell early enough, r=fabrice
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 270359
diff changeset
  1199
  if (mDidSetRealShowInfo) {
b9453b7c7fcec539219ca360efcf51197fd28f5b Bug 1191724, ensure private browser flag is set on docshell early enough, r=fabrice
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 270359
diff changeset
  1200
    return;
b9453b7c7fcec539219ca360efcf51197fd28f5b Bug 1191724, ensure private browser flag is set on docshell early enough, r=fabrice
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 270359
diff changeset
  1201
  }
b9453b7c7fcec539219ca360efcf51197fd28f5b Bug 1191724, ensure private browser flag is set on docshell early enough, r=fabrice
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 270359
diff changeset
  1202
b9453b7c7fcec539219ca360efcf51197fd28f5b Bug 1191724, ensure private browser flag is set on docshell early enough, r=fabrice
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 270359
diff changeset
  1203
  if (!aInfo.fakeShowInfo()) {
b9453b7c7fcec539219ca360efcf51197fd28f5b Bug 1191724, ensure private browser flag is set on docshell early enough, r=fabrice
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 270359
diff changeset
  1204
    // Once we've got one ShowInfo from parent, no need to update the values
b9453b7c7fcec539219ca360efcf51197fd28f5b Bug 1191724, ensure private browser flag is set on docshell early enough, r=fabrice
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 270359
diff changeset
  1205
    // anymore.
b9453b7c7fcec539219ca360efcf51197fd28f5b Bug 1191724, ensure private browser flag is set on docshell early enough, r=fabrice
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 270359
diff changeset
  1206
    mDidSetRealShowInfo = true;
b9453b7c7fcec539219ca360efcf51197fd28f5b Bug 1191724, ensure private browser flag is set on docshell early enough, r=fabrice
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 270359
diff changeset
  1207
  }
b9453b7c7fcec539219ca360efcf51197fd28f5b Bug 1191724, ensure private browser flag is set on docshell early enough, r=fabrice
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 270359
diff changeset
  1208
297506
9d6203236f472e9ab981401a7f6636943e1316f6 Bug 1261612 - Allow <iframe mozbrowser> in chrome doc to use transparent attribute. r=smaug
Kan-Ru Chen <kanru@kanru.info>
parents: 297505
diff changeset
  1209
  mIsTransparent = aInfo.isTransparent();
218333
6e90fd9bf6e266e77aaeb863e674026f3595eba3 Bug 1003848 - Don't use sync messaging during BrowserElementChild initialization r=smaug
Fabrice Desré <fabrice@mozilla.com>
parents: 218330
diff changeset
  1210
}
6e90fd9bf6e266e77aaeb863e674026f3595eba3 Bug 1003848 - Don't use sync messaging during BrowserElementChild initialization r=smaug
Fabrice Desré <fabrice@mozilla.com>
parents: 218330
diff changeset
  1211
508841
1798281cc4dfb3099cd1beaedddb0724e9529083 Bug 1606659 - Make Browser*::Show take two arguments, one from the parent process, one from the owner of the frame. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 508642
diff changeset
  1212
mozilla::ipc::IPCResult BrowserChild::RecvShow(
1798281cc4dfb3099cd1beaedddb0724e9529083 Bug 1606659 - Make Browser*::Show take two arguments, one from the parent process, one from the owner of the frame. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 508642
diff changeset
  1213
    const ParentShowInfo& aParentInfo, const OwnerShowInfo& aOwnerInfo) {
329872
bf830a2e2346b71f46ab7edd59ae0d787adfbb1c Bug 1331509 - Rearrange TabChild::RecvShow to make it a bit more obvious how InitRenderingState can be extracted. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 329641
diff changeset
  1214
  bool res = true;
bf830a2e2346b71f46ab7edd59ae0d787adfbb1c Bug 1331509 - Rearrange TabChild::RecvShow to make it a bit more obvious how InitRenderingState can be extracted. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 329641
diff changeset
  1215
508841
1798281cc4dfb3099cd1beaedddb0724e9529083 Bug 1606659 - Make Browser*::Show take two arguments, one from the parent process, one from the owner of the frame. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 508642
diff changeset
  1216
  mPuppetWidget->SetSizeMode(aOwnerInfo.sizeMode());
329872
bf830a2e2346b71f46ab7edd59ae0d787adfbb1c Bug 1331509 - Rearrange TabChild::RecvShow to make it a bit more obvious how InitRenderingState can be extracted. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 329641
diff changeset
  1217
  if (!mDidFakeShow) {
175119
daada068c02fe87b991ae6a7aa23ce377143de56 Bug 985817 - Move some TabChild functionality into base class to be reusable in Embedlite implementation. r=kats
Tatiana Meshkova <tanya.meshkova@gmail.com>
parents: 174866
diff changeset
  1218
    nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(WebNavigation());
54008
daeab9b5b99bbc50099ae3a66b87bd339db48940 Bug 582057, part k: Gut platform widgets from content processes. sr=bsmedberg
Chris Jones <jones.chris.g@gmail.com>
parents: 50801
diff changeset
  1219
    if (!baseWindow) {
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1220
      NS_ERROR("WebNavigation() doesn't QI to nsIBaseWindow");
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1221
      return IPC_FAIL_NO_REASON(this);
54008
daeab9b5b99bbc50099ae3a66b87bd339db48940 Bug 582057, part k: Gut platform widgets from content processes. sr=bsmedberg
Chris Jones <jones.chris.g@gmail.com>
parents: 50801
diff changeset
  1222
    }
daeab9b5b99bbc50099ae3a66b87bd339db48940 Bug 582057, part k: Gut platform widgets from content processes. sr=bsmedberg
Chris Jones <jones.chris.g@gmail.com>
parents: 50801
diff changeset
  1223
78840
ec7577dec4fceef0ac2717416d9c48289402d935 Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Ehsan Akhgari <ehsan@mozilla.com>
parents: 78469
diff changeset
  1224
    baseWindow->SetVisibility(true);
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1225
    res = InitBrowserChildMessageManager();
329872
bf830a2e2346b71f46ab7edd59ae0d787adfbb1c Bug 1331509 - Rearrange TabChild::RecvShow to make it a bit more obvious how InitRenderingState can be extracted. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 329641
diff changeset
  1226
  }
bf830a2e2346b71f46ab7edd59ae0d787adfbb1c Bug 1331509 - Rearrange TabChild::RecvShow to make it a bit more obvious how InitRenderingState can be extracted. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 329641
diff changeset
  1227
508841
1798281cc4dfb3099cd1beaedddb0724e9529083 Bug 1606659 - Make Browser*::Show take two arguments, one from the parent process, one from the owner of the frame. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 508642
diff changeset
  1228
  ApplyParentShowInfo(aParentInfo);
558193
35f3e90b365788ba92a19cdd540d9cc3a989607d Bug 1585070 - move nsPIDOMWindowOuter::mIsActive to BrowsingContext. r=kmag
Steven MacLeod <steven@smacleod.ca>
parents: 557477
diff changeset
  1229
509918
05639d6591b3251c31fdaf5fe5d37dd162009a8b Bug 1588791 - Make fission iframes honor and deal with the scrolling attribute. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 509887
diff changeset
  1230
  if (!mIsTopLevel) {
05639d6591b3251c31fdaf5fe5d37dd162009a8b Bug 1588791 - Make fission iframes honor and deal with the scrolling attribute. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 509887
diff changeset
  1231
    RecvScrollbarPreferenceChanged(aOwnerInfo.scrollbarPreference());
05639d6591b3251c31fdaf5fe5d37dd162009a8b Bug 1588791 - Make fission iframes honor and deal with the scrolling attribute. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 509887
diff changeset
  1232
  }
329872
bf830a2e2346b71f46ab7edd59ae0d787adfbb1c Bug 1331509 - Rearrange TabChild::RecvShow to make it a bit more obvious how InitRenderingState can be extracted. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 329641
diff changeset
  1233
bf830a2e2346b71f46ab7edd59ae0d787adfbb1c Bug 1331509 - Rearrange TabChild::RecvShow to make it a bit more obvious how InitRenderingState can be extracted. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 329641
diff changeset
  1234
  if (!res) {
bf830a2e2346b71f46ab7edd59ae0d787adfbb1c Bug 1331509 - Rearrange TabChild::RecvShow to make it a bit more obvious how InitRenderingState can be extracted. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 329641
diff changeset
  1235
    return IPC_FAIL_NO_REASON(this);
bf830a2e2346b71f46ab7edd59ae0d787adfbb1c Bug 1331509 - Rearrange TabChild::RecvShow to make it a bit more obvious how InitRenderingState can be extracted. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 329641
diff changeset
  1236
  }
431435
290b508c04ee871a1582f4ede10ed1d6ed2cc8dd Bug 1481351 - Fix some issues around PBrowser::Show message handling, tidy up web replay child headers, r=mccr8.
Brian Hackett <bhackett1024@gmail.com>
parents: 431226
diff changeset
  1237
495352
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  1238
  UpdateVisibility();
476563
4df5fa6fa785961229e7e0a7a0ebbab625192f24 Bug 1519546, part 6 - Centralize the visibility logic in BrowserChild and use EffectsInfo. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 476562
diff changeset
  1239
329872
bf830a2e2346b71f46ab7edd59ae0d787adfbb1c Bug 1331509 - Rearrange TabChild::RecvShow to make it a bit more obvious how InitRenderingState can be extracted. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 329641
diff changeset
  1240
  return IPC_OK();
54008
daeab9b5b99bbc50099ae3a66b87bd339db48940 Bug 582057, part k: Gut platform widgets from content processes. sr=bsmedberg
Chris Jones <jones.chris.g@gmail.com>
parents: 50801
diff changeset
  1241
}
daeab9b5b99bbc50099ae3a66b87bd339db48940 Bug 582057, part k: Gut platform widgets from content processes. sr=bsmedberg
Chris Jones <jones.chris.g@gmail.com>
parents: 50801
diff changeset
  1242
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1243
mozilla::ipc::IPCResult BrowserChild::RecvInitRendering(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1244
    const TextureFactoryIdentifier& aTextureFactoryIdentifier,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1245
    const layers::LayersId& aLayersId,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1246
    const CompositorOptions& aCompositorOptions, const bool& aLayersConnected) {
386152
38330dd0d9e5e297b396e760c2997c86a1e64a59 Bug 1391262 - Do not use remote LayerManager when its initialization fails r=dvander
sotaro <sotaro.ikeda.g@gmail.com>
parents: 385544
diff changeset
  1247
  mLayersConnected = Some(aLayersConnected);
444789
3e1fb79a5d08c19f363e3c77886d71a9357f1f49 Bug 1503655 part 7 - Remove aHasRenderFrame from PBrowser::InitRendering. r=kats
Ryan Hunt <rhunt@eqrion.net>
parents: 444788
diff changeset
  1248
  InitRenderingState(aTextureFactoryIdentifier, aLayersId, aCompositorOptions);
329873
edcd2bd8340d4fceac08c0b904096275a4e29703 Bug 1331509 - Extract the InitRenderingState function in TabChild and invoke it earlier from TabParent. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 329872
diff changeset
  1249
  return IPC_OK();
edcd2bd8340d4fceac08c0b904096275a4e29703 Bug 1331509 - Extract the InitRenderingState function in TabChild and invoke it earlier from TabParent. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 329872
diff changeset
  1250
}
edcd2bd8340d4fceac08c0b904096275a4e29703 Bug 1331509 - Extract the InitRenderingState function in TabChild and invoke it earlier from TabParent. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 329872
diff changeset
  1251
509918
05639d6591b3251c31fdaf5fe5d37dd162009a8b Bug 1588791 - Make fission iframes honor and deal with the scrolling attribute. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 509887
diff changeset
  1252
mozilla::ipc::IPCResult BrowserChild::RecvScrollbarPreferenceChanged(
05639d6591b3251c31fdaf5fe5d37dd162009a8b Bug 1588791 - Make fission iframes honor and deal with the scrolling attribute. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 509887
diff changeset
  1253
    ScrollbarPreference aPreference) {
05639d6591b3251c31fdaf5fe5d37dd162009a8b Bug 1588791 - Make fission iframes honor and deal with the scrolling attribute. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 509887
diff changeset
  1254
  MOZ_ASSERT(!mIsTopLevel,
05639d6591b3251c31fdaf5fe5d37dd162009a8b Bug 1588791 - Make fission iframes honor and deal with the scrolling attribute. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 509887
diff changeset
  1255
             "Scrollbar visibility should be derived from chrome flags for "
05639d6591b3251c31fdaf5fe5d37dd162009a8b Bug 1588791 - Make fission iframes honor and deal with the scrolling attribute. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 509887
diff changeset
  1256
             "top-level windows");
521859
0d709dba321059a974f44c497bf0a5e148e9ec8b Bug 1624747 - Null-check docshell from BrowserChild::RecvScrollbarPreferencesChanged / RecvShow. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 520787
diff changeset
  1257
  if (nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation())) {
0d709dba321059a974f44c497bf0a5e148e9ec8b Bug 1624747 - Null-check docshell from BrowserChild::RecvScrollbarPreferencesChanged / RecvShow. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 520787
diff changeset
  1258
    nsDocShell::Cast(docShell)->SetScrollbarPreference(aPreference);
0d709dba321059a974f44c497bf0a5e148e9ec8b Bug 1624747 - Null-check docshell from BrowserChild::RecvScrollbarPreferencesChanged / RecvShow. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 520787
diff changeset
  1259
  }
509918
05639d6591b3251c31fdaf5fe5d37dd162009a8b Bug 1588791 - Make fission iframes honor and deal with the scrolling attribute. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 509887
diff changeset
  1260
  return IPC_OK();
05639d6591b3251c31fdaf5fe5d37dd162009a8b Bug 1588791 - Make fission iframes honor and deal with the scrolling attribute. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 509887
diff changeset
  1261
}
05639d6591b3251c31fdaf5fe5d37dd162009a8b Bug 1588791 - Make fission iframes honor and deal with the scrolling attribute. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 509887
diff changeset
  1262
502510
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1263
mozilla::ipc::IPCResult BrowserChild::RecvCompositorOptionsChanged(
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1264
    const CompositorOptions& aNewOptions) {
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1265
  MOZ_ASSERT(mCompositorOptions);
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1266
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1267
  // The only compositor option we currently support changing is APZ
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1268
  // enablement. Even that is only partially supported for now:
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1269
  //   * Going from APZ to non-APZ is fine - we just flip the stored flag.
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1270
  //     Note that we keep the actors (mApzcTreeManager, and the APZChild
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1271
  //     created in InitAPZState()) around (read on for why).
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1272
  //   * Going from non-APZ to APZ is only supported if we were using
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1273
  //     APZ initially (at InitRendering() time) and we are transitioning
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1274
  //     back. In this case, we just reuse the actors which we kept around.
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1275
  //     Fully supporting a non-APZ to APZ transition (i.e. even in cases
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1276
  //     where we initialized as non-APZ) would require setting up the actors
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1277
  //     here. (In that case, we would also have the options of destroying
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1278
  //     the actors in the APZ --> non-APZ case, and always re-creating them
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1279
  //     during a non-APZ --> APZ transition).
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1280
  mCompositorOptions->SetUseAPZ(aNewOptions.UseAPZ());
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1281
  return IPC_OK();
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1282
}
408a199d1d47d782a0a6f43991d72a00a7a7da49 Bug 1589022 - Partial support for moving a tab between windows with different APZ enablement. r=nika,tnikkel
Botond Ballo <botond@mozilla.com>
parents: 502470
diff changeset
  1283
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1284
mozilla::ipc::IPCResult BrowserChild::RecvUpdateDimensions(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1285
    const DimensionInfo& aDimensionInfo) {
515950
954d5a7490a36c05b8f07e0caaa782c7eb0a2ed5 Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown
Andrew McCreight <continuation@gmail.com>
parents: 515838
diff changeset
  1286
  if (mLayersConnected.isNothing()) {
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1287
    return IPC_OK();
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1288
  }
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1289
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1290
  mUnscaledOuterRect = aDimensionInfo.rect();
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1291
  mClientOffset = aDimensionInfo.clientOffset();
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1292
  mChromeOffset = aDimensionInfo.chromeOffset();
559319
9755f95ce00538a4b868734b7e3a9867088c9f6f Bug 1615151 - Don't set the chrome offset for OOP iframe's browser. r=hsivonen
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 559129
diff changeset
  1293
  MOZ_ASSERT_IF(!IsTopLevel(), mChromeOffset == LayoutDeviceIntPoint());
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1294
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1295
  mOrientation = aDimensionInfo.orientation();
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1296
  SetUnscaledInnerSize(aDimensionInfo.size());
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1297
  if (!mHasValidInnerSize && aDimensionInfo.size().width != 0 &&
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1298
      aDimensionInfo.size().height != 0) {
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1299
    mHasValidInnerSize = true;
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1300
  }
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1301
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1302
  ScreenIntSize screenSize = GetInnerSize();
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1303
  ScreenIntRect screenRect = GetOuterRect();
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1304
537186
345be10ae3f6fa33b5297e80217feaf40bb87a11 Bug 1647871 - Remove AutoResizeReflowSquasher. r=kats
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 537043
diff changeset
  1305
  // Make sure to set the size on the document viewer first.  The
345be10ae3f6fa33b5297e80217feaf40bb87a11 Bug 1647871 - Remove AutoResizeReflowSquasher. r=kats
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 537043
diff changeset
  1306
  // MobileViewportManager needs the content viewer size to be updated before
345be10ae3f6fa33b5297e80217feaf40bb87a11 Bug 1647871 - Remove AutoResizeReflowSquasher. r=kats
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 537043
diff changeset
  1307
  // the reflow, otherwise it gets a stale size when it computes a new CSS
345be10ae3f6fa33b5297e80217feaf40bb87a11 Bug 1647871 - Remove AutoResizeReflowSquasher. r=kats
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 537043
diff changeset
  1308
  // viewport.
345be10ae3f6fa33b5297e80217feaf40bb87a11 Bug 1647871 - Remove AutoResizeReflowSquasher. r=kats
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 537043
diff changeset
  1309
  nsCOMPtr<nsIBaseWindow> baseWin = do_QueryInterface(WebNavigation());
345be10ae3f6fa33b5297e80217feaf40bb87a11 Bug 1647871 - Remove AutoResizeReflowSquasher. r=kats
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 537043
diff changeset
  1310
  baseWin->SetPositionAndSize(0, 0, screenSize.width, screenSize.height,
345be10ae3f6fa33b5297e80217feaf40bb87a11 Bug 1647871 - Remove AutoResizeReflowSquasher. r=kats
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 537043
diff changeset
  1311
                              nsIBaseWindow::eRepaint);
345be10ae3f6fa33b5297e80217feaf40bb87a11 Bug 1647871 - Remove AutoResizeReflowSquasher. r=kats
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 537043
diff changeset
  1312
345be10ae3f6fa33b5297e80217feaf40bb87a11 Bug 1647871 - Remove AutoResizeReflowSquasher. r=kats
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 537043
diff changeset
  1313
  mPuppetWidget->Resize(screenRect.x + mClientOffset.x + mChromeOffset.x,
345be10ae3f6fa33b5297e80217feaf40bb87a11 Bug 1647871 - Remove AutoResizeReflowSquasher. r=kats
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 537043
diff changeset
  1314
                        screenRect.y + mClientOffset.y + mChromeOffset.y,
345be10ae3f6fa33b5297e80217feaf40bb87a11 Bug 1647871 - Remove AutoResizeReflowSquasher. r=kats
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 537043
diff changeset
  1315
                        screenSize.width, screenSize.height, true);
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1316
516803
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  1317
  RecvSafeAreaInsetsChanged(mPuppetWidget->GetSafeAreaInsets());
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  1318
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1319
  return IPC_OK();
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
  1320
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
  1321
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1322
mozilla::ipc::IPCResult BrowserChild::RecvSizeModeChanged(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1323
    const nsSizeMode& aSizeMode) {
285540
9ecc9682c3a35496b18a114b85af871f1d6bffa4 Bug 1104916 - Implement CSS media query display-mode. r=cam
Brendan Dahl <bdahl@mozilla.com>
parents: 285474
diff changeset
  1324
  mPuppetWidget->SetSizeMode(aSizeMode);
294712
4965b4f209335d05855c813e772e5ec45ba2df0c Bug 1259641 - Do not force reflow for all tabs when size mode changed. r=smaug
Wei-Cheng Pan <wpan@mozilla.com>
parents: 294638
diff changeset
  1325
  if (!mPuppetWidget->IsVisible()) {
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1326
    return IPC_OK();
294712
4965b4f209335d05855c813e772e5ec45ba2df0c Bug 1259641 - Do not force reflow for all tabs when size mode changed. r=smaug
Wei-Cheng Pan <wpan@mozilla.com>
parents: 294638
diff changeset
  1327
  }
469386
148e810b01d22b00e254c445dda2f659534103a7 Bug 1542664 - Make TabChild use mozilla::PresShell directly rather than via nsIPresShell r=nika
Masayuki Nakano <masayuki@d-toybox.com>
parents: 469371
diff changeset
  1328
  nsCOMPtr<Document> document(GetTopLevelDocument());
515377
813b87f46a51ca84c805a37d669f076de67e2d9f Bug 1577432 - Null check document in BrowserChild::RecvSizeModeChanged, r=bdahl
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 515284
diff changeset
  1329
  if (!document) {
813b87f46a51ca84c805a37d669f076de67e2d9f Bug 1577432 - Null check document in BrowserChild::RecvSizeModeChanged, r=bdahl
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 515284
diff changeset
  1330
    return IPC_OK();
813b87f46a51ca84c805a37d669f076de67e2d9f Bug 1577432 - Null check document in BrowserChild::RecvSizeModeChanged, r=bdahl
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 515284
diff changeset
  1331
  }
404585
3790c8adcba31c0a49bda55161777a7992fbfb4a Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 404432
diff changeset
  1332
  nsPresContext* presContext = document->GetPresContext();
3790c8adcba31c0a49bda55161777a7992fbfb4a Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 404432
diff changeset
  1333
  if (presContext) {
3790c8adcba31c0a49bda55161777a7992fbfb4a Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 404432
diff changeset
  1334
    presContext->SizeModeChanged(aSizeMode);
285540
9ecc9682c3a35496b18a114b85af871f1d6bffa4 Bug 1104916 - Implement CSS media query display-mode. r=cam
Brendan Dahl <bdahl@mozilla.com>
parents: 285474
diff changeset
  1335
  }
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1336
  return IPC_OK();
285540
9ecc9682c3a35496b18a114b85af871f1d6bffa4 Bug 1104916 - Implement CSS media query display-mode. r=cam
Brendan Dahl <bdahl@mozilla.com>
parents: 285474
diff changeset
  1337
}
9ecc9682c3a35496b18a114b85af871f1d6bffa4 Bug 1104916 - Implement CSS media query display-mode. r=cam
Brendan Dahl <bdahl@mozilla.com>
parents: 285474
diff changeset
  1338
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1339
mozilla::ipc::IPCResult BrowserChild::RecvChildToParentMatrix(
514172
6f78a9af0ca1948154d72305219493b1bed02540 Bug 1615609 - Rename nsRefreshDriver::IntersectionObservationAdded. r=hiro
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 514150
diff changeset
  1340
    const Maybe<gfx::Matrix4x4>& aMatrix,
6f78a9af0ca1948154d72305219493b1bed02540 Bug 1615609 - Rename nsRefreshDriver::IntersectionObservationAdded. r=hiro
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 514150
diff changeset
  1341
    const ScreenRect& aTopLevelViewportVisibleRectInBrowserCoords) {
468524
6e52132e84820d113675c86a68cabf661d603d6d Bug 1532901 - Fix event.screenX and event.screenY inside out-of-process iframes. r=nika
Henri Sivonen <hsivonen@hsivonen.fi>
parents: 468495
diff changeset
  1342
  mChildToParentConversionMatrix =
488996
6b1a0a29644ea5c1c041e24b0e2f2bda1e0a4710 Bug 1565525 - Modify MatrixMessage to carry a Maybe<Matrix>, so that a transform can be cleared by sending Nothing. r=hsivonen
Botond Ballo <botond@mozilla.com>
parents: 488964
diff changeset
  1343
      LayoutDeviceToLayoutDeviceMatrix4x4::FromUnknownMatrix(aMatrix);
513178
3985a60a75b372ea14a845dbb2f5d9a0d53dc4e5 Bug 1599795 - Rename BrowserChild::GetRemoteDocumentRect to GetTopLevelViewportVisibleRectInBrowserCoords. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513177
diff changeset
  1344
  mTopLevelViewportVisibleRectInBrowserCoords =
3985a60a75b372ea14a845dbb2f5d9a0d53dc4e5 Bug 1599795 - Rename BrowserChild::GetRemoteDocumentRect to GetTopLevelViewportVisibleRectInBrowserCoords. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513177
diff changeset
  1345
      aTopLevelViewportVisibleRectInBrowserCoords;
513177
ed241344c39143250c9aa766d1ef3bfb56514e1e Bug 1599795 - Trigger UpdateIntersectionObservation in response to APZ changes. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513146
diff changeset
  1346
514172
6f78a9af0ca1948154d72305219493b1bed02540 Bug 1615609 - Rename nsRefreshDriver::IntersectionObservationAdded. r=hiro
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 514150
diff changeset
  1347
  // Trigger an intersection observation update since ancestor viewports
6f78a9af0ca1948154d72305219493b1bed02540 Bug 1615609 - Rename nsRefreshDriver::IntersectionObservationAdded. r=hiro
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 514150
diff changeset
  1348
  // changed.
513177
ed241344c39143250c9aa766d1ef3bfb56514e1e Bug 1599795 - Trigger UpdateIntersectionObservation in response to APZ changes. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513146
diff changeset
  1349
  if (RefPtr<Document> toplevelDoc = GetTopLevelDocument()) {
514172
6f78a9af0ca1948154d72305219493b1bed02540 Bug 1615609 - Rename nsRefreshDriver::IntersectionObservationAdded. r=hiro
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 514150
diff changeset
  1350
    if (nsPresContext* pc = toplevelDoc->GetPresContext()) {
6f78a9af0ca1948154d72305219493b1bed02540 Bug 1615609 - Rename nsRefreshDriver::IntersectionObservationAdded. r=hiro
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 514150
diff changeset
  1351
      pc->RefreshDriver()->EnsureIntersectionObservationsUpdateHappens();
513177
ed241344c39143250c9aa766d1ef3bfb56514e1e Bug 1599795 - Trigger UpdateIntersectionObservation in response to APZ changes. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513146
diff changeset
  1352
    }
ed241344c39143250c9aa766d1ef3bfb56514e1e Bug 1599795 - Trigger UpdateIntersectionObservation in response to APZ changes. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513146
diff changeset
  1353
  }
ed241344c39143250c9aa766d1ef3bfb56514e1e Bug 1599795 - Trigger UpdateIntersectionObservation in response to APZ changes. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513146
diff changeset
  1354
468524
6e52132e84820d113675c86a68cabf661d603d6d Bug 1532901 - Fix event.screenX and event.screenY inside out-of-process iframes. r=nika
Henri Sivonen <hsivonen@hsivonen.fi>
parents: 468495
diff changeset
  1355
  return IPC_OK();
6e52132e84820d113675c86a68cabf661d603d6d Bug 1532901 - Fix event.screenX and event.screenY inside out-of-process iframes. r=nika
Henri Sivonen <hsivonen@hsivonen.fi>
parents: 468495
diff changeset
  1356
}
6e52132e84820d113675c86a68cabf661d603d6d Bug 1532901 - Fix event.screenX and event.screenY inside out-of-process iframes. r=nika
Henri Sivonen <hsivonen@hsivonen.fi>
parents: 468495
diff changeset
  1357
473565
d77d76d37d4dccf39c12fa81c970088b5388d0f1 Bug 1518919 - Propagate CSS visibility information to descendant documents via IPC call for fission. r=jwatt
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 472824
diff changeset
  1358
mozilla::ipc::IPCResult BrowserChild::RecvSetIsUnderHiddenEmbedderElement(
d77d76d37d4dccf39c12fa81c970088b5388d0f1 Bug 1518919 - Propagate CSS visibility information to descendant documents via IPC call for fission. r=jwatt
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 472824
diff changeset
  1359
    const bool& aIsUnderHiddenEmbedderElement) {
d77d76d37d4dccf39c12fa81c970088b5388d0f1 Bug 1518919 - Propagate CSS visibility information to descendant documents via IPC call for fission. r=jwatt
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 472824
diff changeset
  1360
  if (RefPtr<PresShell> presShell = GetTopLevelPresShell()) {
d77d76d37d4dccf39c12fa81c970088b5388d0f1 Bug 1518919 - Propagate CSS visibility information to descendant documents via IPC call for fission. r=jwatt
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 472824
diff changeset
  1361
    presShell->SetIsUnderHiddenEmbedderElement(aIsUnderHiddenEmbedderElement);
d77d76d37d4dccf39c12fa81c970088b5388d0f1 Bug 1518919 - Propagate CSS visibility information to descendant documents via IPC call for fission. r=jwatt
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 472824
diff changeset
  1362
  }
d77d76d37d4dccf39c12fa81c970088b5388d0f1 Bug 1518919 - Propagate CSS visibility information to descendant documents via IPC call for fission. r=jwatt
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 472824
diff changeset
  1363
  return IPC_OK();
d77d76d37d4dccf39c12fa81c970088b5388d0f1 Bug 1518919 - Propagate CSS visibility information to descendant documents via IPC call for fission. r=jwatt
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 472824
diff changeset
  1364
}
d77d76d37d4dccf39c12fa81c970088b5388d0f1 Bug 1518919 - Propagate CSS visibility information to descendant documents via IPC call for fission. r=jwatt
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 472824
diff changeset
  1365
501887
b79f9f171fb110ee5469a8b6a645da77a44bfde8 Bug 1586144 - Introduce an API to set the dynamic toolbar maximum height in GeckoView. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 501204
diff changeset
  1366
mozilla::ipc::IPCResult BrowserChild::RecvDynamicToolbarMaxHeightChanged(
b79f9f171fb110ee5469a8b6a645da77a44bfde8 Bug 1586144 - Introduce an API to set the dynamic toolbar maximum height in GeckoView. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 501204
diff changeset
  1367
    const ScreenIntCoord& aHeight) {
b79f9f171fb110ee5469a8b6a645da77a44bfde8 Bug 1586144 - Introduce an API to set the dynamic toolbar maximum height in GeckoView. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 501204
diff changeset
  1368
#if defined(MOZ_WIDGET_ANDROID)
b79f9f171fb110ee5469a8b6a645da77a44bfde8 Bug 1586144 - Introduce an API to set the dynamic toolbar maximum height in GeckoView. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 501204
diff changeset
  1369
  mDynamicToolbarMaxHeight = aHeight;
b79f9f171fb110ee5469a8b6a645da77a44bfde8 Bug 1586144 - Introduce an API to set the dynamic toolbar maximum height in GeckoView. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 501204
diff changeset
  1370
b79f9f171fb110ee5469a8b6a645da77a44bfde8 Bug 1586144 - Introduce an API to set the dynamic toolbar maximum height in GeckoView. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 501204
diff changeset
  1371
  RefPtr<Document> document = GetTopLevelDocument();
b79f9f171fb110ee5469a8b6a645da77a44bfde8 Bug 1586144 - Introduce an API to set the dynamic toolbar maximum height in GeckoView. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 501204
diff changeset
  1372
  if (!document) {
b79f9f171fb110ee5469a8b6a645da77a44bfde8 Bug 1586144 - Introduce an API to set the dynamic toolbar maximum height in GeckoView. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 501204
diff changeset
  1373
    return IPC_OK();
b79f9f171fb110ee5469a8b6a645da77a44bfde8 Bug 1586144 - Introduce an API to set the dynamic toolbar maximum height in GeckoView. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 501204
diff changeset
  1374
  }
b79f9f171fb110ee5469a8b6a645da77a44bfde8 Bug 1586144 - Introduce an API to set the dynamic toolbar maximum height in GeckoView. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 501204
diff changeset
  1375
b79f9f171fb110ee5469a8b6a645da77a44bfde8 Bug 1586144 - Introduce an API to set the dynamic toolbar maximum height in GeckoView. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 501204
diff changeset
  1376
  if (RefPtr<nsPresContext> presContext = document->GetPresContext()) {
b79f9f171fb110ee5469a8b6a645da77a44bfde8 Bug 1586144 - Introduce an API to set the dynamic toolbar maximum height in GeckoView. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 501204
diff changeset
  1377
    presContext->SetDynamicToolbarMaxHeight(aHeight);
b79f9f171fb110ee5469a8b6a645da77a44bfde8 Bug 1586144 - Introduce an API to set the dynamic toolbar maximum height in GeckoView. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 501204
diff changeset
  1378
  }
b79f9f171fb110ee5469a8b6a645da77a44bfde8 Bug 1586144 - Introduce an API to set the dynamic toolbar maximum height in GeckoView. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 501204
diff changeset
  1379
#endif
b79f9f171fb110ee5469a8b6a645da77a44bfde8 Bug 1586144 - Introduce an API to set the dynamic toolbar maximum height in GeckoView. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 501204
diff changeset
  1380
  return IPC_OK();
b79f9f171fb110ee5469a8b6a645da77a44bfde8 Bug 1586144 - Introduce an API to set the dynamic toolbar maximum height in GeckoView. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 501204
diff changeset
  1381
}
b79f9f171fb110ee5469a8b6a645da77a44bfde8 Bug 1586144 - Introduce an API to set the dynamic toolbar maximum height in GeckoView. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 501204
diff changeset
  1382
503185
8d6a8573e09b671441e355879c70838f22f5490b Bug 1586986 - Deliver 'fixed-bottom' offset to the top of the pres context on the foreground tab. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 502510
diff changeset
  1383
mozilla::ipc::IPCResult BrowserChild::RecvDynamicToolbarOffsetChanged(
8d6a8573e09b671441e355879c70838f22f5490b Bug 1586986 - Deliver 'fixed-bottom' offset to the top of the pres context on the foreground tab. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 502510
diff changeset
  1384
    const ScreenIntCoord& aOffset) {
8d6a8573e09b671441e355879c70838f22f5490b Bug 1586986 - Deliver 'fixed-bottom' offset to the top of the pres context on the foreground tab. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 502510
diff changeset
  1385
#if defined(MOZ_WIDGET_ANDROID)
8d6a8573e09b671441e355879c70838f22f5490b Bug 1586986 - Deliver 'fixed-bottom' offset to the top of the pres context on the foreground tab. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 502510
diff changeset
  1386
  RefPtr<Document> document = GetTopLevelDocument();
8d6a8573e09b671441e355879c70838f22f5490b Bug 1586986 - Deliver 'fixed-bottom' offset to the top of the pres context on the foreground tab. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 502510
diff changeset
  1387
  if (!document) {
8d6a8573e09b671441e355879c70838f22f5490b Bug 1586986 - Deliver 'fixed-bottom' offset to the top of the pres context on the foreground tab. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 502510
diff changeset
  1388
    return IPC_OK();
8d6a8573e09b671441e355879c70838f22f5490b Bug 1586986 - Deliver 'fixed-bottom' offset to the top of the pres context on the foreground tab. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 502510
diff changeset
  1389
  }
8d6a8573e09b671441e355879c70838f22f5490b Bug 1586986 - Deliver 'fixed-bottom' offset to the top of the pres context on the foreground tab. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 502510
diff changeset
  1390
8d6a8573e09b671441e355879c70838f22f5490b Bug 1586986 - Deliver 'fixed-bottom' offset to the top of the pres context on the foreground tab. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 502510
diff changeset
  1391
  if (nsPresContext* presContext = document->GetPresContext()) {
8d6a8573e09b671441e355879c70838f22f5490b Bug 1586986 - Deliver 'fixed-bottom' offset to the top of the pres context on the foreground tab. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 502510
diff changeset
  1392
    presContext->UpdateDynamicToolbarOffset(aOffset);
8d6a8573e09b671441e355879c70838f22f5490b Bug 1586986 - Deliver 'fixed-bottom' offset to the top of the pres context on the foreground tab. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 502510
diff changeset
  1393
  }
8d6a8573e09b671441e355879c70838f22f5490b Bug 1586986 - Deliver 'fixed-bottom' offset to the top of the pres context on the foreground tab. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 502510
diff changeset
  1394
#endif
8d6a8573e09b671441e355879c70838f22f5490b Bug 1586986 - Deliver 'fixed-bottom' offset to the top of the pres context on the foreground tab. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 502510
diff changeset
  1395
  return IPC_OK();
8d6a8573e09b671441e355879c70838f22f5490b Bug 1586986 - Deliver 'fixed-bottom' offset to the top of the pres context on the foreground tab. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 502510
diff changeset
  1396
}
8d6a8573e09b671441e355879c70838f22f5490b Bug 1586986 - Deliver 'fixed-bottom' offset to the top of the pres context on the foreground tab. r=geckoview-reviewers,tnikkel,snorp
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 502510
diff changeset
  1397
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1398
mozilla::ipc::IPCResult BrowserChild::RecvSuppressDisplayport(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1399
    const bool& aEnabled) {
469386
148e810b01d22b00e254c445dda2f659534103a7 Bug 1542664 - Make TabChild use mozilla::PresShell directly rather than via nsIPresShell r=nika
Masayuki Nakano <masayuki@d-toybox.com>
parents: 469371
diff changeset
  1400
  if (RefPtr<PresShell> presShell = GetTopLevelPresShell()) {
148e810b01d22b00e254c445dda2f659534103a7 Bug 1542664 - Make TabChild use mozilla::PresShell directly rather than via nsIPresShell r=nika
Masayuki Nakano <masayuki@d-toybox.com>
parents: 469371
diff changeset
  1401
    presShell->SuppressDisplayport(aEnabled);
258744
35f538038395489cafccbdfe18f0f86d682d8e9d Bug 1186662 - Part 1: Add SuppressDisplayport painting and use it during tab switch. r=kats,mconley
Benoit Girard <b56girard@gmail.com>
parents: 258322
diff changeset
  1402
  }
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1403
  return IPC_OK();
258744
35f538038395489cafccbdfe18f0f86d682d8e9d Bug 1186662 - Part 1: Add SuppressDisplayport painting and use it during tab switch. r=kats,mconley
Benoit Girard <b56girard@gmail.com>
parents: 258322
diff changeset
  1404
}
35f538038395489cafccbdfe18f0f86d682d8e9d Bug 1186662 - Part 1: Add SuppressDisplayport painting and use it during tab switch. r=kats,mconley
Benoit Girard <b56girard@gmail.com>
parents: 258322
diff changeset
  1405
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1406
void BrowserChild::HandleDoubleTap(const CSSPoint& aPoint,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1407
                                   const Modifiers& aModifiers,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1408
                                   const ScrollableLayerGuid& aGuid) {
515284
4a846dab4279600eb5d640f6fcaf8caf6aaeaf7f Bug 1617565 - Convert additional compile-conditional logging bits to MOZ_LOG. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 514172
diff changeset
  1409
  MOZ_LOG(
4a846dab4279600eb5d640f6fcaf8caf6aaeaf7f Bug 1617565 - Convert additional compile-conditional logging bits to MOZ_LOG. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 514172
diff changeset
  1410
      sApzChildLog, LogLevel::Debug,
550506
67ac8857fac01cc71040fff423bc7c92105728cc Bug 1667656 - Use ostream operator instead of AppendToString for PointTyped. r=mattwoodrow
Kartikaya Gupta <kgupta@mozilla.com>
parents: 550295
diff changeset
  1411
      ("Handling double tap at %s with %p %p\n", ToString(aPoint).c_str(),
515284
4a846dab4279600eb5d640f6fcaf8caf6aaeaf7f Bug 1617565 - Convert additional compile-conditional logging bits to MOZ_LOG. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 514172
diff changeset
  1412
       mBrowserChildMessageManager ? mBrowserChildMessageManager->GetWrapper()
4a846dab4279600eb5d640f6fcaf8caf6aaeaf7f Bug 1617565 - Convert additional compile-conditional logging bits to MOZ_LOG. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 514172
diff changeset
  1413
                                   : nullptr,
4a846dab4279600eb5d640f6fcaf8caf6aaeaf7f Bug 1617565 - Convert additional compile-conditional logging bits to MOZ_LOG. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 514172
diff changeset
  1414
       mBrowserChildMessageManager.get()));
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1415
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1416
  if (!mBrowserChildMessageManager) {
284580
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
  1417
    return;
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
  1418
  }
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
  1419
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
  1420
  // Note: there is nothing to do with the modifiers here, as we are not
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
  1421
  // synthesizing any sort of mouse event.
469386
148e810b01d22b00e254c445dda2f659534103a7 Bug 1542664 - Make TabChild use mozilla::PresShell directly rather than via nsIPresShell r=nika
Masayuki Nakano <masayuki@d-toybox.com>
parents: 469371
diff changeset
  1422
  RefPtr<Document> document = GetTopLevelDocument();
575620
44f195ffc4de336b86e21ab4379e717c2ee7c11c Bug 1702467. Double tap zoom can make us zoom to a part of an element when we could fit the entire element at the same zoom. r=botond
Timothy Nikkel <tnikkel@gmail.com>
parents: 574590
diff changeset
  1423
  ZoomTarget zoomTarget = CalculateRectToZoomTo(document, aPoint);
284580
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
  1424
  // The double-tap can be dispatched by any scroll frame (so |aGuid| could be
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
  1425
  // the guid of any scroll frame), but the zoom-to-rect operation must be
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
  1426
  // performed by the root content scroll frame, so query its identifiers
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
  1427
  // for the SendZoomToRect() call rather than using the ones from |aGuid|.
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
  1428
  uint32_t presShellId;
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
  1429
  ViewID viewId;
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
  1430
  if (APZCCallbackHelper::GetOrCreateScrollIdentifiers(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1431
          document->GetDocumentElement(), &presShellId, &viewId) &&
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1432
      mApzcTreeManager) {
520787
5916b41d10e9c8e6731db02a1611a4b28c1c25ba Bug 1622360 - Remove SLGuidAndRenderRoot and convert remaining uses to ScrollableLayerGuid. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 520370
diff changeset
  1433
    ScrollableLayerGuid guid(mLayersId, presShellId, viewId);
311191
12b61fd41c9947ac45df8789acd711c57d1657f4 Bug 1289650 - Use PAPZCTreeManager in content process instead of PAPZ. r=kats
Ryan Hunt <rhunt@mozilla.com>
parents: 311044
diff changeset
  1434
581812
5141c00e55f9c12d274de4bef2abe21853fe5283 Bug 1713589. If double tap zoom can't find a rect to zoom in to and we are zoomed out then zoom in some small default amount. r=botond
Timothy Nikkel <tnikkel@gmail.com>
parents: 581791
diff changeset
  1435
    mApzcTreeManager->ZoomToRect(guid, zoomTarget, ZOOM_IN_IF_CANT_ZOOM_OUT);
284580
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
  1436
  }
99892
19b28e14df61d51ff1666b1a64ca44a26e093231 Bug 750977: Implement glue code for asynchronous panning/zooming. r=jlebar,roc,vingtetun
Chris Jones <jones.chris.g@gmail.com>
parents: 99867
diff changeset
  1437
}
19b28e14df61d51ff1666b1a64ca44a26e093231 Bug 750977: Implement glue code for asynchronous panning/zooming. r=jlebar,roc,vingtetun
Chris Jones <jones.chris.g@gmail.com>
parents: 99867
diff changeset
  1438
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1439
mozilla::ipc::IPCResult BrowserChild::RecvHandleTap(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1440
    const GeckoContentController::TapType& aType,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1441
    const LayoutDevicePoint& aPoint, const Modifiers& aModifiers,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1442
    const ScrollableLayerGuid& aGuid, const uint64_t& aInputBlockId) {
463352
8c8e2862fd5e6df9fd5279324ecf941960a9a291 Bug 1532725 - Make TabParent::Recv{MouseEvent, HandleTap, ..} a script boundary and hold a strong reference. r=bzbarsky
Ryan Hunt <rhunt@eqrion.net>
parents: 462435
diff changeset
  1443
  // IPDL doesn't hold a strong reference to protocols as they're not required
8c8e2862fd5e6df9fd5279324ecf941960a9a291 Bug 1532725 - Make TabParent::Recv{MouseEvent, HandleTap, ..} a script boundary and hold a strong reference. r=bzbarsky
Ryan Hunt <rhunt@eqrion.net>
parents: 462435
diff changeset
  1444
  // to be refcounted. This function can run script, which may trigger a nested
8c8e2862fd5e6df9fd5279324ecf941960a9a291 Bug 1532725 - Make TabParent::Recv{MouseEvent, HandleTap, ..} a script boundary and hold a strong reference. r=bzbarsky
Ryan Hunt <rhunt@eqrion.net>
parents: 462435
diff changeset
  1445
  // event loop, which may release this, so we hold a strong reference here.
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1446
  RefPtr<BrowserChild> kungFuDeathGrip(this);
469387
34d4432920622d2d2bcdd865cc4ee609a2a8aebf Bug 1542665 - Stop using `const nsCOMPtr<nsIPresShell>&` arguments r=bzbarsky
Masayuki Nakano <masayuki@d-toybox.com>
parents: 469386
diff changeset
  1447
  RefPtr<PresShell> presShell = GetTopLevelPresShell();
307363
3b0313fd4ce642a75a5165180def038e243deb30 Bug 1250024 - Fix touch-tap event coordinate transformations when a fullzoom is applied. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 307008
diff changeset
  1448
  if (!presShell) {
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1449
    return IPC_OK();
307363
3b0313fd4ce642a75a5165180def038e243deb30 Bug 1250024 - Fix touch-tap event coordinate transformations when a fullzoom is applied. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 307008
diff changeset
  1450
  }
3b0313fd4ce642a75a5165180def038e243deb30 Bug 1250024 - Fix touch-tap event coordinate transformations when a fullzoom is applied. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 307008
diff changeset
  1451
  if (!presShell->GetPresContext()) {
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1452
    return IPC_OK();
307363
3b0313fd4ce642a75a5165180def038e243deb30 Bug 1250024 - Fix touch-tap event coordinate transformations when a fullzoom is applied. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 307008
diff changeset
  1453
  }
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1454
  CSSToLayoutDeviceScale scale(
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1455
      presShell->GetPresContext()->CSSToDevPixelScale());
528228
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1456
  CSSPoint point = aPoint / scale;
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1457
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1458
  // Stash the guid in InputAPZContext so that when the visual-to-layout
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1459
  // transform is applied to the event's coordinates, we use the right transform
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1460
  // based on the scroll frame being targeted.
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1461
  // The other values don't really matter.
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1462
  InputAPZContext context(aGuid, aInputBlockId, nsEventStatus_eSentinel);
307363
3b0313fd4ce642a75a5165180def038e243deb30 Bug 1250024 - Fix touch-tap event coordinate transformations when a fullzoom is applied. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 307008
diff changeset
  1463
303720
b8f47976eb5aa814e28278ce5ab71d75b2ff5b57 Bug 1256339 - Collapse the different Handle*Tap functions in GeckoContentController into a single API. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 303623
diff changeset
  1464
  switch (aType) {
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1465
    case GeckoContentController::TapType::eSingleTap:
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1466
      if (mBrowserChildMessageManager) {
472824
7748746bf2feda8edd0cabfdaff88b7faf059ad5 Bug 1548568 - Cleanup to remove unused guid parameter in callback. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 472823
diff changeset
  1467
        mAPZEventState->ProcessSingleTap(point, scale, aModifiers, 1);
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1468
      }
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1469
      break;
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1470
    case GeckoContentController::TapType::eDoubleTap:
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1471
      HandleDoubleTap(point, aModifiers, aGuid);
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1472
      break;
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1473
    case GeckoContentController::TapType::eSecondTap:
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1474
      if (mBrowserChildMessageManager) {
472824
7748746bf2feda8edd0cabfdaff88b7faf059ad5 Bug 1548568 - Cleanup to remove unused guid parameter in callback. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 472823
diff changeset
  1475
        mAPZEventState->ProcessSingleTap(point, scale, aModifiers, 2);
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1476
      }
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1477
      break;
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1478
    case GeckoContentController::TapType::eLongTap:
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1479
      if (mBrowserChildMessageManager) {
463734
19f3dfdf76da0c37c018683808add3d19f192e56 Bug 1534608. MOZ_CAN_RUN_SCRIPT should disallow non-stack refptr arguments. r=emilio
Boris Zbarsky <bzbarsky@mit.edu>
parents: 463353
diff changeset
  1480
        RefPtr<APZEventState> eventState(mAPZEventState);
472824
7748746bf2feda8edd0cabfdaff88b7faf059ad5 Bug 1548568 - Cleanup to remove unused guid parameter in callback. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 472823
diff changeset
  1481
        eventState->ProcessLongTap(presShell, point, scale, aModifiers,
463734
19f3dfdf76da0c37c018683808add3d19f192e56 Bug 1534608. MOZ_CAN_RUN_SCRIPT should disallow non-stack refptr arguments. r=emilio
Boris Zbarsky <bzbarsky@mit.edu>
parents: 463353
diff changeset
  1482
                                   aInputBlockId);
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1483
      }
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1484
      break;
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1485
    case GeckoContentController::TapType::eLongTapUp:
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1486
      if (mBrowserChildMessageManager) {
463734
19f3dfdf76da0c37c018683808add3d19f192e56 Bug 1534608. MOZ_CAN_RUN_SCRIPT should disallow non-stack refptr arguments. r=emilio
Boris Zbarsky <bzbarsky@mit.edu>
parents: 463353
diff changeset
  1487
        RefPtr<APZEventState> eventState(mAPZEventState);
19f3dfdf76da0c37c018683808add3d19f192e56 Bug 1534608. MOZ_CAN_RUN_SCRIPT should disallow non-stack refptr arguments. r=emilio
Boris Zbarsky <bzbarsky@mit.edu>
parents: 463353
diff changeset
  1488
        eventState->ProcessLongTapUp(presShell, point, scale, aModifiers);
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1489
      }
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1490
      break;
112727
f3d9d7b86339cfb6d7eeda53f0811c55997f09bb Bug 796275 - Context menu fires on wrong target out of process. r=cjones
Andrea Marchesini <amarchesini@mozilla.com>
parents: 112665
diff changeset
  1491
  }
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1492
  return IPC_OK();
112727
f3d9d7b86339cfb6d7eeda53f0811c55997f09bb Bug 796275 - Context menu fires on wrong target out of process. r=cjones
Andrea Marchesini <amarchesini@mozilla.com>
parents: 112665
diff changeset
  1493
}
f3d9d7b86339cfb6d7eeda53f0811c55997f09bb Bug 796275 - Context menu fires on wrong target out of process. r=cjones
Andrea Marchesini <amarchesini@mozilla.com>
parents: 112665
diff changeset
  1494
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1495
mozilla::ipc::IPCResult BrowserChild::RecvNormalPriorityHandleTap(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1496
    const GeckoContentController::TapType& aType,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1497
    const LayoutDevicePoint& aPoint, const Modifiers& aModifiers,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1498
    const ScrollableLayerGuid& aGuid, const uint64_t& aInputBlockId) {
463352
8c8e2862fd5e6df9fd5279324ecf941960a9a291 Bug 1532725 - Make TabParent::Recv{MouseEvent, HandleTap, ..} a script boundary and hold a strong reference. r=bzbarsky
Ryan Hunt <rhunt@eqrion.net>
parents: 462435
diff changeset
  1499
  // IPDL doesn't hold a strong reference to protocols as they're not required
8c8e2862fd5e6df9fd5279324ecf941960a9a291 Bug 1532725 - Make TabParent::Recv{MouseEvent, HandleTap, ..} a script boundary and hold a strong reference. r=bzbarsky
Ryan Hunt <rhunt@eqrion.net>
parents: 462435
diff changeset
  1500
  // to be refcounted. This function can run script, which may trigger a nested
8c8e2862fd5e6df9fd5279324ecf941960a9a291 Bug 1532725 - Make TabParent::Recv{MouseEvent, HandleTap, ..} a script boundary and hold a strong reference. r=bzbarsky
Ryan Hunt <rhunt@eqrion.net>
parents: 462435
diff changeset
  1501
  // event loop, which may release this, so we hold a strong reference here.
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1502
  RefPtr<BrowserChild> kungFuDeathGrip(this);
376315
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  1503
  return RecvHandleTap(aType, aPoint, aModifiers, aGuid, aInputBlockId);
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  1504
}
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  1505
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1506
bool BrowserChild::NotifyAPZStateChange(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1507
    const ViewID& aViewId,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1508
    const layers::GeckoContentController::APZStateChange& aChange,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1509
    const int& aArg) {
321029
6fbbd157345fc54d39e3265865c45963df5243fa Bug 1310509 - Call NotifyAsyncPanZoomStarted/Stopped on document containing current scrolling content. r=kats
Ting-Yu Lin <tlin@mozilla.com>
parents: 320777
diff changeset
  1510
  mAPZEventState->ProcessAPZStateChange(aViewId, aChange, aArg);
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1511
  if (aChange ==
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1512
      layers::GeckoContentController::APZStateChange::eTransformEnd) {
249868
23b7cd26fa9a83c997d69759148fbdc44338a57d Bug 1139155 - Add a mechanism to know when the APZ is done processing. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 249767
diff changeset
  1513
    // This is used by tests to determine when the APZ is done doing whatever
23b7cd26fa9a83c997d69759148fbdc44338a57d Bug 1139155 - Add a mechanism to know when the APZ is done processing. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 249767
diff changeset
  1514
    // it's doing. XXX generify this as needed when writing additional tests.
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1515
    nsCOMPtr<nsIObserverService> observerService =
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1516
        mozilla::services::GetObserverService();
285606
f1595343603de627341a05ea0c2876d6caffa88a Bug 1249943 - Make test_basic_pan work on Fennec and Linux as well. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 285540
diff changeset
  1517
    observerService->NotifyObservers(nullptr, "APZ:TransformEnd", nullptr);
249868
23b7cd26fa9a83c997d69759148fbdc44338a57d Bug 1139155 - Add a mechanism to know when the APZ is done processing. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 249767
diff changeset
  1518
  }
159662
c25e3a7c7e2ffbc2cc34e7bd9d305213e5bf23c1 Bug 814435 - Prevent scrollbars from fading out while user is scrolling. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 159415
diff changeset
  1519
  return true;
c25e3a7c7e2ffbc2cc34e7bd9d305213e5bf23c1 Bug 814435 - Prevent scrollbars from fading out while user is scrolling. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 159415
diff changeset
  1520
}
c25e3a7c7e2ffbc2cc34e7bd9d305213e5bf23c1 Bug 814435 - Prevent scrollbars from fading out while user is scrolling. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 159415
diff changeset
  1521
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1522
void BrowserChild::StartScrollbarDrag(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1523
    const layers::AsyncDragMetrics& aDragMetrics) {
520787
5916b41d10e9c8e6731db02a1611a4b28c1c25ba Bug 1622360 - Remove SLGuidAndRenderRoot and convert remaining uses to ScrollableLayerGuid. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 520370
diff changeset
  1524
  ScrollableLayerGuid guid(mLayersId, aDragMetrics.mPresShellId,
5916b41d10e9c8e6731db02a1611a4b28c1c25ba Bug 1622360 - Remove SLGuidAndRenderRoot and convert remaining uses to ScrollableLayerGuid. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 520370
diff changeset
  1525
                           aDragMetrics.mViewId);
311191
12b61fd41c9947ac45df8789acd711c57d1657f4 Bug 1289650 - Use PAPZCTreeManager in content process instead of PAPZ. r=kats
Ryan Hunt <rhunt@mozilla.com>
parents: 311044
diff changeset
  1526
12b61fd41c9947ac45df8789acd711c57d1657f4 Bug 1289650 - Use PAPZCTreeManager in content process instead of PAPZ. r=kats
Ryan Hunt <rhunt@mozilla.com>
parents: 311044
diff changeset
  1527
  if (mApzcTreeManager) {
12b61fd41c9947ac45df8789acd711c57d1657f4 Bug 1289650 - Use PAPZCTreeManager in content process instead of PAPZ. r=kats
Ryan Hunt <rhunt@mozilla.com>
parents: 311044
diff changeset
  1528
    mApzcTreeManager->StartScrollbarDrag(guid, aDragMetrics);
284580
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
  1529
  }
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
  1530
}
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
  1531
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1532
void BrowserChild::ZoomToRect(const uint32_t& aPresShellId,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1533
                              const ScrollableLayerGuid::ViewID& aViewId,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1534
                              const CSSRect& aRect, const uint32_t& aFlags) {
520787
5916b41d10e9c8e6731db02a1611a4b28c1c25ba Bug 1622360 - Remove SLGuidAndRenderRoot and convert remaining uses to ScrollableLayerGuid. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 520370
diff changeset
  1535
  ScrollableLayerGuid guid(mLayersId, aPresShellId, aViewId);
311191
12b61fd41c9947ac45df8789acd711c57d1657f4 Bug 1289650 - Use PAPZCTreeManager in content process instead of PAPZ. r=kats
Ryan Hunt <rhunt@mozilla.com>
parents: 311044
diff changeset
  1536
12b61fd41c9947ac45df8789acd711c57d1657f4 Bug 1289650 - Use PAPZCTreeManager in content process instead of PAPZ. r=kats
Ryan Hunt <rhunt@mozilla.com>
parents: 311044
diff changeset
  1537
  if (mApzcTreeManager) {
575620
44f195ffc4de336b86e21ab4379e717c2ee7c11c Bug 1702467. Double tap zoom can make us zoom to a part of an element when we could fit the entire element at the same zoom. r=botond
Timothy Nikkel <tnikkel@gmail.com>
parents: 574590
diff changeset
  1538
    mApzcTreeManager->ZoomToRect(guid, ZoomTarget{aRect, Nothing()}, aFlags);
284580
9e71a38057d1e37194c6a367d7df337e7088acca Bug 1020199 - Make sure APZ works with nested oop iframe. r=kats, r=dvander.
Peter Van der Beken <peterv@propagandism.org>
parents: 284023
diff changeset
  1539
  }
249767
ee20787262f2519dc10b44467a5bb328dc471ba9 Bug 1163832 - Add an API to flush pending APZ repaint requests and dispatch a notification upon completion. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 249622
diff changeset
  1540
}
ee20787262f2519dc10b44467a5bb328dc471ba9 Bug 1163832 - Add an API to flush pending APZ repaint requests and dispatch a notification upon completion. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 249622
diff changeset
  1541
557404
d66f803de161691a662e8095677ea048213ad660 Bug 1618386 - Add action ids to filter out stale active browsing context updates. r=nika
Henri Sivonen <hsivonen@hsivonen.fi>
parents: 556874
diff changeset
  1542
mozilla::ipc::IPCResult BrowserChild::RecvActivate(uint64_t aActionId) {
430498
82e7fc39892683ac5e2ba5c4609816a934f6cb5f Bug 1480645 - Remove nsIWebBrowserFocus; r=nika
Kyle Machulis <kyle@nonpolynomial.com>
parents: 430497
diff changeset
  1543
  MOZ_ASSERT(mWebBrowser);
557404
d66f803de161691a662e8095677ea048213ad660 Bug 1618386 - Add action ids to filter out stale active browsing context updates. r=nika
Henri Sivonen <hsivonen@hsivonen.fi>
parents: 556874
diff changeset
  1544
  mWebBrowser->FocusActivate(aActionId);
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1545
  return IPC_OK();
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
  1546
}
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
  1547
557404
d66f803de161691a662e8095677ea048213ad660 Bug 1618386 - Add action ids to filter out stale active browsing context updates. r=nika
Henri Sivonen <hsivonen@hsivonen.fi>
parents: 556874
diff changeset
  1548
mozilla::ipc::IPCResult BrowserChild::RecvDeactivate(uint64_t aActionId) {
430498
82e7fc39892683ac5e2ba5c4609816a934f6cb5f Bug 1480645 - Remove nsIWebBrowserFocus; r=nika
Kyle Machulis <kyle@nonpolynomial.com>
parents: 430497
diff changeset
  1549
  MOZ_ASSERT(mWebBrowser);
557404
d66f803de161691a662e8095677ea048213ad660 Bug 1618386 - Add action ids to filter out stale active browsing context updates. r=nika
Henri Sivonen <hsivonen@hsivonen.fi>
parents: 556874
diff changeset
  1550
  mWebBrowser->FocusDeactivate(aActionId);
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1551
  return IPC_OK();
72542
238b9a9479ed090b134d80ee8984855ec4746129 Bug 583976. Part 1 - Add focus manager support for focus activation/deactivation in remote content. r=enn,smaug
Felipe Gomes <felipc@gmail.com>
parents: 72453
diff changeset
  1552
}
238b9a9479ed090b134d80ee8984855ec4746129 Bug 583976. Part 1 - Add focus manager support for focus activation/deactivation in remote content. r=enn,smaug
Felipe Gomes <felipc@gmail.com>
parents: 72453
diff changeset
  1553
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1554
mozilla::ipc::IPCResult BrowserChild::RecvSetKeyboardIndicators(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1555
    const UIStateChangeType& aShowFocusRings) {
301335
435c691340a05280302417b3ba150a317cc16c08 Bug 1174798, propagate keyboard indicator state down to child processes, r=smaug
Neil Deakin <neil@mozilla.com>
parents: 300956
diff changeset
  1556
  nsCOMPtr<nsPIDOMWindowOuter> window = do_GetInterface(WebNavigation());
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1557
  NS_ENSURE_TRUE(window, IPC_OK());
476652
8d2dcfb9a9b65fefb90354d5208eef08df60a96d Bug 1545499 - Remove dead code for threading accelerator state. r=NeilDeakin
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 476591
diff changeset
  1558
  window->SetKeyboardIndicators(aShowFocusRings);
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1559
  return IPC_OK();
301335
435c691340a05280302417b3ba150a317cc16c08 Bug 1174798, propagate keyboard indicator state down to child processes, r=smaug
Neil Deakin <neil@mozilla.com>
parents: 300956
diff changeset
  1560
}
435c691340a05280302417b3ba150a317cc16c08 Bug 1174798, propagate keyboard indicator state down to child processes, r=smaug
Neil Deakin <neil@mozilla.com>
parents: 300956
diff changeset
  1561
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1562
mozilla::ipc::IPCResult BrowserChild::RecvStopIMEStateManagement() {
250928
455ce99715135d6d37785682120296f613330c83 Bug 1053053 part.2 Notify child process's IMEStateManager of that it should stop manageing IME state r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 250659
diff changeset
  1563
  IMEStateManager::StopIMEStateManagement();
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1564
  return IPC_OK();
250928
455ce99715135d6d37785682120296f613330c83 Bug 1053053 part.2 Notify child process's IMEStateManager of that it should stop manageing IME state r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 250659
diff changeset
  1565
}
455ce99715135d6d37785682120296f613330c83 Bug 1053053 part.2 Notify child process's IMEStateManager of that it should stop manageing IME state r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 250659
diff changeset
  1566
589325
51c88c4d63a974fda2ec2b11ee92b25bcede6884 Bug 1511231 - Part 4: s/ProcessPendingColaescedTouchData/ProcessPendingCoalescedTouchData/; r=smaug
Edgar Chen <echen@mozilla.com>
parents: 589324
diff changeset
  1567
void BrowserChild::ProcessPendingCoalescedTouchData() {
582091
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1568
  MOZ_ASSERT(StaticPrefs::dom_events_coalesce_touchmove());
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1569
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1570
  if (mCoalescedTouchData.IsEmpty()) {
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1571
    return;
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1572
  }
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1573
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1574
  if (mCoalescedTouchMoveEventFlusher) {
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1575
    mCoalescedTouchMoveEventFlusher->RemoveObserver();
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1576
  }
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1577
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1578
  UniquePtr<WidgetTouchEvent> touchMoveEvent =
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1579
      mCoalescedTouchData.TakeCoalescedEvent();
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1580
  Unused << RecvRealTouchEvent(*touchMoveEvent,
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1581
                               mCoalescedTouchData.GetScrollableLayerGuid(),
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1582
                               mCoalescedTouchData.GetInputBlockId(),
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1583
                               mCoalescedTouchData.GetApzResponse());
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1584
}
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1585
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1586
void BrowserChild::ProcessPendingCoalescedMouseDataAndDispatchEvents() {
387138
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1587
  if (!mCoalesceMouseMoveEvents || !mCoalescedMouseEventFlusher) {
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1588
    // We don't enable mouse coalescing or we are destroying BrowserChild.
375979
64edaaccec973cd3b0d2aeea1f565d65e8614ea3 Bug 1361067 Part2: Coalesce mouse move events to be once per refresh cycle. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375978
diff changeset
  1589
    return;
64edaaccec973cd3b0d2aeea1f565d65e8614ea3 Bug 1361067 Part2: Coalesce mouse move events to be once per refresh cycle. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375978
diff changeset
  1590
  }
387138
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1591
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1592
  // We may reentry the event loop and push more data to
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1593
  // mToBeDispatchedMouseData while dispatching an event.
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1594
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1595
  // We may have some pending coalesced data while dispatch an event and reentry
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1596
  // the event loop. In that case we don't have chance to consume the remainding
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1597
  // pending data until we get new mouse events. Get some helps from
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1598
  // mCoalescedMouseEventFlusher to trigger it.
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1599
  mCoalescedMouseEventFlusher->StartObserver();
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1600
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1601
  while (mToBeDispatchedMouseData.GetSize() > 0) {
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1602
    UniquePtr<CoalescedMouseData> data(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1603
        static_cast<CoalescedMouseData*>(mToBeDispatchedMouseData.PopFront()));
387138
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1604
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1605
    UniquePtr<WidgetMouseEvent> event = data->TakeCoalescedEvent();
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1606
    if (event) {
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1607
      // Dispatch the pending events. Using HandleRealMouseButtonEvent
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1608
      // to bypass the coalesce handling in RecvRealMouseMoveEvent. Can't use
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1609
      // RecvRealMouseButtonEvent because we may also put some mouse events
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1610
      // other than mousemove.
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1611
      HandleRealMouseButtonEvent(*event, data->GetScrollableLayerGuid(),
387138
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1612
                                 data->GetInputBlockId());
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1613
    }
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1614
  }
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1615
  // mCoalescedMouseEventFlusher may be destroyed when reentrying the event
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1616
  // loop.
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1617
  if (mCoalescedMouseEventFlusher) {
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1618
    mCoalescedMouseEventFlusher->RemoveObserver();
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1619
  }
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1620
}
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1621
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1622
LayoutDeviceToLayoutDeviceMatrix4x4
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1623
BrowserChild::GetChildToParentConversionMatrix() const {
468524
6e52132e84820d113675c86a68cabf661d603d6d Bug 1532901 - Fix event.screenX and event.screenY inside out-of-process iframes. r=nika
Henri Sivonen <hsivonen@hsivonen.fi>
parents: 468495
diff changeset
  1624
  if (mChildToParentConversionMatrix) {
6e52132e84820d113675c86a68cabf661d603d6d Bug 1532901 - Fix event.screenX and event.screenY inside out-of-process iframes. r=nika
Henri Sivonen <hsivonen@hsivonen.fi>
parents: 468495
diff changeset
  1625
    return *mChildToParentConversionMatrix;
6e52132e84820d113675c86a68cabf661d603d6d Bug 1532901 - Fix event.screenX and event.screenY inside out-of-process iframes. r=nika
Henri Sivonen <hsivonen@hsivonen.fi>
parents: 468495
diff changeset
  1626
  }
6e52132e84820d113675c86a68cabf661d603d6d Bug 1532901 - Fix event.screenX and event.screenY inside out-of-process iframes. r=nika
Henri Sivonen <hsivonen@hsivonen.fi>
parents: 468495
diff changeset
  1627
  LayoutDevicePoint offset(GetChromeOffset());
6e52132e84820d113675c86a68cabf661d603d6d Bug 1532901 - Fix event.screenX and event.screenY inside out-of-process iframes. r=nika
Henri Sivonen <hsivonen@hsivonen.fi>
parents: 468495
diff changeset
  1628
  return LayoutDeviceToLayoutDeviceMatrix4x4::Translation(offset);
6e52132e84820d113675c86a68cabf661d603d6d Bug 1532901 - Fix event.screenX and event.screenY inside out-of-process iframes. r=nika
Henri Sivonen <hsivonen@hsivonen.fi>
parents: 468495
diff changeset
  1629
}
6e52132e84820d113675c86a68cabf661d603d6d Bug 1532901 - Fix event.screenX and event.screenY inside out-of-process iframes. r=nika
Henri Sivonen <hsivonen@hsivonen.fi>
parents: 468495
diff changeset
  1630
582552
5e0d86ff0ab99b77261b55c48ee5e09e66e6915a Bug 1706853 - Make GetFrameVisibleRectOnScreen return Nothing() if we haven't received OOP iframe's transformed rectangle from APZ. r=botond
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 582442
diff changeset
  1631
Maybe<ScreenRect> BrowserChild::GetTopLevelViewportVisibleRectInBrowserCoords()
5e0d86ff0ab99b77261b55c48ee5e09e66e6915a Bug 1706853 - Make GetFrameVisibleRectOnScreen return Nothing() if we haven't received OOP iframe's transformed rectangle from APZ. r=botond
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 582442
diff changeset
  1632
    const {
5e0d86ff0ab99b77261b55c48ee5e09e66e6915a Bug 1706853 - Make GetFrameVisibleRectOnScreen return Nothing() if we haven't received OOP iframe's transformed rectangle from APZ. r=botond
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 582442
diff changeset
  1633
  if (!mChildToParentConversionMatrix) {
5e0d86ff0ab99b77261b55c48ee5e09e66e6915a Bug 1706853 - Make GetFrameVisibleRectOnScreen return Nothing() if we haven't received OOP iframe's transformed rectangle from APZ. r=botond
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 582442
diff changeset
  1634
    return Nothing();
5e0d86ff0ab99b77261b55c48ee5e09e66e6915a Bug 1706853 - Make GetFrameVisibleRectOnScreen return Nothing() if we haven't received OOP iframe's transformed rectangle from APZ. r=botond
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 582442
diff changeset
  1635
  }
5e0d86ff0ab99b77261b55c48ee5e09e66e6915a Bug 1706853 - Make GetFrameVisibleRectOnScreen return Nothing() if we haven't received OOP iframe's transformed rectangle from APZ. r=botond
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 582442
diff changeset
  1636
  return Some(mTopLevelViewportVisibleRectInBrowserCoords);
492764
fb5bcfad4822475c2b90d76d7165674ae259d570 Bug 1541705 - Notify areas of out-of-process subframes from the compositor to the corresponding process. r=botond
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 492234
diff changeset
  1637
}
fb5bcfad4822475c2b90d76d7165674ae259d570 Bug 1541705 - Notify areas of out-of-process subframes from the compositor to the corresponding process. r=botond
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 492234
diff changeset
  1638
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1639
void BrowserChild::FlushAllCoalescedMouseData() {
387138
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1640
  MOZ_ASSERT(mCoalesceMouseMoveEvents);
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1641
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1642
  // Move all entries from mCoalescedMouseData to mToBeDispatchedMouseData.
572904
da46b77569234b55d782fcfd17cdd18291fb160e Bug 1184468 - Use nsBaseHashtable::Values. r=xpcom-reviewers,nika
Simon Giesecke <sgiesecke@mozilla.com>
parents: 572098
diff changeset
  1643
  for (const auto& data : mCoalescedMouseData.Values()) {
385267
5e0a1d82ef670c537b7b5c60ba0f2606a9f04ef7 Bug 1404273 - [Pointer Event] Coalescing mousemove for different pointers. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 384034
diff changeset
  1644
    if (!data || data->IsEmpty()) {
5e0a1d82ef670c537b7b5c60ba0f2606a9f04ef7 Bug 1404273 - [Pointer Event] Coalescing mousemove for different pointers. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 384034
diff changeset
  1645
      continue;
5e0a1d82ef670c537b7b5c60ba0f2606a9f04ef7 Bug 1404273 - [Pointer Event] Coalescing mousemove for different pointers. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 384034
diff changeset
  1646
    }
387138
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1647
    UniquePtr<CoalescedMouseData> dispatchData =
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1648
        MakeUnique<CoalescedMouseData>();
387138
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1649
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1650
    dispatchData->RetrieveDataFrom(*data);
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1651
    mToBeDispatchedMouseData.Push(dispatchData.release());
385267
5e0a1d82ef670c537b7b5c60ba0f2606a9f04ef7 Bug 1404273 - [Pointer Event] Coalescing mousemove for different pointers. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 384034
diff changeset
  1652
  }
387138
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1653
  mCoalescedMouseData.Clear();
375979
64edaaccec973cd3b0d2aeea1f565d65e8614ea3 Bug 1361067 Part2: Coalesce mouse move events to be once per refresh cycle. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375978
diff changeset
  1654
}
64edaaccec973cd3b0d2aeea1f565d65e8614ea3 Bug 1361067 Part2: Coalesce mouse move events to be once per refresh cycle. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375978
diff changeset
  1655
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1656
mozilla::ipc::IPCResult BrowserChild::RecvRealMouseMoveEvent(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1657
    const WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1658
    const uint64_t& aInputBlockId) {
377972
19078068a74b4cca3dc74c15b2ab5c23f659342c Bug 1395361: Avoid using mCoalescedMouseEventFlusher after it's destroyed. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 377644
diff changeset
  1659
  if (mCoalesceMouseMoveEvents && mCoalescedMouseEventFlusher) {
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1660
    CoalescedMouseData* data =
568202
c4e0b884258db89e4ae28e5157e739d2ec051511 Bug 1691913 - Rename nsClassHashtable::LookupOrAdd to GetOrInsertNew. r=xpcom-reviewers,nika
Simon Giesecke <sgiesecke@mozilla.com>
parents: 567693
diff changeset
  1661
        mCoalescedMouseData.GetOrInsertNew(aEvent.pointerId);
438949
29e74e1fa224acfc5985c07eca25542a6a79895c Bug 1494978 - Use LookupOrAdd to simplify hashtable lookup in mouse event coalescence; r=smaug
Edgar Chen <echen@mozilla.com>
parents: 438931
diff changeset
  1662
    MOZ_ASSERT(data);
385267
5e0a1d82ef670c537b7b5c60ba0f2606a9f04ef7 Bug 1404273 - [Pointer Event] Coalescing mousemove for different pointers. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 384034
diff changeset
  1663
    if (data->CanCoalesce(aEvent, aGuid, aInputBlockId)) {
5e0a1d82ef670c537b7b5c60ba0f2606a9f04ef7 Bug 1404273 - [Pointer Event] Coalescing mousemove for different pointers. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 384034
diff changeset
  1664
      data->Coalesce(aEvent, aGuid, aInputBlockId);
375979
64edaaccec973cd3b0d2aeea1f565d65e8614ea3 Bug 1361067 Part2: Coalesce mouse move events to be once per refresh cycle. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375978
diff changeset
  1665
      mCoalescedMouseEventFlusher->StartObserver();
64edaaccec973cd3b0d2aeea1f565d65e8614ea3 Bug 1361067 Part2: Coalesce mouse move events to be once per refresh cycle. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375978
diff changeset
  1666
      return IPC_OK();
64edaaccec973cd3b0d2aeea1f565d65e8614ea3 Bug 1361067 Part2: Coalesce mouse move events to be once per refresh cycle. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375978
diff changeset
  1667
    }
387138
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1668
    // Can't coalesce current mousemove event. Put the coalesced mousemove data
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1669
    // with the same pointer id to mToBeDispatchedMouseData, coalesce the
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1670
    // current one, and process all pending data in mToBeDispatchedMouseData.
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1671
    UniquePtr<CoalescedMouseData> dispatchData =
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1672
        MakeUnique<CoalescedMouseData>();
387138
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1673
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1674
    dispatchData->RetrieveDataFrom(*data);
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1675
    mToBeDispatchedMouseData.Push(dispatchData.release());
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1676
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1677
    // Put new data to replace the old one in the hash table.
567693
a16a6660e684698e3fc69e88c1946a3a0b6a7adf Bug 1692880 - Make Put accept DataType instead of wrapping UserDataType. r=xpcom-reviewers,necko-reviewers,nika
Simon Giesecke <sgiesecke@mozilla.com>
parents: 567595
diff changeset
  1678
    CoalescedMouseData* newData =
a16a6660e684698e3fc69e88c1946a3a0b6a7adf Bug 1692880 - Make Put accept DataType instead of wrapping UserDataType. r=xpcom-reviewers,necko-reviewers,nika
Simon Giesecke <sgiesecke@mozilla.com>
parents: 567595
diff changeset
  1679
        mCoalescedMouseData
568882
ff46eda9cc314eb255bb17fccb9c052c1d2107a0 Bug 1691913 - Rename nsBaseHashtable::Put to InsertOrUpdate. r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
Simon Giesecke <sgiesecke@mozilla.com>
parents: 568832
diff changeset
  1680
            .InsertOrUpdate(aEvent.pointerId, MakeUnique<CoalescedMouseData>())
567693
a16a6660e684698e3fc69e88c1946a3a0b6a7adf Bug 1692880 - Make Put accept DataType instead of wrapping UserDataType. r=xpcom-reviewers,necko-reviewers,nika
Simon Giesecke <sgiesecke@mozilla.com>
parents: 567595
diff changeset
  1681
            .get();
387138
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1682
    newData->Coalesce(aEvent, aGuid, aInputBlockId);
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1683
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1684
    // Dispatch all pending mouse events.
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1685
    ProcessPendingCoalescedMouseDataAndDispatchEvents();
375979
64edaaccec973cd3b0d2aeea1f565d65e8614ea3 Bug 1361067 Part2: Coalesce mouse move events to be once per refresh cycle. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375978
diff changeset
  1686
    mCoalescedMouseEventFlusher->StartObserver();
64edaaccec973cd3b0d2aeea1f565d65e8614ea3 Bug 1361067 Part2: Coalesce mouse move events to be once per refresh cycle. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375978
diff changeset
  1687
  } else if (!RecvRealMouseButtonEvent(aEvent, aGuid, aInputBlockId)) {
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1688
    return IPC_FAIL_NO_REASON(this);
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1689
  }
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1690
  return IPC_OK();
229277
5931982fa54bd923b75658713367a2ef06b1bd51 Bug 1130051 - Compress mousemove IPDL messages. r=kats
David Parks <davidp99@gmail.com>
parents: 228909
diff changeset
  1691
}
5931982fa54bd923b75658713367a2ef06b1bd51 Bug 1130051 - Compress mousemove IPDL messages. r=kats
David Parks <davidp99@gmail.com>
parents: 228909
diff changeset
  1692
560288
608c0563811f2640958b6e5535f7ec90633e030b Bug 1681667 - Make `BrowserChild` never coalesce/discard synthesized mouse events for test r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 560146
diff changeset
  1693
mozilla::ipc::IPCResult BrowserChild::RecvRealMouseMoveEventForTests(
608c0563811f2640958b6e5535f7ec90633e030b Bug 1681667 - Make `BrowserChild` never coalesce/discard synthesized mouse events for test r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 560146
diff changeset
  1694
    const WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
608c0563811f2640958b6e5535f7ec90633e030b Bug 1681667 - Make `BrowserChild` never coalesce/discard synthesized mouse events for test r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 560146
diff changeset
  1695
    const uint64_t& aInputBlockId) {
608c0563811f2640958b6e5535f7ec90633e030b Bug 1681667 - Make `BrowserChild` never coalesce/discard synthesized mouse events for test r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 560146
diff changeset
  1696
  return RecvRealMouseMoveEvent(aEvent, aGuid, aInputBlockId);
608c0563811f2640958b6e5535f7ec90633e030b Bug 1681667 - Make `BrowserChild` never coalesce/discard synthesized mouse events for test r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 560146
diff changeset
  1697
}
608c0563811f2640958b6e5535f7ec90633e030b Bug 1681667 - Make `BrowserChild` never coalesce/discard synthesized mouse events for test r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 560146
diff changeset
  1698
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1699
mozilla::ipc::IPCResult BrowserChild::RecvNormalPriorityRealMouseMoveEvent(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1700
    const WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1701
    const uint64_t& aInputBlockId) {
376315
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  1702
  return RecvRealMouseMoveEvent(aEvent, aGuid, aInputBlockId);
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  1703
}
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  1704
560288
608c0563811f2640958b6e5535f7ec90633e030b Bug 1681667 - Make `BrowserChild` never coalesce/discard synthesized mouse events for test r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 560146
diff changeset
  1705
mozilla::ipc::IPCResult
608c0563811f2640958b6e5535f7ec90633e030b Bug 1681667 - Make `BrowserChild` never coalesce/discard synthesized mouse events for test r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 560146
diff changeset
  1706
BrowserChild::RecvNormalPriorityRealMouseMoveEventForTests(
608c0563811f2640958b6e5535f7ec90633e030b Bug 1681667 - Make `BrowserChild` never coalesce/discard synthesized mouse events for test r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 560146
diff changeset
  1707
    const WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
608c0563811f2640958b6e5535f7ec90633e030b Bug 1681667 - Make `BrowserChild` never coalesce/discard synthesized mouse events for test r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 560146
diff changeset
  1708
    const uint64_t& aInputBlockId) {
608c0563811f2640958b6e5535f7ec90633e030b Bug 1681667 - Make `BrowserChild` never coalesce/discard synthesized mouse events for test r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 560146
diff changeset
  1709
  return RecvRealMouseMoveEvent(aEvent, aGuid, aInputBlockId);
608c0563811f2640958b6e5535f7ec90633e030b Bug 1681667 - Make `BrowserChild` never coalesce/discard synthesized mouse events for test r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 560146
diff changeset
  1710
}
608c0563811f2640958b6e5535f7ec90633e030b Bug 1681667 - Make `BrowserChild` never coalesce/discard synthesized mouse events for test r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 560146
diff changeset
  1711
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1712
mozilla::ipc::IPCResult BrowserChild::RecvSynthMouseMoveEvent(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1713
    const WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1714
    const uint64_t& aInputBlockId) {
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1715
  if (!RecvRealMouseButtonEvent(aEvent, aGuid, aInputBlockId)) {
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1716
    return IPC_FAIL_NO_REASON(this);
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1717
  }
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1718
  return IPC_OK();
259762
28f8a5676d8aec4d679074c357c60778d558b620 Bug 1177018 - Send mouse move events generated via nsIPresShell::SynthesizeMouseMove() to the child process through a different IPDL message than real mouse move events. r=smaug
Botond Ballo <botond@mozilla.com>
parents: 259576
diff changeset
  1719
}
28f8a5676d8aec4d679074c357c60778d558b620 Bug 1177018 - Send mouse move events generated via nsIPresShell::SynthesizeMouseMove() to the child process through a different IPDL message than real mouse move events. r=smaug
Botond Ballo <botond@mozilla.com>
parents: 259576
diff changeset
  1720
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1721
mozilla::ipc::IPCResult BrowserChild::RecvNormalPrioritySynthMouseMoveEvent(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1722
    const WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1723
    const uint64_t& aInputBlockId) {
376315
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  1724
  return RecvSynthMouseMoveEvent(aEvent, aGuid, aInputBlockId);
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  1725
}
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  1726
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1727
mozilla::ipc::IPCResult BrowserChild::RecvRealMouseButtonEvent(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1728
    const WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1729
    const uint64_t& aInputBlockId) {
387138
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1730
  if (mCoalesceMouseMoveEvents && mCoalescedMouseEventFlusher &&
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1731
      aEvent.mMessage != eMouseMove) {
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1732
    // When receiving a mouse event other than mousemove, we have to dispatch
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1733
    // all coalesced events before it. However, we can't dispatch all pending
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1734
    // coalesced events directly because we may reentry the event loop while
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1735
    // dispatching. To make sure we won't dispatch disorder events, we move all
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1736
    // coalesced mousemove events and current event to a deque to dispatch them.
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1737
    // When reentrying the event loop and dispatching more events, we put new
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1738
    // events in the end of the nsQueue and dispatch events from the beginning.
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1739
    FlushAllCoalescedMouseData();
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1740
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1741
    UniquePtr<CoalescedMouseData> dispatchData =
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1742
        MakeUnique<CoalescedMouseData>();
387138
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1743
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1744
    dispatchData->Coalesce(aEvent, aGuid, aInputBlockId);
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1745
    mToBeDispatchedMouseData.Push(dispatchData.release());
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1746
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1747
    ProcessPendingCoalescedMouseDataAndDispatchEvents();
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1748
    return IPC_OK();
375979
64edaaccec973cd3b0d2aeea1f565d65e8614ea3 Bug 1361067 Part2: Coalesce mouse move events to be once per refresh cycle. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375978
diff changeset
  1749
  }
387138
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1750
  HandleRealMouseButtonEvent(aEvent, aGuid, aInputBlockId);
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1751
  return IPC_OK();
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1752
}
9b9629c68575006ca1bded6c279040ecb05802e8 Bug 1407700 Part2: Handle the case to re-entry event loop for mousemove coalescing. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 387137
diff changeset
  1753
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1754
void BrowserChild::HandleRealMouseButtonEvent(const WidgetMouseEvent& aEvent,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1755
                                              const ScrollableLayerGuid& aGuid,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1756
                                              const uint64_t& aInputBlockId) {
528228
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1757
  WidgetMouseEvent localEvent(aEvent);
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1758
  localEvent.mWidget = mPuppetWidget;
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1759
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1760
  // We need one InputAPZContext here to propagate |aGuid| to places in
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1761
  // SendSetTargetAPZCNotification() which apply the visual-to-layout transform,
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1762
  // and another below to propagate the |postLayerization| flag (whose value
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1763
  // we don't know until SendSetTargetAPZCNotification() returns) into
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1764
  // the event dispatch code.
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1765
  InputAPZContext context1(aGuid, aInputBlockId, nsEventStatus_eSentinel);
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1766
302104
4e6b1c5bc5bf71c84ce30d37cf4944b4c2d3f761 Bug 1280805 - Don't assert in the valid case where the child process gets an event with an input block id but no mHandledByAPZ. r=rbarker
Kartikaya Gupta <kgupta@mozilla.com>
parents: 301335
diff changeset
  1767
  // Mouse events like eMouseEnterIntoWidget, that are created in the parent
4e6b1c5bc5bf71c84ce30d37cf4944b4c2d3f761 Bug 1280805 - Don't assert in the valid case where the child process gets an event with an input block id but no mHandledByAPZ. r=rbarker
Kartikaya Gupta <kgupta@mozilla.com>
parents: 301335
diff changeset
  1768
  // process EventStateManager code, have an input block id which they get from
4e6b1c5bc5bf71c84ce30d37cf4944b4c2d3f761 Bug 1280805 - Don't assert in the valid case where the child process gets an event with an input block id but no mHandledByAPZ. r=rbarker
Kartikaya Gupta <kgupta@mozilla.com>
parents: 301335
diff changeset
  1769
  // the InputAPZContext in the parent process stack. However, they did not
4e6b1c5bc5bf71c84ce30d37cf4944b4c2d3f761 Bug 1280805 - Don't assert in the valid case where the child process gets an event with an input block id but no mHandledByAPZ. r=rbarker
Kartikaya Gupta <kgupta@mozilla.com>
parents: 301335
diff changeset
  1770
  // actually go through the APZ code and so their mHandledByAPZ flag is false.
330263
16f6a42267a0064e5c6c9226b32bbbbc95e81d82 Bug 1332195 part.2 Fix some nits of event handlers in TabChild, TabParent and PuppetWidget r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 330262
diff changeset
  1771
  // Since thos events didn't go through APZ, we don't need to send
16f6a42267a0064e5c6c9226b32bbbbc95e81d82 Bug 1332195 part.2 Fix some nits of event handlers in TabChild, TabParent and PuppetWidget r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 330262
diff changeset
  1772
  // notifications for them.
575979
472077cb1e3827a16c4939ec5cb2dc207629b409 Bug 1699844 - Make promiseDocumentFlushed handle presshell destruction correctly. r=smaug,botond
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 575620
diff changeset
  1773
  RefPtr<DisplayportSetListener> postLayerization;
528228
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1774
  if (aInputBlockId && localEvent.mFlags.mHandledByAPZ) {
469386
148e810b01d22b00e254c445dda2f659534103a7 Bug 1542664 - Make TabChild use mozilla::PresShell directly rather than via nsIPresShell r=nika
Masayuki Nakano <masayuki@d-toybox.com>
parents: 469371
diff changeset
  1775
    nsCOMPtr<Document> document(GetTopLevelDocument());
422758
1deb0d199abe9460a4882e855d14e8fb700774a5 Bug 1468545 - Ensure the drag metrics gets to APZ before the target APZC for inactive scrollframes. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 422756
diff changeset
  1776
    postLayerization = APZCCallbackHelper::SendSetTargetAPZCNotification(
528228
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1777
        mPuppetWidget, document, localEvent, aGuid.mLayersId, aInputBlockId);
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1778
  }
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1779
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1780
  InputAPZContext context2(aGuid, aInputBlockId, nsEventStatus_eSentinel,
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1781
                           postLayerization != nullptr);
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1782
370467
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  1783
  DispatchWidgetEventViaAPZ(localEvent);
270493
0095ee7c07a34c940a30836704b5dff9107be686 Bug 1211612 - Add DragInputBlock for async scrollbars. r=kats
Benoit Girard <b56girard@gmail.com>
parents: 270453
diff changeset
  1784
528228
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1785
  if (aInputBlockId && localEvent.mFlags.mHandledByAPZ) {
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1786
    mAPZEventState->ProcessMouseEvent(localEvent, aInputBlockId);
270493
0095ee7c07a34c940a30836704b5dff9107be686 Bug 1211612 - Add DragInputBlock for async scrollbars. r=kats
Benoit Girard <b56girard@gmail.com>
parents: 270453
diff changeset
  1787
  }
422758
1deb0d199abe9460a4882e855d14e8fb700774a5 Bug 1468545 - Ensure the drag metrics gets to APZ before the target APZC for inactive scrollframes. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 422756
diff changeset
  1788
1deb0d199abe9460a4882e855d14e8fb700774a5 Bug 1468545 - Ensure the drag metrics gets to APZ before the target APZC for inactive scrollframes. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 422756
diff changeset
  1789
  // Do this after the DispatchWidgetEventViaAPZ call above, so that if the
1deb0d199abe9460a4882e855d14e8fb700774a5 Bug 1468545 - Ensure the drag metrics gets to APZ before the target APZC for inactive scrollframes. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 422756
diff changeset
  1790
  // mouse event triggered a post-refresh AsyncDragMetrics message to be sent
1deb0d199abe9460a4882e855d14e8fb700774a5 Bug 1468545 - Ensure the drag metrics gets to APZ before the target APZC for inactive scrollframes. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 422756
diff changeset
  1791
  // to APZ (from scrollbar dragging in nsSliderFrame), then that will reach
1deb0d199abe9460a4882e855d14e8fb700774a5 Bug 1468545 - Ensure the drag metrics gets to APZ before the target APZC for inactive scrollframes. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 422756
diff changeset
  1792
  // APZ before the SetTargetAPZC message. This ensures the drag input block
1deb0d199abe9460a4882e855d14e8fb700774a5 Bug 1468545 - Ensure the drag metrics gets to APZ before the target APZC for inactive scrollframes. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 422756
diff changeset
  1793
  // gets the drag metrics before handling the input events.
575979
472077cb1e3827a16c4939ec5cb2dc207629b409 Bug 1699844 - Make promiseDocumentFlushed handle presshell destruction correctly. r=smaug,botond
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 575620
diff changeset
  1794
  if (postLayerization) {
584317
9d23f785e755345c0c52242adc071d8bd7101e46 Bug 1716481 - Improve ManagedPostRefreshObserver. r=smaug
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584311
diff changeset
  1795
    postLayerization->Register();
422758
1deb0d199abe9460a4882e855d14e8fb700774a5 Bug 1468545 - Ensure the drag metrics gets to APZ before the target APZC for inactive scrollframes. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 422756
diff changeset
  1796
  }
72544
fb5ad0e555fdda4bff68c09cc878ca7dafbe00dd Bug 583976. Part 3 - Automatically forward mouse and key input events to out-of-process content, and add cursor support in PuppetWidget. r=smaug,stechz
Felipe Gomes <felipc@gmail.com>
parents: 72542
diff changeset
  1797
}
fb5ad0e555fdda4bff68c09cc878ca7dafbe00dd Bug 583976. Part 3 - Automatically forward mouse and key input events to out-of-process content, and add cursor support in PuppetWidget. r=smaug,stechz
Felipe Gomes <felipc@gmail.com>
parents: 72542
diff changeset
  1798
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1799
mozilla::ipc::IPCResult BrowserChild::RecvNormalPriorityRealMouseButtonEvent(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1800
    const WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1801
    const uint64_t& aInputBlockId) {
376315
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  1802
  return RecvRealMouseButtonEvent(aEvent, aGuid, aInputBlockId);
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  1803
}
347236
1b47b363a447fbe4906b4ba71369d1c6f8c32795 Bug 1337963 - Coalesce wheel events in the content process so that long wheel event handlers don't hang the content process. r=smaug
Stone Shih <sshih@mozilla.com>
parents: 347235
diff changeset
  1804
569013
f8fa05f30e8017354e109606db529cf48488f17a Bug 1694229 - Separate Enter/Exit Widget Events from Mouse Button events r=smaug
Doug Thayer <dothayer@mozilla.com>
parents: 568882
diff changeset
  1805
mozilla::ipc::IPCResult BrowserChild::RecvRealMouseEnterExitWidgetEvent(
f8fa05f30e8017354e109606db529cf48488f17a Bug 1694229 - Separate Enter/Exit Widget Events from Mouse Button events r=smaug
Doug Thayer <dothayer@mozilla.com>
parents: 568882
diff changeset
  1806
    const WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
f8fa05f30e8017354e109606db529cf48488f17a Bug 1694229 - Separate Enter/Exit Widget Events from Mouse Button events r=smaug
Doug Thayer <dothayer@mozilla.com>
parents: 568882
diff changeset
  1807
    const uint64_t& aInputBlockId) {
f8fa05f30e8017354e109606db529cf48488f17a Bug 1694229 - Separate Enter/Exit Widget Events from Mouse Button events r=smaug
Doug Thayer <dothayer@mozilla.com>
parents: 568882
diff changeset
  1808
  return RecvRealMouseButtonEvent(aEvent, aGuid, aInputBlockId);
f8fa05f30e8017354e109606db529cf48488f17a Bug 1694229 - Separate Enter/Exit Widget Events from Mouse Button events r=smaug
Doug Thayer <dothayer@mozilla.com>
parents: 568882
diff changeset
  1809
}
f8fa05f30e8017354e109606db529cf48488f17a Bug 1694229 - Separate Enter/Exit Widget Events from Mouse Button events r=smaug
Doug Thayer <dothayer@mozilla.com>
parents: 568882
diff changeset
  1810
f8fa05f30e8017354e109606db529cf48488f17a Bug 1694229 - Separate Enter/Exit Widget Events from Mouse Button events r=smaug
Doug Thayer <dothayer@mozilla.com>
parents: 568882
diff changeset
  1811
mozilla::ipc::IPCResult
f8fa05f30e8017354e109606db529cf48488f17a Bug 1694229 - Separate Enter/Exit Widget Events from Mouse Button events r=smaug
Doug Thayer <dothayer@mozilla.com>
parents: 568882
diff changeset
  1812
BrowserChild::RecvNormalPriorityRealMouseEnterExitWidgetEvent(
f8fa05f30e8017354e109606db529cf48488f17a Bug 1694229 - Separate Enter/Exit Widget Events from Mouse Button events r=smaug
Doug Thayer <dothayer@mozilla.com>
parents: 568882
diff changeset
  1813
    const WidgetMouseEvent& aEvent, const ScrollableLayerGuid& aGuid,
f8fa05f30e8017354e109606db529cf48488f17a Bug 1694229 - Separate Enter/Exit Widget Events from Mouse Button events r=smaug
Doug Thayer <dothayer@mozilla.com>
parents: 568882
diff changeset
  1814
    const uint64_t& aInputBlockId) {
f8fa05f30e8017354e109606db529cf48488f17a Bug 1694229 - Separate Enter/Exit Widget Events from Mouse Button events r=smaug
Doug Thayer <dothayer@mozilla.com>
parents: 568882
diff changeset
  1815
  return RecvRealMouseButtonEvent(aEvent, aGuid, aInputBlockId);
f8fa05f30e8017354e109606db529cf48488f17a Bug 1694229 - Separate Enter/Exit Widget Events from Mouse Button events r=smaug
Doug Thayer <dothayer@mozilla.com>
parents: 568882
diff changeset
  1816
}
f8fa05f30e8017354e109606db529cf48488f17a Bug 1694229 - Separate Enter/Exit Widget Events from Mouse Button events r=smaug
Doug Thayer <dothayer@mozilla.com>
parents: 568882
diff changeset
  1817
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1818
nsEventStatus BrowserChild::DispatchWidgetEventViaAPZ(WidgetGUIEvent& aEvent) {
370467
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  1819
  aEvent.ResetWaitingReplyFromRemoteProcessState();
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  1820
  return APZCCallbackHelper::DispatchWidgetEvent(aEvent);
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  1821
}
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  1822
581791
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1823
void BrowserChild::DispatchCoalescedWheelEvent() {
387137
78041b59b1a19f5ba9653bcc7b750059ce858fb3 Bug 1407700 Part1: Revise CoalescedInputData interfaces. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 386153
diff changeset
  1824
  UniquePtr<WidgetWheelEvent> wheelEvent =
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1825
      mCoalescedWheelData.TakeCoalescedEvent();
347236
1b47b363a447fbe4906b4ba71369d1c6f8c32795 Bug 1337963 - Coalesce wheel events in the content process so that long wheel event handlers don't hang the content process. r=smaug
Stone Shih <sshih@mozilla.com>
parents: 347235
diff changeset
  1826
  MOZ_ASSERT(wheelEvent);
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1827
  DispatchWheelEvent(*wheelEvent, mCoalescedWheelData.GetScrollableLayerGuid(),
347236
1b47b363a447fbe4906b4ba71369d1c6f8c32795 Bug 1337963 - Coalesce wheel events in the content process so that long wheel event handlers don't hang the content process. r=smaug
Stone Shih <sshih@mozilla.com>
parents: 347235
diff changeset
  1828
                     mCoalescedWheelData.GetInputBlockId());
1b47b363a447fbe4906b4ba71369d1c6f8c32795 Bug 1337963 - Coalesce wheel events in the content process so that long wheel event handlers don't hang the content process. r=smaug
Stone Shih <sshih@mozilla.com>
parents: 347235
diff changeset
  1829
}
1b47b363a447fbe4906b4ba71369d1c6f8c32795 Bug 1337963 - Coalesce wheel events in the content process so that long wheel event handlers don't hang the content process. r=smaug
Stone Shih <sshih@mozilla.com>
parents: 347235
diff changeset
  1830
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1831
void BrowserChild::DispatchWheelEvent(const WidgetWheelEvent& aEvent,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1832
                                      const ScrollableLayerGuid& aGuid,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1833
                                      const uint64_t& aInputBlockId) {
347236
1b47b363a447fbe4906b4ba71369d1c6f8c32795 Bug 1337963 - Coalesce wheel events in the content process so that long wheel event handlers don't hang the content process. r=smaug
Stone Shih <sshih@mozilla.com>
parents: 347235
diff changeset
  1834
  WidgetWheelEvent localEvent(aEvent);
302104
4e6b1c5bc5bf71c84ce30d37cf4944b4c2d3f761 Bug 1280805 - Don't assert in the valid case where the child process gets an event with an input block id but no mHandledByAPZ. r=rbarker
Kartikaya Gupta <kgupta@mozilla.com>
parents: 301335
diff changeset
  1835
  if (aInputBlockId && aEvent.mFlags.mHandledByAPZ) {
469386
148e810b01d22b00e254c445dda2f659534103a7 Bug 1542664 - Make TabChild use mozilla::PresShell directly rather than via nsIPresShell r=nika
Masayuki Nakano <masayuki@d-toybox.com>
parents: 469371
diff changeset
  1836
    nsCOMPtr<Document> document(GetTopLevelDocument());
575979
472077cb1e3827a16c4939ec5cb2dc207629b409 Bug 1699844 - Make promiseDocumentFlushed handle presshell destruction correctly. r=smaug,botond
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 575620
diff changeset
  1837
    RefPtr<DisplayportSetListener> postLayerization =
422758
1deb0d199abe9460a4882e855d14e8fb700774a5 Bug 1468545 - Ensure the drag metrics gets to APZ before the target APZC for inactive scrollframes. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 422756
diff changeset
  1838
        APZCCallbackHelper::SendSetTargetAPZCNotification(
472823
a51bea90b88626322cbee00108436736ad09f024 Bug 1548568 - Cleanup to stop passing around a guid when we only need a layers id. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 472788
diff changeset
  1839
            mPuppetWidget, document, aEvent, aGuid.mLayersId, aInputBlockId);
575979
472077cb1e3827a16c4939ec5cb2dc207629b409 Bug 1699844 - Make promiseDocumentFlushed handle presshell destruction correctly. r=smaug,botond
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 575620
diff changeset
  1840
    if (postLayerization) {
584317
9d23f785e755345c0c52242adc071d8bd7101e46 Bug 1716481 - Improve ManagedPostRefreshObserver. r=smaug
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584311
diff changeset
  1841
      postLayerization->Register();
422758
1deb0d199abe9460a4882e855d14e8fb700774a5 Bug 1468545 - Ensure the drag metrics gets to APZ before the target APZC for inactive scrollframes. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 422756
diff changeset
  1842
    }
218843
5493ccef57ca405f9d9ee3956ea80d693dbcf2d3 Add support for mouse wheel transactions. (bug 1013432 part 6, r=kats)
David Anderson <danderson@mozilla.com>
parents: 218840
diff changeset
  1843
  }
5493ccef57ca405f9d9ee3956ea80d693dbcf2d3 Add support for mouse wheel transactions. (bug 1013432 part 6, r=kats)
David Anderson <danderson@mozilla.com>
parents: 218840
diff changeset
  1844
293579
5ac6c8d1fc28d8f35ec6a680a140057f399c30cd Bug 1259657 Rename WidgetGUIEvent::widget to WidgetGUIEvent::mWidget r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 293411
diff changeset
  1845
  localEvent.mWidget = mPuppetWidget;
528228
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1846
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1847
  // Stash the guid in InputAPZContext so that when the visual-to-layout
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1848
  // transform is applied to the event's coordinates, we use the right transform
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1849
  // based on the scroll frame being targeted.
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1850
  // The other values don't really matter.
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1851
  InputAPZContext context(aGuid, aInputBlockId, nsEventStatus_eSentinel);
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1852
370467
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  1853
  DispatchWidgetEventViaAPZ(localEvent);
288177
f5bc4a98a12cf1166a6c9607faedfdd269f127b3 Bug 1242690 - Ensure that mouse events have the callback transform applied. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 287956
diff changeset
  1854
f5bc4a98a12cf1166a6c9607faedfdd269f127b3 Bug 1242690 - Ensure that mouse events have the callback transform applied. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 287956
diff changeset
  1855
  if (localEvent.mCanTriggerSwipe) {
f5bc4a98a12cf1166a6c9607faedfdd269f127b3 Bug 1242690 - Ensure that mouse events have the callback transform applied. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 287956
diff changeset
  1856
    SendRespondStartSwipeEvent(aInputBlockId, localEvent.TriggersSwipe());
275084
ffb07ca7200e86d6f476ca99b4f324e1aeae5fac Bug 1221913 - Make swiping work correctly in e10s mode even if APZ is off. r=kats
Markus Stange <mstange@themasta.com>
parents: 272817
diff changeset
  1857
  }
ffb07ca7200e86d6f476ca99b4f324e1aeae5fac Bug 1221913 - Make swiping work correctly in e10s mode even if APZ is off. r=kats
Markus Stange <mstange@themasta.com>
parents: 272817
diff changeset
  1858
302104
4e6b1c5bc5bf71c84ce30d37cf4944b4c2d3f761 Bug 1280805 - Don't assert in the valid case where the child process gets an event with an input block id but no mHandledByAPZ. r=rbarker
Kartikaya Gupta <kgupta@mozilla.com>
parents: 301335
diff changeset
  1859
  if (aInputBlockId && aEvent.mFlags.mHandledByAPZ) {
472824
7748746bf2feda8edd0cabfdaff88b7faf059ad5 Bug 1548568 - Cleanup to remove unused guid parameter in callback. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 472823
diff changeset
  1860
    mAPZEventState->ProcessWheelEvent(localEvent, aInputBlockId);
218843
5493ccef57ca405f9d9ee3956ea80d693dbcf2d3 Add support for mouse wheel transactions. (bug 1013432 part 6, r=kats)
David Anderson <danderson@mozilla.com>
parents: 218840
diff changeset
  1861
  }
347236
1b47b363a447fbe4906b4ba71369d1c6f8c32795 Bug 1337963 - Coalesce wheel events in the content process so that long wheel event handlers don't hang the content process. r=smaug
Stone Shih <sshih@mozilla.com>
parents: 347235
diff changeset
  1862
}
1b47b363a447fbe4906b4ba71369d1c6f8c32795 Bug 1337963 - Coalesce wheel events in the content process so that long wheel event handlers don't hang the content process. r=smaug
Stone Shih <sshih@mozilla.com>
parents: 347235
diff changeset
  1863
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1864
mozilla::ipc::IPCResult BrowserChild::RecvMouseWheelEvent(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1865
    const WidgetWheelEvent& aEvent, const ScrollableLayerGuid& aGuid,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1866
    const uint64_t& aInputBlockId) {
347236
1b47b363a447fbe4906b4ba71369d1c6f8c32795 Bug 1337963 - Coalesce wheel events in the content process so that long wheel event handlers don't hang the content process. r=smaug
Stone Shih <sshih@mozilla.com>
parents: 347235
diff changeset
  1867
  bool isNextWheelEvent = false;
581791
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1868
  // We only coalesce the current event when
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1869
  // 1. It's eWheel (we don't coalesce eOperationStart and eWheelOperationEnd)
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1870
  // 2. It has same attributes as the coalesced wheel event which is not yet
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1871
  //    fired.
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1872
  if (aEvent.mMessage == eWheel) {
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1873
    GetIPCChannel()->PeekMessages(
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1874
        [&isNextWheelEvent](const IPC::Message& aMsg) -> bool {
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1875
          if (aMsg.type() == mozilla::dom::PBrowser::Msg_MouseWheelEvent__ID) {
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1876
            isNextWheelEvent = true;
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1877
          }
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1878
          return false;  // Stop peeking.
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1879
        });
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1880
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1881
    if (!mCoalescedWheelData.IsEmpty() &&
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1882
        !mCoalescedWheelData.CanCoalesce(aEvent, aGuid, aInputBlockId)) {
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1883
      DispatchCoalescedWheelEvent();
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1884
      MOZ_ASSERT(mCoalescedWheelData.IsEmpty());
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1885
    }
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1886
    mCoalescedWheelData.Coalesce(aEvent, aGuid, aInputBlockId);
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1887
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1888
    MOZ_ASSERT(!mCoalescedWheelData.IsEmpty());
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1889
    // If the next event isn't a wheel event, make sure we dispatch.
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1890
    if (!isNextWheelEvent) {
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1891
      DispatchCoalescedWheelEvent();
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1892
    }
347236
1b47b363a447fbe4906b4ba71369d1c6f8c32795 Bug 1337963 - Coalesce wheel events in the content process so that long wheel event handlers don't hang the content process. r=smaug
Stone Shih <sshih@mozilla.com>
parents: 347235
diff changeset
  1893
  } else {
1b47b363a447fbe4906b4ba71369d1c6f8c32795 Bug 1337963 - Coalesce wheel events in the content process so that long wheel event handlers don't hang the content process. r=smaug
Stone Shih <sshih@mozilla.com>
parents: 347235
diff changeset
  1894
    DispatchWheelEvent(aEvent, aGuid, aInputBlockId);
1b47b363a447fbe4906b4ba71369d1c6f8c32795 Bug 1337963 - Coalesce wheel events in the content process so that long wheel event handlers don't hang the content process. r=smaug
Stone Shih <sshih@mozilla.com>
parents: 347235
diff changeset
  1895
  }
581791
fe220954fea7c6fd6305a970b34a3890ed43a423 Bug 1712726 - Part 1: Coalesce mouse wheel events whenever possible. r=smaug
Bas Schouten <bschouten@mozilla.com>
parents: 581780
diff changeset
  1896
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1897
  return IPC_OK();
102055
61d8207c4fa3b31c9823661980daa47136ebf8eb Bug 719320 part.1 Add DOM3 WheelEvent r=smaug, sr=jst
Masayuki Nakano <masayuki@d-toybox.com>
parents: 101926
diff changeset
  1898
}
61d8207c4fa3b31c9823661980daa47136ebf8eb Bug 719320 part.1 Add DOM3 WheelEvent r=smaug, sr=jst
Masayuki Nakano <masayuki@d-toybox.com>
parents: 101926
diff changeset
  1899
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1900
mozilla::ipc::IPCResult BrowserChild::RecvNormalPriorityMouseWheelEvent(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1901
    const WidgetWheelEvent& aEvent, const ScrollableLayerGuid& aGuid,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1902
    const uint64_t& aInputBlockId) {
376315
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  1903
  return RecvMouseWheelEvent(aEvent, aGuid, aInputBlockId);
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  1904
}
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  1905
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1906
mozilla::ipc::IPCResult BrowserChild::RecvRealTouchEvent(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1907
    const WidgetTouchEvent& aEvent, const ScrollableLayerGuid& aGuid,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1908
    const uint64_t& aInputBlockId, const nsEventStatus& aApzResponse) {
515284
4a846dab4279600eb5d640f6fcaf8caf6aaeaf7f Bug 1617565 - Convert additional compile-conditional logging bits to MOZ_LOG. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 514172
diff changeset
  1909
  MOZ_LOG(sApzChildLog, LogLevel::Debug,
4a846dab4279600eb5d640f6fcaf8caf6aaeaf7f Bug 1617565 - Convert additional compile-conditional logging bits to MOZ_LOG. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 514172
diff changeset
  1910
          ("Receiving touch event of type %d\n", aEvent.mMessage));
205005
519d2fba6cfe52a7b689d7e177b8a2f3bc4773f7 Bug 1066185 - Add some more logging in TabChild.cpp. r=smaug
Kartikaya Gupta <kgupta@mozilla.com>
parents: 204252
diff changeset
  1911
582442
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1912
  if (StaticPrefs::dom_events_coalesce_touchmove()) {
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1913
    if (aEvent.mMessage == eTouchEnd || aEvent.mMessage == eTouchStart) {
589325
51c88c4d63a974fda2ec2b11ee92b25bcede6884 Bug 1511231 - Part 4: s/ProcessPendingColaescedTouchData/ProcessPendingCoalescedTouchData/; r=smaug
Edgar Chen <echen@mozilla.com>
parents: 589324
diff changeset
  1914
      ProcessPendingCoalescedTouchData();
582442
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1915
    }
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1916
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1917
    if (aEvent.mMessage != eTouchMove) {
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1918
      sConsecutiveTouchMoveCount = 0;
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1919
    }
582091
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1920
  }
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1921
148957
fe2419c32ee75250a3342c08040c462cd5fb2ccc Bug 920377 part.13 Get rid of nsTouchEvent r=roc
Masayuki Nakano <masayuki@d-toybox.com>
parents: 148651
diff changeset
  1922
  WidgetTouchEvent localEvent(aEvent);
293579
5ac6c8d1fc28d8f35ec6a680a140057f399c30cd Bug 1259657 Rename WidgetGUIEvent::widget to WidgetGUIEvent::mWidget r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 293411
diff changeset
  1923
  localEvent.mWidget = mPuppetWidget;
228798
5669834a94543c7d12fc21939276a2e4fdab2d82 Bug 1127066 - Extract a helper to apply the APZ callback transform to a touch event. r=kats
Botond Ballo <botond@mozilla.com>
parents: 228797
diff changeset
  1924
528228
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1925
  // Stash the guid in InputAPZContext so that when the visual-to-layout
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1926
  // transform is applied to the event's coordinates, we use the right transform
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1927
  // based on the scroll frame being targeted.
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1928
  // The other values don't really matter.
ff865d99f67efd46d08e6c78e8f4c5a5f1bd3db3 Bug 1556556 - Remove applications of the visual-to-layout transform at the process boundary (and equivalent places for non-e10s). r=kats
Botond Ballo <botond@mozilla.com>
parents: 526903
diff changeset
  1929
  InputAPZContext context(aGuid, aInputBlockId, aApzResponse);
228798
5669834a94543c7d12fc21939276a2e4fdab2d82 Bug 1127066 - Extract a helper to apply the APZ callback transform to a touch event. r=kats
Botond Ballo <botond@mozilla.com>
parents: 228797
diff changeset
  1930
548036
ca7ab0e42f54fc527ed266c155a2a3724da17490 Bug 1648491 - Have the main thread double-check APZ's consumable state. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 547789
diff changeset
  1931
  nsTArray<TouchBehaviorFlags> allowedTouchBehaviors;
262345
a92cec9902d70d52289ee2205b3f5f925c332e3c Bug 895274 part.241 Rename NS_TOUCH_START to eTouchStart r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 262150
diff changeset
  1932
  if (localEvent.mMessage == eTouchStart && AsyncPanZoomEnabled()) {
469386
148e810b01d22b00e254c445dda2f659534103a7 Bug 1542664 - Make TabChild use mozilla::PresShell directly rather than via nsIPresShell r=nika
Masayuki Nakano <masayuki@d-toybox.com>
parents: 469371
diff changeset
  1933
    nsCOMPtr<Document> document = GetTopLevelDocument();
478637
1091aed2035c378a1f70111dd1bab19c7a566847 Bug 1490044 - Move all prefs used in WebIDL to StaticPrefs. r=bzbarsky
Peter Van der Beken <peterv@propagandism.org>
parents: 477553
diff changeset
  1934
    if (StaticPrefs::layout_css_touch_action_enabled()) {
548036
ca7ab0e42f54fc527ed266c155a2a3724da17490 Bug 1648491 - Have the main thread double-check APZ's consumable state. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 547789
diff changeset
  1935
      allowedTouchBehaviors =
ca7ab0e42f54fc527ed266c155a2a3724da17490 Bug 1648491 - Have the main thread double-check APZ's consumable state. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 547789
diff changeset
  1936
          APZCCallbackHelper::SendSetAllowedTouchBehaviorNotification(
ca7ab0e42f54fc527ed266c155a2a3724da17490 Bug 1648491 - Have the main thread double-check APZ's consumable state. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 547789
diff changeset
  1937
              mPuppetWidget, document, localEvent, aInputBlockId,
ca7ab0e42f54fc527ed266c155a2a3724da17490 Bug 1648491 - Have the main thread double-check APZ's consumable state. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 547789
diff changeset
  1938
              mSetAllowedTouchBehaviorCallback);
234458
01abf38a6a4db728f2603395fcbc2edffca1cc45 Bug 1122090 - Send the allowed behaviour notification to APZ for touch blocks when touch-action is enabled. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 234391
diff changeset
  1939
    }
575979
472077cb1e3827a16c4939ec5cb2dc207629b409 Bug 1699844 - Make promiseDocumentFlushed handle presshell destruction correctly. r=smaug,botond
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 575620
diff changeset
  1940
    RefPtr<DisplayportSetListener> postLayerization =
422758
1deb0d199abe9460a4882e855d14e8fb700774a5 Bug 1468545 - Ensure the drag metrics gets to APZ before the target APZC for inactive scrollframes. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 422756
diff changeset
  1941
        APZCCallbackHelper::SendSetTargetAPZCNotification(
473998
1274c074caef1fb327fad2d59bda256e5029e5e2 Bug 1550930 part 3. Stop using [array] for nsIDroppedLinkHandler.dropLinks. r=NeilDeakin
Boris Zbarsky <bzbarsky@mit.edu>
parents: 473810
diff changeset
  1942
            mPuppetWidget, document, localEvent, aGuid.mLayersId,
1274c074caef1fb327fad2d59bda256e5029e5e2 Bug 1550930 part 3. Stop using [array] for nsIDroppedLinkHandler.dropLinks. r=NeilDeakin
Boris Zbarsky <bzbarsky@mit.edu>
parents: 473810
diff changeset
  1943
            aInputBlockId);
575979
472077cb1e3827a16c4939ec5cb2dc207629b409 Bug 1699844 - Make promiseDocumentFlushed handle presshell destruction correctly. r=smaug,botond
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 575620
diff changeset
  1944
    if (postLayerization) {
584317
9d23f785e755345c0c52242adc071d8bd7101e46 Bug 1716481 - Improve ManagedPostRefreshObserver. r=smaug
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584311
diff changeset
  1945
      postLayerization->Register();
422758
1deb0d199abe9460a4882e855d14e8fb700774a5 Bug 1468545 - Ensure the drag metrics gets to APZ before the target APZC for inactive scrollframes. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 422756
diff changeset
  1946
    }
228798
5669834a94543c7d12fc21939276a2e4fdab2d82 Bug 1127066 - Extract a helper to apply the APZ callback transform to a touch event. r=kats
Botond Ballo <botond@mozilla.com>
parents: 228797
diff changeset
  1947
  }
5669834a94543c7d12fc21939276a2e4fdab2d82 Bug 1127066 - Extract a helper to apply the APZ callback transform to a touch event. r=kats
Botond Ballo <botond@mozilla.com>
parents: 228797
diff changeset
  1948
216989
e3c088f81361d4c67e54ae06cb86ef22999fe9ff Bug 918288 - Add code to TabChild to dispatch the SetTargetAPZC notification. r=roc,botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 216945
diff changeset
  1949
  // Dispatch event to content (potentially a long-running operation)
370467
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  1950
  nsEventStatus status = DispatchWidgetEventViaAPZ(localEvent);
103015
746eb3e15dec03fb1e3b133b9d57b0e9de8f2fb5 Bug 775447: Let touch-event listeners cancel async pan/zoom r=cjones
Doug Sherk <dsherk2@mozilla.com>
parents: 102632
diff changeset
  1951
247190
a509c974aa1f07e07b650c18c4dbc91a1e84336b Use widgets for APZ checks, rather than gfxPrefs. (bug 1162064, r=kats,mstange)
David Anderson <danderson@mozilla.com>
parents: 246551
diff changeset
  1952
  if (!AsyncPanZoomEnabled()) {
270528
e03e6330f54b119213d0d16524e2e1e7f5ed41ca Bug 1219898 - Remove legacy handling of touch events for non-APZ e10s platforms. r=smaug
Kartikaya Gupta <kgupta@mozilla.com>
parents: 270525
diff changeset
  1953
    // We shouldn't have any e10s platforms that have touch events enabled
e03e6330f54b119213d0d16524e2e1e7f5ed41ca Bug 1219898 - Remove legacy handling of touch events for non-APZ e10s platforms. r=smaug
Kartikaya Gupta <kgupta@mozilla.com>
parents: 270525
diff changeset
  1954
    // without APZ.
e03e6330f54b119213d0d16524e2e1e7f5ed41ca Bug 1219898 - Remove legacy handling of touch events for non-APZ e10s platforms. r=smaug
Kartikaya Gupta <kgupta@mozilla.com>
parents: 270525
diff changeset
  1955
    MOZ_ASSERT(false);
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1956
    return IPC_OK();
161582
4587af159a9ea86f81c49ad34a35e0c60b12b257 Bug 950300 - Cancel APZC panning is the first touchmove is preventDefault'ed. r=kats
Vivien Nicolas <21@vingtetun.org>
parents: 161144
diff changeset
  1957
  }
4587af159a9ea86f81c49ad34a35e0c60b12b257 Bug 950300 - Cancel APZC panning is the first touchmove is preventDefault'ed. r=kats
Vivien Nicolas <21@vingtetun.org>
parents: 161144
diff changeset
  1958
270529
377b4cc2501664fcdf2d8f8078384414f5a2924a Bug 1219898 - Remove use of gPreventMouseEvents in APZ event state-tracking code. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 270528
diff changeset
  1959
  mAPZEventState->ProcessTouchEvent(localEvent, aGuid, aInputBlockId,
548036
ca7ab0e42f54fc527ed266c155a2a3724da17490 Bug 1648491 - Have the main thread double-check APZ's consumable state. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 547789
diff changeset
  1960
                                    aApzResponse, status,
ca7ab0e42f54fc527ed266c155a2a3724da17490 Bug 1648491 - Have the main thread double-check APZ's consumable state. r=botond
Kartikaya Gupta <kgupta@mozilla.com>
parents: 547789
diff changeset
  1961
                                    std::move(allowedTouchBehaviors));
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  1962
  return IPC_OK();
99601
d1045701fee9a5261caa30d7d35c933c68031b2e Bug 774139: Forward touch events across processes. r=felipe,smaug
Chris Jones <jones.chris.g@gmail.com>
parents: 99481
diff changeset
  1963
}
72544
fb5ad0e555fdda4bff68c09cc878ca7dafbe00dd Bug 583976. Part 3 - Automatically forward mouse and key input events to out-of-process content, and add cursor support in PuppetWidget. r=smaug,stechz
Felipe Gomes <felipc@gmail.com>
parents: 72542
diff changeset
  1964
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1965
mozilla::ipc::IPCResult BrowserChild::RecvNormalPriorityRealTouchEvent(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1966
    const WidgetTouchEvent& aEvent, const ScrollableLayerGuid& aGuid,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1967
    const uint64_t& aInputBlockId, const nsEventStatus& aApzResponse) {
376315
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  1968
  return RecvRealTouchEvent(aEvent, aGuid, aInputBlockId, aApzResponse);
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  1969
}
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  1970
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  1971
mozilla::ipc::IPCResult BrowserChild::RecvRealTouchMoveEvent(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1972
    const WidgetTouchEvent& aEvent, const ScrollableLayerGuid& aGuid,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  1973
    const uint64_t& aInputBlockId, const nsEventStatus& aApzResponse) {
582442
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1974
  if (StaticPrefs::dom_events_coalesce_touchmove()) {
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1975
    ++sConsecutiveTouchMoveCount;
589324
4882bffd97f899f544c3402bab713b4e467420e2 Bug 1511231 - Part 3: Expose coalesced Touches to PointerEvent.getCoalescedEvents(); r=smaug
Edgar Chen <echen@mozilla.com>
parents: 589305
diff changeset
  1976
    if (mCoalescedTouchMoveEventFlusher) {
582442
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1977
      MOZ_ASSERT(aEvent.mMessage == eTouchMove);
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1978
      if (mCoalescedTouchData.IsEmpty() ||
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1979
          mCoalescedTouchData.CanCoalesce(aEvent, aGuid, aInputBlockId,
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1980
                                          aApzResponse)) {
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1981
        mCoalescedTouchData.Coalesce(aEvent, aGuid, aInputBlockId,
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1982
                                     aApzResponse);
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1983
      } else {
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1984
        UniquePtr<WidgetTouchEvent> touchMoveEvent =
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1985
            mCoalescedTouchData.TakeCoalescedEvent();
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1986
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1987
        mCoalescedTouchData.Coalesce(aEvent, aGuid, aInputBlockId,
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1988
                                     aApzResponse);
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1989
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1990
        if (!RecvRealTouchEvent(*touchMoveEvent,
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1991
                                mCoalescedTouchData.GetScrollableLayerGuid(),
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1992
                                mCoalescedTouchData.GetInputBlockId(),
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1993
                                mCoalescedTouchData.GetApzResponse())) {
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1994
          return IPC_FAIL_NO_REASON(this);
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  1995
        }
582091
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  1996
      }
589324
4882bffd97f899f544c3402bab713b4e467420e2 Bug 1511231 - Part 3: Expose coalesced Touches to PointerEvent.getCoalescedEvents(); r=smaug
Edgar Chen <echen@mozilla.com>
parents: 589305
diff changeset
  1997
4882bffd97f899f544c3402bab713b4e467420e2 Bug 1511231 - Part 3: Expose coalesced Touches to PointerEvent.getCoalescedEvents(); r=smaug
Edgar Chen <echen@mozilla.com>
parents: 589305
diff changeset
  1998
      if (sConsecutiveTouchMoveCount > 1) {
4882bffd97f899f544c3402bab713b4e467420e2 Bug 1511231 - Part 3: Expose coalesced Touches to PointerEvent.getCoalescedEvents(); r=smaug
Edgar Chen <echen@mozilla.com>
parents: 589305
diff changeset
  1999
        mCoalescedTouchMoveEventFlusher->StartObserver();
4882bffd97f899f544c3402bab713b4e467420e2 Bug 1511231 - Part 3: Expose coalesced Touches to PointerEvent.getCoalescedEvents(); r=smaug
Edgar Chen <echen@mozilla.com>
parents: 589305
diff changeset
  2000
      } else {
4882bffd97f899f544c3402bab713b4e467420e2 Bug 1511231 - Part 3: Expose coalesced Touches to PointerEvent.getCoalescedEvents(); r=smaug
Edgar Chen <echen@mozilla.com>
parents: 589305
diff changeset
  2001
        // Flush the pending coalesced touch in order to avoid the first
4882bffd97f899f544c3402bab713b4e467420e2 Bug 1511231 - Part 3: Expose coalesced Touches to PointerEvent.getCoalescedEvents(); r=smaug
Edgar Chen <echen@mozilla.com>
parents: 589305
diff changeset
  2002
        // touchmove be overridden by the second one.
589325
51c88c4d63a974fda2ec2b11ee92b25bcede6884 Bug 1511231 - Part 4: s/ProcessPendingColaescedTouchData/ProcessPendingCoalescedTouchData/; r=smaug
Edgar Chen <echen@mozilla.com>
parents: 589324
diff changeset
  2003
        ProcessPendingCoalescedTouchData();
589324
4882bffd97f899f544c3402bab713b4e467420e2 Bug 1511231 - Part 3: Expose coalesced Touches to PointerEvent.getCoalescedEvents(); r=smaug
Edgar Chen <echen@mozilla.com>
parents: 589305
diff changeset
  2004
      }
582442
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  2005
      return IPC_OK();
582091
f69bba33de158f56121f85f27fffc0a1fe780772 Bug 1712825 - Allow coalescing touchmove events in BrowserChild r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 581851
diff changeset
  2006
    }
582442
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  2007
  }
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  2008
479fa52659556f507af340c14ba6f7551f843290 Bug 1715252 - Fix a crash where some touchmove coalescing code is not behind the pref r=smaug
Sean Feng <sefeng@mozilla.com>
parents: 582401
diff changeset
  2009
  if (!RecvRealTouchEvent(aEvent, aGuid, aInputBlockId, aApzResponse)) {
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2010
    return IPC_FAIL_NO_REASON(this);
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2011
  }
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2012
  return IPC_OK();
103467
b543ecb718e3dd5e51b43942a137f75d86c1c2ed Bug 774988: Compress touchmove events across processes. r=bent
Chris Jones <jones.chris.g@gmail.com>
parents: 103431
diff changeset
  2013
}
b543ecb718e3dd5e51b43942a137f75d86c1c2ed Bug 774988: Compress touchmove events across processes. r=bent
Chris Jones <jones.chris.g@gmail.com>
parents: 103431
diff changeset
  2014
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2015
mozilla::ipc::IPCResult BrowserChild::RecvNormalPriorityRealTouchMoveEvent(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2016
    const WidgetTouchEvent& aEvent, const ScrollableLayerGuid& aGuid,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2017
    const uint64_t& aInputBlockId, const nsEventStatus& aApzResponse) {
376315
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  2018
  return RecvRealTouchMoveEvent(aEvent, aGuid, aInputBlockId, aApzResponse);
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  2019
}
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  2020
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2021
mozilla::ipc::IPCResult BrowserChild::RecvRealDragEvent(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2022
    const WidgetDragEvent& aEvent, const uint32_t& aDragAction,
488964
544bb8b63a3e9d38f69698596a6b37bff4f2e112 Bug 1561056 - Pass CSP on Link-drop r=ckerschb,Gijs,farre
Sebastian Streich <sstreich@mozilla.com>
parents: 488815
diff changeset
  2023
    const uint32_t& aDropEffect, nsIPrincipal* aPrincipal,
544bb8b63a3e9d38f69698596a6b37bff4f2e112 Bug 1561056 - Pass CSP on Link-drop r=ckerschb,Gijs,farre
Sebastian Streich <sstreich@mozilla.com>
parents: 488815
diff changeset
  2024
    nsIContentSecurityPolicy* aCsp) {
238260
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2025
  WidgetDragEvent localEvent(aEvent);
293579
5ac6c8d1fc28d8f35ec6a680a140057f399c30cd Bug 1259657 Rename WidgetGUIEvent::widget to WidgetGUIEvent::mWidget r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 293411
diff changeset
  2026
  localEvent.mWidget = mPuppetWidget;
238260
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2027
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2028
  nsCOMPtr<nsIDragSession> dragSession = nsContentUtils::GetDragSession();
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2029
  if (dragSession) {
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2030
    dragSession->SetDragAction(aDragAction);
452502
32f94b7a8db69e3ab86135182fe8e43ea6926767 Bug 1509384 - Use IPC::Principal instead of Principal URI string in Drag-and-Drop. r=smaug
Tooru Fujisawa <arai_a@mac.com>
parents: 452446
diff changeset
  2031
    dragSession->SetTriggeringPrincipal(aPrincipal);
488964
544bb8b63a3e9d38f69698596a6b37bff4f2e112 Bug 1561056 - Pass CSP on Link-drop r=ckerschb,Gijs,farre
Sebastian Streich <sstreich@mozilla.com>
parents: 488815
diff changeset
  2032
    dragSession->SetCsp(aCsp);
408055
5ab74cd16594f58974e3db83e19f89492250b71f Bug 1444686 part 3. Get rid of nsIDOMDataTransfer::Get/SetMozCursor. r=mystor
Boris Zbarsky <bzbarsky@mit.edu>
parents: 406869
diff changeset
  2033
    RefPtr<DataTransfer> initialDataTransfer = dragSession->GetDataTransfer();
238260
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2034
    if (initialDataTransfer) {
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2035
      initialDataTransfer->SetDropEffectInt(aDropEffect);
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2036
    }
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2037
  }
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2038
260498
df96cb04b9dd41d97951a8cc6e68d7c332616c08 Bug 895274 part.77 Rename NS_DRAGDROP_DROP to eDrop r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 259986
diff changeset
  2039
  if (aEvent.mMessage == eDrop) {
238260
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2040
    bool canDrop = true;
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2041
    if (!dragSession || NS_FAILED(dragSession->GetCanDrop(&canDrop)) ||
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2042
        !canDrop) {
260504
aaffbbb943e446e995c9f08c363bae24e0712a28 Bug 895274 part.83 Rename NS_DRAGDROP_EXIT to eDragExit r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 260502
diff changeset
  2043
      localEvent.mMessage = eDragExit;
238260
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2044
    }
260502
4f79fccb269836a8053a036c8a0734d618d92b41 Bug 895274 part.81 Rename NS_DRAGDROP_OVER to eDragOver r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 260501
diff changeset
  2045
  } else if (aEvent.mMessage == eDragOver) {
238260
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2046
    nsCOMPtr<nsIDragService> dragService =
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2047
        do_GetService("@mozilla.org/widget/dragservice;1");
238260
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2048
    if (dragService) {
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2049
      // This will dispatch 'drag' event at the source if the
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2050
      // drag transaction started in this process.
347235
a4f60181551b8bb66f6623b0bc65008ca16dc755 Bug 606885 - Fire drag events with keyboard modifiers. r=enn
Stone Shih <sshih@mozilla.com>
parents: 346026
diff changeset
  2051
      dragService->FireDragEventAtSource(eDrag, aEvent.mModifiers);
238260
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2052
    }
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2053
  }
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2054
370467
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  2055
  DispatchWidgetEventViaAPZ(localEvent);
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2056
  return IPC_OK();
238260
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2057
}
1eec2c8789c1f3865e339fce65a83d5f668cdea4 Bug 936092, initial DnD support for e10s, r=enndeakin,karlt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 238191
diff changeset
  2058
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2059
void BrowserChild::RequestEditCommands(nsIWidget::NativeKeyBindingsType aType,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2060
                                       const WidgetKeyboardEvent& aEvent,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2061
                                       nsTArray<CommandInt>& aCommands) {
359282
b75c111837a802ceb953dba50a3c5a193d53ca22 Bug 1339543 part 4 Change nsIWidget::ExecuteNativeKeyBinding() to nsIWidget::GetEditCommands() which just retrieves edit commands for the type r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 359280
diff changeset
  2062
  MOZ_ASSERT(aCommands.IsEmpty());
b75c111837a802ceb953dba50a3c5a193d53ca22 Bug 1339543 part 4 Change nsIWidget::ExecuteNativeKeyBinding() to nsIWidget::GetEditCommands() which just retrieves edit commands for the type r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 359280
diff changeset
  2063
b75c111837a802ceb953dba50a3c5a193d53ca22 Bug 1339543 part 4 Change nsIWidget::ExecuteNativeKeyBinding() to nsIWidget::GetEditCommands() which just retrieves edit commands for the type r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 359280
diff changeset
  2064
  if (NS_WARN_IF(aEvent.IsEditCommandsInitialized(aType))) {
526903
fdef6c89e60fac700def0ff9284e45efe0ece8e4 Bug 1626570 - Improve handling of copying arrays in dom/ipc/. r=nika
Simon Giesecke <sgiesecke@mozilla.com>
parents: 526816
diff changeset
  2065
    aCommands = aEvent.EditCommandsConstRef(aType).Clone();
179463
b2a47bd7d0df3a65ec0057e0c9625adf4a0417ec Bug 993714 - [e10s] Cache native key bindings in tests (r=masayuki,sr=roc)
Bill McCloskey <wmccloskey@mozilla.com>
parents: 179121
diff changeset
  2066
    return;
b2a47bd7d0df3a65ec0057e0c9625adf4a0417ec Bug 993714 - [e10s] Cache native key bindings in tests (r=masayuki,sr=roc)
Bill McCloskey <wmccloskey@mozilla.com>
parents: 179121
diff changeset
  2067
  }
b2a47bd7d0df3a65ec0057e0c9625adf4a0417ec Bug 993714 - [e10s] Cache native key bindings in tests (r=masayuki,sr=roc)
Bill McCloskey <wmccloskey@mozilla.com>
parents: 179121
diff changeset
  2068
359282
b75c111837a802ceb953dba50a3c5a193d53ca22 Bug 1339543 part 4 Change nsIWidget::ExecuteNativeKeyBinding() to nsIWidget::GetEditCommands() which just retrieves edit commands for the type r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 359280
diff changeset
  2069
  switch (aType) {
b75c111837a802ceb953dba50a3c5a193d53ca22 Bug 1339543 part 4 Change nsIWidget::ExecuteNativeKeyBinding() to nsIWidget::GetEditCommands() which just retrieves edit commands for the type r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 359280
diff changeset
  2070
    case nsIWidget::NativeKeyBindingsForSingleLineEditor:
b75c111837a802ceb953dba50a3c5a193d53ca22 Bug 1339543 part 4 Change nsIWidget::ExecuteNativeKeyBinding() to nsIWidget::GetEditCommands() which just retrieves edit commands for the type r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 359280
diff changeset
  2071
    case nsIWidget::NativeKeyBindingsForMultiLineEditor:
b75c111837a802ceb953dba50a3c5a193d53ca22 Bug 1339543 part 4 Change nsIWidget::ExecuteNativeKeyBinding() to nsIWidget::GetEditCommands() which just retrieves edit commands for the type r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 359280
diff changeset
  2072
    case nsIWidget::NativeKeyBindingsForRichTextEditor:
b75c111837a802ceb953dba50a3c5a193d53ca22 Bug 1339543 part 4 Change nsIWidget::ExecuteNativeKeyBinding() to nsIWidget::GetEditCommands() which just retrieves edit commands for the type r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 359280
diff changeset
  2073
      break;
b75c111837a802ceb953dba50a3c5a193d53ca22 Bug 1339543 part 4 Change nsIWidget::ExecuteNativeKeyBinding() to nsIWidget::GetEditCommands() which just retrieves edit commands for the type r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 359280
diff changeset
  2074
    default:
b75c111837a802ceb953dba50a3c5a193d53ca22 Bug 1339543 part 4 Change nsIWidget::ExecuteNativeKeyBinding() to nsIWidget::GetEditCommands() which just retrieves edit commands for the type r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 359280
diff changeset
  2075
      MOZ_ASSERT_UNREACHABLE("Invalid native key bindings type");
179463
b2a47bd7d0df3a65ec0057e0c9625adf4a0417ec Bug 993714 - [e10s] Cache native key bindings in tests (r=masayuki,sr=roc)
Bill McCloskey <wmccloskey@mozilla.com>
parents: 179121
diff changeset
  2076
  }
359284
bf71ece03a290119c947cb3f93d311c34a6d4a78 Bug 1339543 part 6 PBrowser::RequestNativeKeyBindings() should retrieves edit commands only for specified type r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 359282
diff changeset
  2077
367379
44f5ac7a16e452b0001f5a59832ec81654faebb2 Bug 1377653 - part3: WidgetEvent::mFlags should have a bool flag if it's been posted to at least one remote process r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 367378
diff changeset
  2078
  // Don't send aEvent to the parent process directly because it'll be marked
44f5ac7a16e452b0001f5a59832ec81654faebb2 Bug 1377653 - part3: WidgetEvent::mFlags should have a bool flag if it's been posted to at least one remote process r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 367378
diff changeset
  2079
  // as posted to remote process.
44f5ac7a16e452b0001f5a59832ec81654faebb2 Bug 1377653 - part3: WidgetEvent::mFlags should have a bool flag if it's been posted to at least one remote process r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 367378
diff changeset
  2080
  WidgetKeyboardEvent localEvent(aEvent);
44f5ac7a16e452b0001f5a59832ec81654faebb2 Bug 1377653 - part3: WidgetEvent::mFlags should have a bool flag if it's been posted to at least one remote process r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 367378
diff changeset
  2081
  SendRequestNativeKeyBindings(aType, localEvent, &aCommands);
179463
b2a47bd7d0df3a65ec0057e0c9625adf4a0417ec Bug 993714 - [e10s] Cache native key bindings in tests (r=masayuki,sr=roc)
Bill McCloskey <wmccloskey@mozilla.com>
parents: 179121
diff changeset
  2082
}
b2a47bd7d0df3a65ec0057e0c9625adf4a0417ec Bug 993714 - [e10s] Cache native key bindings in tests (r=masayuki,sr=roc)
Bill McCloskey <wmccloskey@mozilla.com>
parents: 179121
diff changeset
  2083
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2084
mozilla::ipc::IPCResult BrowserChild::RecvNativeSynthesisResponse(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2085
    const uint64_t& aObserverId, const nsCString& aResponse) {
330263
16f6a42267a0064e5c6c9226b32bbbbc95e81d82 Bug 1332195 part.2 Fix some nits of event handlers in TabChild, TabParent and PuppetWidget r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 330262
diff changeset
  2086
  mozilla::widget::AutoObserverNotifier::NotifySavedObserver(aObserverId,
16f6a42267a0064e5c6c9226b32bbbbc95e81d82 Bug 1332195 part.2 Fix some nits of event handlers in TabChild, TabParent and PuppetWidget r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 330262
diff changeset
  2087
                                                             aResponse.get());
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2088
  return IPC_OK();
239022
371a7026a1dfe35089c8f91014b2eab3a20a18c3 Bug 1146349 - Wire up native event synthesization in child processes. r=smaug
Kartikaya Gupta <kgupta@mozilla.com>
parents: 238899
diff changeset
  2089
}
371a7026a1dfe35089c8f91014b2eab3a20a18c3 Bug 1146349 - Wire up native event synthesization in child processes. r=smaug
Kartikaya Gupta <kgupta@mozilla.com>
parents: 238899
diff changeset
  2090
482349
f33f444893963bf4bcf0385a2f43052f19170a7e bug 1562889 - Convert content-sessionStore to C++: add browser epochs support r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 482313
diff changeset
  2091
mozilla::ipc::IPCResult BrowserChild::RecvUpdateEpoch(const uint32_t& aEpoch) {
f33f444893963bf4bcf0385a2f43052f19170a7e bug 1562889 - Convert content-sessionStore to C++: add browser epochs support r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 482313
diff changeset
  2092
  mSessionStoreListener->SetEpoch(aEpoch);
573215
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
  2093
482349
f33f444893963bf4bcf0385a2f43052f19170a7e bug 1562889 - Convert content-sessionStore to C++: add browser epochs support r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 482313
diff changeset
  2094
  return IPC_OK();
f33f444893963bf4bcf0385a2f43052f19170a7e bug 1562889 - Convert content-sessionStore to C++: add browser epochs support r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 482313
diff changeset
  2095
}
f33f444893963bf4bcf0385a2f43052f19170a7e bug 1562889 - Convert content-sessionStore to C++: add browser epochs support r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 482313
diff changeset
  2096
582687
65bfa10b398edd3b7284898cf71170adafa62e8b Bug 1715264 - Cleanup how Session Store collects SessionHistory, r=farre
Kashav Madan <kshvmdn@gmail.com>
parents: 582552
diff changeset
  2097
mozilla::ipc::IPCResult BrowserChild::RecvUpdateSHistory() {
519606
e90c2551e6d05e0ea6b8dfb4ee670e83ccc84e85 Bug 1507287 - Make sessionRestore work with session history living in the parent process. r=peterv,mikedeboer
Alphan Chen <alchen@mozilla.com>
parents: 519543
diff changeset
  2098
  if (mSessionStoreListener) {
582687
65bfa10b398edd3b7284898cf71170adafa62e8b Bug 1715264 - Cleanup how Session Store collects SessionHistory, r=farre
Kashav Madan <kshvmdn@gmail.com>
parents: 582552
diff changeset
  2099
    mSessionStoreListener->UpdateSHistoryChanges();
519606
e90c2551e6d05e0ea6b8dfb4ee670e83ccc84e85 Bug 1507287 - Make sessionRestore work with session history living in the parent process. r=peterv,mikedeboer
Alphan Chen <alchen@mozilla.com>
parents: 519543
diff changeset
  2100
  }
e90c2551e6d05e0ea6b8dfb4ee670e83ccc84e85 Bug 1507287 - Make sessionRestore work with session history living in the parent process. r=peterv,mikedeboer
Alphan Chen <alchen@mozilla.com>
parents: 519543
diff changeset
  2101
  return IPC_OK();
e90c2551e6d05e0ea6b8dfb4ee670e83ccc84e85 Bug 1507287 - Make sessionRestore work with session history living in the parent process. r=peterv,mikedeboer
Alphan Chen <alchen@mozilla.com>
parents: 519543
diff changeset
  2102
}
e90c2551e6d05e0ea6b8dfb4ee670e83ccc84e85 Bug 1507287 - Make sessionRestore work with session history living in the parent process. r=peterv,mikedeboer
Alphan Chen <alchen@mozilla.com>
parents: 519543
diff changeset
  2103
329603
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2104
// In case handling repeated keys takes much time, we skip firing new ones.
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2105
bool BrowserChild::SkipRepeatedKeyEvent(const WidgetKeyboardEvent& aEvent) {
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2106
  if (mRepeatedKeyEventTime.IsNull() || !aEvent.CanSkipInRemoteProcess() ||
329603
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2107
      (aEvent.mMessage != eKeyDown && aEvent.mMessage != eKeyPress)) {
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2108
    mRepeatedKeyEventTime = TimeStamp();
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2109
    mSkipKeyPress = false;
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2110
    return false;
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2111
  }
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2112
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2113
  if ((aEvent.mMessage == eKeyDown &&
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2114
       (mRepeatedKeyEventTime > aEvent.mTimeStamp)) ||
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2115
      (mSkipKeyPress && (aEvent.mMessage == eKeyPress))) {
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2116
    // If we skip a keydown event, also the following keypress events should be
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2117
    // skipped.
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2118
    mSkipKeyPress |= aEvent.mMessage == eKeyDown;
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2119
    return true;
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2120
  }
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2121
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2122
  if (aEvent.mMessage == eKeyDown) {
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2123
    // If keydown wasn't skipped, nor should the possible following keypress.
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2124
    mRepeatedKeyEventTime = TimeStamp();
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2125
    mSkipKeyPress = false;
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2126
  }
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2127
  return false;
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2128
}
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2129
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2130
void BrowserChild::UpdateRepeatedKeyEventEndTime(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2131
    const WidgetKeyboardEvent& aEvent) {
329603
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2132
  if (aEvent.mIsRepeat &&
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2133
      (aEvent.mMessage == eKeyDown || aEvent.mMessage == eKeyPress)) {
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2134
    mRepeatedKeyEventTime = TimeStamp::Now();
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2135
  }
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2136
}
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2137
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2138
mozilla::ipc::IPCResult BrowserChild::RecvRealKeyEvent(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2139
    const WidgetKeyboardEvent& aEvent) {
330262
6638661271a77c239a322147cf41ef462321e90b Bug 1332195 part.1 Event handlers in TabChild, TabParent and PuppetWidget should use "a" prefix for their arguments r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 330028
diff changeset
  2140
  if (SkipRepeatedKeyEvent(aEvent)) {
329603
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2141
    return IPC_OK();
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2142
  }
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2143
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2144
  MOZ_ASSERT(
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2145
      aEvent.mMessage != eKeyPress || aEvent.AreAllEditCommandsInitialized(),
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2146
      "eKeyPress event should have native key binding information");
359280
198e58f7052f48338f8c10c08c6b6713bae8bafb Bug 1339543 part 2 eKeyPress event should have edit commands for all editor types when it's dispatched to a remote process r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 358656
diff changeset
  2147
198e58f7052f48338f8c10c08c6b6713bae8bafb Bug 1339543 part 2 eKeyPress event should have edit commands for all editor types when it's dispatched to a remote process r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 358656
diff changeset
  2148
  // If content code called preventDefault() on a keydown event, then we don't
198e58f7052f48338f8c10c08c6b6713bae8bafb Bug 1339543 part 2 eKeyPress event should have edit commands for all editor types when it's dispatched to a remote process r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 358656
diff changeset
  2149
  // want to process any following keypress events.
198e58f7052f48338f8c10c08c6b6713bae8bafb Bug 1339543 part 2 eKeyPress event should have edit commands for all editor types when it's dispatched to a remote process r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 358656
diff changeset
  2150
  if (aEvent.mMessage == eKeyPress && mIgnoreKeyPressEvent) {
198e58f7052f48338f8c10c08c6b6713bae8bafb Bug 1339543 part 2 eKeyPress event should have edit commands for all editor types when it's dispatched to a remote process r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 358656
diff changeset
  2151
    return IPC_OK();
174609
da72442a5a3c0596b40122c9352b7a1f5dfe4439 Bug 977904 - [e10s] Get native key bindings working. r=masayuki
Tom Schuster <evilpies@gmail.com>
parents: 174232
diff changeset
  2152
  }
173107
6c80860a2266fc9ca31fd48cde00d9ce98b1a96d Bug 972420 - [e10s] Don't send keypress if keydown was prevented (r=smaug)
Bill McCloskey <wmccloskey@mozilla.com>
parents: 172866
diff changeset
  2153
330262
6638661271a77c239a322147cf41ef462321e90b Bug 1332195 part.1 Event handlers in TabChild, TabParent and PuppetWidget should use "a" prefix for their arguments r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 330028
diff changeset
  2154
  WidgetKeyboardEvent localEvent(aEvent);
293579
5ac6c8d1fc28d8f35ec6a680a140057f399c30cd Bug 1259657 Rename WidgetGUIEvent::widget to WidgetGUIEvent::mWidget r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 293411
diff changeset
  2155
  localEvent.mWidget = mPuppetWidget;
358548
dc96471117ab6243119c8593b5f562e413036f81 Bug 429824: Properly forward native OSX events to the native menu bar if they haven't been handled by the child process in e10s. r=mstange,masayuki
Stephen A Pohl <spohl.mozilla.bugs@gmail.com>
parents: 358091
diff changeset
  2156
  localEvent.mUniqueId = aEvent.mUniqueId;
370467
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  2157
  nsEventStatus status = DispatchWidgetEventViaAPZ(localEvent);
173107
6c80860a2266fc9ca31fd48cde00d9ce98b1a96d Bug 972420 - [e10s] Don't send keypress if keydown was prevented (r=smaug)
Bill McCloskey <wmccloskey@mozilla.com>
parents: 172866
diff changeset
  2158
329603
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2159
  // Update the end time of the possible repeated event so that we can skip
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2160
  // some incoming events in case event handling took long time.
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2161
  UpdateRepeatedKeyEventEndTime(localEvent);
68aff122042fd472f4dcc05f259929a8b7efe894 Bug 1330252, try to avoid flooding child process with repeated key events, r=masayuki
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 329205
diff changeset
  2162
330262
6638661271a77c239a322147cf41ef462321e90b Bug 1332195 part.1 Event handlers in TabChild, TabParent and PuppetWidget should use "a" prefix for their arguments r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 330028
diff changeset
  2163
  if (aEvent.mMessage == eKeyDown) {
173107
6c80860a2266fc9ca31fd48cde00d9ce98b1a96d Bug 972420 - [e10s] Don't send keypress if keydown was prevented (r=smaug)
Bill McCloskey <wmccloskey@mozilla.com>
parents: 172866
diff changeset
  2164
    mIgnoreKeyPressEvent = status == nsEventStatus_eConsumeNoDefault;
6c80860a2266fc9ca31fd48cde00d9ce98b1a96d Bug 972420 - [e10s] Don't send keypress if keydown was prevented (r=smaug)
Bill McCloskey <wmccloskey@mozilla.com>
parents: 172866
diff changeset
  2165
  }
6c80860a2266fc9ca31fd48cde00d9ce98b1a96d Bug 972420 - [e10s] Don't send keypress if keydown was prevented (r=smaug)
Bill McCloskey <wmccloskey@mozilla.com>
parents: 172866
diff changeset
  2166
323742
1b3e82cf6ec0b09e19c56214c121be177bce4130 Bug 1309587 - PreventDefault() on suppressed/delayed key events that are sent back to parent. r=smaug
Jessica Jong <jjong>
parents: 323236
diff changeset
  2167
  if (localEvent.mFlags.mIsSuppressedOrDelayed) {
1b3e82cf6ec0b09e19c56214c121be177bce4130 Bug 1309587 - PreventDefault() on suppressed/delayed key events that are sent back to parent. r=smaug
Jessica Jong <jjong>
parents: 323236
diff changeset
  2168
    localEvent.PreventDefault();
1b3e82cf6ec0b09e19c56214c121be177bce4130 Bug 1309587 - PreventDefault() on suppressed/delayed key events that are sent back to parent. r=smaug
Jessica Jong <jjong>
parents: 323236
diff changeset
  2169
  }
1b3e82cf6ec0b09e19c56214c121be177bce4130 Bug 1309587 - PreventDefault() on suppressed/delayed key events that are sent back to parent. r=smaug
Jessica Jong <jjong>
parents: 323236
diff changeset
  2170
296996
1b02f9d6c0586c7d7db405b3fc1ad4347503a180 Bug 1101975, handle access keys in content process before menus, r=masayuki
Neil Deakin <neil@mozilla.com>
parents: 296981
diff changeset
  2171
  // If a response is desired from the content process, resend the key event.
370467
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  2172
  if (aEvent.WantReplyFromContentProcess()) {
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  2173
    // If the event's default isn't prevented but the status is no default,
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  2174
    // That means that the event was consumed by EventStateManager or something
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  2175
    // which is not a usual event handler.  In such case, prevent its default
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  2176
    // as a default handler.  For example, when an eKeyPress event matches
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  2177
    // with a content accesskey, and it's executed, peventDefault() of the
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  2178
    // event won't be called but the status is set to "no default".  Then,
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  2179
    // the event shouldn't be handled by nsMenuBarListener in the main process.
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  2180
    if (!localEvent.DefaultPrevented() &&
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  2181
        status == nsEventStatus_eConsumeNoDefault) {
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  2182
      localEvent.PreventDefault();
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  2183
    }
424489
c0cd065ee5c8832f6962d09805541ecad1d5398e Bug 1435717 - Make calling WidgetEvent::PreventDefault*() stop cross process forwarding too r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 424024
diff changeset
  2184
    // This is an ugly hack, mNoRemoteProcessDispatch is set to true when the
c0cd065ee5c8832f6962d09805541ecad1d5398e Bug 1435717 - Make calling WidgetEvent::PreventDefault*() stop cross process forwarding too r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 424024
diff changeset
  2185
    // event's PreventDefault() or StopScrollProcessForwarding() is called.
c0cd065ee5c8832f6962d09805541ecad1d5398e Bug 1435717 - Make calling WidgetEvent::PreventDefault*() stop cross process forwarding too r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 424024
diff changeset
  2186
    // And then, it'll be checked by ParamTraits<mozilla::WidgetEvent>::Write()
c0cd065ee5c8832f6962d09805541ecad1d5398e Bug 1435717 - Make calling WidgetEvent::PreventDefault*() stop cross process forwarding too r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 424024
diff changeset
  2187
    // whether the event is being sent to remote process unexpectedly.
c0cd065ee5c8832f6962d09805541ecad1d5398e Bug 1435717 - Make calling WidgetEvent::PreventDefault*() stop cross process forwarding too r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 424024
diff changeset
  2188
    // However, unfortunately, it cannot check the destination.  Therefore,
c0cd065ee5c8832f6962d09805541ecad1d5398e Bug 1435717 - Make calling WidgetEvent::PreventDefault*() stop cross process forwarding too r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 424024
diff changeset
  2189
    // we need to clear the flag explicitly here because ParamTraits should
c0cd065ee5c8832f6962d09805541ecad1d5398e Bug 1435717 - Make calling WidgetEvent::PreventDefault*() stop cross process forwarding too r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 424024
diff changeset
  2190
    // keep checking the flag for avoiding regression.
c0cd065ee5c8832f6962d09805541ecad1d5398e Bug 1435717 - Make calling WidgetEvent::PreventDefault*() stop cross process forwarding too r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 424024
diff changeset
  2191
    localEvent.mFlags.mNoRemoteProcessDispatch = false;
174232
cce47e0594310065d59060d0b1c81fe78bf7baa6 Bug 862519 - [e10s] Better handling of key commands also handled by content (r=smaug)
Bill McCloskey <wmccloskey@mozilla.com>
parents: 174157
diff changeset
  2192
    SendReplyKeyEvent(localEvent);
cce47e0594310065d59060d0b1c81fe78bf7baa6 Bug 862519 - [e10s] Better handling of key commands also handled by content (r=smaug)
Bill McCloskey <wmccloskey@mozilla.com>
parents: 174157
diff changeset
  2193
  }
cce47e0594310065d59060d0b1c81fe78bf7baa6 Bug 862519 - [e10s] Better handling of key commands also handled by content (r=smaug)
Bill McCloskey <wmccloskey@mozilla.com>
parents: 174157
diff changeset
  2194
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2195
  return IPC_OK();
72544
fb5ad0e555fdda4bff68c09cc878ca7dafbe00dd Bug 583976. Part 3 - Automatically forward mouse and key input events to out-of-process content, and add cursor support in PuppetWidget. r=smaug,stechz
Felipe Gomes <felipc@gmail.com>
parents: 72542
diff changeset
  2196
}
fb5ad0e555fdda4bff68c09cc878ca7dafbe00dd Bug 583976. Part 3 - Automatically forward mouse and key input events to out-of-process content, and add cursor support in PuppetWidget. r=smaug,stechz
Felipe Gomes <felipc@gmail.com>
parents: 72542
diff changeset
  2197
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2198
mozilla::ipc::IPCResult BrowserChild::RecvNormalPriorityRealKeyEvent(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2199
    const WidgetKeyboardEvent& aEvent) {
376315
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  2200
  return RecvRealKeyEvent(aEvent);
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  2201
}
5f6a7c8712b3c69ed0f099f385ae462b7fb1354b Bug 1389314 Part2: Support enabling and disabling the input priority events in runtime. r=smaug.
Stone Shih <sshih@mozilla.com>
parents: 375979
diff changeset
  2202
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2203
mozilla::ipc::IPCResult BrowserChild::RecvCompositionEvent(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2204
    const WidgetCompositionEvent& aEvent) {
330262
6638661271a77c239a322147cf41ef462321e90b Bug 1332195 part.1 Event handlers in TabChild, TabParent and PuppetWidget should use "a" prefix for their arguments r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 330028
diff changeset
  2205
  WidgetCompositionEvent localEvent(aEvent);
293579
5ac6c8d1fc28d8f35ec6a680a140057f399c30cd Bug 1259657 Rename WidgetGUIEvent::widget to WidgetGUIEvent::mWidget r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 293411
diff changeset
  2206
  localEvent.mWidget = mPuppetWidget;
370467
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  2207
  DispatchWidgetEventViaAPZ(localEvent);
330262
6638661271a77c239a322147cf41ef462321e90b Bug 1332195 part.1 Event handlers in TabChild, TabParent and PuppetWidget should use "a" prefix for their arguments r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 330028
diff changeset
  2208
  Unused << SendOnEventNeedingAckHandled(aEvent.mMessage);
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2209
  return IPC_OK();
50730
d061f90eea9d59f98b18900f7a3a05e755aba5e8 Bug 582644 - IME event remoting, patch for widget; r=dougt, blocking-fennec=2.0a1+
Jim Chen <nchen@mozilla.com>
parents: 50694
diff changeset
  2210
}
d061f90eea9d59f98b18900f7a3a05e755aba5e8 Bug 582644 - IME event remoting, patch for widget; r=dougt, blocking-fennec=2.0a1+
Jim Chen <nchen@mozilla.com>
parents: 50694
diff changeset
  2211
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2212
mozilla::ipc::IPCResult BrowserChild::RecvNormalPriorityCompositionEvent(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2213
    const WidgetCompositionEvent& aEvent) {
383865
d9c1d98878cb54dc6a0afcc7092d2ea8f3077265 Bug 1400189 - Give same priority to composition events and selectionset event as keyboard events at sending those events from the main process to a remote process r=stone
Masayuki Nakano <masayuki@d-toybox.com>
parents: 383816
diff changeset
  2214
  return RecvCompositionEvent(aEvent);
d9c1d98878cb54dc6a0afcc7092d2ea8f3077265 Bug 1400189 - Give same priority to composition events and selectionset event as keyboard events at sending those events from the main process to a remote process r=stone
Masayuki Nakano <masayuki@d-toybox.com>
parents: 383816
diff changeset
  2215
}
d9c1d98878cb54dc6a0afcc7092d2ea8f3077265 Bug 1400189 - Give same priority to composition events and selectionset event as keyboard events at sending those events from the main process to a remote process r=stone
Masayuki Nakano <masayuki@d-toybox.com>
parents: 383816
diff changeset
  2216
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2217
mozilla::ipc::IPCResult BrowserChild::RecvSelectionEvent(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2218
    const WidgetSelectionEvent& aEvent) {
330262
6638661271a77c239a322147cf41ef462321e90b Bug 1332195 part.1 Event handlers in TabChild, TabParent and PuppetWidget should use "a" prefix for their arguments r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 330028
diff changeset
  2219
  WidgetSelectionEvent localEvent(aEvent);
293579
5ac6c8d1fc28d8f35ec6a680a140057f399c30cd Bug 1259657 Rename WidgetGUIEvent::widget to WidgetGUIEvent::mWidget r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 293411
diff changeset
  2220
  localEvent.mWidget = mPuppetWidget;
370467
ce1fe9986ce932b2d19ee240548b91176568f065 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 370465
diff changeset
  2221
  DispatchWidgetEventViaAPZ(localEvent);
330262
6638661271a77c239a322147cf41ef462321e90b Bug 1332195 part.1 Event handlers in TabChild, TabParent and PuppetWidget should use "a" prefix for their arguments r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 330028
diff changeset
  2222
  Unused << SendOnEventNeedingAckHandled(aEvent.mMessage);
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2223
  return IPC_OK();
50730
d061f90eea9d59f98b18900f7a3a05e755aba5e8 Bug 582644 - IME event remoting, patch for widget; r=dougt, blocking-fennec=2.0a1+
Jim Chen <nchen@mozilla.com>
parents: 50694
diff changeset
  2224
}
d061f90eea9d59f98b18900f7a3a05e755aba5e8 Bug 582644 - IME event remoting, patch for widget; r=dougt, blocking-fennec=2.0a1+
Jim Chen <nchen@mozilla.com>
parents: 50694
diff changeset
  2225
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2226
mozilla::ipc::IPCResult BrowserChild::RecvNormalPrioritySelectionEvent(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2227
    const WidgetSelectionEvent& aEvent) {
383865
d9c1d98878cb54dc6a0afcc7092d2ea8f3077265 Bug 1400189 - Give same priority to composition events and selectionset event as keyboard events at sending those events from the main process to a remote process r=stone
Masayuki Nakano <masayuki@d-toybox.com>
parents: 383816
diff changeset
  2228
  return RecvSelectionEvent(aEvent);
d9c1d98878cb54dc6a0afcc7092d2ea8f3077265 Bug 1400189 - Give same priority to composition events and selectionset event as keyboard events at sending those events from the main process to a remote process r=stone
Masayuki Nakano <masayuki@d-toybox.com>
parents: 383816
diff changeset
  2229
}
d9c1d98878cb54dc6a0afcc7092d2ea8f3077265 Bug 1400189 - Give same priority to composition events and selectionset event as keyboard events at sending those events from the main process to a remote process r=stone
Masayuki Nakano <masayuki@d-toybox.com>
parents: 383816
diff changeset
  2230
579854
37f8398e12577246dface385d2e025d2e35982bc Bug 1520983 - part 1: Add new content command event for inserting text r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 579848
diff changeset
  2231
mozilla::ipc::IPCResult BrowserChild::RecvInsertText(
37f8398e12577246dface385d2e025d2e35982bc Bug 1520983 - part 1: Add new content command event for inserting text r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 579848
diff changeset
  2232
    const nsString& aStringToInsert) {
37f8398e12577246dface385d2e025d2e35982bc Bug 1520983 - part 1: Add new content command event for inserting text r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 579848
diff changeset
  2233
  // Use normal event path to reach focused document.
37f8398e12577246dface385d2e025d2e35982bc Bug 1520983 - part 1: Add new content command event for inserting text r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 579848
diff changeset
  2234
  WidgetContentCommandEvent localEvent(true, eContentCommandInsertText,
37f8398e12577246dface385d2e025d2e35982bc Bug 1520983 - part 1: Add new content command event for inserting text r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 579848
diff changeset
  2235
                                       mPuppetWidget);
37f8398e12577246dface385d2e025d2e35982bc Bug 1520983 - part 1: Add new content command event for inserting text r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 579848
diff changeset
  2236
  localEvent.mString = Some(aStringToInsert);
37f8398e12577246dface385d2e025d2e35982bc Bug 1520983 - part 1: Add new content command event for inserting text r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 579848
diff changeset
  2237
  DispatchWidgetEventViaAPZ(localEvent);
37f8398e12577246dface385d2e025d2e35982bc Bug 1520983 - part 1: Add new content command event for inserting text r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 579848
diff changeset
  2238
  return IPC_OK();
37f8398e12577246dface385d2e025d2e35982bc Bug 1520983 - part 1: Add new content command event for inserting text r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 579848
diff changeset
  2239
}
37f8398e12577246dface385d2e025d2e35982bc Bug 1520983 - part 1: Add new content command event for inserting text r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 579848
diff changeset
  2240
37f8398e12577246dface385d2e025d2e35982bc Bug 1520983 - part 1: Add new content command event for inserting text r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 579848
diff changeset
  2241
mozilla::ipc::IPCResult BrowserChild::RecvNormalPriorityInsertText(
37f8398e12577246dface385d2e025d2e35982bc Bug 1520983 - part 1: Add new content command event for inserting text r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 579848
diff changeset
  2242
    const nsString& aStringToInsert) {
37f8398e12577246dface385d2e025d2e35982bc Bug 1520983 - part 1: Add new content command event for inserting text r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 579848
diff changeset
  2243
  return RecvInsertText(aStringToInsert);
37f8398e12577246dface385d2e025d2e35982bc Bug 1520983 - part 1: Add new content command event for inserting text r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 579848
diff changeset
  2244
}
37f8398e12577246dface385d2e025d2e35982bc Bug 1520983 - part 1: Add new content command event for inserting text r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 579848
diff changeset
  2245
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2246
mozilla::ipc::IPCResult BrowserChild::RecvPasteTransferable(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2247
    const IPCDataTransfer& aDataTransfer, const bool& aIsPrivateData,
560979
b1c2b38fcc18bfcabf8a8b3fe4725f413c7e65c3 Bug 1682103 - Make nsContentPolicyType a CEnum type. r=ckerschb
Masatoshi Kimura <VYV03354@nifty.ne.jp>
parents: 560840
diff changeset
  2248
    nsIPrincipal* aRequestingPrincipal,
b1c2b38fcc18bfcabf8a8b3fe4725f413c7e65c3 Bug 1682103 - Make nsContentPolicyType a CEnum type. r=ckerschb
Masatoshi Kimura <VYV03354@nifty.ne.jp>
parents: 560840
diff changeset
  2249
    const nsContentPolicyType& aContentPolicyType) {
312352
3bb42e64430405cb93bcaee9e31affdf2314db8b Bug 1297539 - Add IPC message, PasteTransferable, to call PasteTransferable via a controller on the content process to handle the command content event, "pasteTransferable". New method nsContentUtils::IPCTransferableToTransferable since ContentParent::RecvSetClipboard and TabChild::RecvPasteTransferable both require the same setup to make a transferable. r=mrbkap
Jimmy Wang <jimmyw22@gmail.com>
parents: 312332
diff changeset
  2250
  nsresult rv;
3bb42e64430405cb93bcaee9e31affdf2314db8b Bug 1297539 - Add IPC message, PasteTransferable, to call PasteTransferable via a controller on the content process to handle the command content event, "pasteTransferable". New method nsContentUtils::IPCTransferableToTransferable since ContentParent::RecvSetClipboard and TabChild::RecvPasteTransferable both require the same setup to make a transferable. r=mrbkap
Jimmy Wang <jimmyw22@gmail.com>
parents: 312332
diff changeset
  2251
  nsCOMPtr<nsITransferable> trans =
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2252
      do_CreateInstance("@mozilla.org/widget/transferable;1", &rv);
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2253
  NS_ENSURE_SUCCESS(rv, IPC_OK());
312352
3bb42e64430405cb93bcaee9e31affdf2314db8b Bug 1297539 - Add IPC message, PasteTransferable, to call PasteTransferable via a controller on the content process to handle the command content event, "pasteTransferable". New method nsContentUtils::IPCTransferableToTransferable since ContentParent::RecvSetClipboard and TabChild::RecvPasteTransferable both require the same setup to make a transferable. r=mrbkap
Jimmy Wang <jimmyw22@gmail.com>
parents: 312332
diff changeset
  2254
  trans->Init(nullptr);
3bb42e64430405cb93bcaee9e31affdf2314db8b Bug 1297539 - Add IPC message, PasteTransferable, to call PasteTransferable via a controller on the content process to handle the command content event, "pasteTransferable". New method nsContentUtils::IPCTransferableToTransferable since ContentParent::RecvSetClipboard and TabChild::RecvPasteTransferable both require the same setup to make a transferable. r=mrbkap
Jimmy Wang <jimmyw22@gmail.com>
parents: 312332
diff changeset
  2255
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2256
  rv = nsContentUtils::IPCTransferableToTransferable(
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2257
      aDataTransfer, aIsPrivateData, aRequestingPrincipal, aContentPolicyType,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2258
      trans, nullptr, this);
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2259
  NS_ENSURE_SUCCESS(rv, IPC_OK());
312352
3bb42e64430405cb93bcaee9e31affdf2314db8b Bug 1297539 - Add IPC message, PasteTransferable, to call PasteTransferable via a controller on the content process to handle the command content event, "pasteTransferable". New method nsContentUtils::IPCTransferableToTransferable since ContentParent::RecvSetClipboard and TabChild::RecvPasteTransferable both require the same setup to make a transferable. r=mrbkap
Jimmy Wang <jimmyw22@gmail.com>
parents: 312332
diff changeset
  2260
3bb42e64430405cb93bcaee9e31affdf2314db8b Bug 1297539 - Add IPC message, PasteTransferable, to call PasteTransferable via a controller on the content process to handle the command content event, "pasteTransferable". New method nsContentUtils::IPCTransferableToTransferable since ContentParent::RecvSetClipboard and TabChild::RecvPasteTransferable both require the same setup to make a transferable. r=mrbkap
Jimmy Wang <jimmyw22@gmail.com>
parents: 312332
diff changeset
  2261
  nsCOMPtr<nsIDocShell> ourDocShell = do_GetInterface(WebNavigation());
3bb42e64430405cb93bcaee9e31affdf2314db8b Bug 1297539 - Add IPC message, PasteTransferable, to call PasteTransferable via a controller on the content process to handle the command content event, "pasteTransferable". New method nsContentUtils::IPCTransferableToTransferable since ContentParent::RecvSetClipboard and TabChild::RecvPasteTransferable both require the same setup to make a transferable. r=mrbkap
Jimmy Wang <jimmyw22@gmail.com>
parents: 312332
diff changeset
  2262
  if (NS_WARN_IF(!ourDocShell)) {
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2263
    return IPC_OK();
312352
3bb42e64430405cb93bcaee9e31affdf2314db8b Bug 1297539 - Add IPC message, PasteTransferable, to call PasteTransferable via a controller on the content process to handle the command content event, "pasteTransferable". New method nsContentUtils::IPCTransferableToTransferable since ContentParent::RecvSetClipboard and TabChild::RecvPasteTransferable both require the same setup to make a transferable. r=mrbkap
Jimmy Wang <jimmyw22@gmail.com>
parents: 312332
diff changeset
  2264
  }
3bb42e64430405cb93bcaee9e31affdf2314db8b Bug 1297539 - Add IPC message, PasteTransferable, to call PasteTransferable via a controller on the content process to handle the command content event, "pasteTransferable". New method nsContentUtils::IPCTransferableToTransferable since ContentParent::RecvSetClipboard and TabChild::RecvPasteTransferable both require the same setup to make a transferable. r=mrbkap
Jimmy Wang <jimmyw22@gmail.com>
parents: 312332
diff changeset
  2265
426442
da50b3158af37d5b3dacd133fd302ea639767fd1 Bug 1450882 - part 4: Make C++ users of nsICommandParams use nsCommandParams directly r=Ehsan
Masayuki Nakano <masayuki@d-toybox.com>
parents: 426408
diff changeset
  2266
  RefPtr<nsCommandParams> params = new nsCommandParams();
da50b3158af37d5b3dacd133fd302ea639767fd1 Bug 1450882 - part 4: Make C++ users of nsICommandParams use nsCommandParams directly r=Ehsan
Masayuki Nakano <masayuki@d-toybox.com>
parents: 426408
diff changeset
  2267
  rv = params->SetISupports("transferable", trans);
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2268
  NS_ENSURE_SUCCESS(rv, IPC_OK());
312352
3bb42e64430405cb93bcaee9e31affdf2314db8b Bug 1297539 - Add IPC message, PasteTransferable, to call PasteTransferable via a controller on the content process to handle the command content event, "pasteTransferable". New method nsContentUtils::IPCTransferableToTransferable since ContentParent::RecvSetClipboard and TabChild::RecvPasteTransferable both require the same setup to make a transferable. r=mrbkap
Jimmy Wang <jimmyw22@gmail.com>
parents: 312332
diff changeset
  2269
3bb42e64430405cb93bcaee9e31affdf2314db8b Bug 1297539 - Add IPC message, PasteTransferable, to call PasteTransferable via a controller on the content process to handle the command content event, "pasteTransferable". New method nsContentUtils::IPCTransferableToTransferable since ContentParent::RecvSetClipboard and TabChild::RecvPasteTransferable both require the same setup to make a transferable. r=mrbkap
Jimmy Wang <jimmyw22@gmail.com>
parents: 312332
diff changeset
  2270
  ourDocShell->DoCommandWithParams("cmd_pasteTransferable", params);
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2271
  return IPC_OK();
312352
3bb42e64430405cb93bcaee9e31affdf2314db8b Bug 1297539 - Add IPC message, PasteTransferable, to call PasteTransferable via a controller on the content process to handle the command content event, "pasteTransferable". New method nsContentUtils::IPCTransferableToTransferable since ContentParent::RecvSetClipboard and TabChild::RecvPasteTransferable both require the same setup to make a transferable. r=mrbkap
Jimmy Wang <jimmyw22@gmail.com>
parents: 312332
diff changeset
  2272
}
3bb42e64430405cb93bcaee9e31affdf2314db8b Bug 1297539 - Add IPC message, PasteTransferable, to call PasteTransferable via a controller on the content process to handle the command content event, "pasteTransferable". New method nsContentUtils::IPCTransferableToTransferable since ContentParent::RecvSetClipboard and TabChild::RecvPasteTransferable both require the same setup to make a transferable. r=mrbkap
Jimmy Wang <jimmyw22@gmail.com>
parents: 312332
diff changeset
  2273
504801
f8cf90698071b93818a2fe9df8a0d13d256aafb8 Bug 1600454 - Fix build with --disable-accessibility. r=MarcoZ
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 503185
diff changeset
  2274
#ifdef ACCESSIBILITY
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2275
a11y::PDocAccessibleChild* BrowserChild::AllocPDocAccessibleChild(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2276
    PDocAccessibleChild*, const uint64_t&, const uint32_t&,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2277
    const IAccessibleHolder&) {
246331
76fdd1a7e61da8051f8149d175f74c651e4e5f8e bug 1167295 - manage PDocAccessible with PBrowser instead of PContent r=smaug
Trevor Saunders <tbsaunde@tbsaunde.org>
parents: 245937
diff changeset
  2278
  MOZ_ASSERT(false, "should never call this!");
76fdd1a7e61da8051f8149d175f74c651e4e5f8e bug 1167295 - manage PDocAccessible with PBrowser instead of PContent r=smaug
Trevor Saunders <tbsaunde@tbsaunde.org>
parents: 245937
diff changeset
  2279
  return nullptr;
76fdd1a7e61da8051f8149d175f74c651e4e5f8e bug 1167295 - manage PDocAccessible with PBrowser instead of PContent r=smaug
Trevor Saunders <tbsaunde@tbsaunde.org>
parents: 245937
diff changeset
  2280
}
76fdd1a7e61da8051f8149d175f74c651e4e5f8e bug 1167295 - manage PDocAccessible with PBrowser instead of PContent r=smaug
Trevor Saunders <tbsaunde@tbsaunde.org>
parents: 245937
diff changeset
  2281
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2282
bool BrowserChild::DeallocPDocAccessibleChild(
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2283
    a11y::PDocAccessibleChild* aChild) {
246331
76fdd1a7e61da8051f8149d175f74c651e4e5f8e bug 1167295 - manage PDocAccessible with PBrowser instead of PContent r=smaug
Trevor Saunders <tbsaunde@tbsaunde.org>
parents: 245937
diff changeset
  2284
  delete static_cast<mozilla::a11y::DocAccessibleChild*>(aChild);
76fdd1a7e61da8051f8149d175f74c651e4e5f8e bug 1167295 - manage PDocAccessible with PBrowser instead of PContent r=smaug
Trevor Saunders <tbsaunde@tbsaunde.org>
parents: 245937
diff changeset
  2285
  return true;
76fdd1a7e61da8051f8149d175f74c651e4e5f8e bug 1167295 - manage PDocAccessible with PBrowser instead of PContent r=smaug
Trevor Saunders <tbsaunde@tbsaunde.org>
parents: 245937
diff changeset
  2286
}
504801
f8cf90698071b93818a2fe9df8a0d13d256aafb8 Bug 1600454 - Fix build with --disable-accessibility. r=MarcoZ
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 503185
diff changeset
  2287
#endif
246331
76fdd1a7e61da8051f8149d175f74c651e4e5f8e bug 1167295 - manage PDocAccessible with PBrowser instead of PContent r=smaug
Trevor Saunders <tbsaunde@tbsaunde.org>
parents: 245937
diff changeset
  2288
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2289
PColorPickerChild* BrowserChild::AllocPColorPickerChild(const nsString&,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2290
                                                        const nsString&) {
325156
afe43384706c6fc527164a746b7a8c8a2762d4ed Bug 1296189 - Replace NS_RUNTIMEABORT("some string literal message") with MOZ_CRASH(). r=froydnj
Tomislav Jurin <svezauzeto12@hotmail.com>
parents: 324806
diff changeset
  2291
  MOZ_CRASH("unused");
170128
02959a932fb7886d002f86cb29bc4ce57ac5c146 Bug 963294 - [e10s] Implement a proxy for the color picker. r=jdm
Tom Schuster <evilpies@gmail.com>
parents: 170123
diff changeset
  2292
  return nullptr;
02959a932fb7886d002f86cb29bc4ce57ac5c146 Bug 963294 - [e10s] Implement a proxy for the color picker. r=jdm
Tom Schuster <evilpies@gmail.com>
parents: 170123
diff changeset
  2293
}
02959a932fb7886d002f86cb29bc4ce57ac5c146 Bug 963294 - [e10s] Implement a proxy for the color picker. r=jdm
Tom Schuster <evilpies@gmail.com>
parents: 170123
diff changeset
  2294
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2295
bool BrowserChild::DeallocPColorPickerChild(PColorPickerChild* aColorPicker) {
170128
02959a932fb7886d002f86cb29bc4ce57ac5c146 Bug 963294 - [e10s] Implement a proxy for the color picker. r=jdm
Tom Schuster <evilpies@gmail.com>
parents: 170123
diff changeset
  2296
  nsColorPickerProxy* picker = static_cast<nsColorPickerProxy*>(aColorPicker);
02959a932fb7886d002f86cb29bc4ce57ac5c146 Bug 963294 - [e10s] Implement a proxy for the color picker. r=jdm
Tom Schuster <evilpies@gmail.com>
parents: 170123
diff changeset
  2297
  NS_RELEASE(picker);
02959a932fb7886d002f86cb29bc4ce57ac5c146 Bug 963294 - [e10s] Implement a proxy for the color picker. r=jdm
Tom Schuster <evilpies@gmail.com>
parents: 170123
diff changeset
  2298
  return true;
02959a932fb7886d002f86cb29bc4ce57ac5c146 Bug 963294 - [e10s] Implement a proxy for the color picker. r=jdm
Tom Schuster <evilpies@gmail.com>
parents: 170123
diff changeset
  2299
}
02959a932fb7886d002f86cb29bc4ce57ac5c146 Bug 963294 - [e10s] Implement a proxy for the color picker. r=jdm
Tom Schuster <evilpies@gmail.com>
parents: 170123
diff changeset
  2300
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2301
PFilePickerChild* BrowserChild::AllocPFilePickerChild(const nsString&,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2302
                                                      const int16_t&) {
325156
afe43384706c6fc527164a746b7a8c8a2762d4ed Bug 1296189 - Replace NS_RUNTIMEABORT("some string literal message") with MOZ_CRASH(). r=froydnj
Tomislav Jurin <svezauzeto12@hotmail.com>
parents: 324806
diff changeset
  2303
  MOZ_CRASH("unused");
169202
3e38ac18ab846e1971de5c96bb8c612edaeef540 Bug 910384 - Change nsFilePickerProxy to be asynchronous and add a proper IPDL protocol for it. r=jdm
Tom Schuster <evilpies@gmail.com>
parents: 168894
diff changeset
  2304
  return nullptr;
3e38ac18ab846e1971de5c96bb8c612edaeef540 Bug 910384 - Change nsFilePickerProxy to be asynchronous and add a proper IPDL protocol for it. r=jdm
Tom Schuster <evilpies@gmail.com>
parents: 168894
diff changeset
  2305
}
3e38ac18ab846e1971de5c96bb8c612edaeef540 Bug 910384 - Change nsFilePickerProxy to be asynchronous and add a proper IPDL protocol for it. r=jdm
Tom Schuster <evilpies@gmail.com>
parents: 168894
diff changeset
  2306
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2307
bool BrowserChild::DeallocPFilePickerChild(PFilePickerChild* actor) {
169202
3e38ac18ab846e1971de5c96bb8c612edaeef540 Bug 910384 - Change nsFilePickerProxy to be asynchronous and add a proper IPDL protocol for it. r=jdm
Tom Schuster <evilpies@gmail.com>
parents: 168894
diff changeset
  2308
  nsFilePickerProxy* filePicker = static_cast<nsFilePickerProxy*>(actor);
3e38ac18ab846e1971de5c96bb8c612edaeef540 Bug 910384 - Change nsFilePickerProxy to be asynchronous and add a proper IPDL protocol for it. r=jdm
Tom Schuster <evilpies@gmail.com>
parents: 168894
diff changeset
  2309
  NS_RELEASE(filePicker);
3e38ac18ab846e1971de5c96bb8c612edaeef540 Bug 910384 - Change nsFilePickerProxy to be asynchronous and add a proper IPDL protocol for it. r=jdm
Tom Schuster <evilpies@gmail.com>
parents: 168894
diff changeset
  2310
  return true;
3e38ac18ab846e1971de5c96bb8c612edaeef540 Bug 910384 - Change nsFilePickerProxy to be asynchronous and add a proper IPDL protocol for it. r=jdm
Tom Schuster <evilpies@gmail.com>
parents: 168894
diff changeset
  2311
}
3e38ac18ab846e1971de5c96bb8c612edaeef540 Bug 910384 - Change nsFilePickerProxy to be asynchronous and add a proper IPDL protocol for it. r=jdm
Tom Schuster <evilpies@gmail.com>
parents: 168894
diff changeset
  2312
559023
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
  2313
PVsyncChild* BrowserChild::AllocPVsyncChild() {
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
  2314
  RefPtr<dom::VsyncChild> actor = new VsyncChild();
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
  2315
  // There still has one ref-count after return, and it will be released in
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
  2316
  // DeallocPVsyncChild().
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
  2317
  return actor.forget().take();
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
  2318
}
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
  2319
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
  2320
bool BrowserChild::DeallocPVsyncChild(PVsyncChild* aActor) {
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
  2321
  MOZ_ASSERT(aActor);
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
  2322
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
  2323
  // This actor already has one ref-count. Please check AllocPVsyncChild().
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
  2324
  RefPtr<VsyncChild> actor = dont_AddRef(static_cast<VsyncChild*>(aActor));
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
  2325
  return true;
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
  2326
}
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
  2327
561769
Robert Mader <robert.mader@posteo.de>
parents: 561768
diff changeset
  2328
RefPtr<VsyncChild> BrowserChild::GetVsyncChild() {
Robert Mader <robert.mader@posteo.de>
parents: 561768
diff changeset
  2329
  // Initializing mVsyncChild here turns on per-BrowserChild Vsync for a
Robert Mader <robert.mader@posteo.de>
parents: 561768
diff changeset
  2330
  // given platform. Note: this only makes sense if nsWindow returns a
Robert Mader <robert.mader@posteo.de>
parents: 561768
diff changeset
  2331
  // window-specific VsyncSource.
Robert Mader <robert.mader@posteo.de>
parents: 561768
diff changeset
  2332
#if defined(MOZ_WAYLAND)
569307
49a6125392f5d6ce92443676d6297c46980d4a29 Bug 1695453 - Rename IsWaylandDisabled to IsWaylandEnabled, r=stransky
Robert Mader <robert.mader@posteo.de>
parents: 569013
diff changeset
  2333
  if (IsWaylandEnabled() && !mVsyncChild) {
561769
Robert Mader <robert.mader@posteo.de>
parents: 561768
diff changeset
  2334
    PVsyncChild* actor = SendPVsyncConstructor();
Robert Mader <robert.mader@posteo.de>
parents: 561768
diff changeset
  2335
    mVsyncChild = static_cast<VsyncChild*>(actor);
Robert Mader <robert.mader@posteo.de>
parents: 561768
diff changeset
  2336
  }
Robert Mader <robert.mader@posteo.de>
parents: 561768
diff changeset
  2337
#endif
Robert Mader <robert.mader@posteo.de>
parents: 561768
diff changeset
  2338
  return mVsyncChild;
Robert Mader <robert.mader@posteo.de>
parents: 561768
diff changeset
  2339
}
559023
e4dc75be2d567794f20d9b79d6396d4e7faf36dd Bug 1645528 - Connect nsRefreshDrivers in content processes with a widget-local vsync source r=mattwoodrow,emilio
Robert Mader <robert.mader@posteo.de>
parents: 558615
diff changeset
  2340
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2341
mozilla::ipc::IPCResult BrowserChild::RecvActivateFrameEvent(
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2342
    const nsString& aType, const bool& capture) {
282426
e22b3043887ed36bf2c634c2924a7c8d39d226b1 Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug
Kyle Huey <khuey@kylehuey.com>
parents: 282389
diff changeset
  2343
  nsCOMPtr<nsPIDOMWindowOuter> window = do_GetInterface(WebNavigation());
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2344
  NS_ENSURE_TRUE(window, IPC_OK());
431226
674c721d44fee8c4edd243312cbc73f81122e5d0 Bug 1481645 - Remove some redundant uses of do_QueryInterface. r=bzbarsky
Adrian Wielgosik <adrian.wielgosik@gmail.com>
parents: 430929
diff changeset
  2345
  nsCOMPtr<EventTarget> chromeHandler = window->GetChromeEventHandler();
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2346
  NS_ENSURE_TRUE(chromeHandler, IPC_OK());
268184
e8c7dfe727cd970e2c3294934e2927b14143c205 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
Nathan Froyd <froydnj@mozilla.com>
parents: 267632
diff changeset
  2347
  RefPtr<ContentListener> listener = new ContentListener(this);
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
  2348
  chromeHandler->AddEventListener(aType, listener, capture);
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2349
  return IPC_OK();
36268
f80b4464d261a7ab6c6b340449dda2f7c272b511 Revert the electrolysis-plugins-only branch so that the Electrolysis repository can return to its normal (plugins and tabs) state.
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff changeset
  2350
}
46683
416375517820bf550a6bf64a0d5a4ba729eb6d97 Bug 542242 - E10s, content process event handlers, r=jst, r=bsmedberg
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46682
diff changeset
  2351
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2352
mozilla::ipc::IPCResult BrowserChild::RecvLoadRemoteScript(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2353
    const nsString& aURL, const bool& aRunInGlobalScope) {
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2354
  if (!InitBrowserChildMessageManager())
74131
8c6c251baaec5f0c01fe2221e0230c17032e290c Bug 648484, parts 3, 3.1, and 3.2: Allow passing a "backend hint" to GetLayerManager() to request a non-default layer manager backend. Deal with failure to hook up shadow layers. sr=roc
Chris Jones <jones.chris.g@gmail.com>
parents: 73394
diff changeset
  2355
    // This can happen if we're half-destroyed.  It's not a fatal
8c6c251baaec5f0c01fe2221e0230c17032e290c Bug 648484, parts 3, 3.1, and 3.2: Allow passing a "backend hint" to GetLayerManager() to request a non-default layer manager backend. Deal with failure to hook up shadow layers. sr=roc
Chris Jones <jones.chris.g@gmail.com>
parents: 73394
diff changeset
  2356
    // error.
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2357
    return IPC_OK();
51362
090abc158c8ce764fd899c62539fa613947f9af3 Bug 586283 - RecvLoadRemoteScript called before TabChild::InitTabChildGlobal finished. Prevent event loop rotation problem, and RecvLoadRemoteScript call during RecvCreateWidget r=olli
Oleg Romashin <romaxa@gmail.com>
parents: 51342
diff changeset
  2358
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2359
  JS::Rooted<JSObject*> mm(RootingCx(),
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2360
                           mBrowserChildMessageManager->GetOrCreateWrapper());
431547
c7a263321e999b1806b8facd31177ca026a7a33f Bug 1480244: Part 4 - Make child message managers non-global objects. r=bz
Kris Maglione <maglione.k@gmail.com>
parents: 431542
diff changeset
  2361
  if (!mm) {
409299
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  2362
    // This can happen if we're half-destroyed.  It's not a fatal error.
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  2363
    return IPC_OK();
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  2364
  }
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  2365
431547
c7a263321e999b1806b8facd31177ca026a7a33f Bug 1480244: Part 4 - Make child message managers non-global objects. r=bz
Kris Maglione <maglione.k@gmail.com>
parents: 431542
diff changeset
  2366
  LoadScriptInternal(mm, aURL, !aRunInGlobalScope);
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2367
  return IPC_OK();
46683
416375517820bf550a6bf64a0d5a4ba729eb6d97 Bug 542242 - E10s, content process event handlers, r=jst, r=bsmedberg
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46682
diff changeset
  2368
}
416375517820bf550a6bf64a0d5a4ba729eb6d97 Bug 542242 - E10s, content process event handlers, r=jst, r=bsmedberg
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46682
diff changeset
  2369
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2370
mozilla::ipc::IPCResult BrowserChild::RecvAsyncMessage(
525196
b6848f971b5704f41dbd97facb037ae0558591fd Bug 1631358 - remove CPOW support in the message manager, r=mccr8
Gijs Kruitbosch <gijskruitbosch@gmail.com>
parents: 524975
diff changeset
  2371
    const nsString& aMessage, const ClonedMessageData& aData) {
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2372
  AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING("BrowserChild::RecvAsyncMessage",
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2373
                                             OTHER, aMessage);
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2374
  MMPrinter::Print("BrowserChild::RecvAsyncMessage", aMessage, aData);
350507
42d542898d8014a53c77bd26dcf636e252a69bf2 Bug 1348426 - Add profiler labels to RecvSync/Async/RpcMessage that include the message name. r=billm
Markus Stange <mstange@themasta.com>
parents: 350171
diff changeset
  2375
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2376
  if (!mBrowserChildMessageManager) {
329755
d75f6cff73c834f8226da39a8599cc3c82cedc8b Bug 1331193 Make TabChild handle a nullptr mMessageManager. r=smaug
Ben Kelly <ben@wanderview.com>
parents: 329641
diff changeset
  2377
    return IPC_OK();
46683
416375517820bf550a6bf64a0d5a4ba729eb6d97 Bug 542242 - E10s, content process event handlers, r=jst, r=bsmedberg
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46682
diff changeset
  2378
  }
329755
d75f6cff73c834f8226da39a8599cc3c82cedc8b Bug 1331193 Make TabChild handle a nullptr mMessageManager. r=smaug
Ben Kelly <ben@wanderview.com>
parents: 329641
diff changeset
  2379
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2380
  RefPtr<nsFrameMessageManager> mm =
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2381
      mBrowserChildMessageManager->GetMessageManager();
409299
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  2382
329755
d75f6cff73c834f8226da39a8599cc3c82cedc8b Bug 1331193 Make TabChild handle a nullptr mMessageManager. r=smaug
Ben Kelly <ben@wanderview.com>
parents: 329641
diff changeset
  2383
  // We should have a message manager if the global is alive, but it
d75f6cff73c834f8226da39a8599cc3c82cedc8b Bug 1331193 Make TabChild handle a nullptr mMessageManager. r=smaug
Ben Kelly <ben@wanderview.com>
parents: 329641
diff changeset
  2384
  // seems sometimes we don't.  Assert in aurora/nightly, but don't
d75f6cff73c834f8226da39a8599cc3c82cedc8b Bug 1331193 Make TabChild handle a nullptr mMessageManager. r=smaug
Ben Kelly <ben@wanderview.com>
parents: 329641
diff changeset
  2385
  // crash in release builds.
409299
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  2386
  MOZ_DIAGNOSTIC_ASSERT(mm);
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  2387
  if (!mm) {
329755
d75f6cff73c834f8226da39a8599cc3c82cedc8b Bug 1331193 Make TabChild handle a nullptr mMessageManager. r=smaug
Ben Kelly <ben@wanderview.com>
parents: 329641
diff changeset
  2388
    return IPC_OK();
d75f6cff73c834f8226da39a8599cc3c82cedc8b Bug 1331193 Make TabChild handle a nullptr mMessageManager. r=smaug
Ben Kelly <ben@wanderview.com>
parents: 329641
diff changeset
  2389
  }
d75f6cff73c834f8226da39a8599cc3c82cedc8b Bug 1331193 Make TabChild handle a nullptr mMessageManager. r=smaug
Ben Kelly <ben@wanderview.com>
parents: 329641
diff changeset
  2390
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2391
  JS::Rooted<JSObject*> kungFuDeathGrip(
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2392
      dom::RootingCx(), mBrowserChildMessageManager->GetWrapper());
329755
d75f6cff73c834f8226da39a8599cc3c82cedc8b Bug 1331193 Make TabChild handle a nullptr mMessageManager. r=smaug
Ben Kelly <ben@wanderview.com>
parents: 329641
diff changeset
  2393
  StructuredCloneData data;
d75f6cff73c834f8226da39a8599cc3c82cedc8b Bug 1331193 Make TabChild handle a nullptr mMessageManager. r=smaug
Ben Kelly <ben@wanderview.com>
parents: 329641
diff changeset
  2394
  UnpackClonedMessageDataForChild(aData, data);
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2395
  mm->ReceiveMessage(static_cast<EventTarget*>(mBrowserChildMessageManager),
525196
b6848f971b5704f41dbd97facb037ae0558591fd Bug 1631358 - remove CPOW support in the message manager, r=mccr8
Gijs Kruitbosch <gijskruitbosch@gmail.com>
parents: 524975
diff changeset
  2396
                     nullptr, aMessage, false, &data, nullptr, IgnoreErrors());
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2397
  return IPC_OK();
46683
416375517820bf550a6bf64a0d5a4ba729eb6d97 Bug 542242 - E10s, content process event handlers, r=jst, r=bsmedberg
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46682
diff changeset
  2398
}
416375517820bf550a6bf64a0d5a4ba729eb6d97 Bug 542242 - E10s, content process event handlers, r=jst, r=bsmedberg
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46682
diff changeset
  2399
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2400
mozilla::ipc::IPCResult BrowserChild::RecvSwappedWithOtherRemoteLoader(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2401
    const IPCTabContext& aContext) {
243189
eb58a88c452916195554b6338c82a3178eb85d87 Bug 1136478 - Fire pagehide / pageshow events in content after swapping remote frame loaders. r=smaug.
Mike Conley <mconley@mozilla.com>
parents: 242882
diff changeset
  2402
  nsCOMPtr<nsIDocShell> ourDocShell = do_GetInterface(WebNavigation());
eb58a88c452916195554b6338c82a3178eb85d87 Bug 1136478 - Fire pagehide / pageshow events in content after swapping remote frame loaders. r=smaug.
Mike Conley <mconley@mozilla.com>
parents: 242882
diff changeset
  2403
  if (NS_WARN_IF(!ourDocShell)) {
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2404
    return IPC_OK();
243189
eb58a88c452916195554b6338c82a3178eb85d87 Bug 1136478 - Fire pagehide / pageshow events in content after swapping remote frame loaders. r=smaug.
Mike Conley <mconley@mozilla.com>
parents: 242882
diff changeset
  2405
  }
eb58a88c452916195554b6338c82a3178eb85d87 Bug 1136478 - Fire pagehide / pageshow events in content after swapping remote frame loaders. r=smaug.
Mike Conley <mconley@mozilla.com>
parents: 242882
diff changeset
  2406
282426
e22b3043887ed36bf2c634c2924a7c8d39d226b1 Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug
Kyle Huey <khuey@kylehuey.com>
parents: 282389
diff changeset
  2407
  nsCOMPtr<nsPIDOMWindowOuter> ourWindow = ourDocShell->GetWindow();
243189
eb58a88c452916195554b6338c82a3178eb85d87 Bug 1136478 - Fire pagehide / pageshow events in content after swapping remote frame loaders. r=smaug.
Mike Conley <mconley@mozilla.com>
parents: 242882
diff changeset
  2408
  if (NS_WARN_IF(!ourWindow)) {
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2409
    return IPC_OK();
243189
eb58a88c452916195554b6338c82a3178eb85d87 Bug 1136478 - Fire pagehide / pageshow events in content after swapping remote frame loaders. r=smaug.
Mike Conley <mconley@mozilla.com>
parents: 242882
diff changeset
  2410
  }
eb58a88c452916195554b6338c82a3178eb85d87 Bug 1136478 - Fire pagehide / pageshow events in content after swapping remote frame loaders. r=smaug.
Mike Conley <mconley@mozilla.com>
parents: 242882
diff changeset
  2411
268184
e8c7dfe727cd970e2c3294934e2927b14143c205 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
Nathan Froyd <froydnj@mozilla.com>
parents: 267632
diff changeset
  2412
  RefPtr<nsDocShell> docShell = static_cast<nsDocShell*>(ourDocShell.get());
256866
abd120a5b64087e0c8f43b596d60f269b5dff466 Bug 1191491 - Do not dispatch an audio-playback notification when swapping browsers; r=smaug
Ehsan Akhgari <ehsan@mozilla.com>
parents: 256578
diff changeset
  2413
432214
335facce978ea7f9ef1e8dcfafc082e5b99f5a47 Bug 1483664: Part 0 - Dispatch pagehide/pageshow to all system group listeners on frameloader swap. r=smaug,mconley
Kris Maglione <maglione.k@gmail.com>
parents: 431781
diff changeset
  2414
  nsCOMPtr<EventTarget> ourEventTarget = nsGlobalWindowOuter::Cast(ourWindow);
243189
eb58a88c452916195554b6338c82a3178eb85d87 Bug 1136478 - Fire pagehide / pageshow events in content after swapping remote frame loaders. r=smaug.
Mike Conley <mconley@mozilla.com>
parents: 242882
diff changeset
  2415
256866
abd120a5b64087e0c8f43b596d60f269b5dff466 Bug 1191491 - Do not dispatch an audio-playback notification when swapping browsers; r=smaug
Ehsan Akhgari <ehsan@mozilla.com>
parents: 256578
diff changeset
  2416
  docShell->SetInFrameSwap(true);
abd120a5b64087e0c8f43b596d60f269b5dff466 Bug 1191491 - Do not dispatch an audio-playback notification when swapping browsers; r=smaug
Ehsan Akhgari <ehsan@mozilla.com>
parents: 256578
diff changeset
  2417
494475
19ac58d9d129891f54bb1c79c3554cbac0b5967e Bug 1578379 - Make pageshow / pagehide during frame loader swaps not mess with document visibility. r=bzbarsky
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 494474
diff changeset
  2418
  nsContentUtils::FirePageShowEventForFrameLoaderSwap(
19ac58d9d129891f54bb1c79c3554cbac0b5967e Bug 1578379 - Make pageshow / pagehide during frame loader swaps not mess with document visibility. r=bzbarsky
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 494474
diff changeset
  2419
      ourDocShell, ourEventTarget, false, true);
19ac58d9d129891f54bb1c79c3554cbac0b5967e Bug 1578379 - Make pageshow / pagehide during frame loader swaps not mess with document visibility. r=bzbarsky
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 494474
diff changeset
  2420
  nsContentUtils::FirePageHideEventForFrameLoaderSwap(ourDocShell,
19ac58d9d129891f54bb1c79c3554cbac0b5967e Bug 1578379 - Make pageshow / pagehide during frame loader swaps not mess with document visibility. r=bzbarsky
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 494474
diff changeset
  2421
                                                      ourEventTarget, true);
296009
88d9ca956c2ca82816ffa85cb286361e9ec4c9cf Bug 1268688 - Start browser API for frames swapping to HTML. r=bz
J. Ryan Stinnett <jryans@gmail.com>
parents: 294847
diff changeset
  2422
88d9ca956c2ca82816ffa85cb286361e9ec4c9cf Bug 1268688 - Start browser API for frames swapping to HTML. r=bz
J. Ryan Stinnett <jryans@gmail.com>
parents: 294847
diff changeset
  2423
  // Owner content type may have changed, so store the possibly updated context
88d9ca956c2ca82816ffa85cb286361e9ec4c9cf Bug 1268688 - Start browser API for frames swapping to HTML. r=bz
J. Ryan Stinnett <jryans@gmail.com>
parents: 294847
diff changeset
  2424
  // and notify others.
88d9ca956c2ca82816ffa85cb286361e9ec4c9cf Bug 1268688 - Start browser API for frames swapping to HTML. r=bz
J. Ryan Stinnett <jryans@gmail.com>
parents: 294847
diff changeset
  2425
  MaybeInvalidTabContext maybeContext(aContext);
88d9ca956c2ca82816ffa85cb286361e9ec4c9cf Bug 1268688 - Start browser API for frames swapping to HTML. r=bz
J. Ryan Stinnett <jryans@gmail.com>
parents: 294847
diff changeset
  2426
  if (!maybeContext.IsValid()) {
88d9ca956c2ca82816ffa85cb286361e9ec4c9cf Bug 1268688 - Start browser API for frames swapping to HTML. r=bz
J. Ryan Stinnett <jryans@gmail.com>
parents: 294847
diff changeset
  2427
    NS_ERROR(nsPrintfCString("Received an invalid TabContext from "
88d9ca956c2ca82816ffa85cb286361e9ec4c9cf Bug 1268688 - Start browser API for frames swapping to HTML. r=bz
J. Ryan Stinnett <jryans@gmail.com>
parents: 294847
diff changeset
  2428
                             "the parent process. (%s)",
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2429
                             maybeContext.GetInvalidReason())
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2430
                 .get());
296009
88d9ca956c2ca82816ffa85cb286361e9ec4c9cf Bug 1268688 - Start browser API for frames swapping to HTML. r=bz
J. Ryan Stinnett <jryans@gmail.com>
parents: 294847
diff changeset
  2431
    MOZ_CRASH("Invalid TabContext received from the parent process.");
88d9ca956c2ca82816ffa85cb286361e9ec4c9cf Bug 1268688 - Start browser API for frames swapping to HTML. r=bz
J. Ryan Stinnett <jryans@gmail.com>
parents: 294847
diff changeset
  2432
  }
88d9ca956c2ca82816ffa85cb286361e9ec4c9cf Bug 1268688 - Start browser API for frames swapping to HTML. r=bz
J. Ryan Stinnett <jryans@gmail.com>
parents: 294847
diff changeset
  2433
88d9ca956c2ca82816ffa85cb286361e9ec4c9cf Bug 1268688 - Start browser API for frames swapping to HTML. r=bz
J. Ryan Stinnett <jryans@gmail.com>
parents: 294847
diff changeset
  2434
  if (!UpdateTabContextAfterSwap(maybeContext.GetTabContext())) {
88d9ca956c2ca82816ffa85cb286361e9ec4c9cf Bug 1268688 - Start browser API for frames swapping to HTML. r=bz
J. Ryan Stinnett <jryans@gmail.com>
parents: 294847
diff changeset
  2435
    MOZ_CRASH("Update to TabContext after swap was denied.");
88d9ca956c2ca82816ffa85cb286361e9ec4c9cf Bug 1268688 - Start browser API for frames swapping to HTML. r=bz
J. Ryan Stinnett <jryans@gmail.com>
parents: 294847
diff changeset
  2436
  }
297648
c98c66836c74b4afb687f1cea822e575d7a015b4 Bug 1250063 - Part 2: don't call notifyTabContextUpdated(). r=sicking
Yoshi Huang <allstars.chh@mozilla.com>
parents: 297528
diff changeset
  2437
296009
88d9ca956c2ca82816ffa85cb286361e9ec4c9cf Bug 1268688 - Start browser API for frames swapping to HTML. r=bz
J. Ryan Stinnett <jryans@gmail.com>
parents: 294847
diff changeset
  2438
  // Ignore previous value of mTriedBrowserInit since owner content has changed.
88d9ca956c2ca82816ffa85cb286361e9ec4c9cf Bug 1268688 - Start browser API for frames swapping to HTML. r=bz
J. Ryan Stinnett <jryans@gmail.com>
parents: 294847
diff changeset
  2439
  mTriedBrowserInit = true;
88d9ca956c2ca82816ffa85cb286361e9ec4c9cf Bug 1268688 - Start browser API for frames swapping to HTML. r=bz
J. Ryan Stinnett <jryans@gmail.com>
parents: 294847
diff changeset
  2440
494475
19ac58d9d129891f54bb1c79c3554cbac0b5967e Bug 1578379 - Make pageshow / pagehide during frame loader swaps not mess with document visibility. r=bzbarsky
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 494474
diff changeset
  2441
  nsContentUtils::FirePageShowEventForFrameLoaderSwap(
19ac58d9d129891f54bb1c79c3554cbac0b5967e Bug 1578379 - Make pageshow / pagehide during frame loader swaps not mess with document visibility. r=bzbarsky
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 494474
diff changeset
  2442
      ourDocShell, ourEventTarget, true, true);
256866
abd120a5b64087e0c8f43b596d60f269b5dff466 Bug 1191491 - Do not dispatch an audio-playback notification when swapping browsers; r=smaug
Ehsan Akhgari <ehsan@mozilla.com>
parents: 256578
diff changeset
  2443
abd120a5b64087e0c8f43b596d60f269b5dff466 Bug 1191491 - Do not dispatch an audio-playback notification when swapping browsers; r=smaug
Ehsan Akhgari <ehsan@mozilla.com>
parents: 256578
diff changeset
  2444
  docShell->SetInFrameSwap(false);
abd120a5b64087e0c8f43b596d60f269b5dff466 Bug 1191491 - Do not dispatch an audio-playback notification when swapping browsers; r=smaug
Ehsan Akhgari <ehsan@mozilla.com>
parents: 256578
diff changeset
  2445
494475
19ac58d9d129891f54bb1c79c3554cbac0b5967e Bug 1578379 - Make pageshow / pagehide during frame loader swaps not mess with document visibility. r=bzbarsky
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 494474
diff changeset
  2446
  // This is needed to get visibility state right in cases when we swapped a
19ac58d9d129891f54bb1c79c3554cbac0b5967e Bug 1578379 - Make pageshow / pagehide during frame loader swaps not mess with document visibility. r=bzbarsky
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 494474
diff changeset
  2447
  // visible tab (foreground in visible window) with a non-visible tab.
19ac58d9d129891f54bb1c79c3554cbac0b5967e Bug 1578379 - Make pageshow / pagehide during frame loader swaps not mess with document visibility. r=bzbarsky
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 494474
diff changeset
  2448
  if (RefPtr<Document> doc = docShell->GetDocument()) {
19ac58d9d129891f54bb1c79c3554cbac0b5967e Bug 1578379 - Make pageshow / pagehide during frame loader swaps not mess with document visibility. r=bzbarsky
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 494474
diff changeset
  2449
    doc->UpdateVisibilityState();
19ac58d9d129891f54bb1c79c3554cbac0b5967e Bug 1578379 - Make pageshow / pagehide during frame loader swaps not mess with document visibility. r=bzbarsky
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 494474
diff changeset
  2450
  }
19ac58d9d129891f54bb1c79c3554cbac0b5967e Bug 1578379 - Make pageshow / pagehide during frame loader swaps not mess with document visibility. r=bzbarsky
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 494474
diff changeset
  2451
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2452
  return IPC_OK();
243189
eb58a88c452916195554b6338c82a3178eb85d87 Bug 1136478 - Fire pagehide / pageshow events in content after swapping remote frame loaders. r=smaug.
Mike Conley <mconley@mozilla.com>
parents: 242882
diff changeset
  2453
}
eb58a88c452916195554b6338c82a3178eb85d87 Bug 1136478 - Fire pagehide / pageshow events in content after swapping remote frame loaders. r=smaug.
Mike Conley <mconley@mozilla.com>
parents: 242882
diff changeset
  2454
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2455
mozilla::ipc::IPCResult BrowserChild::RecvHandleAccessKey(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2456
    const WidgetKeyboardEvent& aEvent, nsTArray<uint32_t>&& aCharCodes) {
469386
148e810b01d22b00e254c445dda2f659534103a7 Bug 1542664 - Make TabChild use mozilla::PresShell directly rather than via nsIPresShell r=nika
Masayuki Nakano <masayuki@d-toybox.com>
parents: 469371
diff changeset
  2457
  nsCOMPtr<Document> document(GetTopLevelDocument());
404585
3790c8adcba31c0a49bda55161777a7992fbfb4a Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 404432
diff changeset
  2458
  RefPtr<nsPresContext> pc = document->GetPresContext();
3790c8adcba31c0a49bda55161777a7992fbfb4a Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 404432
diff changeset
  2459
  if (pc) {
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2460
    if (!pc->EventStateManager()->HandleAccessKey(
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2461
            &(const_cast<WidgetKeyboardEvent&>(aEvent)), pc, aCharCodes)) {
404585
3790c8adcba31c0a49bda55161777a7992fbfb4a Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 404432
diff changeset
  2462
      // If no accesskey was found, inform the parent so that accesskeys on
3790c8adcba31c0a49bda55161777a7992fbfb4a Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 404432
diff changeset
  2463
      // menus can be handled.
3790c8adcba31c0a49bda55161777a7992fbfb4a Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 404432
diff changeset
  2464
      WidgetKeyboardEvent localEvent(aEvent);
3790c8adcba31c0a49bda55161777a7992fbfb4a Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 404432
diff changeset
  2465
      localEvent.mWidget = mPuppetWidget;
3790c8adcba31c0a49bda55161777a7992fbfb4a Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 404432
diff changeset
  2466
      SendAccessKeyNotHandled(localEvent);
263235
30333d9cbcb9aaa4c38e92cb3a299bc81954fe6a Bug 1168042, support accesskey redirecting to content process, r=masayuki
Neil Deakin <neil@mozilla.com>
parents: 262348
diff changeset
  2467
    }
30333d9cbcb9aaa4c38e92cb3a299bc81954fe6a Bug 1168042, support accesskey redirecting to content process, r=masayuki
Neil Deakin <neil@mozilla.com>
parents: 262348
diff changeset
  2468
  }
30333d9cbcb9aaa4c38e92cb3a299bc81954fe6a Bug 1168042, support accesskey redirecting to content process, r=masayuki
Neil Deakin <neil@mozilla.com>
parents: 262348
diff changeset
  2469
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2470
  return IPC_OK();
263235
30333d9cbcb9aaa4c38e92cb3a299bc81954fe6a Bug 1168042, support accesskey redirecting to content process, r=masayuki
Neil Deakin <neil@mozilla.com>
parents: 262348
diff changeset
  2471
}
30333d9cbcb9aaa4c38e92cb3a299bc81954fe6a Bug 1168042, support accesskey redirecting to content process, r=masayuki
Neil Deakin <neil@mozilla.com>
parents: 262348
diff changeset
  2472
547218
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2473
mozilla::ipc::IPCResult BrowserChild::RecvPrintPreview(
576458
b10ba48bdd684b89aebc8c90939e0db0e6c3a210 Bug 1705757 - Make printing a single frame choose the right process for the preview frame. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 575979
diff changeset
  2474
    const PrintData& aPrintData, const MaybeDiscardedBrowsingContext& aSourceBC,
547218
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2475
    PrintPreviewResolver&& aCallback) {
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2476
#ifdef NS_PRINTING
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2477
  // If we didn't succeed in passing off ownership of aCallback, then something
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2478
  // went wrong.
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2479
  auto sendCallbackError = MakeScopeExit([&] {
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2480
    if (aCallback) {
560146
01866a705cf38ee53c336a514266716c93f7eba9 Bug 1681095 - Add a privileged API to tell the print dialog whether a selection belongs to the previewed page vs. an iframe. r=dholbert
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 559955
diff changeset
  2481
      aCallback(
01866a705cf38ee53c336a514266716c93f7eba9 Bug 1681095 - Add a privileged API to tell the print dialog whether a selection belongs to the previewed page vs. an iframe. r=dholbert
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 559955
diff changeset
  2482
          PrintPreviewResultInfo(0, 0, false, false, false));  // signal error
547218
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2483
    }
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2484
  });
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2485
576458
b10ba48bdd684b89aebc8c90939e0db0e6c3a210 Bug 1705757 - Make printing a single frame choose the right process for the preview frame. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 575979
diff changeset
  2486
  if (NS_WARN_IF(aSourceBC.IsDiscarded())) {
b10ba48bdd684b89aebc8c90939e0db0e6c3a210 Bug 1705757 - Make printing a single frame choose the right process for the preview frame. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 575979
diff changeset
  2487
    return IPC_OK();
b10ba48bdd684b89aebc8c90939e0db0e6c3a210 Bug 1705757 - Make printing a single frame choose the right process for the preview frame. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 575979
diff changeset
  2488
  }
b10ba48bdd684b89aebc8c90939e0db0e6c3a210 Bug 1705757 - Make printing a single frame choose the right process for the preview frame. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 575979
diff changeset
  2489
547218
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2490
  RefPtr<nsGlobalWindowOuter> sourceWindow;
576458
b10ba48bdd684b89aebc8c90939e0db0e6c3a210 Bug 1705757 - Make printing a single frame choose the right process for the preview frame. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 575979
diff changeset
  2491
  if (!aSourceBC.IsNull()) {
b10ba48bdd684b89aebc8c90939e0db0e6c3a210 Bug 1705757 - Make printing a single frame choose the right process for the preview frame. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 575979
diff changeset
  2492
    sourceWindow = nsGlobalWindowOuter::Cast(aSourceBC.get()->GetDOMWindow());
547218
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2493
    if (NS_WARN_IF(!sourceWindow)) {
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2494
      return IPC_OK();
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2495
    }
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2496
  } else {
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2497
    nsCOMPtr<nsPIDOMWindowOuter> ourWindow = do_GetInterface(WebNavigation());
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2498
    if (NS_WARN_IF(!ourWindow)) {
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2499
      return IPC_OK();
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2500
    }
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2501
    sourceWindow = nsGlobalWindowOuter::Cast(ourWindow);
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2502
  }
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2503
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2504
  RefPtr<nsIPrintSettings> printSettings;
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2505
  nsCOMPtr<nsIPrintSettingsService> printSettingsSvc =
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2506
      do_GetService("@mozilla.org/gfx/printsettings-service;1");
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2507
  if (NS_WARN_IF(!printSettingsSvc)) {
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2508
    return IPC_OK();
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2509
  }
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2510
  printSettingsSvc->GetNewPrintSettings(getter_AddRefs(printSettings));
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2511
  if (NS_WARN_IF(!printSettings)) {
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2512
    return IPC_OK();
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2513
  }
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2514
  printSettingsSvc->DeserializeToPrintSettings(aPrintData, printSettings);
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2515
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2516
  nsCOMPtr<nsIDocShell> docShellToCloneInto;
576458
b10ba48bdd684b89aebc8c90939e0db0e6c3a210 Bug 1705757 - Make printing a single frame choose the right process for the preview frame. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 575979
diff changeset
  2517
  if (!aSourceBC.IsNull()) {
547218
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2518
    docShellToCloneInto = do_GetInterface(WebNavigation());
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2519
    if (NS_WARN_IF(!docShellToCloneInto)) {
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2520
      return IPC_OK();
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2521
    }
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2522
  }
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2523
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2524
  sourceWindow->Print(printSettings,
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2525
                      /* aListener = */ nullptr, docShellToCloneInto,
547666
69dba5223556804e95c75ddc8a4617e62e856157 Bug 1662975 - Don't return from window.print() until the print dialog is closed. r=jwatt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 547665
diff changeset
  2526
                      nsGlobalWindowOuter::IsPreview::Yes,
552461
7c5864d62b1356bb4271e7bc3f8424ced44c6732 Bug 1669925 - Add a printing.trigger keyed scalar to record what triggers a particular print dialog. r=jwatt,marionette-reviewers,maja_zf
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 550543
diff changeset
  2527
                      nsGlobalWindowOuter::IsForWindowDotPrint::No,
547666
69dba5223556804e95c75ddc8a4617e62e856157 Bug 1662975 - Don't return from window.print() until the print dialog is closed. r=jwatt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 547665
diff changeset
  2528
                      std::move(aCallback), IgnoreErrors());
547218
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2529
#endif
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2530
  return IPC_OK();
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2531
}
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2532
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2533
mozilla::ipc::IPCResult BrowserChild::RecvExitPrintPreview() {
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2534
#ifdef NS_PRINTING
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2535
  nsCOMPtr<nsIWebBrowserPrint> webBrowserPrint =
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2536
      do_GetInterface(ToSupports(WebNavigation()));
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2537
  if (NS_WARN_IF(!webBrowserPrint)) {
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2538
    return IPC_OK();
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2539
  }
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2540
  webBrowserPrint->ExitPrintPreview();
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2541
#endif
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2542
  return IPC_OK();
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2543
}
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2544
576458
b10ba48bdd684b89aebc8c90939e0db0e6c3a210 Bug 1705757 - Make printing a single frame choose the right process for the preview frame. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 575979
diff changeset
  2545
mozilla::ipc::IPCResult BrowserChild::RecvPrint(
b10ba48bdd684b89aebc8c90939e0db0e6c3a210 Bug 1705757 - Make printing a single frame choose the right process for the preview frame. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 575979
diff changeset
  2546
    const MaybeDiscardedBrowsingContext& aBc, const PrintData& aPrintData) {
297525
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
  2547
#ifdef NS_PRINTING
576458
b10ba48bdd684b89aebc8c90939e0db0e6c3a210 Bug 1705757 - Make printing a single frame choose the right process for the preview frame. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 575979
diff changeset
  2548
  if (NS_WARN_IF(aBc.IsNullOrDiscarded())) {
b10ba48bdd684b89aebc8c90939e0db0e6c3a210 Bug 1705757 - Make printing a single frame choose the right process for the preview frame. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 575979
diff changeset
  2549
    return IPC_OK();
b10ba48bdd684b89aebc8c90939e0db0e6c3a210 Bug 1705757 - Make printing a single frame choose the right process for the preview frame. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 575979
diff changeset
  2550
  }
546159
93e3344dd1f7454dc46c1553dd05e5e3bc78c349 Bug 1636728 - Centralize printing entry points in nsGlobalWindowOuter, and move cloning out of nsPrintJob. r=jwatt,geckoview-reviewers,smaug,agi
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 545310
diff changeset
  2551
  RefPtr<nsGlobalWindowOuter> outerWindow =
576458
b10ba48bdd684b89aebc8c90939e0db0e6c3a210 Bug 1705757 - Make printing a single frame choose the right process for the preview frame. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 575979
diff changeset
  2552
      nsGlobalWindowOuter::Cast(aBc.get()->GetDOMWindow());
299557
5ffffa9906f34339a4ac4f6bdb895af83f31ff79 Bug 1274937: Add outer window ID argument to nsFrameLoader::Print to allow printing of frames. r=jimm
Bob Owen <bobowencode@gmail.com>
parents: 299248
diff changeset
  2553
  if (NS_WARN_IF(!outerWindow)) {
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2554
    return IPC_OK();
299557
5ffffa9906f34339a4ac4f6bdb895af83f31ff79 Bug 1274937: Add outer window ID argument to nsFrameLoader::Print to allow printing of frames. r=jimm
Bob Owen <bobowencode@gmail.com>
parents: 299248
diff changeset
  2555
  }
5ffffa9906f34339a4ac4f6bdb895af83f31ff79 Bug 1274937: Add outer window ID argument to nsFrameLoader::Print to allow printing of frames. r=jimm
Bob Owen <bobowencode@gmail.com>
parents: 299248
diff changeset
  2556
297525
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
  2557
  nsCOMPtr<nsIPrintSettingsService> printSettingsSvc =
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2558
      do_GetService("@mozilla.org/gfx/printsettings-service;1");
297525
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
  2559
  if (NS_WARN_IF(!printSettingsSvc)) {
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2560
    return IPC_OK();
297525
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
  2561
  }
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
  2562
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
  2563
  nsCOMPtr<nsIPrintSettings> printSettings;
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
  2564
  nsresult rv =
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2565
      printSettingsSvc->GetNewPrintSettings(getter_AddRefs(printSettings));
297525
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
  2566
  if (NS_WARN_IF(NS_FAILED(rv))) {
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2567
    return IPC_OK();
297525
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
  2568
  }
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
  2569
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2570
  nsCOMPtr<nsIPrintSession> printSession =
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2571
      do_CreateInstance("@mozilla.org/gfx/printsession;1", &rv);
297525
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
  2572
  if (NS_WARN_IF(NS_FAILED(rv))) {
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2573
    return IPC_OK();
297525
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
  2574
  }
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
  2575
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
  2576
  printSettings->SetPrintSession(printSession);
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
  2577
  printSettingsSvc->DeserializeToPrintSettings(aPrintData, printSettings);
546159
93e3344dd1f7454dc46c1553dd05e5e3bc78c349 Bug 1636728 - Centralize printing entry points in nsGlobalWindowOuter, and move cloning out of nsPrintJob. r=jwatt,geckoview-reviewers,smaug,agi
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 545310
diff changeset
  2578
  {
93e3344dd1f7454dc46c1553dd05e5e3bc78c349 Bug 1636728 - Centralize printing entry points in nsGlobalWindowOuter, and move cloning out of nsPrintJob. r=jwatt,geckoview-reviewers,smaug,agi
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 545310
diff changeset
  2579
    IgnoredErrorResult rv;
93e3344dd1f7454dc46c1553dd05e5e3bc78c349 Bug 1636728 - Centralize printing entry points in nsGlobalWindowOuter, and move cloning out of nsPrintJob. r=jwatt,geckoview-reviewers,smaug,agi
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 545310
diff changeset
  2580
    outerWindow->Print(printSettings,
93e3344dd1f7454dc46c1553dd05e5e3bc78c349 Bug 1636728 - Centralize printing entry points in nsGlobalWindowOuter, and move cloning out of nsPrintJob. r=jwatt,geckoview-reviewers,smaug,agi
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 545310
diff changeset
  2581
                       /* aListener = */ nullptr,
93e3344dd1f7454dc46c1553dd05e5e3bc78c349 Bug 1636728 - Centralize printing entry points in nsGlobalWindowOuter, and move cloning out of nsPrintJob. r=jwatt,geckoview-reviewers,smaug,agi
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 545310
diff changeset
  2582
                       /* aWindowToCloneInto = */ nullptr,
547666
69dba5223556804e95c75ddc8a4617e62e856157 Bug 1662975 - Don't return from window.print() until the print dialog is closed. r=jwatt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 547665
diff changeset
  2583
                       nsGlobalWindowOuter::IsPreview::No,
552461
7c5864d62b1356bb4271e7bc3f8424ced44c6732 Bug 1669925 - Add a printing.trigger keyed scalar to record what triggers a particular print dialog. r=jwatt,marionette-reviewers,maja_zf
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 550543
diff changeset
  2584
                       nsGlobalWindowOuter::IsForWindowDotPrint::No,
547218
3103a7279ab95219071393c4d132a7f18664fb8e Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Jonathan Watt <jwatt@jwatt.org>
parents: 546845
diff changeset
  2585
                       /* aPrintPreviewCallback = */ nullptr, rv);
546159
93e3344dd1f7454dc46c1553dd05e5e3bc78c349 Bug 1636728 - Centralize printing entry points in nsGlobalWindowOuter, and move cloning out of nsPrintJob. r=jwatt,geckoview-reviewers,smaug,agi
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 545310
diff changeset
  2586
    if (NS_WARN_IF(rv.Failed())) {
93e3344dd1f7454dc46c1553dd05e5e3bc78c349 Bug 1636728 - Centralize printing entry points in nsGlobalWindowOuter, and move cloning out of nsPrintJob. r=jwatt,geckoview-reviewers,smaug,agi
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 545310
diff changeset
  2587
      return IPC_OK();
93e3344dd1f7454dc46c1553dd05e5e3bc78c349 Bug 1636728 - Centralize printing entry points in nsGlobalWindowOuter, and move cloning out of nsPrintJob. r=jwatt,geckoview-reviewers,smaug,agi
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 545310
diff changeset
  2588
    }
297525
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
  2589
  }
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
  2590
#endif
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2591
  return IPC_OK();
297525
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
  2592
}
5324db36f2395612f56751de883bff47916c6e27 Bug 1189846 Part 9: Add ability to print from the parent process with settings and progress listener. r=jimm, r=smaug
Bob Owen <bobowencode@gmail.com>
parents: 297506
diff changeset
  2593
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2594
mozilla::ipc::IPCResult BrowserChild::RecvUpdateNativeWindowHandle(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2595
    const uintptr_t& aNewHandle) {
314457
345334eff0212ecb78a29a65c62b1e95d0279f3a Bug 1297549: Part 2 - Propagate changes in tab native window down to content for a11y; r=jimm
Aaron Klotz <aklotz@mozilla.com>
parents: 314346
diff changeset
  2596
#if defined(XP_WIN) && defined(ACCESSIBILITY)
345334eff0212ecb78a29a65c62b1e95d0279f3a Bug 1297549: Part 2 - Propagate changes in tab native window down to content for a11y; r=jimm
Aaron Klotz <aklotz@mozilla.com>
parents: 314346
diff changeset
  2597
  mNativeWindowHandle = aNewHandle;
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2598
  return IPC_OK();
314457
345334eff0212ecb78a29a65c62b1e95d0279f3a Bug 1297549: Part 2 - Propagate changes in tab native window down to content for a11y; r=jimm
Aaron Klotz <aklotz@mozilla.com>
parents: 314346
diff changeset
  2599
#else
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2600
  return IPC_FAIL_NO_REASON(this);
314457
345334eff0212ecb78a29a65c62b1e95d0279f3a Bug 1297549: Part 2 - Propagate changes in tab native window down to content for a11y; r=jimm
Aaron Klotz <aklotz@mozilla.com>
parents: 314346
diff changeset
  2601
#endif
345334eff0212ecb78a29a65c62b1e95d0279f3a Bug 1297549: Part 2 - Propagate changes in tab native window down to content for a11y; r=jimm
Aaron Klotz <aklotz@mozilla.com>
parents: 314346
diff changeset
  2602
}
345334eff0212ecb78a29a65c62b1e95d0279f3a Bug 1297549: Part 2 - Propagate changes in tab native window down to content for a11y; r=jimm
Aaron Klotz <aklotz@mozilla.com>
parents: 314346
diff changeset
  2603
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2604
mozilla::ipc::IPCResult BrowserChild::RecvDestroy() {
201335
98623c0c5ba2c1f6b1b4d1f0fbad6dd6b6b7baa3 Bug 1047303: use nsITimer to dispatch click and contextmenu event. r=bent
Patrick Wang(Chih-Kai Wang) <kk1fff@patrickz.net>
parents: 201307
diff changeset
  2605
  MOZ_ASSERT(mDestroyed == false);
98623c0c5ba2c1f6b1b4d1f0fbad6dd6b6b7baa3 Bug 1047303: use nsITimer to dispatch click and contextmenu event. r=bent
Patrick Wang(Chih-Kai Wang) <kk1fff@patrickz.net>
parents: 201307
diff changeset
  2606
  mDestroyed = true;
98623c0c5ba2c1f6b1b4d1f0fbad6dd6b6b7baa3 Bug 1047303: use nsITimer to dispatch click and contextmenu event. r=bent
Patrick Wang(Chih-Kai Wang) <kk1fff@patrickz.net>
parents: 201307
diff changeset
  2607
271698
4d69fc402b8653416eedc893787e63f674985eee Bug 1189195 - Fix PContentPermissionRequest shutdown () r=fabrice
Sotaro Ikeda <sotaro.ikeda.g@gmail.com>
parents: 270705
diff changeset
  2608
  nsTArray<PContentPermissionRequestChild*> childArray =
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2609
      nsContentPermissionUtils::GetContentPermissionRequestChildById(
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2610
          GetTabId());
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2611
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2612
  // Need to close undeleted ContentPermissionRequestChilds before tab is
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2613
  // closed.
271698
4d69fc402b8653416eedc893787e63f674985eee Bug 1189195 - Fix PContentPermissionRequest shutdown () r=fabrice
Sotaro Ikeda <sotaro.ikeda.g@gmail.com>
parents: 270705
diff changeset
  2614
  for (auto& permissionRequestChild : childArray) {
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2615
    auto child = static_cast<RemotePermissionRequest*>(permissionRequestChild);
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2616
    child->Destroy();
271698
4d69fc402b8653416eedc893787e63f674985eee Bug 1189195 - Fix PContentPermissionRequest shutdown () r=fabrice
Sotaro Ikeda <sotaro.ikeda.g@gmail.com>
parents: 270705
diff changeset
  2617
  }
4d69fc402b8653416eedc893787e63f674985eee Bug 1189195 - Fix PContentPermissionRequest shutdown () r=fabrice
Sotaro Ikeda <sotaro.ikeda.g@gmail.com>
parents: 270705
diff changeset
  2618
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2619
  if (mBrowserChildMessageManager) {
234471
ca6d6b665bc111fe76806ba02d8a069cd96dfd49 Bug 1126089 - Allow messages to be sent after frame script unload event (r=smaug)
Bill McCloskey <bill.mccloskey@gmail.com>
parents: 234458
diff changeset
  2620
    // Message handlers are called from the event loop, so it better be safe to
ca6d6b665bc111fe76806ba02d8a069cd96dfd49 Bug 1126089 - Allow messages to be sent after frame script unload event (r=smaug)
Bill McCloskey <bill.mccloskey@gmail.com>
parents: 234458
diff changeset
  2621
    // run script.
ca6d6b665bc111fe76806ba02d8a069cd96dfd49 Bug 1126089 - Allow messages to be sent after frame script unload event (r=smaug)
Bill McCloskey <bill.mccloskey@gmail.com>
parents: 234458
diff changeset
  2622
    MOZ_ASSERT(nsContentUtils::IsSafeToRunScript());
538158
3f8100fb74318f9e0b3b6351ade737994d13bcf8 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Simon Giesecke <sgiesecke@mozilla.com>
parents: 537675
diff changeset
  2623
    mBrowserChildMessageManager->DispatchTrustedEvent(u"unload"_ns);
74131
8c6c251baaec5f0c01fe2221e0230c17032e290c Bug 648484, parts 3, 3.1, and 3.2: Allow passing a "backend hint" to GetLayerManager() to request a non-default layer manager backend. Deal with failure to hook up shadow layers. sr=roc
Chris Jones <jones.chris.g@gmail.com>
parents: 73394
diff changeset
  2624
  }
48950
715f808b0d2bc5c02dc3d510111866006c4c6eb7 Bug 570620, part f: Add a "destroy" phase to PBrowser shutdown to make clean-up easier. r=smaug sr=bsmedberg
Chris Jones <jones.chris.g@gmail.com>
parents: 48601
diff changeset
  2625
108591
1bf3d3d3cbe0a30567cfe7475ce9863b21c46ecf Bug 746502: Add support for <meta name=viewport> on B2G/async panning and zooming r=cjones,smaug
Doug Sherk <dsherk2@mozilla.com>
parents: 108590
diff changeset
  2626
  nsCOMPtr<nsIObserverService> observerService =
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2627
      mozilla::services::GetObserverService();
108591
1bf3d3d3cbe0a30567cfe7475ce9863b21c46ecf Bug 746502: Add support for <meta name=viewport> on B2G/async panning and zooming r=cjones,smaug
Doug Sherk <dsherk2@mozilla.com>
parents: 108590
diff changeset
  2628
1bf3d3d3cbe0a30567cfe7475ce9863b21c46ecf Bug 746502: Add support for <meta name=viewport> on B2G/async panning and zooming r=cjones,smaug
Doug Sherk <dsherk2@mozilla.com>
parents: 108590
diff changeset
  2629
  observerService->RemoveObserver(this, BEFORE_FIRST_PAINT);
1bf3d3d3cbe0a30567cfe7475ce9863b21c46ecf Bug 746502: Add support for <meta name=viewport> on B2G/async panning and zooming r=cjones,smaug
Doug Sherk <dsherk2@mozilla.com>
parents: 108590
diff changeset
  2630
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2631
  // XXX what other code in ~BrowserChild() should we be running here?
54008
daeab9b5b99bbc50099ae3a66b87bd339db48940 Bug 582057, part k: Gut platform widgets from content processes. sr=bsmedberg
Chris Jones <jones.chris.g@gmail.com>
parents: 50801
diff changeset
  2632
  DestroyWindow();
48950
715f808b0d2bc5c02dc3d510111866006c4c6eb7 Bug 570620, part f: Add a "destroy" phase to PBrowser shutdown to make clean-up easier. r=smaug sr=bsmedberg
Chris Jones <jones.chris.g@gmail.com>
parents: 48601
diff changeset
  2633
216945
2cae53b8f3f43f3a2f4feba43ed4856fc71a8437 Bug 1037625 - Allow child processes to respond to 'inner-window-destroyed' notifications without possibly killing the process. r-khuey.
Ben Turner <bent.mozilla@gmail.com>
parents: 215946
diff changeset
  2634
  // Bounce through the event loop once to allow any delayed teardown runnables
2cae53b8f3f43f3a2f4feba43ed4856fc71a8437 Bug 1037625 - Allow child processes to respond to 'inner-window-destroyed' notifications without possibly killing the process. r-khuey.
Ben Turner <bent.mozilla@gmail.com>
parents: 215946
diff changeset
  2635
  // that were just generated to have a chance to run.
2cae53b8f3f43f3a2f4feba43ed4856fc71a8437 Bug 1037625 - Allow child processes to respond to 'inner-window-destroyed' notifications without possibly killing the process. r-khuey.
Ben Turner <bent.mozilla@gmail.com>
parents: 215946
diff changeset
  2636
  nsCOMPtr<nsIRunnable> deleteRunnable = new DelayedDeleteRunnable(this);
290681
af8611a7b88ceb68413da8c6c0b3010d82e5fc5c Bug 1259294: Part 2 - Use MOZ_ALWAYS_SUCCEEDS. r=froydnj
Kyle Huey <khuey@kylehuey.com>
parents: 290660
diff changeset
  2637
  MOZ_ALWAYS_SUCCEEDS(NS_DispatchToCurrentThread(deleteRunnable));
216945
2cae53b8f3f43f3a2f4feba43ed4856fc71a8437 Bug 1037625 - Allow child processes to respond to 'inner-window-destroyed' notifications without possibly killing the process. r-khuey.
Ben Turner <bent.mozilla@gmail.com>
parents: 215946
diff changeset
  2638
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2639
  return IPC_OK();
48950
715f808b0d2bc5c02dc3d510111866006c4c6eb7 Bug 570620, part f: Add a "destroy" phase to PBrowser shutdown to make clean-up easier. r=smaug sr=bsmedberg
Chris Jones <jones.chris.g@gmail.com>
parents: 48601
diff changeset
  2640
}
46683
416375517820bf550a6bf64a0d5a4ba729eb6d97 Bug 542242 - E10s, content process event handlers, r=jst, r=bsmedberg
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46682
diff changeset
  2641
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2642
mozilla::ipc::IPCResult BrowserChild::RecvRenderLayers(
495354
7f2441f2f26e90459c47e1249d694d76e7625f18 Bug 1582042 - Remove useless threading of aForceRepaint around various IPC messages. r=mconley
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495352
diff changeset
  2643
    const bool& aEnabled, const layers::LayersObserverEpoch& aEpoch) {
398594
24aa7ff25c3d4334234a103b718ba4b643a4e397 Bug 1423208 - Queue pending RenderLayers calls when there are DocShell creation blockers. r=mystor
Mike Conley <mconley@mozilla.com>
parents: 398052
diff changeset
  2644
  if (mPendingDocShellBlockers > 0) {
24aa7ff25c3d4334234a103b718ba4b643a4e397 Bug 1423208 - Queue pending RenderLayers calls when there are DocShell creation blockers. r=mystor
Mike Conley <mconley@mozilla.com>
parents: 398052
diff changeset
  2645
    mPendingRenderLayersReceivedMessage = true;
24aa7ff25c3d4334234a103b718ba4b643a4e397 Bug 1423208 - Queue pending RenderLayers calls when there are DocShell creation blockers. r=mystor
Mike Conley <mconley@mozilla.com>
parents: 398052
diff changeset
  2646
    mPendingRenderLayers = aEnabled;
429191
383e6ae8f7d4d1961a56aa6f5a69b4c3e8c3e2e5 Bug 1478016 - Add a strongly-typed LayersObserverEpoch type. r=mattwoodrow
Kartikaya Gupta <kgupta@mozilla.com>
parents: 428116
diff changeset
  2647
    mPendingLayersObserverEpoch = aEpoch;
398594
24aa7ff25c3d4334234a103b718ba4b643a4e397 Bug 1423208 - Queue pending RenderLayers calls when there are DocShell creation blockers. r=mystor
Mike Conley <mconley@mozilla.com>
parents: 398052
diff changeset
  2648
    return IPC_OK();
24aa7ff25c3d4334234a103b718ba4b643a4e397 Bug 1423208 - Queue pending RenderLayers calls when there are DocShell creation blockers. r=mystor
Mike Conley <mconley@mozilla.com>
parents: 398052
diff changeset
  2649
  }
24aa7ff25c3d4334234a103b718ba4b643a4e397 Bug 1423208 - Queue pending RenderLayers calls when there are DocShell creation blockers. r=mystor
Mike Conley <mconley@mozilla.com>
parents: 398052
diff changeset
  2650
398043
b0c38584a789814fc80bfd3c139e23d7ab193417 Bug 1397426 - Add IPC interface to tell TabChild's to render and clear layers, distinct from setting the active state on the DocShell. r=billm
Mike Conley <mconley@mozilla.com>
parents: 395424
diff changeset
  2651
  // Since requests to change the rendering state come in from both the hang
b0c38584a789814fc80bfd3c139e23d7ab193417 Bug 1397426 - Add IPC interface to tell TabChild's to render and clear layers, distinct from setting the active state on the DocShell. r=billm
Mike Conley <mconley@mozilla.com>
parents: 395424
diff changeset
  2652
  // monitor channel and the PContent channel, we have an ordering problem. This
b0c38584a789814fc80bfd3c139e23d7ab193417 Bug 1397426 - Add IPC interface to tell TabChild's to render and clear layers, distinct from setting the active state on the DocShell. r=billm
Mike Conley <mconley@mozilla.com>
parents: 395424
diff changeset
  2653
  // code ensures that we respect the order in which the requests were made and
b0c38584a789814fc80bfd3c139e23d7ab193417 Bug 1397426 - Add IPC interface to tell TabChild's to render and clear layers, distinct from setting the active state on the DocShell. r=billm
Mike Conley <mconley@mozilla.com>
parents: 395424
diff changeset
  2654
  // ignore stale requests.
429191
383e6ae8f7d4d1961a56aa6f5a69b4c3e8c3e2e5 Bug 1478016 - Add a strongly-typed LayersObserverEpoch type. r=mattwoodrow
Kartikaya Gupta <kgupta@mozilla.com>
parents: 428116
diff changeset
  2655
  if (mLayersObserverEpoch >= aEpoch) {
398043
b0c38584a789814fc80bfd3c139e23d7ab193417 Bug 1397426 - Add IPC interface to tell TabChild's to render and clear layers, distinct from setting the active state on the DocShell. r=billm
Mike Conley <mconley@mozilla.com>
parents: 395424
diff changeset
  2656
    return IPC_OK();
b0c38584a789814fc80bfd3c139e23d7ab193417 Bug 1397426 - Add IPC interface to tell TabChild's to render and clear layers, distinct from setting the active state on the DocShell. r=billm
Mike Conley <mconley@mozilla.com>
parents: 395424
diff changeset
  2657
  }
429191
383e6ae8f7d4d1961a56aa6f5a69b4c3e8c3e2e5 Bug 1478016 - Add a strongly-typed LayersObserverEpoch type. r=mattwoodrow
Kartikaya Gupta <kgupta@mozilla.com>
parents: 428116
diff changeset
  2658
  mLayersObserverEpoch = aEpoch;
398043
b0c38584a789814fc80bfd3c139e23d7ab193417 Bug 1397426 - Add IPC interface to tell TabChild's to render and clear layers, distinct from setting the active state on the DocShell. r=billm
Mike Conley <mconley@mozilla.com>
parents: 395424
diff changeset
  2659
419219
27f6f789b1940eaaad96223fac928ca2bb371dd7 Bug 1176019 - Force a paint when switching to a loaded tab r=mconley
Doug Thayer <dothayer@mozilla.com>
parents: 418679
diff changeset
  2660
  auto clearPaintWhileInterruptingJS = MakeScopeExit([&] {
318982
c4eee1d6a915416807a52071b863831b00be9390 Bug 1312080 - Tell the BackgroundHangMonitor for force paint in the content process to wait after the next paint, even if we weren't interrupting JS. r=billm"
Mike Conley <mconley@mozilla.com>
parents: 318871
diff changeset
  2661
    // We might force a paint, or we might already have painted and this is a
c4eee1d6a915416807a52071b863831b00be9390 Bug 1312080 - Tell the BackgroundHangMonitor for force paint in the content process to wait after the next paint, even if we weren't interrupting JS. r=billm"
Mike Conley <mconley@mozilla.com>
parents: 318871
diff changeset
  2662
    // no-op. In either case, once we exit this scope, we need to alert the
c4eee1d6a915416807a52071b863831b00be9390 Bug 1312080 - Tell the BackgroundHangMonitor for force paint in the content process to wait after the next paint, even if we weren't interrupting JS. r=billm"
Mike Conley <mconley@mozilla.com>
parents: 318871
diff changeset
  2663
    // ProcessHangMonitor that we've finished responding to what might have
c4eee1d6a915416807a52071b863831b00be9390 Bug 1312080 - Tell the BackgroundHangMonitor for force paint in the content process to wait after the next paint, even if we weren't interrupting JS. r=billm"
Mike Conley <mconley@mozilla.com>
parents: 318871
diff changeset
  2664
    // been a request to force paint. This is so that the BackgroundHangMonitor
c4eee1d6a915416807a52071b863831b00be9390 Bug 1312080 - Tell the BackgroundHangMonitor for force paint in the content process to wait after the next paint, even if we weren't interrupting JS. r=billm"
Mike Conley <mconley@mozilla.com>
parents: 318871
diff changeset
  2665
    // for force painting can be made to wait again.
398043
b0c38584a789814fc80bfd3c139e23d7ab193417 Bug 1397426 - Add IPC interface to tell TabChild's to render and clear layers, distinct from setting the active state on the DocShell. r=billm
Mike Conley <mconley@mozilla.com>
parents: 395424
diff changeset
  2666
    if (aEnabled) {
429191
383e6ae8f7d4d1961a56aa6f5a69b4c3e8c3e2e5 Bug 1478016 - Add a strongly-typed LayersObserverEpoch type. r=mattwoodrow
Kartikaya Gupta <kgupta@mozilla.com>
parents: 428116
diff changeset
  2667
      ProcessHangMonitor::ClearPaintWhileInterruptingJS(mLayersObserverEpoch);
318982
c4eee1d6a915416807a52071b863831b00be9390 Bug 1312080 - Tell the BackgroundHangMonitor for force paint in the content process to wait after the next paint, even if we weren't interrupting JS. r=billm"
Mike Conley <mconley@mozilla.com>
parents: 318871
diff changeset
  2668
    }
c4eee1d6a915416807a52071b863831b00be9390 Bug 1312080 - Tell the BackgroundHangMonitor for force paint in the content process to wait after the next paint, even if we weren't interrupting JS. r=billm"
Mike Conley <mconley@mozilla.com>
parents: 318871
diff changeset
  2669
  });
c4eee1d6a915416807a52071b863831b00be9390 Bug 1312080 - Tell the BackgroundHangMonitor for force paint in the content process to wait after the next paint, even if we weren't interrupting JS. r=billm"
Mike Conley <mconley@mozilla.com>
parents: 318871
diff changeset
  2670
408907
ff98ae41c55832db41b2803ee60f60073427a05e Bug 1443329 - Ensure we always call NotifyActivity on ForcePaint BHR r=mconley
Doug Thayer <dothayer@mozilla.com>
parents: 408906
diff changeset
  2671
  if (aEnabled) {
419219
27f6f789b1940eaaad96223fac928ca2bb371dd7 Bug 1176019 - Force a paint when switching to a loaded tab r=mconley
Doug Thayer <dothayer@mozilla.com>
parents: 418679
diff changeset
  2672
    ProcessHangMonitor::MaybeStartPaintWhileInterruptingJS();
408907
ff98ae41c55832db41b2803ee60f60073427a05e Bug 1443329 - Ensure we always call NotifyActivity on ForcePaint BHR r=mconley
Doug Thayer <dothayer@mozilla.com>
parents: 408906
diff changeset
  2673
  }
ff98ae41c55832db41b2803ee60f60073427a05e Bug 1443329 - Ensure we always call NotifyActivity on ForcePaint BHR r=mconley
Doug Thayer <dothayer@mozilla.com>
parents: 408906
diff changeset
  2674
342159
b7619d5557e00c8ef4fc8e20f23172353d525a3a Bug 1333122 - Use the CompositorOptions to determine the appropriate LayerManager to create for content-process tabs. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 342148
diff changeset
  2675
  if (mCompositorOptions) {
b7619d5557e00c8ef4fc8e20f23172353d525a3a Bug 1333122 - Use the CompositorOptions to determine the appropriate LayerManager to create for content-process tabs. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 342148
diff changeset
  2676
    MOZ_ASSERT(mPuppetWidget);
591040
06213402f850853c04405fc60157bff3f2b1fde4 Bug 1728914 - Use WebRenderLayerManager directly in BrowserChild. r=gfx-reviewers,jrmuizel
Matt Woodrow <mwoodrow@mozilla.com>
parents: 590278
diff changeset
  2677
    RefPtr<WebRenderLayerManager> lm =
06213402f850853c04405fc60157bff3f2b1fde4 Bug 1728914 - Use WebRenderLayerManager directly in BrowserChild. r=gfx-reviewers,jrmuizel
Matt Woodrow <mwoodrow@mozilla.com>
parents: 590278
diff changeset
  2678
        mPuppetWidget->GetWindowRenderer()->AsWebRender();
587869
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  2679
    if (lm) {
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  2680
      // We send the current layer observer epoch to the compositor so that
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  2681
      // BrowserParent knows whether a layer update notification corresponds to
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  2682
      // the latest RecvRenderLayers request that was made.
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  2683
      lm->SetLayersObserverEpoch(mLayersObserverEpoch);
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  2684
    }
321645
6864810d43907191e3520fa2323b4460fc3411a9 Bug 1315974 - When creating the widget layer manager, don't assume it will always be a ClientLayerManager. r=mattwoodrow
Kartikaya Gupta <kgupta@mozilla.com>
parents: 321029
diff changeset
  2685
  }
314336
cfcd8c4f3a36b958002010a9c6d461a7769996d5 Bug 1279086 - Allow painting for tab switch when JS is running (r=dvander,mconley,mrbkap)
Bill McCloskey <billm@mozilla.com>
parents: 314305
diff changeset
  2686
476563
4df5fa6fa785961229e7e0a7a0ebbab625192f24 Bug 1519546, part 6 - Centralize the visibility logic in BrowserChild and use EffectsInfo. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 476562
diff changeset
  2687
  mRenderLayers = aEnabled;
4df5fa6fa785961229e7e0a7a0ebbab625192f24 Bug 1519546, part 6 - Centralize the visibility logic in BrowserChild and use EffectsInfo. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 476562
diff changeset
  2688
495352
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2689
  if (aEnabled && IsVisible()) {
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2690
    // This request is a no-op.
495354
7f2441f2f26e90459c47e1249d694d76e7625f18 Bug 1582042 - Remove useless threading of aForceRepaint around various IPC messages. r=mconley
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495352
diff changeset
  2691
    // In this case, we still want a MozLayerTreeReady notification to fire
7f2441f2f26e90459c47e1249d694d76e7625f18 Bug 1582042 - Remove useless threading of aForceRepaint around various IPC messages. r=mconley
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495352
diff changeset
  2692
    // in the parent (so that it knows that the child has updated its epoch).
7f2441f2f26e90459c47e1249d694d76e7625f18 Bug 1582042 - Remove useless threading of aForceRepaint around various IPC messages. r=mconley
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495352
diff changeset
  2693
    // PaintWhileInterruptingJSNoOp does that.
7f2441f2f26e90459c47e1249d694d76e7625f18 Bug 1582042 - Remove useless threading of aForceRepaint around various IPC messages. r=mconley
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495352
diff changeset
  2694
    if (IPCOpen()) {
7f2441f2f26e90459c47e1249d694d76e7625f18 Bug 1582042 - Remove useless threading of aForceRepaint around various IPC messages. r=mconley
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495352
diff changeset
  2695
      Unused << SendPaintWhileInterruptingJSNoOp(mLayersObserverEpoch);
314336
cfcd8c4f3a36b958002010a9c6d461a7769996d5 Bug 1279086 - Allow painting for tab switch when JS is running (r=dvander,mconley,mrbkap)
Bill McCloskey <billm@mozilla.com>
parents: 314305
diff changeset
  2696
    }
495352
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2697
    return IPC_OK();
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2698
  }
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2699
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2700
  // FIXME(emilio): Probably / maybe this shouldn't be needed? See the comment
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2701
  // in MakeVisible(), having the two separate states is not great.
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2702
  UpdateVisibility();
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2703
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2704
  if (!aEnabled) {
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2705
    return IPC_OK();
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2706
  }
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2707
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2708
  nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2709
  if (!docShell) {
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2710
    return IPC_OK();
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2711
  }
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2712
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2713
  // We don't use BrowserChildBase::GetPresShell() here because that would
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2714
  // create a content viewer if one doesn't exist yet. Creating a content
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2715
  // viewer can cause JS to run, which we want to avoid.
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2716
  // nsIDocShell::GetPresShell returns null if no content viewer exists yet.
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2717
  RefPtr<PresShell> presShell = docShell->GetPresShell();
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2718
  if (!presShell) {
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2719
    return IPC_OK();
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2720
  }
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2721
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2722
  if (nsIFrame* root = presShell->GetRootFrame()) {
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2723
    root->SchedulePaint();
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2724
  }
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2725
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2726
  Telemetry::AutoTimer<Telemetry::TABCHILD_PAINT_TIME> timer;
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2727
  // If we need to repaint, let's do that right away. No sense waiting until
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2728
  // we get back to the event loop again. We suppress the display port so
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2729
  // that we only paint what's visible. This ensures that the tab we're
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2730
  // switching to paints as quickly as possible.
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2731
  presShell->SuppressDisplayport(true);
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2732
  if (nsContentUtils::IsSafeToRunScript()) {
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2733
    WebWidget()->PaintNowIfNeeded();
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2734
  } else {
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2735
    RefPtr<nsViewManager> vm = presShell->GetViewManager();
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2736
    if (nsView* view = vm->GetRootView()) {
587868
ce8f605d6920aca0f8f9801b820c218b6f4bcb4a Bug 1722258 - Split out fallible composite-only path of PresShell::Paint. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587182
diff changeset
  2737
      presShell->Paint(view, view->GetBounds(), PaintFlags::None);
495352
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2738
    }
314336
cfcd8c4f3a36b958002010a9c6d461a7769996d5 Bug 1279086 - Allow painting for tab switch when JS is running (r=dvander,mconley,mrbkap)
Bill McCloskey <billm@mozilla.com>
parents: 314305
diff changeset
  2739
  }
495352
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2740
  presShell->SuppressDisplayport(false);
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2741
  return IPC_OK();
171510
2fc218e7ad72fe779ec69b2cbdb77e6420d65e11 Bug 978540 - [e10s] Correctly maintain active state for remote docShells r=smaug
Tim Taubert <ttaubert@mozilla.com>
parents: 170585
diff changeset
  2742
}
2fc218e7ad72fe779ec69b2cbdb77e6420d65e11 Bug 978540 - [e10s] Correctly maintain active state for remote docShells r=smaug
Tim Taubert <ttaubert@mozilla.com>
parents: 170585
diff changeset
  2743
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2744
mozilla::ipc::IPCResult BrowserChild::RecvNavigateByKey(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2745
    const bool& aForward, const bool& aForDocumentNavigation) {
523823
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2746
  nsFocusManager* fm = nsFocusManager::GetFocusManager();
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2747
  if (!fm) {
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2748
    return IPC_OK();
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2749
  }
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2750
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2751
  RefPtr<Element> result;
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2752
  nsCOMPtr<nsPIDOMWindowOuter> window = do_GetInterface(WebNavigation());
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2753
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2754
  // Move to the first or last document.
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2755
  {
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2756
    uint32_t type =
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2757
        aForward
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2758
            ? (aForDocumentNavigation
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2759
                   ? static_cast<uint32_t>(nsIFocusManager::MOVEFOCUS_FIRSTDOC)
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2760
                   : static_cast<uint32_t>(nsIFocusManager::MOVEFOCUS_ROOT))
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2761
            : (aForDocumentNavigation
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2762
                   ? static_cast<uint32_t>(nsIFocusManager::MOVEFOCUS_LASTDOC)
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2763
                   : static_cast<uint32_t>(nsIFocusManager::MOVEFOCUS_LAST));
523823
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2764
    uint32_t flags = nsIFocusManager::FLAG_BYKEY;
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2765
    if (aForward || aForDocumentNavigation) {
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2766
      flags |= nsIFocusManager::FLAG_NOSCROLL;
254329
7e72681dff59cb7f38dda53604a27d191a7a2e5f Bug 1176239, do tab navigation in the child when moving between the parent and child process, r=smaug
Neil Deakin <neil@mozilla.com>
parents: 254079
diff changeset
  2767
    }
523823
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2768
    fm->MoveFocus(window, nullptr, type, flags, getter_AddRefs(result));
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2769
  }
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2770
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2771
  // No valid root element was found, so move to the first focusable element.
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2772
  if (!result && aForward && !aForDocumentNavigation) {
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2773
    fm->MoveFocus(window, nullptr, nsIFocusManager::MOVEFOCUS_FIRST,
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2774
                  nsIFocusManager::FLAG_BYKEY, getter_AddRefs(result));
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2775
  }
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2776
a92516514d8c6f782ff4a362eaa194f7b13e899b Bug 1627986 - Don't scroll when focusing the root for document navigation. r=hsivonen
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 522799
diff changeset
  2777
  SendRequestFocus(false, CallerType::System);
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  2778
  return IPC_OK();
252595
cf5cb1d5802ea1f3ec6a2af1178c8c2a95f0f400 Bug 1132518, make document navigation with F6/Shift+F6 work in e10s. This combines the document and tab navigation mechanisms together, r=smaug
Neil Deakin <neil@mozilla.com>
parents: 252510
diff changeset
  2779
}
cf5cb1d5802ea1f3ec6a2af1178c8c2a95f0f400 Bug 1132518, make document navigation with F6/Shift+F6 work in e10s. This combines the document and tab navigation mechanisms together, r=smaug
Neil Deakin <neil@mozilla.com>
parents: 252510
diff changeset
  2780
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2781
bool BrowserChild::InitBrowserChildMessageManager() {
570297
ce268e67dbcd2f283cd556d8bc364653572a5967 Bug 1663757 - Part 3: Start sending web progress events in oop subframes, r=annyG
Nika Layzell <nika@thelayzells.com>
parents: 570295
diff changeset
  2782
  mShouldSendWebProgressEventsToParent = true;
ce268e67dbcd2f283cd556d8bc364653572a5967 Bug 1663757 - Part 3: Start sending web progress events in oop subframes, r=annyG
Nika Layzell <nika@thelayzells.com>
parents: 570295
diff changeset
  2783
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2784
  if (!mBrowserChildMessageManager) {
282426
e22b3043887ed36bf2c634c2924a7c8d39d226b1 Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug
Kyle Huey <khuey@kylehuey.com>
parents: 282389
diff changeset
  2785
    nsCOMPtr<nsPIDOMWindowOuter> window = do_GetInterface(WebNavigation());
103787
3925750b682fb35b7bd639c6a1b031adda991ecf Bug 781725: Refactor TabChild to allow pre-created instances, and then use a pre-created instance to pre-load and compile BrowserElementChild.js. r=smaug
Chris Jones <jones.chris.g@gmail.com>
parents: 103563
diff changeset
  2786
    NS_ENSURE_TRUE(window, false);
431226
674c721d44fee8c4edd243312cbc73f81122e5d0 Bug 1481645 - Remove some redundant uses of do_QueryInterface. r=bzbarsky
Adrian Wielgosik <adrian.wielgosik@gmail.com>
parents: 430929
diff changeset
  2787
    nsCOMPtr<EventTarget> chromeHandler = window->GetChromeEventHandler();
103787
3925750b682fb35b7bd639c6a1b031adda991ecf Bug 781725: Refactor TabChild to allow pre-created instances, and then use a pre-created instance to pre-load and compile BrowserElementChild.js. r=smaug
Chris Jones <jones.chris.g@gmail.com>
parents: 103563
diff changeset
  2788
    NS_ENSURE_TRUE(chromeHandler, false);
51362
090abc158c8ce764fd899c62539fa613947f9af3 Bug 586283 - RecvLoadRemoteScript called before TabChild::InitTabChildGlobal finished. Prevent event loop rotation problem, and RecvLoadRemoteScript call during RecvCreateWidget r=olli
Oleg Romashin <romaxa@gmail.com>
parents: 51342
diff changeset
  2789
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2790
    RefPtr<BrowserChildMessageManager> scope = mBrowserChildMessageManager =
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2791
        new BrowserChildMessageManager(this);
431547
c7a263321e999b1806b8facd31177ca026a7a33f Bug 1480244: Part 4 - Make child message managers non-global objects. r=bz
Kris Maglione <maglione.k@gmail.com>
parents: 431542
diff changeset
  2792
c7a263321e999b1806b8facd31177ca026a7a33f Bug 1480244: Part 4 - Make child message managers non-global objects. r=bz
Kris Maglione <maglione.k@gmail.com>
parents: 431542
diff changeset
  2793
    MOZ_ALWAYS_TRUE(nsMessageManagerScriptExecutor::Init());
46683
416375517820bf550a6bf64a0d5a4ba729eb6d97 Bug 542242 - E10s, content process event handlers, r=jst, r=bsmedberg
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46682
diff changeset
  2794
103787
3925750b682fb35b7bd639c6a1b031adda991ecf Bug 781725: Refactor TabChild to allow pre-created instances, and then use a pre-created instance to pre-load and compile BrowserElementChild.js. r=smaug
Chris Jones <jones.chris.g@gmail.com>
parents: 103563
diff changeset
  2795
    nsCOMPtr<nsPIWindowRoot> root = do_QueryInterface(chromeHandler);
409299
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  2796
    if (NS_WARN_IF(!root)) {
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2797
      mBrowserChildMessageManager = nullptr;
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2798
      return false;
409299
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  2799
    }
103787
3925750b682fb35b7bd639c6a1b031adda991ecf Bug 781725: Refactor TabChild to allow pre-created instances, and then use a pre-created instance to pre-load and compile BrowserElementChild.js. r=smaug
Chris Jones <jones.chris.g@gmail.com>
parents: 103563
diff changeset
  2800
    root->SetParentTarget(scope);
3925750b682fb35b7bd639c6a1b031adda991ecf Bug 781725: Refactor TabChild to allow pre-created instances, and then use a pre-created instance to pre-load and compile BrowserElementChild.js. r=smaug
Chris Jones <jones.chris.g@gmail.com>
parents: 103563
diff changeset
  2801
  }
97353
18d056438d00dcd4933aff95abbdd77c1f70fa42 Bug 765075 - Load BrowserElementChild.js before returning the result of window.open from <iframe mozbrowser> to the opener. r=smaug
Justin Lebar <justin.lebar@gmail.com>
parents: 96532
diff changeset
  2802
322842
69d33fe8ac7aaaa361fecafbb1cdb2ffa5577616 Bug 1311149 - Remove the b2g preallocated app support; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 322841
diff changeset
  2803
  if (!mTriedBrowserInit) {
103787
3925750b682fb35b7bd639c6a1b031adda991ecf Bug 781725: Refactor TabChild to allow pre-created instances, and then use a pre-created instance to pre-load and compile BrowserElementChild.js. r=smaug
Chris Jones <jones.chris.g@gmail.com>
parents: 103563
diff changeset
  2804
    mTriedBrowserInit = true;
97353
18d056438d00dcd4933aff95abbdd77c1f70fa42 Bug 765075 - Load BrowserElementChild.js before returning the result of window.open from <iframe mozbrowser> to the opener. r=smaug
Justin Lebar <justin.lebar@gmail.com>
parents: 96532
diff changeset
  2805
  }
18d056438d00dcd4933aff95abbdd77c1f70fa42 Bug 765075 - Load BrowserElementChild.js before returning the result of window.open from <iframe mozbrowser> to the opener. r=smaug
Justin Lebar <justin.lebar@gmail.com>
parents: 96532
diff changeset
  2806
46683
416375517820bf550a6bf64a0d5a4ba729eb6d97 Bug 542242 - E10s, content process event handlers, r=jst, r=bsmedberg
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46682
diff changeset
  2807
  return true;
416375517820bf550a6bf64a0d5a4ba729eb6d97 Bug 542242 - E10s, content process event handlers, r=jst, r=bsmedberg
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46682
diff changeset
  2808
}
416375517820bf550a6bf64a0d5a4ba729eb6d97 Bug 542242 - E10s, content process event handlers, r=jst, r=bsmedberg
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46682
diff changeset
  2809
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2810
void BrowserChild::InitRenderingState(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2811
    const TextureFactoryIdentifier& aTextureFactoryIdentifier,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2812
    const layers::LayersId& aLayersId,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2813
    const CompositorOptions& aCompositorOptions) {
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2814
  mPuppetWidget->InitIMEState();
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2815
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2816
  MOZ_ASSERT(aLayersId.IsValid());
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2817
  mTextureFactoryIdentifier = aTextureFactoryIdentifier;
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2818
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2819
  // Pushing layers transactions directly to a separate
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2820
  // compositor context.
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2821
  PCompositorBridgeChild* compositorChild = CompositorBridgeChild::Get();
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2822
  if (!compositorChild) {
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2823
    mLayersConnected = Some(false);
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2824
    NS_WARNING("failed to get CompositorBridgeChild instance");
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2825
    return;
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2826
  }
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2827
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2828
  mCompositorOptions = Some(aCompositorOptions);
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2829
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2830
  if (aLayersId.IsValid()) {
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2831
    StaticMutexAutoLock lock(sBrowserChildrenMutex);
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2832
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2833
    if (!sBrowserChildren) {
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2834
      sBrowserChildren = new BrowserChildMap;
331698
d500ad0713bbf3461bb7eb5f6e3455dfb220f24f Bug 1322633 - Don't initialize APZ protocols unless PLayerTransaction was successfully set up. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 331357
diff changeset
  2835
    }
570217
c247b91b08b66a00826f7344141011ff4ee679ca Bug 1693541 - Improve uses of nsBaseHashtable and descendants and avoid multiple subsequent lookups in dom/ipc. r=nika
Simon Giesecke <sgiesecke@mozilla.com>
parents: 569307
diff changeset
  2836
    MOZ_ASSERT(!sBrowserChildren->Contains(uint64_t(aLayersId)));
568882
ff46eda9cc314eb255bb17fccb9c052c1d2107a0 Bug 1691913 - Rename nsBaseHashtable::Put to InsertOrUpdate. r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
Simon Giesecke <sgiesecke@mozilla.com>
parents: 568832
diff changeset
  2837
    sBrowserChildren->InsertOrUpdate(uint64_t(aLayersId), this);
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2838
    mLayersId = aLayersId;
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2839
  }
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2840
556874
990cc484f91ade72d32f184cbed03cabca1aa0b1 Bug 1676721 - Fix an incorrect assertion. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 554788
diff changeset
  2841
  // Depending on timing, we might paint too early and fall back to basic
990cc484f91ade72d32f184cbed03cabca1aa0b1 Bug 1676721 - Fix an incorrect assertion. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 554788
diff changeset
  2842
  // layers. CreateRemoteLayerManager will destroy us if we manage to get a
990cc484f91ade72d32f184cbed03cabca1aa0b1 Bug 1676721 - Fix an incorrect assertion. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 554788
diff changeset
  2843
  // remote layer manager though, so that's fine.
990cc484f91ade72d32f184cbed03cabca1aa0b1 Bug 1676721 - Fix an incorrect assertion. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 554788
diff changeset
  2844
  MOZ_ASSERT(!mPuppetWidget->HasLayerManager() ||
586492
76ccadcf74235eea28f88592488e3b908773c1b2 Bug 1721537 - Split out WindowRenderer base class from LayerManager. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 585083
diff changeset
  2845
             mPuppetWidget->GetWindowRenderer()->GetBackendType() ==
556874
990cc484f91ade72d32f184cbed03cabca1aa0b1 Bug 1676721 - Fix an incorrect assertion. r=mattwoodrow
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 554788
diff changeset
  2846
                 layers::LayersBackend::LAYERS_BASIC);
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2847
  bool success = false;
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2848
  if (mLayersConnected == Some(true)) {
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2849
    success = CreateRemoteLayerManager(compositorChild);
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2850
  }
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2851
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2852
  if (success) {
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2853
    MOZ_ASSERT(mLayersConnected == Some(true));
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2854
    // Succeeded to create "remote" layer manager
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2855
    ImageBridgeChild::IdentifyCompositorTextureHost(mTextureFactoryIdentifier);
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2856
    gfx::VRManagerChild::IdentifyTextureHost(mTextureFactoryIdentifier);
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2857
    InitAPZState();
591040
06213402f850853c04405fc60157bff3f2b1fde4 Bug 1728914 - Use WebRenderLayerManager directly in BrowserChild. r=gfx-reviewers,jrmuizel
Matt Woodrow <mwoodrow@mozilla.com>
parents: 590278
diff changeset
  2858
    RefPtr<WebRenderLayerManager> lm =
06213402f850853c04405fc60157bff3f2b1fde4 Bug 1728914 - Use WebRenderLayerManager directly in BrowserChild. r=gfx-reviewers,jrmuizel
Matt Woodrow <mwoodrow@mozilla.com>
parents: 590278
diff changeset
  2859
        mPuppetWidget->GetWindowRenderer()->AsWebRender();
587869
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  2860
    if (lm) {
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  2861
      lm->SetLayersObserverEpoch(mLayersObserverEpoch);
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  2862
    }
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2863
  } else {
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2864
    NS_WARNING("Fallback to BasicLayerManager");
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2865
    mLayersConnected = Some(false);
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2866
  }
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2867
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2868
  nsCOMPtr<nsIObserverService> observerService =
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2869
      mozilla::services::GetObserverService();
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2870
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2871
  if (observerService) {
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2872
    observerService->AddObserver(this, BEFORE_FIRST_PAINT, false);
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2873
  }
54019
9dfdccfd5bdcd2f100c8f1a88e61a429398498bf Bug 570620, part o: Connect the dots to enable drawing remote frames for <browser remote>: create the frame on the content side, insert a display item for it in compositor-side SubdocFrame, and use IPC-enabled layer managers to make it all work. r=mats sr=roc
Chris Jones <jones.chris.g@gmail.com>
parents: 54018
diff changeset
  2874
}
9dfdccfd5bdcd2f100c8f1a88e61a429398498bf Bug 570620, part o: Connect the dots to enable drawing remote frames for <browser remote>: create the frame on the content side, insert a display item for it in compositor-side SubdocFrame, and use IPC-enabled layer managers to make it all work. r=mats sr=roc
Chris Jones <jones.chris.g@gmail.com>
parents: 54018
diff changeset
  2875
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2876
bool BrowserChild::CreateRemoteLayerManager(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2877
    mozilla::layers::PCompositorBridgeChild* aCompositorChild) {
386153
e0c53e24ab2a59ea1fb21d482404e54641107658 Bug 1391262 - Create TabChild::CreateRemoteLayerManager() r=dvander
sotaro <sotaro.ikeda.g@gmail.com>
parents: 386152
diff changeset
  2878
  MOZ_ASSERT(aCompositorChild);
e0c53e24ab2a59ea1fb21d482404e54641107658 Bug 1391262 - Create TabChild::CreateRemoteLayerManager() r=dvander
sotaro <sotaro.ikeda.g@gmail.com>
parents: 386152
diff changeset
  2879
589151
f37913e7cb9295617b7e5a7ac5f462f29df583b4 Bug 1726063 - Remove support for non-WR compositor initialization. r=jrmuizel,aosmond
Matt Woodrow <mwoodrow@mozilla.com>
parents: 588638
diff changeset
  2880
  return mPuppetWidget->CreateRemoteLayerManager(
591057
1b49e7328ae43c6565d167f4c391430575097fd3 Bug 1727682 - Make WebRenderLayerManager not inherit LayerManager. r=jrmuizel
Matt Woodrow <mwoodrow@mozilla.com>
parents: 591040
diff changeset
  2881
      [&](WebRenderLayerManager* aLayerManager) -> bool {
589151
f37913e7cb9295617b7e5a7ac5f462f29df583b4 Bug 1726063 - Remove support for non-WR compositor initialization. r=jrmuizel,aosmond
Matt Woodrow <mwoodrow@mozilla.com>
parents: 588638
diff changeset
  2882
        nsCString error;
591057
1b49e7328ae43c6565d167f4c391430575097fd3 Bug 1727682 - Make WebRenderLayerManager not inherit LayerManager. r=jrmuizel
Matt Woodrow <mwoodrow@mozilla.com>
parents: 591040
diff changeset
  2883
        return aLayerManager->Initialize(aCompositorChild,
1b49e7328ae43c6565d167f4c391430575097fd3 Bug 1727682 - Make WebRenderLayerManager not inherit LayerManager. r=jrmuizel
Matt Woodrow <mwoodrow@mozilla.com>
parents: 591040
diff changeset
  2884
                                         wr::AsPipelineId(mLayersId),
1b49e7328ae43c6565d167f4c391430575097fd3 Bug 1727682 - Make WebRenderLayerManager not inherit LayerManager. r=jrmuizel
Matt Woodrow <mwoodrow@mozilla.com>
parents: 591040
diff changeset
  2885
                                         &mTextureFactoryIdentifier, error);
589151
f37913e7cb9295617b7e5a7ac5f462f29df583b4 Bug 1726063 - Remove support for non-WR compositor initialization. r=jrmuizel,aosmond
Matt Woodrow <mwoodrow@mozilla.com>
parents: 588638
diff changeset
  2886
      });
386153
e0c53e24ab2a59ea1fb21d482404e54641107658 Bug 1391262 - Create TabChild::CreateRemoteLayerManager() r=dvander
sotaro <sotaro.ikeda.g@gmail.com>
parents: 386152
diff changeset
  2887
}
e0c53e24ab2a59ea1fb21d482404e54641107658 Bug 1391262 - Create TabChild::CreateRemoteLayerManager() r=dvander
sotaro <sotaro.ikeda.g@gmail.com>
parents: 386152
diff changeset
  2888
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2889
void BrowserChild::InitAPZState() {
329205
cfebe97561fb3c35c99776cb5deaa7607fdf0b21 Bug 1330037 - Propagate the CompositorOptions over to TabChild and keep a copy there. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 329164
diff changeset
  2890
  if (!mCompositorOptions->UseAPZ()) {
325289
1d9ec0ad1388284030757003dbffa93bcaf9c0e0 Bug 1320817 - Move child process PAPZ initialization into TabChild::InitRenderingState. r=kats
Ryan Hunt <rhunt@eqrion.net>
parents: 325156
diff changeset
  2891
    return;
1d9ec0ad1388284030757003dbffa93bcaf9c0e0 Bug 1320817 - Move child process PAPZ initialization into TabChild::InitRenderingState. r=kats
Ryan Hunt <rhunt@eqrion.net>
parents: 325156
diff changeset
  2892
  }
329205
cfebe97561fb3c35c99776cb5deaa7607fdf0b21 Bug 1330037 - Propagate the CompositorOptions over to TabChild and keep a copy there. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 329164
diff changeset
  2893
  auto cbc = CompositorBridgeChild::Get();
325289
1d9ec0ad1388284030757003dbffa93bcaf9c0e0 Bug 1320817 - Move child process PAPZ initialization into TabChild::InitRenderingState. r=kats
Ryan Hunt <rhunt@eqrion.net>
parents: 325156
diff changeset
  2894
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2895
  // Initialize the ApzcTreeManager. This takes multiple casts because of ugly
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2896
  // multiple inheritance.
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2897
  PAPZCTreeManagerChild* baseProtocol =
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2898
      cbc->SendPAPZCTreeManagerConstructor(mLayersId);
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2899
  APZCTreeManagerChild* derivedProtocol =
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2900
      static_cast<APZCTreeManagerChild*>(baseProtocol);
325289
1d9ec0ad1388284030757003dbffa93bcaf9c0e0 Bug 1320817 - Move child process PAPZ initialization into TabChild::InitRenderingState. r=kats
Ryan Hunt <rhunt@eqrion.net>
parents: 325156
diff changeset
  2901
1d9ec0ad1388284030757003dbffa93bcaf9c0e0 Bug 1320817 - Move child process PAPZ initialization into TabChild::InitRenderingState. r=kats
Ryan Hunt <rhunt@eqrion.net>
parents: 325156
diff changeset
  2902
  mApzcTreeManager = RefPtr<IAPZCTreeManager>(derivedProtocol);
1d9ec0ad1388284030757003dbffa93bcaf9c0e0 Bug 1320817 - Move child process PAPZ initialization into TabChild::InitRenderingState. r=kats
Ryan Hunt <rhunt@eqrion.net>
parents: 325156
diff changeset
  2903
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2904
  // Initialize the GeckoContentController for this tab. We don't hold a
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2905
  // reference because we don't need it. The ContentProcessController will hold
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2906
  // a reference to the tab, and will be destroyed by the compositor or ipdl
325289
1d9ec0ad1388284030757003dbffa93bcaf9c0e0 Bug 1320817 - Move child process PAPZ initialization into TabChild::InitRenderingState. r=kats
Ryan Hunt <rhunt@eqrion.net>
parents: 325156
diff changeset
  2907
  // during destruction.
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2908
  RefPtr<GeckoContentController> contentController =
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  2909
      new ContentProcessController(this);
349802
3ff9768569a491da474c0ecea20317220c9ab9f4 Bug 1343479 - Label the tasks for APZ module. r=bevistseng,kats
Kevin Chen <kechen@mozilla.com>
parents: 348325
diff changeset
  2910
  APZChild* apzChild = new APZChild(contentController);
3ff9768569a491da474c0ecea20317220c9ab9f4 Bug 1343479 - Label the tasks for APZ module. r=bevistseng,kats
Kevin Chen <kechen@mozilla.com>
parents: 348325
diff changeset
  2911
  cbc->SendPAPZConstructor(apzChild, mLayersId);
325289
1d9ec0ad1388284030757003dbffa93bcaf9c0e0 Bug 1320817 - Move child process PAPZ initialization into TabChild::InitRenderingState. r=kats
Ryan Hunt <rhunt@eqrion.net>
parents: 325156
diff changeset
  2912
}
1d9ec0ad1388284030757003dbffa93bcaf9c0e0 Bug 1320817 - Move child process PAPZ initialization into TabChild::InitRenderingState. r=kats
Ryan Hunt <rhunt@eqrion.net>
parents: 325156
diff changeset
  2913
476561
4658bf615f4b0b4f0979dbb0d4e8c0b4b3b1f3f8 Bug 1519546, part 4 - Wire up basic EffectsInfo updates in DOM IPC. r=farre
Ryan Hunt <rhunt@eqrion.net>
parents: 476560
diff changeset
  2914
IPCResult BrowserChild::RecvUpdateEffects(const EffectsInfo& aEffects) {
583086
20c1ef91fc108f15d23c5108662b542c37938311 Bug 1709460 - Add a flag representing whether mEffectsInfo has been set or not. r=tnikkel
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 582925
diff changeset
  2915
  mDidSetEffectsInfo = true;
20c1ef91fc108f15d23c5108662b542c37938311 Bug 1709460 - Add a flag representing whether mEffectsInfo has been set or not. r=tnikkel
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 582925
diff changeset
  2916
517486
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2917
  bool needInvalidate = false;
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2918
  if (mEffectsInfo.IsVisible() && aEffects.IsVisible() &&
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2919
      mEffectsInfo != aEffects) {
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2920
    // if we are staying visible and either the visrect or scale changed we need
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2921
    // to invalidate
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2922
    needInvalidate = true;
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2923
  }
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2924
476561
4658bf615f4b0b4f0979dbb0d4e8c0b4b3b1f3f8 Bug 1519546, part 4 - Wire up basic EffectsInfo updates in DOM IPC. r=farre
Ryan Hunt <rhunt@eqrion.net>
parents: 476560
diff changeset
  2925
  mEffectsInfo = aEffects;
495352
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2926
  UpdateVisibility();
517486
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2927
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2928
  if (needInvalidate) {
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2929
    nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2930
    if (docShell) {
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2931
      // We don't use BrowserChildBase::GetPresShell() here because that would
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2932
      // create a content viewer if one doesn't exist yet. Creating a content
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2933
      // viewer can cause JS to run, which we want to avoid.
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2934
      // nsIDocShell::GetPresShell returns null if no content viewer exists yet.
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2935
      RefPtr<PresShell> presShell = docShell->GetPresShell();
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2936
      if (presShell) {
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2937
        if (nsIFrame* root = presShell->GetRootFrame()) {
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2938
          root->InvalidateFrame();
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2939
        }
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2940
      }
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2941
    }
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2942
  }
f714fc6d0d908979703f4c04961c79a808ec05fd Bug 1620817. Invalidate when the BrowserChild gets a different visible rect. r=mattwoodrow
Timothy Nikkel <tnikkel@gmail.com>
parents: 517195
diff changeset
  2943
476561
4658bf615f4b0b4f0979dbb0d4e8c0b4b3b1f3f8 Bug 1519546, part 4 - Wire up basic EffectsInfo updates in DOM IPC. r=farre
Ryan Hunt <rhunt@eqrion.net>
parents: 476560
diff changeset
  2944
  return IPC_OK();
4658bf615f4b0b4f0979dbb0d4e8c0b4b3b1f3f8 Bug 1519546, part 4 - Wire up basic EffectsInfo updates in DOM IPC. r=farre
Ryan Hunt <rhunt@eqrion.net>
parents: 476560
diff changeset
  2945
}
4658bf615f4b0b4f0979dbb0d4e8c0b4b3b1f3f8 Bug 1519546, part 4 - Wire up basic EffectsInfo updates in DOM IPC. r=farre
Ryan Hunt <rhunt@eqrion.net>
parents: 476560
diff changeset
  2946
476563
4df5fa6fa785961229e7e0a7a0ebbab625192f24 Bug 1519546, part 6 - Centralize the visibility logic in BrowserChild and use EffectsInfo. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 476562
diff changeset
  2947
bool BrowserChild::IsVisible() {
4df5fa6fa785961229e7e0a7a0ebbab625192f24 Bug 1519546, part 6 - Centralize the visibility logic in BrowserChild and use EffectsInfo. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 476562
diff changeset
  2948
  return mPuppetWidget && mPuppetWidget->IsVisible();
4df5fa6fa785961229e7e0a7a0ebbab625192f24 Bug 1519546, part 6 - Centralize the visibility logic in BrowserChild and use EffectsInfo. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 476562
diff changeset
  2949
}
4df5fa6fa785961229e7e0a7a0ebbab625192f24 Bug 1519546, part 6 - Centralize the visibility logic in BrowserChild and use EffectsInfo. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 476562
diff changeset
  2950
495352
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2951
void BrowserChild::UpdateVisibility() {
478622
e3f2d2748314c9594692d615570bc1e746d552fc Bug 1558482 - Add visibleRect and scaling to EffectsInfo and compute them when using layers. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 477553
diff changeset
  2952
  bool shouldBeVisible = mIsTopLevel ? mRenderLayers : mEffectsInfo.IsVisible();
476563
4df5fa6fa785961229e7e0a7a0ebbab625192f24 Bug 1519546, part 6 - Centralize the visibility logic in BrowserChild and use EffectsInfo. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 476562
diff changeset
  2953
  bool isVisible = IsVisible();
4df5fa6fa785961229e7e0a7a0ebbab625192f24 Bug 1519546, part 6 - Centralize the visibility logic in BrowserChild and use EffectsInfo. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 476562
diff changeset
  2954
4df5fa6fa785961229e7e0a7a0ebbab625192f24 Bug 1519546, part 6 - Centralize the visibility logic in BrowserChild and use EffectsInfo. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 476562
diff changeset
  2955
  if (shouldBeVisible != isVisible) {
4df5fa6fa785961229e7e0a7a0ebbab625192f24 Bug 1519546, part 6 - Centralize the visibility logic in BrowserChild and use EffectsInfo. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 476562
diff changeset
  2956
    if (shouldBeVisible) {
495352
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2957
      MakeVisible();
476563
4df5fa6fa785961229e7e0a7a0ebbab625192f24 Bug 1519546, part 6 - Centralize the visibility logic in BrowserChild and use EffectsInfo. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 476562
diff changeset
  2958
    } else {
4df5fa6fa785961229e7e0a7a0ebbab625192f24 Bug 1519546, part 6 - Centralize the visibility logic in BrowserChild and use EffectsInfo. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 476562
diff changeset
  2959
      MakeHidden();
4df5fa6fa785961229e7e0a7a0ebbab625192f24 Bug 1519546, part 6 - Centralize the visibility logic in BrowserChild and use EffectsInfo. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 476562
diff changeset
  2960
    }
4df5fa6fa785961229e7e0a7a0ebbab625192f24 Bug 1519546, part 6 - Centralize the visibility logic in BrowserChild and use EffectsInfo. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 476562
diff changeset
  2961
  }
4df5fa6fa785961229e7e0a7a0ebbab625192f24 Bug 1519546, part 6 - Centralize the visibility logic in BrowserChild and use EffectsInfo. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 476562
diff changeset
  2962
}
4df5fa6fa785961229e7e0a7a0ebbab625192f24 Bug 1519546, part 6 - Centralize the visibility logic in BrowserChild and use EffectsInfo. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 476562
diff changeset
  2963
495352
08088ff7a8be5215b969199d2e8a7bb2d1dc77bd Bug 1582042 - Use DocShell::SetIsActive from BrowserChild::MakeVisible for non top-level browsers. r=mconley,rhunt
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495119
diff changeset
  2964
void BrowserChild::MakeVisible() {
398043
b0c38584a789814fc80bfd3c139e23d7ab193417 Bug 1397426 - Add IPC interface to tell TabChild's to render and clear layers, distinct from setting the active state on the DocShell. r=billm
Mike Conley <mconley@mozilla.com>
parents: 395424
diff changeset
  2965
  if (IsVisible()) {
314336
cfcd8c4f3a36b958002010a9c6d461a7769996d5 Bug 1279086 - Allow painting for tab switch when JS is running (r=dvander,mconley,mrbkap)
Bill McCloskey <billm@mozilla.com>
parents: 314305
diff changeset
  2966
    return;
cfcd8c4f3a36b958002010a9c6d461a7769996d5 Bug 1279086 - Allow painting for tab switch when JS is running (r=dvander,mconley,mrbkap)
Bill McCloskey <billm@mozilla.com>
parents: 314305
diff changeset
  2967
  }
cfcd8c4f3a36b958002010a9c6d461a7769996d5 Bug 1279086 - Allow painting for tab switch when JS is running (r=dvander,mconley,mrbkap)
Bill McCloskey <billm@mozilla.com>
parents: 314305
diff changeset
  2968
249318
daefa5ea5f981ca4a0026be825c9eda09d815f90 Bug 1175383 TabChild should store PuppetWidget as is rather than as nsIWidget r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 248968
diff changeset
  2969
  if (mPuppetWidget) {
daefa5ea5f981ca4a0026be825c9eda09d815f90 Bug 1175383 TabChild should store PuppetWidget as is rather than as nsIWidget r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 248968
diff changeset
  2970
    mPuppetWidget->Show(true);
245093
77655fe1aab56a3c4cc7a631aa8e3e1c2b6e866a Bug 1154231 - Part 1. Use LRU to manage remote layers. r=mattwoodrow
Kan-Ru Chen <kanru@kanru.info>
parents: 244496
diff changeset
  2971
  }
476563
4df5fa6fa785961229e7e0a7a0ebbab625192f24 Bug 1519546, part 6 - Centralize the visibility logic in BrowserChild and use EffectsInfo. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 476562
diff changeset
  2972
584789
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  2973
  PresShellActivenessMaybeChanged();
112665
ea85f4e3fc2de25e94235875648923f562c7252f Bug 806029: Have remote content drop their buffers when they're hidden. r=mattwoodrow sr=roc
Chris Jones <jones.chris.g@gmail.com>
parents: 112043
diff changeset
  2974
}
ea85f4e3fc2de25e94235875648923f562c7252f Bug 806029: Have remote content drop their buffers when they're hidden. r=mattwoodrow sr=roc
Chris Jones <jones.chris.g@gmail.com>
parents: 112043
diff changeset
  2975
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  2976
void BrowserChild::MakeHidden() {
398043
b0c38584a789814fc80bfd3c139e23d7ab193417 Bug 1397426 - Add IPC interface to tell TabChild's to render and clear layers, distinct from setting the active state on the DocShell. r=billm
Mike Conley <mconley@mozilla.com>
parents: 395424
diff changeset
  2977
  if (!IsVisible()) {
314336
cfcd8c4f3a36b958002010a9c6d461a7769996d5 Bug 1279086 - Allow painting for tab switch when JS is running (r=dvander,mconley,mrbkap)
Bill McCloskey <billm@mozilla.com>
parents: 314305
diff changeset
  2978
    return;
cfcd8c4f3a36b958002010a9c6d461a7769996d5 Bug 1279086 - Allow painting for tab switch when JS is running (r=dvander,mconley,mrbkap)
Bill McCloskey <billm@mozilla.com>
parents: 314305
diff changeset
  2979
  }
cfcd8c4f3a36b958002010a9c6d461a7769996d5 Bug 1279086 - Allow painting for tab switch when JS is running (r=dvander,mconley,mrbkap)
Bill McCloskey <billm@mozilla.com>
parents: 314305
diff changeset
  2980
398051
707a2b0aede11d52aa5ab818a975170f894ba550 Bug 1397426 - Make TabParent's assume they're rendering layers by default on construction. r=billm
Mike Conley <mconley@mozilla.com>
parents: 398046
diff changeset
  2981
  // Due to the nested event loop in ContentChild::ProvideWindowCommon,
707a2b0aede11d52aa5ab818a975170f894ba550 Bug 1397426 - Make TabParent's assume they're rendering layers by default on construction. r=billm
Mike Conley <mconley@mozilla.com>
parents: 398046
diff changeset
  2982
  // it's possible to be told to become hidden before we're finished
707a2b0aede11d52aa5ab818a975170f894ba550 Bug 1397426 - Make TabParent's assume they're rendering layers by default on construction. r=billm
Mike Conley <mconley@mozilla.com>
parents: 398046
diff changeset
  2983
  // setting up a layer manager. We should skip clearing cached layers
707a2b0aede11d52aa5ab818a975170f894ba550 Bug 1397426 - Make TabParent's assume they're rendering layers by default on construction. r=billm
Mike Conley <mconley@mozilla.com>
parents: 398046
diff changeset
  2984
  // in that case, since doing so might accidentally put is into
707a2b0aede11d52aa5ab818a975170f894ba550 Bug 1397426 - Make TabParent's assume they're rendering layers by default on construction. r=billm
Mike Conley <mconley@mozilla.com>
parents: 398046
diff changeset
  2985
  // BasicLayers mode.
584788
cb704553fc64228fa96f84aed08a38cd91aeedf5 Bug 1717983 - Improve PresShell active flag handling. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584779
diff changeset
  2986
  if (mPuppetWidget) {
cb704553fc64228fa96f84aed08a38cd91aeedf5 Bug 1717983 - Improve PresShell active flag handling. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584779
diff changeset
  2987
    if (mPuppetWidget->HasLayerManager()) {
cb704553fc64228fa96f84aed08a38cd91aeedf5 Bug 1717983 - Improve PresShell active flag handling. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584779
diff changeset
  2988
      ClearCachedResources();
cb704553fc64228fa96f84aed08a38cd91aeedf5 Bug 1717983 - Improve PresShell active flag handling. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584779
diff changeset
  2989
    }
cb704553fc64228fa96f84aed08a38cd91aeedf5 Bug 1717983 - Improve PresShell active flag handling. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584779
diff changeset
  2990
    mPuppetWidget->Show(false);
398051
707a2b0aede11d52aa5ab818a975170f894ba550 Bug 1397426 - Make TabParent's assume they're rendering layers by default on construction. r=billm
Mike Conley <mconley@mozilla.com>
parents: 398046
diff changeset
  2991
  }
245093
77655fe1aab56a3c4cc7a631aa8e3e1c2b6e866a Bug 1154231 - Part 1. Use LRU to manage remote layers. r=mattwoodrow
Kan-Ru Chen <kanru@kanru.info>
parents: 244496
diff changeset
  2992
584789
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  2993
  PresShellActivenessMaybeChanged();
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  2994
}
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  2995
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  2996
IPCResult BrowserChild::RecvPreserveLayers(bool aPreserve) {
584936
70be81d77fa61b6b2a9e49c487f5b64023d21ce1 Bug 1719328 - Fix an embarrassing typo in BrowserChild::RecvPreserveLayers. r=Mossop a=Aryx
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584869
diff changeset
  2997
  mIsPreservingLayers = aPreserve;
584789
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  2998
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  2999
  PresShellActivenessMaybeChanged();
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3000
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3001
  return IPC_OK();
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3002
}
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3003
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3004
void BrowserChild::PresShellActivenessMaybeChanged() {
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3005
  // We don't use BrowserChildBase::GetPresShell() here because that would
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3006
  // create a content viewer if one doesn't exist yet. Creating a content
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3007
  // viewer can cause JS to run, which we want to avoid.
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3008
  // nsIDocShell::GetPresShell returns null if no content viewer exists yet.
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3009
  //
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3010
  // When this method is called we don't want to go through the browsing context
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3011
  // because we don't want to change the visibility state of the document, which
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3012
  // has side effects like firing events to content, unblocking media playback,
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3013
  // unthrottling timeouts... PresShell activeness has a lot less side effects.
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3014
  nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3015
  if (!docShell) {
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3016
    return;
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3017
  }
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3018
  RefPtr<PresShell> presShell = docShell->GetPresShell();
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3019
  if (!presShell) {
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3020
    return;
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3021
  }
effd766404918d198f7df060b33da3347f9bb1a8 Bug 1717983 - Don't consider a browser active if the tab is inactive but we're preserving layers. r=nika
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 584788
diff changeset
  3022
  presShell->ActivenessMaybeChanged();
112665
ea85f4e3fc2de25e94235875648923f562c7252f Bug 806029: Have remote content drop their buffers when they're hidden. r=mattwoodrow sr=roc
Chris Jones <jones.chris.g@gmail.com>
parents: 112043
diff changeset
  3023
}
ea85f4e3fc2de25e94235875648923f562c7252f Bug 806029: Have remote content drop their buffers when they're hidden. r=mattwoodrow sr=roc
Chris Jones <jones.chris.g@gmail.com>
parents: 112043
diff changeset
  3024
95085
43fb1c7ae6e7dc201eaf2dff7e5d503c38b66bfc Bug 758401 - Add a way to get message manager from docshell, r=jst
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 94632
diff changeset
  3025
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3026
BrowserChild::GetMessageManager(ContentFrameMessageManager** aResult) {
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3027
  RefPtr<ContentFrameMessageManager> mm(mBrowserChildMessageManager);
409300
243246b2f4406f0b2f118758220db5c7fdd215df Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 6: Mark some IDL interfaces as non-scriptable. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409299
diff changeset
  3028
  mm.forget(aResult);
243246b2f4406f0b2f118758220db5c7fdd215df Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 6: Mark some IDL interfaces as non-scriptable. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409299
diff changeset
  3029
  return *aResult ? NS_OK : NS_ERROR_FAILURE;
95085
43fb1c7ae6e7dc201eaf2dff7e5d503c38b66bfc Bug 758401 - Add a way to get message manager from docshell, r=jst
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 94632
diff changeset
  3030
}
43fb1c7ae6e7dc201eaf2dff7e5d503c38b66bfc Bug 758401 - Add a way to get message manager from docshell, r=jst
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 94632
diff changeset
  3031
588592
d3a4322fecf612ea22e026e8570599dccbcd5643 Bug 1724748 - Add nsITopLevelNavigationDelegate to allow JSWindowActorChilds to allow/deny top-level navigations. r=smaug
Mike Conley <mconley@mozilla.com>
parents: 588191
diff changeset
  3032
already_AddRefed<nsITopLevelNavigationDelegate>
d3a4322fecf612ea22e026e8570599dccbcd5643 Bug 1724748 - Add nsITopLevelNavigationDelegate to allow JSWindowActorChilds to allow/deny top-level navigations. r=smaug
Mike Conley <mconley@mozilla.com>
parents: 588191
diff changeset
  3033
BrowserChild::GetTopLevelNavigationDelegate() {
d3a4322fecf612ea22e026e8570599dccbcd5643 Bug 1724748 - Add nsITopLevelNavigationDelegate to allow JSWindowActorChilds to allow/deny top-level navigations. r=smaug
Mike Conley <mconley@mozilla.com>
parents: 588191
diff changeset
  3034
  nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
d3a4322fecf612ea22e026e8570599dccbcd5643 Bug 1724748 - Add nsITopLevelNavigationDelegate to allow JSWindowActorChilds to allow/deny top-level navigations. r=smaug
Mike Conley <mconley@mozilla.com>
parents: 588191
diff changeset
  3035
  if (nsCOMPtr<nsITopLevelNavigationDelegate> delegate = do_QueryActor(
d3a4322fecf612ea22e026e8570599dccbcd5643 Bug 1724748 - Add nsITopLevelNavigationDelegate to allow JSWindowActorChilds to allow/deny top-level navigations. r=smaug
Mike Conley <mconley@mozilla.com>
parents: 588191
diff changeset
  3036
          "TopLevelNavigationDelegate", docShell->GetDocument())) {
d3a4322fecf612ea22e026e8570599dccbcd5643 Bug 1724748 - Add nsITopLevelNavigationDelegate to allow JSWindowActorChilds to allow/deny top-level navigations. r=smaug
Mike Conley <mconley@mozilla.com>
parents: 588191
diff changeset
  3037
    return delegate.forget();
d3a4322fecf612ea22e026e8570599dccbcd5643 Bug 1724748 - Add nsITopLevelNavigationDelegate to allow JSWindowActorChilds to allow/deny top-level navigations. r=smaug
Mike Conley <mconley@mozilla.com>
parents: 588191
diff changeset
  3038
  }
d3a4322fecf612ea22e026e8570599dccbcd5643 Bug 1724748 - Add nsITopLevelNavigationDelegate to allow JSWindowActorChilds to allow/deny top-level navigations. r=smaug
Mike Conley <mconley@mozilla.com>
parents: 588191
diff changeset
  3039
  return nullptr;
d3a4322fecf612ea22e026e8570599dccbcd5643 Bug 1724748 - Add nsITopLevelNavigationDelegate to allow JSWindowActorChilds to allow/deny top-level navigations. r=smaug
Mike Conley <mconley@mozilla.com>
parents: 588191
diff changeset
  3040
}
d3a4322fecf612ea22e026e8570599dccbcd5643 Bug 1724748 - Add nsITopLevelNavigationDelegate to allow JSWindowActorChilds to allow/deny top-level navigations. r=smaug
Mike Conley <mconley@mozilla.com>
parents: 588191
diff changeset
  3041
510473
5cb2b4727452b54b0ecf07c10178e01e1f8bc4a1 Bug 1432856 - Extended focus methods in Window.webidl, Client.webidl and Element.webidl to pass CallerType. r=smaug
pbz <pbz@mozilla.com>
parents: 510341
diff changeset
  3042
void BrowserChild::SendRequestFocus(bool aCanFocus, CallerType aCallerType) {
554526
f4242b119e61e5e2f793cec1c5519279752df004 Bug 1665752 - Do not send IPC to request focus if the browsing context already has the focus; r=hsivonen
Edgar Chen <echen@mozilla.com>
parents: 554276
diff changeset
  3043
  nsFocusManager* fm = nsFocusManager::GetFocusManager();
f4242b119e61e5e2f793cec1c5519279752df004 Bug 1665752 - Do not send IPC to request focus if the browsing context already has the focus; r=hsivonen
Edgar Chen <echen@mozilla.com>
parents: 554276
diff changeset
  3044
  if (!fm) {
f4242b119e61e5e2f793cec1c5519279752df004 Bug 1665752 - Do not send IPC to request focus if the browsing context already has the focus; r=hsivonen
Edgar Chen <echen@mozilla.com>
parents: 554276
diff changeset
  3045
    return;
f4242b119e61e5e2f793cec1c5519279752df004 Bug 1665752 - Do not send IPC to request focus if the browsing context already has the focus; r=hsivonen
Edgar Chen <echen@mozilla.com>
parents: 554276
diff changeset
  3046
  }
f4242b119e61e5e2f793cec1c5519279752df004 Bug 1665752 - Do not send IPC to request focus if the browsing context already has the focus; r=hsivonen
Edgar Chen <echen@mozilla.com>
parents: 554276
diff changeset
  3047
f4242b119e61e5e2f793cec1c5519279752df004 Bug 1665752 - Do not send IPC to request focus if the browsing context already has the focus; r=hsivonen
Edgar Chen <echen@mozilla.com>
parents: 554276
diff changeset
  3048
  nsCOMPtr<nsPIDOMWindowOuter> window = do_GetInterface(WebNavigation());
f4242b119e61e5e2f793cec1c5519279752df004 Bug 1665752 - Do not send IPC to request focus if the browsing context already has the focus; r=hsivonen
Edgar Chen <echen@mozilla.com>
parents: 554276
diff changeset
  3049
  if (!window) {
f4242b119e61e5e2f793cec1c5519279752df004 Bug 1665752 - Do not send IPC to request focus if the browsing context already has the focus; r=hsivonen
Edgar Chen <echen@mozilla.com>
parents: 554276
diff changeset
  3050
    return;
f4242b119e61e5e2f793cec1c5519279752df004 Bug 1665752 - Do not send IPC to request focus if the browsing context already has the focus; r=hsivonen
Edgar Chen <echen@mozilla.com>
parents: 554276
diff changeset
  3051
  }
f4242b119e61e5e2f793cec1c5519279752df004 Bug 1665752 - Do not send IPC to request focus if the browsing context already has the focus; r=hsivonen
Edgar Chen <echen@mozilla.com>
parents: 554276
diff changeset
  3052
f4242b119e61e5e2f793cec1c5519279752df004 Bug 1665752 - Do not send IPC to request focus if the browsing context already has the focus; r=hsivonen
Edgar Chen <echen@mozilla.com>
parents: 554276
diff changeset
  3053
  BrowsingContext* focusedBC = fm->GetFocusedBrowsingContext();
f4242b119e61e5e2f793cec1c5519279752df004 Bug 1665752 - Do not send IPC to request focus if the browsing context already has the focus; r=hsivonen
Edgar Chen <echen@mozilla.com>
parents: 554276
diff changeset
  3054
  if (focusedBC == window->GetBrowsingContext()) {
f4242b119e61e5e2f793cec1c5519279752df004 Bug 1665752 - Do not send IPC to request focus if the browsing context already has the focus; r=hsivonen
Edgar Chen <echen@mozilla.com>
parents: 554276
diff changeset
  3055
    // BrowsingContext has the focus already, do not request again.
f4242b119e61e5e2f793cec1c5519279752df004 Bug 1665752 - Do not send IPC to request focus if the browsing context already has the focus; r=hsivonen
Edgar Chen <echen@mozilla.com>
parents: 554276
diff changeset
  3056
    return;
f4242b119e61e5e2f793cec1c5519279752df004 Bug 1665752 - Do not send IPC to request focus if the browsing context already has the focus; r=hsivonen
Edgar Chen <echen@mozilla.com>
parents: 554276
diff changeset
  3057
  }
f4242b119e61e5e2f793cec1c5519279752df004 Bug 1665752 - Do not send IPC to request focus if the browsing context already has the focus; r=hsivonen
Edgar Chen <echen@mozilla.com>
parents: 554276
diff changeset
  3058
510473
5cb2b4727452b54b0ecf07c10178e01e1f8bc4a1 Bug 1432856 - Extended focus methods in Window.webidl, Client.webidl and Element.webidl to pass CallerType. r=smaug
pbz <pbz@mozilla.com>
parents: 510341
diff changeset
  3059
  PBrowserChild::SendRequestFocus(aCanFocus, aCallerType);
153624
aab2a2b73b900689ad2b16dcd7f3ba694c4fcf2e Bug 933099: Banish <windows.h> from nsGlobalWindow.cpp. r=bz
Kyle Huey <khuey@kylehuey.com>
parents: 153547
diff changeset
  3060
}
aab2a2b73b900689ad2b16dcd7f3ba694c4fcf2e Bug 933099: Banish <windows.h> from nsGlobalWindow.cpp. r=bz
Kyle Huey <khuey@kylehuey.com>
parents: 153547
diff changeset
  3061
225180
bccb6cedee610628a74c9286d9c355fabebba9a7 Bug 1105666 - [BrowserAPI] Add an API to indicate this iframe could receive NFC event. r=smaug, kanru, yoshi
Dimi Lee <dlee@mozilla.com>
parents: 224546
diff changeset
  3062
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3063
BrowserChild::GetTabId(uint64_t* aId) {
225180
bccb6cedee610628a74c9286d9c355fabebba9a7 Bug 1105666 - [BrowserAPI] Add an API to indicate this iframe could receive NFC event. r=smaug, kanru, yoshi
Dimi Lee <dlee@mozilla.com>
parents: 224546
diff changeset
  3064
  *aId = GetTabId();
bccb6cedee610628a74c9286d9c355fabebba9a7 Bug 1105666 - [BrowserAPI] Add an API to indicate this iframe could receive NFC event. r=smaug, kanru, yoshi
Dimi Lee <dlee@mozilla.com>
parents: 224546
diff changeset
  3065
  return NS_OK;
bccb6cedee610628a74c9286d9c355fabebba9a7 Bug 1105666 - [BrowserAPI] Add an API to indicate this iframe could receive NFC event. r=smaug, kanru, yoshi
Dimi Lee <dlee@mozilla.com>
parents: 224546
diff changeset
  3066
}
bccb6cedee610628a74c9286d9c355fabebba9a7 Bug 1105666 - [BrowserAPI] Add an API to indicate this iframe could receive NFC event. r=smaug, kanru, yoshi
Dimi Lee <dlee@mozilla.com>
parents: 224546
diff changeset
  3067
552537
5dfe10427d890cf0b208aee07adb77afe2b44dc4 Bug 1670134, remove message manager reference from LightweightThemeChild.jsm, by getting chromeOuterWindowId from BrowserChild instead, r=mconley
Neil Deakin <neil@mozilla.com>
parents: 552461
diff changeset
  3068
NS_IMETHODIMP
5dfe10427d890cf0b208aee07adb77afe2b44dc4 Bug 1670134, remove message manager reference from LightweightThemeChild.jsm, by getting chromeOuterWindowId from BrowserChild instead, r=mconley
Neil Deakin <neil@mozilla.com>
parents: 552461
diff changeset
  3069
BrowserChild::GetChromeOuterWindowID(uint64_t* aId) {
5dfe10427d890cf0b208aee07adb77afe2b44dc4 Bug 1670134, remove message manager reference from LightweightThemeChild.jsm, by getting chromeOuterWindowId from BrowserChild instead, r=mconley
Neil Deakin <neil@mozilla.com>
parents: 552461
diff changeset
  3070
  *aId = ChromeOuterWindowID();
5dfe10427d890cf0b208aee07adb77afe2b44dc4 Bug 1670134, remove message manager reference from LightweightThemeChild.jsm, by getting chromeOuterWindowId from BrowserChild instead, r=mconley
Neil Deakin <neil@mozilla.com>
parents: 552461
diff changeset
  3071
  return NS_OK;
5dfe10427d890cf0b208aee07adb77afe2b44dc4 Bug 1670134, remove message manager reference from LightweightThemeChild.jsm, by getting chromeOuterWindowId from BrowserChild instead, r=mconley
Neil Deakin <neil@mozilla.com>
parents: 552461
diff changeset
  3072
}
5dfe10427d890cf0b208aee07adb77afe2b44dc4 Bug 1670134, remove message manager reference from LightweightThemeChild.jsm, by getting chromeOuterWindowId from BrowserChild instead, r=mconley
Neil Deakin <neil@mozilla.com>
parents: 552461
diff changeset
  3073
525196
b6848f971b5704f41dbd97facb037ae0558591fd Bug 1631358 - remove CPOW support in the message manager, r=mccr8
Gijs Kruitbosch <gijskruitbosch@gmail.com>
parents: 524975
diff changeset
  3074
bool BrowserChild::DoSendBlockingMessage(
b6848f971b5704f41dbd97facb037ae0558591fd Bug 1631358 - remove CPOW support in the message manager, r=mccr8
Gijs Kruitbosch <gijskruitbosch@gmail.com>
parents: 524975
diff changeset
  3075
    const nsAString& aMessage, StructuredCloneData& aData,
b6848f971b5704f41dbd97facb037ae0558591fd Bug 1631358 - remove CPOW support in the message manager, r=mccr8
Gijs Kruitbosch <gijskruitbosch@gmail.com>
parents: 524975
diff changeset
  3076
    nsTArray<StructuredCloneData>* aRetVal) {
101204
4048c64af6de6c36e592300e9b44ba500635559f Bug 759427 - 'Multiprocess blob support for MessageManager and IndexedDB'. r=smaug+janv+khuey (rs=sicking for nsBlobURI changes).
Ben Turner <bent.mozilla@gmail.com>
parents: 101064
diff changeset
  3077
  ClonedMessageData data;
261877
ba1fb46745fba671a113888120d88ed9bd6e7ab7 Bug 1203426 - Rename StructuredCloneIPCHelper to StructuredCloneData, r=smaug
Andrea Marchesini <amarchesini@mozilla.com>
parents: 261592
diff changeset
  3078
  if (!BuildClonedMessageDataForChild(Manager(), aData, data)) {
119760
b162349ad5381a510c03764880c97278c341cac1 Bug 834106 - consolidate ClonedMessageData building code into MessageManagerCallback; r=smaug
Nathan Froyd <froydnj@mozilla.com>
parents: 119086
diff changeset
  3079
    return false;
101204
4048c64af6de6c36e592300e9b44ba500635559f Bug 759427 - 'Multiprocess blob support for MessageManager and IndexedDB'. r=smaug+janv+khuey (rs=sicking for nsBlobURI changes).
Ben Turner <bent.mozilla@gmail.com>
parents: 101064
diff changeset
  3080
  }
525196
b6848f971b5704f41dbd97facb037ae0558591fd Bug 1631358 - remove CPOW support in the message manager, r=mccr8
Gijs Kruitbosch <gijskruitbosch@gmail.com>
parents: 524975
diff changeset
  3081
  return SendSyncMessage(PromiseFlatString(aMessage), data, aRetVal);
46683
416375517820bf550a6bf64a0d5a4ba729eb6d97 Bug 542242 - E10s, content process event handlers, r=jst, r=bsmedberg
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46682
diff changeset
  3082
}
416375517820bf550a6bf64a0d5a4ba729eb6d97 Bug 542242 - E10s, content process event handlers, r=jst, r=bsmedberg
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46682
diff changeset
  3083
525196
b6848f971b5704f41dbd97facb037ae0558591fd Bug 1631358 - remove CPOW support in the message manager, r=mccr8
Gijs Kruitbosch <gijskruitbosch@gmail.com>
parents: 524975
diff changeset
  3084
nsresult BrowserChild::DoSendAsyncMessage(const nsAString& aMessage,
b6848f971b5704f41dbd97facb037ae0558591fd Bug 1631358 - remove CPOW support in the message manager, r=mccr8
Gijs Kruitbosch <gijskruitbosch@gmail.com>
parents: 524975
diff changeset
  3085
                                          StructuredCloneData& aData) {
101204
4048c64af6de6c36e592300e9b44ba500635559f Bug 759427 - 'Multiprocess blob support for MessageManager and IndexedDB'. r=smaug+janv+khuey (rs=sicking for nsBlobURI changes).
Ben Turner <bent.mozilla@gmail.com>
parents: 101064
diff changeset
  3086
  ClonedMessageData data;
261877
ba1fb46745fba671a113888120d88ed9bd6e7ab7 Bug 1203426 - Rename StructuredCloneIPCHelper to StructuredCloneData, r=smaug
Andrea Marchesini <amarchesini@mozilla.com>
parents: 261592
diff changeset
  3087
  if (!BuildClonedMessageDataForChild(Manager(), aData, data)) {
267632
d1d48d269ce519c50f76159817e1ac910268bc48 Bug 1212244 - Same-process sendAsyncMessage can now throw instead of OOM. r=smaug
David Rajchenbach-Teller <dteller@mozilla.com>
parents: 266705
diff changeset
  3088
    return NS_ERROR_DOM_DATA_CLONE_ERR;
101204
4048c64af6de6c36e592300e9b44ba500635559f Bug 759427 - 'Multiprocess blob support for MessageManager and IndexedDB'. r=smaug+janv+khuey (rs=sicking for nsBlobURI changes).
Ben Turner <bent.mozilla@gmail.com>
parents: 101064
diff changeset
  3089
  }
525196
b6848f971b5704f41dbd97facb037ae0558591fd Bug 1631358 - remove CPOW support in the message manager, r=mccr8
Gijs Kruitbosch <gijskruitbosch@gmail.com>
parents: 524975
diff changeset
  3090
  if (!SendAsyncMessage(PromiseFlatString(aMessage), data)) {
267632
d1d48d269ce519c50f76159817e1ac910268bc48 Bug 1212244 - Same-process sendAsyncMessage can now throw instead of OOM. r=smaug
David Rajchenbach-Teller <dteller@mozilla.com>
parents: 266705
diff changeset
  3091
    return NS_ERROR_UNEXPECTED;
d1d48d269ce519c50f76159817e1ac910268bc48 Bug 1212244 - Same-process sendAsyncMessage can now throw instead of OOM. r=smaug
David Rajchenbach-Teller <dteller@mozilla.com>
parents: 266705
diff changeset
  3092
  }
d1d48d269ce519c50f76159817e1ac910268bc48 Bug 1212244 - Same-process sendAsyncMessage can now throw instead of OOM. r=smaug
David Rajchenbach-Teller <dteller@mozilla.com>
parents: 266705
diff changeset
  3093
  return NS_OK;
46683
416375517820bf550a6bf64a0d5a4ba729eb6d97 Bug 542242 - E10s, content process event handlers, r=jst, r=bsmedberg
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46682
diff changeset
  3094
}
416375517820bf550a6bf64a0d5a4ba729eb6d97 Bug 542242 - E10s, content process event handlers, r=jst, r=bsmedberg
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46682
diff changeset
  3095
461887
f41cee9bf14931b453838d1bbcbda528e3b064e8 Bug 1523969 part 6 - Move method definition inline comments to new line in 'dom/'. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 460971
diff changeset
  3096
/* static */
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3097
nsTArray<RefPtr<BrowserChild>> BrowserChild::GetAll() {
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3098
  StaticMutexAutoLock lock(sBrowserChildrenMutex);
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3099
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3100
  if (!sBrowserChildren) {
572904
da46b77569234b55d782fcfd17cdd18291fb160e Bug 1184468 - Use nsBaseHashtable::Values. r=xpcom-reviewers,nika
Simon Giesecke <sgiesecke@mozilla.com>
parents: 572098
diff changeset
  3101
    return {};
314603
101e8160640228dcc0e59429d27a2f3a3a6a957d Recreate PLayerTransactions for TabChildren when the compositor restarts. (bug 1300936 part 4, r=mattwoodrow, r=billm)
David Anderson <danderson@mozilla.com>
parents: 314592
diff changeset
  3102
  }
101e8160640228dcc0e59429d27a2f3a3a6a957d Recreate PLayerTransactions for TabChildren when the compositor restarts. (bug 1300936 part 4, r=mattwoodrow, r=billm)
David Anderson <danderson@mozilla.com>
parents: 314592
diff changeset
  3103
572904
da46b77569234b55d782fcfd17cdd18291fb160e Bug 1184468 - Use nsBaseHashtable::Values. r=xpcom-reviewers,nika
Simon Giesecke <sgiesecke@mozilla.com>
parents: 572098
diff changeset
  3104
  return ToTArray<nsTArray<RefPtr<BrowserChild>>>(sBrowserChildren->Values());
314603
101e8160640228dcc0e59429d27a2f3a3a6a957d Recreate PLayerTransactions for TabChildren when the compositor restarts. (bug 1300936 part 4, r=mattwoodrow, r=billm)
David Anderson <danderson@mozilla.com>
parents: 314592
diff changeset
  3105
}
101e8160640228dcc0e59429d27a2f3a3a6a957d Recreate PLayerTransactions for TabChildren when the compositor restarts. (bug 1300936 part 4, r=mattwoodrow, r=billm)
David Anderson <danderson@mozilla.com>
parents: 314592
diff changeset
  3106
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3107
BrowserChild* BrowserChild::GetFrom(PresShell* aPresShell) {
452446
f0a91d36587266d7454a450c6044d573664fbed5 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 452279
diff changeset
  3108
  Document* doc = aPresShell->GetDocument();
149757
ec20bcd7c9022ef3f30c3ac6976d90c377363ac4 Bug 923151 - Part 1: Don't #include nsIDocument.h in TabChild.h; r=jst
Ehsan Akhgari <ehsan@mozilla.com>
parents: 149619
diff changeset
  3109
  if (!doc) {
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3110
    return nullptr;
149757
ec20bcd7c9022ef3f30c3ac6976d90c377363ac4 Bug 923151 - Part 1: Don't #include nsIDocument.h in TabChild.h; r=jst
Ehsan Akhgari <ehsan@mozilla.com>
parents: 149619
diff changeset
  3111
  }
156688
0a0081b34af7bb85fdb70501b0f00c66eb95a670 bug 939049 - get rid of useless QIs r=smaug
Trevor Saunders <trev.saunders@gmail.com>
parents: 156460
diff changeset
  3112
  nsCOMPtr<nsIDocShell> docShell(doc->GetDocShell());
149757
ec20bcd7c9022ef3f30c3ac6976d90c377363ac4 Bug 923151 - Part 1: Don't #include nsIDocument.h in TabChild.h; r=jst
Ehsan Akhgari <ehsan@mozilla.com>
parents: 149619
diff changeset
  3113
  return GetFrom(docShell);
ec20bcd7c9022ef3f30c3ac6976d90c377363ac4 Bug 923151 - Part 1: Don't #include nsIDocument.h in TabChild.h; r=jst
Ehsan Akhgari <ehsan@mozilla.com>
parents: 149619
diff changeset
  3114
}
ec20bcd7c9022ef3f30c3ac6976d90c377363ac4 Bug 923151 - Part 1: Don't #include nsIDocument.h in TabChild.h; r=jst
Ehsan Akhgari <ehsan@mozilla.com>
parents: 149619
diff changeset
  3115
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3116
BrowserChild* BrowserChild::GetFrom(layers::LayersId aLayersId) {
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3117
  StaticMutexAutoLock lock(sBrowserChildrenMutex);
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3118
  if (!sBrowserChildren) {
178416
263f232855ad658b96452cb431db499ac2505fcb Bug 974197 - Fire MozAfterPaint after the compositor has composited the frame. r=roc
Matt Woodrow <mwoodrow@mozilla.com>
parents: 177846
diff changeset
  3119
    return nullptr;
263f232855ad658b96452cb431db499ac2505fcb Bug 974197 - Fire MozAfterPaint after the compositor has composited the frame. r=roc
Matt Woodrow <mwoodrow@mozilla.com>
parents: 177846
diff changeset
  3120
  }
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3121
  return sBrowserChildren->Get(uint64_t(aLayersId));
178416
263f232855ad658b96452cb431db499ac2505fcb Bug 974197 - Fire MozAfterPaint after the compositor has composited the frame. r=roc
Matt Woodrow <mwoodrow@mozilla.com>
parents: 177846
diff changeset
  3122
}
263f232855ad658b96452cb431db499ac2505fcb Bug 974197 - Fire MozAfterPaint after the compositor has composited the frame. r=roc
Matt Woodrow <mwoodrow@mozilla.com>
parents: 177846
diff changeset
  3123
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3124
void BrowserChild::DidComposite(mozilla::layers::TransactionId aTransactionId,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3125
                                const TimeStamp& aCompositeStart,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3126
                                const TimeStamp& aCompositeEnd) {
249318
daefa5ea5f981ca4a0026be825c9eda09d815f90 Bug 1175383 TabChild should store PuppetWidget as is rather than as nsIWidget r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 248968
diff changeset
  3127
  MOZ_ASSERT(mPuppetWidget);
591040
06213402f850853c04405fc60157bff3f2b1fde4 Bug 1728914 - Use WebRenderLayerManager directly in BrowserChild. r=gfx-reviewers,jrmuizel
Matt Woodrow <mwoodrow@mozilla.com>
parents: 590278
diff changeset
  3128
  RefPtr<WebRenderLayerManager> lm =
06213402f850853c04405fc60157bff3f2b1fde4 Bug 1728914 - Use WebRenderLayerManager directly in BrowserChild. r=gfx-reviewers,jrmuizel
Matt Woodrow <mwoodrow@mozilla.com>
parents: 590278
diff changeset
  3129
      mPuppetWidget->GetWindowRenderer()->AsWebRender();
378228
3d475d6b6b5bd3f7db7a38719d3f0cdb5515e518 Bug 1348280 - Remove LayerManager type assertions from TabChild r=kats
Kirk Steuber <ksteuber@mozilla.com>
parents: 377972
diff changeset
  3130
  MOZ_ASSERT(lm);
3d475d6b6b5bd3f7db7a38719d3f0cdb5515e518 Bug 1348280 - Remove LayerManager type assertions from TabChild r=kats
Kirk Steuber <ksteuber@mozilla.com>
parents: 377972
diff changeset
  3131
587869
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  3132
  if (lm) {
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  3133
    lm->DidComposite(aTransactionId, aCompositeStart, aCompositeEnd);
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  3134
  }
178416
263f232855ad658b96452cb431db499ac2505fcb Bug 974197 - Fire MozAfterPaint after the compositor has composited the frame. r=roc
Matt Woodrow <mwoodrow@mozilla.com>
parents: 177846
diff changeset
  3135
}
263f232855ad658b96452cb431db499ac2505fcb Bug 974197 - Fire MozAfterPaint after the compositor has composited the frame. r=roc
Matt Woodrow <mwoodrow@mozilla.com>
parents: 177846
diff changeset
  3136
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3137
void BrowserChild::DidRequestComposite(const TimeStamp& aCompositeReqStart,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3138
                                       const TimeStamp& aCompositeReqEnd) {
269353
f95c614295a0971529da8c0c93d28718e7c4c5bd Bug 1202657 - Add markers for workers' message passing and serialization/deserialization, r=smaug, jsantell, tromey, ejpbruel
Victor Porof <vporof@mozilla.com>
parents: 268238
diff changeset
  3139
  nsCOMPtr<nsIDocShell> docShellComPtr = do_GetInterface(WebNavigation());
f95c614295a0971529da8c0c93d28718e7c4c5bd Bug 1202657 - Add markers for workers' message passing and serialization/deserialization, r=smaug, jsantell, tromey, ejpbruel
Victor Porof <vporof@mozilla.com>
parents: 268238
diff changeset
  3140
  if (!docShellComPtr) {
262116
d598f1792a949866dd681e933fdc07033961d4c3 Bug 1200252 - Add marker for when the IPC request for a composite is sent to the compositor thread, r=jsantell,matt
Victor Porof <vporof@mozilla.com>
parents: 261592
diff changeset
  3141
    return;
d598f1792a949866dd681e933fdc07033961d4c3 Bug 1200252 - Add marker for when the IPC request for a composite is sent to the compositor thread, r=jsantell,matt
Victor Porof <vporof@mozilla.com>
parents: 261592
diff changeset
  3142
  }
d598f1792a949866dd681e933fdc07033961d4c3 Bug 1200252 - Add marker for when the IPC request for a composite is sent to the compositor thread, r=jsantell,matt
Victor Porof <vporof@mozilla.com>
parents: 261592
diff changeset
  3143
269353
f95c614295a0971529da8c0c93d28718e7c4c5bd Bug 1202657 - Add markers for workers' message passing and serialization/deserialization, r=smaug, jsantell, tromey, ejpbruel
Victor Porof <vporof@mozilla.com>
parents: 268238
diff changeset
  3144
  nsDocShell* docShell = static_cast<nsDocShell*>(docShellComPtr.get());
f95c614295a0971529da8c0c93d28718e7c4c5bd Bug 1202657 - Add markers for workers' message passing and serialization/deserialization, r=smaug, jsantell, tromey, ejpbruel
Victor Porof <vporof@mozilla.com>
parents: 268238
diff changeset
  3145
  RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
f95c614295a0971529da8c0c93d28718e7c4c5bd Bug 1202657 - Add markers for workers' message passing and serialization/deserialization, r=smaug, jsantell, tromey, ejpbruel
Victor Porof <vporof@mozilla.com>
parents: 268238
diff changeset
  3146
f95c614295a0971529da8c0c93d28718e7c4c5bd Bug 1202657 - Add markers for workers' message passing and serialization/deserialization, r=smaug, jsantell, tromey, ejpbruel
Victor Porof <vporof@mozilla.com>
parents: 268238
diff changeset
  3147
  if (timelines && timelines->HasConsumer(docShell)) {
318123
cb6b42803b04e80b7b1109813e535419d422e696 Bug 1310014 - Avoid capturing JS backtraces in TabChild::DidRequestComposite(); r=tromey
Ehsan Akhgari <ehsan@mozilla.com>
parents: 316672
diff changeset
  3148
    // Since we're assuming that it's impossible for content JS to directly
cb6b42803b04e80b7b1109813e535419d422e696 Bug 1310014 - Avoid capturing JS backtraces in TabChild::DidRequestComposite(); r=tromey
Ehsan Akhgari <ehsan@mozilla.com>
parents: 316672
diff changeset
  3149
    // trigger a synchronous paint, we can avoid capturing a stack trace here,
cb6b42803b04e80b7b1109813e535419d422e696 Bug 1310014 - Avoid capturing JS backtraces in TabChild::DidRequestComposite(); r=tromey
Ehsan Akhgari <ehsan@mozilla.com>
parents: 316672
diff changeset
  3150
    // which means we won't run into JS engine reentrancy issues like bug
cb6b42803b04e80b7b1109813e535419d422e696 Bug 1310014 - Avoid capturing JS backtraces in TabChild::DidRequestComposite(); r=tromey
Ehsan Akhgari <ehsan@mozilla.com>
parents: 316672
diff changeset
  3151
    // 1310014.
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3152
    timelines->AddMarkerForDocShell(
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3153
        docShell, "CompositeForwardTransaction", aCompositeReqStart,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3154
        MarkerTracingType::START, MarkerStackRequest::NO_STACK);
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3155
    timelines->AddMarkerForDocShell(docShell, "CompositeForwardTransaction",
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3156
                                    aCompositeReqEnd, MarkerTracingType::END,
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3157
                                    MarkerStackRequest::NO_STACK);
269353
f95c614295a0971529da8c0c93d28718e7c4c5bd Bug 1202657 - Add markers for workers' message passing and serialization/deserialization, r=smaug, jsantell, tromey, ejpbruel
Victor Porof <vporof@mozilla.com>
parents: 268238
diff changeset
  3158
  }
262116
d598f1792a949866dd681e933fdc07033961d4c3 Bug 1200252 - Add marker for when the IPC request for a composite is sent to the compositor thread, r=jsantell,matt
Victor Porof <vporof@mozilla.com>
parents: 261592
diff changeset
  3159
}
d598f1792a949866dd681e933fdc07033961d4c3 Bug 1200252 - Add marker for when the IPC request for a composite is sent to the compositor thread, r=jsantell,matt
Victor Porof <vporof@mozilla.com>
parents: 261592
diff changeset
  3160
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3161
void BrowserChild::ClearCachedResources() {
249318
daefa5ea5f981ca4a0026be825c9eda09d815f90 Bug 1175383 TabChild should store PuppetWidget as is rather than as nsIWidget r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 248968
diff changeset
  3162
  MOZ_ASSERT(mPuppetWidget);
591040
06213402f850853c04405fc60157bff3f2b1fde4 Bug 1728914 - Use WebRenderLayerManager directly in BrowserChild. r=gfx-reviewers,jrmuizel
Matt Woodrow <mwoodrow@mozilla.com>
parents: 590278
diff changeset
  3163
  RefPtr<WebRenderLayerManager> lm =
06213402f850853c04405fc60157bff3f2b1fde4 Bug 1728914 - Use WebRenderLayerManager directly in BrowserChild. r=gfx-reviewers,jrmuizel
Matt Woodrow <mwoodrow@mozilla.com>
parents: 590278
diff changeset
  3164
      mPuppetWidget->GetWindowRenderer()->AsWebRender();
587869
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  3165
  if (lm) {
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  3166
    lm->ClearCachedResources();
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  3167
  }
545310
c0a323ca7d8b71128945fbff73c92444d8f7a424 Bug 1647797 - Add GeckoView API to listen for when contentful paint status has been reset. r=geckoview-reviewers,agi,esawin
Jamie Nicol <jnicol@mozilla.com>
parents: 544287
diff changeset
  3168
c0a323ca7d8b71128945fbff73c92444d8f7a424 Bug 1647797 - Add GeckoView API to listen for when contentful paint status has been reset. r=geckoview-reviewers,agi,esawin
Jamie Nicol <jnicol@mozilla.com>
parents: 544287
diff changeset
  3169
  if (nsCOMPtr<Document> document = GetTopLevelDocument()) {
c0a323ca7d8b71128945fbff73c92444d8f7a424 Bug 1647797 - Add GeckoView API to listen for when contentful paint status has been reset. r=geckoview-reviewers,agi,esawin
Jamie Nicol <jnicol@mozilla.com>
parents: 544287
diff changeset
  3170
    nsPresContext* presContext = document->GetPresContext();
c0a323ca7d8b71128945fbff73c92444d8f7a424 Bug 1647797 - Add GeckoView API to listen for when contentful paint status has been reset. r=geckoview-reviewers,agi,esawin
Jamie Nicol <jnicol@mozilla.com>
parents: 544287
diff changeset
  3171
    if (presContext) {
c0a323ca7d8b71128945fbff73c92444d8f7a424 Bug 1647797 - Add GeckoView API to listen for when contentful paint status has been reset. r=geckoview-reviewers,agi,esawin
Jamie Nicol <jnicol@mozilla.com>
parents: 544287
diff changeset
  3172
      presContext->NotifyPaintStatusReset();
c0a323ca7d8b71128945fbff73c92444d8f7a424 Bug 1647797 - Add GeckoView API to listen for when contentful paint status has been reset. r=geckoview-reviewers,agi,esawin
Jamie Nicol <jnicol@mozilla.com>
parents: 544287
diff changeset
  3173
    }
c0a323ca7d8b71128945fbff73c92444d8f7a424 Bug 1647797 - Add GeckoView API to listen for when contentful paint status has been reset. r=geckoview-reviewers,agi,esawin
Jamie Nicol <jnicol@mozilla.com>
parents: 544287
diff changeset
  3174
  }
245093
77655fe1aab56a3c4cc7a631aa8e3e1c2b6e866a Bug 1154231 - Part 1. Use LRU to manage remote layers. r=mattwoodrow
Kan-Ru Chen <kanru@kanru.info>
parents: 244496
diff changeset
  3175
}
77655fe1aab56a3c4cc7a631aa8e3e1c2b6e866a Bug 1154231 - Part 1. Use LRU to manage remote layers. r=mattwoodrow
Kan-Ru Chen <kanru@kanru.info>
parents: 244496
diff changeset
  3176
589520
a95f6a0cd9eb07fd2e19fba745b7a7e84f522c0c Bug 1726291 - Remove FrameLayerBuilder. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 589395
diff changeset
  3177
void BrowserChild::InvalidateLayers() { MOZ_ASSERT(mPuppetWidget); }
286055
6fcea9ec83505069544ad8671b468dff7bd87aea Propagate D3D9 device resets to remote layers. (bug 1245765 part 2, r=mattwoodrow)
David Anderson <danderson@mozilla.com>
parents: 285606
diff changeset
  3178
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3179
void BrowserChild::SchedulePaint() {
438931
94a87c720eee25ae57b47fba0b564de70c7b1741 Bug 1491798- Schedule repaint if WebRender is updated by tab move r=mattwoodrow
sotaro <sotaro.ikeda.g@gmail.com>
parents: 436526
diff changeset
  3180
  nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
94a87c720eee25ae57b47fba0b564de70c7b1741 Bug 1491798- Schedule repaint if WebRender is updated by tab move r=mattwoodrow
sotaro <sotaro.ikeda.g@gmail.com>
parents: 436526
diff changeset
  3181
  if (!docShell) {
94a87c720eee25ae57b47fba0b564de70c7b1741 Bug 1491798- Schedule repaint if WebRender is updated by tab move r=mattwoodrow
sotaro <sotaro.ikeda.g@gmail.com>
parents: 436526
diff changeset
  3182
    return;
94a87c720eee25ae57b47fba0b564de70c7b1741 Bug 1491798- Schedule repaint if WebRender is updated by tab move r=mattwoodrow
sotaro <sotaro.ikeda.g@gmail.com>
parents: 436526
diff changeset
  3183
  }
94a87c720eee25ae57b47fba0b564de70c7b1741 Bug 1491798- Schedule repaint if WebRender is updated by tab move r=mattwoodrow
sotaro <sotaro.ikeda.g@gmail.com>
parents: 436526
diff changeset
  3184
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3185
  // We don't use BrowserChildBase::GetPresShell() here because that would
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3186
  // create a content viewer if one doesn't exist yet. Creating a content viewer
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3187
  // can cause JS to run, which we want to avoid. nsIDocShell::GetPresShell
438931
94a87c720eee25ae57b47fba0b564de70c7b1741 Bug 1491798- Schedule repaint if WebRender is updated by tab move r=mattwoodrow
sotaro <sotaro.ikeda.g@gmail.com>
parents: 436526
diff changeset
  3188
  // returns null if no content viewer exists yet.
469371
c1a9e74c1b4b3e8c0383cd5dfe1b6a3eff4e7ca2 Bug 1542506 - Make nsDocShell use mozilla::PresShell* directly rather than nsIPresShell* r=bzbarsky
Masayuki Nakano <masayuki@d-toybox.com>
parents: 469276
diff changeset
  3189
  if (RefPtr<PresShell> presShell = docShell->GetPresShell()) {
438931
94a87c720eee25ae57b47fba0b564de70c7b1741 Bug 1491798- Schedule repaint if WebRender is updated by tab move r=mattwoodrow
sotaro <sotaro.ikeda.g@gmail.com>
parents: 436526
diff changeset
  3190
    if (nsIFrame* root = presShell->GetRootFrame()) {
94a87c720eee25ae57b47fba0b564de70c7b1741 Bug 1491798- Schedule repaint if WebRender is updated by tab move r=mattwoodrow
sotaro <sotaro.ikeda.g@gmail.com>
parents: 436526
diff changeset
  3191
      root->SchedulePaint();
94a87c720eee25ae57b47fba0b564de70c7b1741 Bug 1491798- Schedule repaint if WebRender is updated by tab move r=mattwoodrow
sotaro <sotaro.ikeda.g@gmail.com>
parents: 436526
diff changeset
  3192
    }
94a87c720eee25ae57b47fba0b564de70c7b1741 Bug 1491798- Schedule repaint if WebRender is updated by tab move r=mattwoodrow
sotaro <sotaro.ikeda.g@gmail.com>
parents: 436526
diff changeset
  3193
  }
94a87c720eee25ae57b47fba0b564de70c7b1741 Bug 1491798- Schedule repaint if WebRender is updated by tab move r=mattwoodrow
sotaro <sotaro.ikeda.g@gmail.com>
parents: 436526
diff changeset
  3194
}
94a87c720eee25ae57b47fba0b564de70c7b1741 Bug 1491798- Schedule repaint if WebRender is updated by tab move r=mattwoodrow
sotaro <sotaro.ikeda.g@gmail.com>
parents: 436526
diff changeset
  3195
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3196
void BrowserChild::ReinitRendering() {
409886
5d9f32557d7740c7c30f7bc6057c4de0c294d828 Bug 1448490 - Make the layers id a struct instead of a uint64_t. r=mattwoodrow
Kartikaya Gupta <kgupta@mozilla.com>
parents: 409300
diff changeset
  3197
  MOZ_ASSERT(mLayersId.IsValid());
314603
101e8160640228dcc0e59429d27a2f3a3a6a957d Recreate PLayerTransactions for TabChildren when the compositor restarts. (bug 1300936 part 4, r=mattwoodrow, r=billm)
David Anderson <danderson@mozilla.com>
parents: 314592
diff changeset
  3198
590278
504f32fb626417e4bc92c1818ecb27476937b53b Bug 1728062 - Skip BrowserChild::ReinitRendering() when BrowserChild is not connected to compositor r=jrmuizel,gfx-reviewers
sotaro <sotaro.ikeda.g@gmail.com>
parents: 589971
diff changeset
  3199
  // In some cases, like when we create a windowless browser,
504f32fb626417e4bc92c1818ecb27476937b53b Bug 1728062 - Skip BrowserChild::ReinitRendering() when BrowserChild is not connected to compositor r=jrmuizel,gfx-reviewers
sotaro <sotaro.ikeda.g@gmail.com>
parents: 589971
diff changeset
  3200
  // RemoteLayerTreeOwner/BrowserChild is not connected to a compositor.
504f32fb626417e4bc92c1818ecb27476937b53b Bug 1728062 - Skip BrowserChild::ReinitRendering() when BrowserChild is not connected to compositor r=jrmuizel,gfx-reviewers
sotaro <sotaro.ikeda.g@gmail.com>
parents: 589971
diff changeset
  3201
  if (mLayersConnected.isNothing() || !*mLayersConnected) {
504f32fb626417e4bc92c1818ecb27476937b53b Bug 1728062 - Skip BrowserChild::ReinitRendering() when BrowserChild is not connected to compositor r=jrmuizel,gfx-reviewers
sotaro <sotaro.ikeda.g@gmail.com>
parents: 589971
diff changeset
  3202
    return;
504f32fb626417e4bc92c1818ecb27476937b53b Bug 1728062 - Skip BrowserChild::ReinitRendering() when BrowserChild is not connected to compositor r=jrmuizel,gfx-reviewers
sotaro <sotaro.ikeda.g@gmail.com>
parents: 589971
diff changeset
  3203
  }
504f32fb626417e4bc92c1818ecb27476937b53b Bug 1728062 - Skip BrowserChild::ReinitRendering() when BrowserChild is not connected to compositor r=jrmuizel,gfx-reviewers
sotaro <sotaro.ikeda.g@gmail.com>
parents: 589971
diff changeset
  3204
314603
101e8160640228dcc0e59429d27a2f3a3a6a957d Recreate PLayerTransactions for TabChildren when the compositor restarts. (bug 1300936 part 4, r=mattwoodrow, r=billm)
David Anderson <danderson@mozilla.com>
parents: 314592
diff changeset
  3205
  // Before we establish a new PLayerTransaction, we must connect our layer tree
101e8160640228dcc0e59429d27a2f3a3a6a957d Recreate PLayerTransactions for TabChildren when the compositor restarts. (bug 1300936 part 4, r=mattwoodrow, r=billm)
David Anderson <danderson@mozilla.com>
parents: 314592
diff changeset
  3206
  // id, CompositorBridge, and the widget compositor all together again.
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3207
  // Normally this happens in BrowserParent before BrowserChild is given
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3208
  // rendering information.
314603
101e8160640228dcc0e59429d27a2f3a3a6a957d Recreate PLayerTransactions for TabChildren when the compositor restarts. (bug 1300936 part 4, r=mattwoodrow, r=billm)
David Anderson <danderson@mozilla.com>
parents: 314592
diff changeset
  3209
  //
470936
47813ecb1f4e0244ded2f7b938430bf52c927751 Bug 1534395 - Rename TabParent to BrowserParent. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470247
diff changeset
  3210
  // In this case, we will send a sync message to our BrowserParent, which in
47813ecb1f4e0244ded2f7b938430bf52c927751 Bug 1534395 - Rename TabParent to BrowserParent. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470247
diff changeset
  3211
  // turn will send a sync message to the Compositor of the widget owning this
47813ecb1f4e0244ded2f7b938430bf52c927751 Bug 1534395 - Rename TabParent to BrowserParent. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470247
diff changeset
  3212
  // tab. This guarantees the correct association is in place before our
314603
101e8160640228dcc0e59429d27a2f3a3a6a957d Recreate PLayerTransactions for TabChildren when the compositor restarts. (bug 1300936 part 4, r=mattwoodrow, r=billm)
David Anderson <danderson@mozilla.com>
parents: 314592
diff changeset
  3213
  // PLayerTransaction constructor message arrives on the cross-process
101e8160640228dcc0e59429d27a2f3a3a6a957d Recreate PLayerTransactions for TabChildren when the compositor restarts. (bug 1300936 part 4, r=mattwoodrow, r=billm)
David Anderson <danderson@mozilla.com>
parents: 314592
diff changeset
  3214
  // compositor bridge.
352070
4b455ab566a205ad6f37eadd1f3400ac01203ec1 Bug 1350638 - Remove sync GetCompositorOptions call in TabChild::ReinitRenderingState. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 352068
diff changeset
  3215
  CompositorOptions options;
4b455ab566a205ad6f37eadd1f3400ac01203ec1 Bug 1350638 - Remove sync GetCompositorOptions call in TabChild::ReinitRenderingState. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 352068
diff changeset
  3216
  SendEnsureLayersConnected(&options);
4b455ab566a205ad6f37eadd1f3400ac01203ec1 Bug 1350638 - Remove sync GetCompositorOptions call in TabChild::ReinitRenderingState. r=dvander
Kartikaya Gupta <kgupta@mozilla.com>
parents: 352068
diff changeset
  3217
  mCompositorOptions = Some(options);
314603
101e8160640228dcc0e59429d27a2f3a3a6a957d Recreate PLayerTransactions for TabChildren when the compositor restarts. (bug 1300936 part 4, r=mattwoodrow, r=billm)
David Anderson <danderson@mozilla.com>
parents: 314592
diff changeset
  3218
369574
649a35887b3018c91766cc4afea8370d54dd3ccd Bug 1350408 - Gracefully handle failures in WebRenderLayerManager::Initialize to allow reinit. r=kats
Andrew Osmond <aosmond@mozilla.com>
parents: 367593
diff changeset
  3219
  bool success = false;
314603
101e8160640228dcc0e59429d27a2f3a3a6a957d Recreate PLayerTransactions for TabChildren when the compositor restarts. (bug 1300936 part 4, r=mattwoodrow, r=billm)
David Anderson <danderson@mozilla.com>
parents: 314592
diff changeset
  3220
  RefPtr<CompositorBridgeChild> cb = CompositorBridgeChild::Get();
386153
e0c53e24ab2a59ea1fb21d482404e54641107658 Bug 1391262 - Create TabChild::CreateRemoteLayerManager() r=dvander
sotaro <sotaro.ikeda.g@gmail.com>
parents: 386152
diff changeset
  3221
e0c53e24ab2a59ea1fb21d482404e54641107658 Bug 1391262 - Create TabChild::CreateRemoteLayerManager() r=dvander
sotaro <sotaro.ikeda.g@gmail.com>
parents: 386152
diff changeset
  3222
  if (cb) {
e0c53e24ab2a59ea1fb21d482404e54641107658 Bug 1391262 - Create TabChild::CreateRemoteLayerManager() r=dvander
sotaro <sotaro.ikeda.g@gmail.com>
parents: 386152
diff changeset
  3223
    success = CreateRemoteLayerManager(cb);
369574
649a35887b3018c91766cc4afea8370d54dd3ccd Bug 1350408 - Gracefully handle failures in WebRenderLayerManager::Initialize to allow reinit. r=kats
Andrew Osmond <aosmond@mozilla.com>
parents: 367593
diff changeset
  3224
  }
649a35887b3018c91766cc4afea8370d54dd3ccd Bug 1350408 - Gracefully handle failures in WebRenderLayerManager::Initialize to allow reinit. r=kats
Andrew Osmond <aosmond@mozilla.com>
parents: 367593
diff changeset
  3225
649a35887b3018c91766cc4afea8370d54dd3ccd Bug 1350408 - Gracefully handle failures in WebRenderLayerManager::Initialize to allow reinit. r=kats
Andrew Osmond <aosmond@mozilla.com>
parents: 367593
diff changeset
  3226
  if (!success) {
649a35887b3018c91766cc4afea8370d54dd3ccd Bug 1350408 - Gracefully handle failures in WebRenderLayerManager::Initialize to allow reinit. r=kats
Andrew Osmond <aosmond@mozilla.com>
parents: 367593
diff changeset
  3227
    NS_WARNING("failed to recreate layer manager");
649a35887b3018c91766cc4afea8370d54dd3ccd Bug 1350408 - Gracefully handle failures in WebRenderLayerManager::Initialize to allow reinit. r=kats
Andrew Osmond <aosmond@mozilla.com>
parents: 367593
diff changeset
  3228
    return;
314603
101e8160640228dcc0e59429d27a2f3a3a6a957d Recreate PLayerTransactions for TabChildren when the compositor restarts. (bug 1300936 part 4, r=mattwoodrow, r=billm)
David Anderson <danderson@mozilla.com>
parents: 314592
diff changeset
  3229
  }
101e8160640228dcc0e59429d27a2f3a3a6a957d Recreate PLayerTransactions for TabChildren when the compositor restarts. (bug 1300936 part 4, r=mattwoodrow, r=billm)
David Anderson <danderson@mozilla.com>
parents: 314592
diff changeset
  3230
386152
38330dd0d9e5e297b396e760c2997c86a1e64a59 Bug 1391262 - Do not use remote LayerManager when its initialization fails r=dvander
sotaro <sotaro.ikeda.g@gmail.com>
parents: 385544
diff changeset
  3231
  mLayersConnected = Some(true);
358041
c78b979c5c5965f97f66733caa77e1ae0510262f Make sure to re-identify TextureFactoryIdentifiers when reinitializing rendering. (bug 1363126 part 6, r=rhunt)
David Anderson <dvander@alliedmods.net>
parents: 358036
diff changeset
  3232
  ImageBridgeChild::IdentifyCompositorTextureHost(mTextureFactoryIdentifier);
c78b979c5c5965f97f66733caa77e1ae0510262f Make sure to re-identify TextureFactoryIdentifiers when reinitializing rendering. (bug 1363126 part 6, r=rhunt)
David Anderson <dvander@alliedmods.net>
parents: 358036
diff changeset
  3233
  gfx::VRManagerChild::IdentifyTextureHost(mTextureFactoryIdentifier);
c78b979c5c5965f97f66733caa77e1ae0510262f Make sure to re-identify TextureFactoryIdentifiers when reinitializing rendering. (bug 1363126 part 6, r=rhunt)
David Anderson <dvander@alliedmods.net>
parents: 358036
diff changeset
  3234
325289
1d9ec0ad1388284030757003dbffa93bcaf9c0e0 Bug 1320817 - Move child process PAPZ initialization into TabChild::InitRenderingState. r=kats
Ryan Hunt <rhunt@eqrion.net>
parents: 325156
diff changeset
  3235
  InitAPZState();
591040
06213402f850853c04405fc60157bff3f2b1fde4 Bug 1728914 - Use WebRenderLayerManager directly in BrowserChild. r=gfx-reviewers,jrmuizel
Matt Woodrow <mwoodrow@mozilla.com>
parents: 590278
diff changeset
  3236
  RefPtr<WebRenderLayerManager> lm =
06213402f850853c04405fc60157bff3f2b1fde4 Bug 1728914 - Use WebRenderLayerManager directly in BrowserChild. r=gfx-reviewers,jrmuizel
Matt Woodrow <mwoodrow@mozilla.com>
parents: 590278
diff changeset
  3237
      mPuppetWidget->GetWindowRenderer()->AsWebRender();
587869
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  3238
  if (lm) {
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  3239
    lm->SetLayersObserverEpoch(mLayersObserverEpoch);
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  3240
  }
321604
e38e63ec11cc305aca30c97bba67feb2982c24cf Bug 1315581 - Notify MediaFormatReader when the compositor gets recreated. r=jya,smaug,jw_wang
Matt Woodrow <mwoodrow@mozilla.com>
parents: 321029
diff changeset
  3241
469386
148e810b01d22b00e254c445dda2f659534103a7 Bug 1542664 - Make TabChild use mozilla::PresShell directly rather than via nsIPresShell r=nika
Masayuki Nakano <masayuki@d-toybox.com>
parents: 469371
diff changeset
  3242
  nsCOMPtr<Document> doc(GetTopLevelDocument());
321604
e38e63ec11cc305aca30c97bba67feb2982c24cf Bug 1315581 - Notify MediaFormatReader when the compositor gets recreated. r=jya,smaug,jw_wang
Matt Woodrow <mwoodrow@mozilla.com>
parents: 321029
diff changeset
  3243
  doc->NotifyLayerManagerRecreated();
314603
101e8160640228dcc0e59429d27a2f3a3a6a957d Recreate PLayerTransactions for TabChildren when the compositor restarts. (bug 1300936 part 4, r=mattwoodrow, r=billm)
David Anderson <danderson@mozilla.com>
parents: 314592
diff changeset
  3244
}
101e8160640228dcc0e59429d27a2f3a3a6a957d Recreate PLayerTransactions for TabChildren when the compositor restarts. (bug 1300936 part 4, r=mattwoodrow, r=billm)
David Anderson <danderson@mozilla.com>
parents: 314592
diff changeset
  3245
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3246
void BrowserChild::ReinitRenderingForDeviceReset() {
358036
063adb4deaf5efe3ef4f80635dd68e15a7a0325e Handle remote device resets by recreating the entire rendering stack. (bug 1363126 part 1, r=rhunt, ipc_r=billm)
David Anderson <dvander@alliedmods.net>
parents: 357719
diff changeset
  3247
  InvalidateLayers();
063adb4deaf5efe3ef4f80635dd68e15a7a0325e Handle remote device resets by recreating the entire rendering stack. (bug 1363126 part 1, r=rhunt, ipc_r=billm)
David Anderson <dvander@alliedmods.net>
parents: 357719
diff changeset
  3248
591040
06213402f850853c04405fc60157bff3f2b1fde4 Bug 1728914 - Use WebRenderLayerManager directly in BrowserChild. r=gfx-reviewers,jrmuizel
Matt Woodrow <mwoodrow@mozilla.com>
parents: 590278
diff changeset
  3249
  RefPtr<WebRenderLayerManager> lm =
06213402f850853c04405fc60157bff3f2b1fde4 Bug 1728914 - Use WebRenderLayerManager directly in BrowserChild. r=gfx-reviewers,jrmuizel
Matt Woodrow <mwoodrow@mozilla.com>
parents: 590278
diff changeset
  3250
      mPuppetWidget->GetWindowRenderer()->AsWebRender();
06213402f850853c04405fc60157bff3f2b1fde4 Bug 1728914 - Use WebRenderLayerManager directly in BrowserChild. r=gfx-reviewers,jrmuizel
Matt Woodrow <mwoodrow@mozilla.com>
parents: 590278
diff changeset
  3251
  if (lm) {
06213402f850853c04405fc60157bff3f2b1fde4 Bug 1728914 - Use WebRenderLayerManager directly in BrowserChild. r=gfx-reviewers,jrmuizel
Matt Woodrow <mwoodrow@mozilla.com>
parents: 590278
diff changeset
  3252
    lm->DoDestroy(/* aIsSync */ true);
358036
063adb4deaf5efe3ef4f80635dd68e15a7a0325e Handle remote device resets by recreating the entire rendering stack. (bug 1363126 part 1, r=rhunt, ipc_r=billm)
David Anderson <dvander@alliedmods.net>
parents: 357719
diff changeset
  3253
  }
063adb4deaf5efe3ef4f80635dd68e15a7a0325e Handle remote device resets by recreating the entire rendering stack. (bug 1363126 part 1, r=rhunt, ipc_r=billm)
David Anderson <dvander@alliedmods.net>
parents: 357719
diff changeset
  3254
063adb4deaf5efe3ef4f80635dd68e15a7a0325e Handle remote device resets by recreating the entire rendering stack. (bug 1363126 part 1, r=rhunt, ipc_r=billm)
David Anderson <dvander@alliedmods.net>
parents: 357719
diff changeset
  3255
  // Proceed with destroying and recreating the layer manager.
063adb4deaf5efe3ef4f80635dd68e15a7a0325e Handle remote device resets by recreating the entire rendering stack. (bug 1363126 part 1, r=rhunt, ipc_r=billm)
David Anderson <dvander@alliedmods.net>
parents: 357719
diff changeset
  3256
  ReinitRendering();
063adb4deaf5efe3ef4f80635dd68e15a7a0325e Handle remote device resets by recreating the entire rendering stack. (bug 1363126 part 1, r=rhunt, ipc_r=billm)
David Anderson <dvander@alliedmods.net>
parents: 357719
diff changeset
  3257
}
063adb4deaf5efe3ef4f80635dd68e15a7a0325e Handle remote device resets by recreating the entire rendering stack. (bug 1363126 part 1, r=rhunt, ipc_r=billm)
David Anderson <dvander@alliedmods.net>
parents: 357719
diff changeset
  3258
164753
a1877d97194db90c2a4e5cf7f6470c7b4d8b8feb Bug 938904 - [e10s] Make tooltips work (r=smaug,enn)
Bill McCloskey <wmccloskey@mozilla.com>
parents: 163723
diff changeset
  3259
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3260
BrowserChild::OnShowTooltip(int32_t aXCoords, int32_t aYCoords,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3261
                            const nsAString& aTipText,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3262
                            const nsAString& aTipDir) {
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3263
  nsString str(aTipText);
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3264
  nsString dir(aTipDir);
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3265
  SendShowTooltip(aXCoords, aYCoords, str, dir);
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3266
  return NS_OK;
164753
a1877d97194db90c2a4e5cf7f6470c7b4d8b8feb Bug 938904 - [e10s] Make tooltips work (r=smaug,enn)
Bill McCloskey <wmccloskey@mozilla.com>
parents: 163723
diff changeset
  3267
}
a1877d97194db90c2a4e5cf7f6470c7b4d8b8feb Bug 938904 - [e10s] Make tooltips work (r=smaug,enn)
Bill McCloskey <wmccloskey@mozilla.com>
parents: 163723
diff changeset
  3268
a1877d97194db90c2a4e5cf7f6470c7b4d8b8feb Bug 938904 - [e10s] Make tooltips work (r=smaug,enn)
Bill McCloskey <wmccloskey@mozilla.com>
parents: 163723
diff changeset
  3269
NS_IMETHODIMP
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3270
BrowserChild::OnHideTooltip() {
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3271
  SendHideTooltip();
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3272
  return NS_OK;
164753
a1877d97194db90c2a4e5cf7f6470c7b4d8b8feb Bug 938904 - [e10s] Make tooltips work (r=smaug,enn)
Bill McCloskey <wmccloskey@mozilla.com>
parents: 163723
diff changeset
  3273
}
101204
4048c64af6de6c36e592300e9b44ba500635559f Bug 759427 - 'Multiprocess blob support for MessageManager and IndexedDB'. r=smaug+janv+khuey (rs=sicking for nsBlobURI changes).
Ben Turner <bent.mozilla@gmail.com>
parents: 101064
diff changeset
  3274
538831
5d5e5aafec2f3c8f1c66e99c2c74b078647f7b5f Bug 1324591 - Report janked animations to the main-thread and update them on the main-thread. r=botond,boris
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 538822
diff changeset
  3275
void BrowserChild::NotifyJankedAnimations(
5d5e5aafec2f3c8f1c66e99c2c74b078647f7b5f Bug 1324591 - Report janked animations to the main-thread and update them on the main-thread. r=botond,boris
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 538822
diff changeset
  3276
    const nsTArray<uint64_t>& aJankedAnimations) {
5d5e5aafec2f3c8f1c66e99c2c74b078647f7b5f Bug 1324591 - Report janked animations to the main-thread and update them on the main-thread. r=botond,boris
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 538822
diff changeset
  3277
  MOZ_ASSERT(mPuppetWidget);
591040
06213402f850853c04405fc60157bff3f2b1fde4 Bug 1728914 - Use WebRenderLayerManager directly in BrowserChild. r=gfx-reviewers,jrmuizel
Matt Woodrow <mwoodrow@mozilla.com>
parents: 590278
diff changeset
  3278
  RefPtr<WebRenderLayerManager> lm =
06213402f850853c04405fc60157bff3f2b1fde4 Bug 1728914 - Use WebRenderLayerManager directly in BrowserChild. r=gfx-reviewers,jrmuizel
Matt Woodrow <mwoodrow@mozilla.com>
parents: 590278
diff changeset
  3279
      mPuppetWidget->GetWindowRenderer()->AsWebRender();
587869
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  3280
  if (lm) {
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  3281
    lm->UpdatePartialPrerenderedAnimations(aJankedAnimations);
e8299f04430316b8ed5a73b8b9f0e824dfe84f38 Bug 1722258 - Convert more LayerManager usage to use WindowRenderer. r=miko
Matt Woodrow <mwoodrow@mozilla.com>
parents: 587868
diff changeset
  3282
  }
538831
5d5e5aafec2f3c8f1c66e99c2c74b078647f7b5f Bug 1324591 - Report janked animations to the main-thread and update them on the main-thread. r=botond,boris
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 538822
diff changeset
  3283
}
5d5e5aafec2f3c8f1c66e99c2c74b078647f7b5f Bug 1324591 - Report janked animations to the main-thread and update them on the main-thread. r=botond,boris
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 538822
diff changeset
  3284
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3285
mozilla::ipc::IPCResult BrowserChild::RecvUIResolutionChanged(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3286
    const float& aDpi, const int32_t& aRounding, const double& aScale) {
515492
d4d3b6aa527011d1a05e437ce8c4e2991b182491 Bug 1561488 - null check document in RecvUIResolutionChanged and RecvThemeChanged, r=bdahl
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 515377
diff changeset
  3287
  nsCOMPtr<Document> document(GetTopLevelDocument());
d4d3b6aa527011d1a05e437ce8c4e2991b182491 Bug 1561488 - null check document in RecvUIResolutionChanged and RecvThemeChanged, r=bdahl
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 515377
diff changeset
  3288
  if (!document) {
d4d3b6aa527011d1a05e437ce8c4e2991b182491 Bug 1561488 - null check document in RecvUIResolutionChanged and RecvThemeChanged, r=bdahl
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 515377
diff changeset
  3289
    return IPC_OK();
d4d3b6aa527011d1a05e437ce8c4e2991b182491 Bug 1561488 - null check document in RecvUIResolutionChanged and RecvThemeChanged, r=bdahl
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 515377
diff changeset
  3290
  }
d4d3b6aa527011d1a05e437ce8c4e2991b182491 Bug 1561488 - null check document in RecvUIResolutionChanged and RecvThemeChanged, r=bdahl
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 515377
diff changeset
  3291
248782
eec75d3d0344987dd38941ac23d4d7ac420d5ddb Bug 1125325 - Make TabParent/TabChild UpdateDimensions messages aware of the display scale. r=kats
David Parks <davidp99@gmail.com>
parents: 248198
diff changeset
  3292
  ScreenIntSize oldScreenSize = GetInnerSize();
369874
b43d89d13360fcdbee0a034eebc308e67c71cf52 Bug 1350643 - Part 7: Remove sync GetDPI/DefaultScale/WidgetRounding. Use primary screen's value until RecvShow. r=kanru
Samael Wang <freesamael@gmail.com>
parents: 369574
diff changeset
  3293
  if (aDpi > 0) {
b43d89d13360fcdbee0a034eebc308e67c71cf52 Bug 1350643 - Part 7: Remove sync GetDPI/DefaultScale/WidgetRounding. Use primary screen's value until RecvShow. r=kanru
Samael Wang <freesamael@gmail.com>
parents: 369574
diff changeset
  3294
    mPuppetWidget->UpdateBackingScaleCache(aDpi, aRounding, aScale);
b43d89d13360fcdbee0a034eebc308e67c71cf52 Bug 1350643 - Part 7: Remove sync GetDPI/DefaultScale/WidgetRounding. Use primary screen's value until RecvShow. r=kanru
Samael Wang <freesamael@gmail.com>
parents: 369574
diff changeset
  3295
  }
404585
3790c8adcba31c0a49bda55161777a7992fbfb4a Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 404432
diff changeset
  3296
  RefPtr<nsPresContext> presContext = document->GetPresContext();
3790c8adcba31c0a49bda55161777a7992fbfb4a Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 404432
diff changeset
  3297
  if (presContext) {
3790c8adcba31c0a49bda55161777a7992fbfb4a Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug
Hiroyuki Ikezoe <hikezoe@mozilla.com>
parents: 404432
diff changeset
  3298
    presContext->UIResolutionChangedSync();
240838
4cc6d2d9c5dcb6a43c0a32bc331d0c896360127a Bug 1096093 - Send ThemeRefresh message from parent down to content process. r=smaug.
Mike Conley <mconley@mozilla.com>
parents: 240758
diff changeset
  3299
  }
248782
eec75d3d0344987dd38941ac23d4d7ac420d5ddb Bug 1125325 - Make TabParent/TabChild UpdateDimensions messages aware of the display scale. r=kats
David Parks <davidp99@gmail.com>
parents: 248198
diff changeset
  3300
eec75d3d0344987dd38941ac23d4d7ac420d5ddb Bug 1125325 - Make TabParent/TabChild UpdateDimensions messages aware of the display scale. r=kats
David Parks <davidp99@gmail.com>
parents: 248198
diff changeset
  3301
  ScreenIntSize screenSize = GetInnerSize();
eec75d3d0344987dd38941ac23d4d7ac420d5ddb Bug 1125325 - Make TabParent/TabChild UpdateDimensions messages aware of the display scale. r=kats
David Parks <davidp99@gmail.com>
parents: 248198
diff changeset
  3302
  if (mHasValidInnerSize && oldScreenSize != screenSize) {
eec75d3d0344987dd38941ac23d4d7ac420d5ddb Bug 1125325 - Make TabParent/TabChild UpdateDimensions messages aware of the display scale. r=kats
David Parks <davidp99@gmail.com>
parents: 248198
diff changeset
  3303
    ScreenIntRect screenRect = GetOuterRect();
537186
345be10ae3f6fa33b5297e80217feaf40bb87a11 Bug 1647871 - Remove AutoResizeReflowSquasher. r=kats
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 537043
diff changeset
  3304
345be10ae3f6fa33b5297e80217feaf40bb87a11 Bug 1647871 - Remove AutoResizeReflowSquasher. r=kats
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 537043
diff changeset
  3305
    // See RecvUpdateDimensions for the order of these operations.
345be10ae3f6fa33b5297e80217feaf40bb87a11 Bug 1647871 - Remove AutoResizeReflowSquasher. r=kats
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 537043
diff changeset
  3306
    nsCOMPtr<nsIBaseWindow> baseWin = do_QueryInterface(WebNavigation());
345be10ae3f6fa33b5297e80217feaf40bb87a11 Bug 1647871 - Remove AutoResizeReflowSquasher. r=kats
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 537043
diff changeset
  3307
    baseWin->SetPositionAndSize(0, 0, screenSize.width, screenSize.height,
345be10ae3f6fa33b5297e80217feaf40bb87a11 Bug 1647871 - Remove AutoResizeReflowSquasher. r=kats
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 537043
diff changeset
  3308
                                nsIBaseWindow::eRepaint);
345be10ae3f6fa33b5297e80217feaf40bb87a11 Bug 1647871 - Remove AutoResizeReflowSquasher. r=kats
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 537043
diff changeset
  3309
404432
92d362925563bf9dfb056255d5d018a84c63bc44 Backed out changeset 38577c007450 (bug 1424371) for Marionett test failure on testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py. CLOSED TREE
Dorel Luca <dluca@mozilla.com>
parents: 404430
diff changeset
  3310
    mPuppetWidget->Resize(screenRect.x + mClientOffset.x + mChromeOffset.x,
92d362925563bf9dfb056255d5d018a84c63bc44 Backed out changeset 38577c007450 (bug 1424371) for Marionett test failure on testing/marionette/harness/marionette_harness/tests/unit/test_window_maximize.py. CLOSED TREE
Dorel Luca <dluca@mozilla.com>
parents: 404430
diff changeset
  3311
                          screenRect.y + mClientOffset.y + mChromeOffset.y,
249318
daefa5ea5f981ca4a0026be825c9eda09d815f90 Bug 1175383 TabChild should store PuppetWidget as is rather than as nsIWidget r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 248968
diff changeset
  3312
                          screenSize.width, screenSize.height, true);
248782
eec75d3d0344987dd38941ac23d4d7ac420d5ddb Bug 1125325 - Make TabParent/TabChild UpdateDimensions messages aware of the display scale. r=kats
David Parks <davidp99@gmail.com>
parents: 248198
diff changeset
  3313
  }
eec75d3d0344987dd38941ac23d4d7ac420d5ddb Bug 1125325 - Make TabParent/TabChild UpdateDimensions messages aware of the display scale. r=kats
David Parks <davidp99@gmail.com>
parents: 248198
diff changeset
  3314
322595
39ac4382a2c019178604b90acd816753fe142908 Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
Kan-Ru Chen <kanru@kanru.info>
parents: 322503
diff changeset
  3315
  return IPC_OK();
240838
4cc6d2d9c5dcb6a43c0a32bc331d0c896360127a Bug 1096093 - Send ThemeRefresh message from parent down to content process. r=smaug.
Mike Conley <mconley@mozilla.com>
parents: 240758
diff changeset
  3316
}
4cc6d2d9c5dcb6a43c0a32bc331d0c896360127a Bug 1096093 - Send ThemeRefresh message from parent down to content process. r=smaug.
Mike Conley <mconley@mozilla.com>
parents: 240758
diff changeset
  3317
516803
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3318
mozilla::ipc::IPCResult BrowserChild::RecvSafeAreaInsetsChanged(
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3319
    const mozilla::ScreenIntMargin& aSafeAreaInsets) {
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3320
  mPuppetWidget->UpdateSafeAreaInsets(aSafeAreaInsets);
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3321
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3322
  nsCOMPtr<nsIScreenManager> screenMgr =
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3323
      do_GetService("@mozilla.org/gfx/screenmanager;1");
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3324
  ScreenIntMargin currentSafeAreaInsets;
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3325
  if (screenMgr) {
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3326
    // aSafeAreaInsets is for current screen. But we have to calculate
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3327
    // safe insets for content window.
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3328
    int32_t x, y, cx, cy;
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3329
    GetDimensions(0, &x, &y, &cx, &cy);
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3330
    nsCOMPtr<nsIScreen> screen;
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3331
    screenMgr->ScreenForRect(x, y, cx, cy, getter_AddRefs(screen));
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3332
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3333
    if (screen) {
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3334
      LayoutDeviceIntRect windowRect(x + mClientOffset.x + mChromeOffset.x,
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3335
                                     y + mClientOffset.y + mChromeOffset.y, cx,
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3336
                                     cy);
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3337
      currentSafeAreaInsets = nsContentUtils::GetWindowSafeAreaInsets(
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3338
          screen, aSafeAreaInsets, windowRect);
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3339
    }
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3340
  }
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3341
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3342
  if (nsCOMPtr<Document> document = GetTopLevelDocument()) {
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3343
    nsPresContext* presContext = document->GetPresContext();
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3344
    if (presContext) {
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3345
      presContext->SetSafeAreaInsets(currentSafeAreaInsets);
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3346
    }
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3347
  }
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3348
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3349
  // https://github.com/w3c/csswg-drafts/issues/4670
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3350
  // Actually we don't set this value on sub document. This behaviour is
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3351
  // same as Blink that safe area insets isn't set on sub document.
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3352
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3353
  return IPC_OK();
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3354
}
d155d510d1a19c3be047dedd63f52562de6a980b Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Makoto Kato <m_kato@ga2.so-net.ne.jp>
parents: 516799
diff changeset
  3355
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3356
mozilla::ipc::IPCResult BrowserChild::RecvAllowScriptsToClose() {
436526
a8dd5d2c8cfff22dd7d349d9fea236e1f90cf493 Bug 1488822 - propagate allowScriptsToClose via the frameloader instead of relying on frame scripts, r=mconley,kmag,nika
Gijs Kruitbosch <gijskruitbosch@gmail.com>
parents: 435171
diff changeset
  3357
  nsCOMPtr<nsPIDOMWindowOuter> window = do_GetInterface(WebNavigation());
a8dd5d2c8cfff22dd7d349d9fea236e1f90cf493 Bug 1488822 - propagate allowScriptsToClose via the frameloader instead of relying on frame scripts, r=mconley,kmag,nika
Gijs Kruitbosch <gijskruitbosch@gmail.com>
parents: 435171
diff changeset
  3358
  if (window) {
a8dd5d2c8cfff22dd7d349d9fea236e1f90cf493 Bug 1488822 - propagate allowScriptsToClose via the frameloader instead of relying on frame scripts, r=mconley,kmag,nika
Gijs Kruitbosch <gijskruitbosch@gmail.com>
parents: 435171
diff changeset
  3359
    nsGlobalWindowOuter::Cast(window)->AllowScriptsToClose();
a8dd5d2c8cfff22dd7d349d9fea236e1f90cf493 Bug 1488822 - propagate allowScriptsToClose via the frameloader instead of relying on frame scripts, r=mconley,kmag,nika
Gijs Kruitbosch <gijskruitbosch@gmail.com>
parents: 435171
diff changeset
  3360
  }
a8dd5d2c8cfff22dd7d349d9fea236e1f90cf493 Bug 1488822 - propagate allowScriptsToClose via the frameloader instead of relying on frame scripts, r=mconley,kmag,nika
Gijs Kruitbosch <gijskruitbosch@gmail.com>
parents: 435171
diff changeset
  3361
  return IPC_OK();
a8dd5d2c8cfff22dd7d349d9fea236e1f90cf493 Bug 1488822 - propagate allowScriptsToClose via the frameloader instead of relying on frame scripts, r=mconley,kmag,nika
Gijs Kruitbosch <gijskruitbosch@gmail.com>
parents: 435171
diff changeset
  3362
}
a8dd5d2c8cfff22dd7d349d9fea236e1f90cf493 Bug 1488822 - propagate allowScriptsToClose via the frameloader instead of relying on frame scripts, r=mconley,kmag,nika
Gijs Kruitbosch <gijskruitbosch@gmail.com>
parents: 435171
diff changeset
  3363
554578
82dc435b2c6d2a638e7ee0ffdfcfd2dd1b478075 Bug 1655239 - Make pointer capture fission compatible; r=smaug
Edgar Chen <echen@mozilla.com>
parents: 554526
diff changeset
  3364
mozilla::ipc::IPCResult BrowserChild::RecvReleaseAllPointerCapture() {
82dc435b2c6d2a638e7ee0ffdfcfd2dd1b478075 Bug 1655239 - Make pointer capture fission compatible; r=smaug
Edgar Chen <echen@mozilla.com>
parents: 554526
diff changeset
  3365
  PointerEventHandler::ReleaseAllPointerCapture();
82dc435b2c6d2a638e7ee0ffdfcfd2dd1b478075 Bug 1655239 - Make pointer capture fission compatible; r=smaug
Edgar Chen <echen@mozilla.com>
parents: 554526
diff changeset
  3366
  return IPC_OK();
82dc435b2c6d2a638e7ee0ffdfcfd2dd1b478075 Bug 1655239 - Make pointer capture fission compatible; r=smaug
Edgar Chen <echen@mozilla.com>
parents: 554526
diff changeset
  3367
}
82dc435b2c6d2a638e7ee0ffdfcfd2dd1b478075 Bug 1655239 - Make pointer capture fission compatible; r=smaug
Edgar Chen <echen@mozilla.com>
parents: 554526
diff changeset
  3368
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3369
PPaymentRequestChild* BrowserChild::AllocPPaymentRequestChild() {
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3370
  MOZ_CRASH(
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3371
      "We should never be manually allocating PPaymentRequestChild actors");
360837
d2370b6a03e89aff5cecb43dada104f887df04bd Bug 1345361 - PaymentRequest constructor implementation. r=baku
Eden Chuang <echuang@mozilla.com>
parents: 360733
diff changeset
  3372
  return nullptr;
d2370b6a03e89aff5cecb43dada104f887df04bd Bug 1345361 - PaymentRequest constructor implementation. r=baku
Eden Chuang <echuang@mozilla.com>
parents: 360733
diff changeset
  3373
}
d2370b6a03e89aff5cecb43dada104f887df04bd Bug 1345361 - PaymentRequest constructor implementation. r=baku
Eden Chuang <echuang@mozilla.com>
parents: 360733
diff changeset
  3374
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3375
bool BrowserChild::DeallocPPaymentRequestChild(PPaymentRequestChild* actor) {
422890
057eef48e70bc9236f4b5079bfb9cbee6b753009 Bug 1442453 - Create a single IPC actor per PaymentRequest. r=baku
Blake Kaplan <mrbkap@gmail.com>
parents: 422758
diff changeset
  3376
  delete actor;
360837
d2370b6a03e89aff5cecb43dada104f887df04bd Bug 1345361 - PaymentRequest constructor implementation. r=baku
Eden Chuang <echuang@mozilla.com>
parents: 360733
diff changeset
  3377
  return true;
d2370b6a03e89aff5cecb43dada104f887df04bd Bug 1345361 - PaymentRequest constructor implementation. r=baku
Eden Chuang <echuang@mozilla.com>
parents: 360733
diff changeset
  3378
}
d2370b6a03e89aff5cecb43dada104f887df04bd Bug 1345361 - PaymentRequest constructor implementation. r=baku
Eden Chuang <echuang@mozilla.com>
parents: 360733
diff changeset
  3379
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3380
ScreenIntSize BrowserChild::GetInnerSize() {
248782
eec75d3d0344987dd38941ac23d4d7ac420d5ddb Bug 1125325 - Make TabParent/TabChild UpdateDimensions messages aware of the display scale. r=kats
David Parks <davidp99@gmail.com>
parents: 248198
diff changeset
  3381
  LayoutDeviceIntSize innerSize =
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3382
      RoundedToInt(mUnscaledInnerSize * mPuppetWidget->GetDefaultScale());
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3383
  return ViewAs<ScreenPixel>(
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3384
      innerSize, PixelCastJustification::LayoutDeviceIsScreenForTabDims);
248782
eec75d3d0344987dd38941ac23d4d7ac420d5ddb Bug 1125325 - Make TabParent/TabChild UpdateDimensions messages aware of the display scale. r=kats
David Parks <davidp99@gmail.com>
parents: 248198
diff changeset
  3385
};
eec75d3d0344987dd38941ac23d4d7ac420d5ddb Bug 1125325 - Make TabParent/TabChild UpdateDimensions messages aware of the display scale. r=kats
David Parks <davidp99@gmail.com>
parents: 248198
diff changeset
  3386
550295
7ed2e1d98e9c2cf8c185d410f8b1c0edd0419953 Bug 1619370 - Return the rect from BrowserChild::GetVisibleRect() in app units r=mattwoodrow
Miko Mynttinen <mikokm@gmail.com>
parents: 550291
diff changeset
  3387
Maybe<nsRect> BrowserChild::GetVisibleRect() const {
478828
f1672aa4e79c277fbf7856df76a9131e9e9d2388 Bug 1559211 - Fallback to conservative visible rect for top-level remote browsers. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 478774
diff changeset
  3388
  if (mIsTopLevel) {
f1672aa4e79c277fbf7856df76a9131e9e9d2388 Bug 1559211 - Fallback to conservative visible rect for top-level remote browsers. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 478774
diff changeset
  3389
    // We are conservative about visible rects for top-level browsers to avoid
f1672aa4e79c277fbf7856df76a9131e9e9d2388 Bug 1559211 - Fallback to conservative visible rect for top-level remote browsers. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 478774
diff changeset
  3390
    // artifacts when resizing
479989
5c4e6eca7339058730338c825461809a6ef9648c Bug 1554861 - Disable clipping and scaling for top-level remote browsers to resolve regressions. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 479252
diff changeset
  3391
    return Nothing();
478623
8e2f26c4072b026814e6f41d2d02257b39ba3025 Bug 1558482 - Apply visibleRect and scaling when painting. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 478622
diff changeset
  3392
  }
550295
7ed2e1d98e9c2cf8c185d410f8b1c0edd0419953 Bug 1619370 - Return the rect from BrowserChild::GetVisibleRect() in app units r=mattwoodrow
Miko Mynttinen <mikokm@gmail.com>
parents: 550291
diff changeset
  3393
583086
20c1ef91fc108f15d23c5108662b542c37938311 Bug 1709460 - Add a flag representing whether mEffectsInfo has been set or not. r=tnikkel
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 582925
diff changeset
  3394
  return mDidSetEffectsInfo ? Some(mEffectsInfo.mVisibleRect) : Nothing();
478623
8e2f26c4072b026814e6f41d2d02257b39ba3025 Bug 1558482 - Apply visibleRect and scaling when painting. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 478622
diff changeset
  3395
}
8e2f26c4072b026814e6f41d2d02257b39ba3025 Bug 1558482 - Apply visibleRect and scaling when painting. r=mattwoodrow
Ryan Hunt <rhunt@eqrion.net>
parents: 478622
diff changeset
  3396
513179
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3397
Maybe<LayoutDeviceRect>
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3398
BrowserChild::GetTopLevelViewportVisibleRectInSelfCoords() const {
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3399
  if (mIsTopLevel) {
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3400
    return Nothing();
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3401
  }
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3402
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3403
  if (!mChildToParentConversionMatrix) {
513425
73e691abcdb522021aabf7a279d2f989e84a64b9 Bug 1614573 - Don't use EffectsInfo.mVisibleRect in BrowserChild::GetTopLevelViewportVisibleRectInSelfCoords(). r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513360
diff changeset
  3404
    // We have no way to tell this remote document visible rect right now.
73e691abcdb522021aabf7a279d2f989e84a64b9 Bug 1614573 - Don't use EffectsInfo.mVisibleRect in BrowserChild::GetTopLevelViewportVisibleRectInSelfCoords(). r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513360
diff changeset
  3405
    return Nothing();
513179
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3406
  }
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3407
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3408
  Maybe<LayoutDeviceToLayoutDeviceMatrix4x4> inverse =
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3409
      mChildToParentConversionMatrix->MaybeInverse();
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3410
  if (!inverse) {
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3411
    return Nothing();
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3412
  }
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3413
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3414
  // Convert the remote document visible rect to the coordinate system of the
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3415
  // iframe document.
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3416
  Maybe<LayoutDeviceRect> rect = UntransformBy(
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3417
      *inverse,
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3418
      ViewAs<LayoutDevicePixel>(
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3419
          mTopLevelViewportVisibleRectInBrowserCoords,
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3420
          PixelCastJustification::ContentProcessIsLayerInUiProcess),
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3421
      LayoutDeviceRect::MaxIntRect());
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3422
  if (!rect) {
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3423
    return Nothing();
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3424
  }
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3425
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3426
  return rect;
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3427
}
b8ad0267e88abff0a54a6f0f1b5de2ad3a018460 Bug 1599795 - Make IntersectionObserver work in fission world. r=emilio
Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
parents: 513178
diff changeset
  3428
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3429
ScreenIntRect BrowserChild::GetOuterRect() {
248782
eec75d3d0344987dd38941ac23d4d7ac420d5ddb Bug 1125325 - Make TabParent/TabChild UpdateDimensions messages aware of the display scale. r=kats
David Parks <davidp99@gmail.com>
parents: 248198
diff changeset
  3430
  LayoutDeviceIntRect outerRect =
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3431
      RoundedToInt(mUnscaledOuterRect * mPuppetWidget->GetDefaultScale());
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3432
  return ViewAs<ScreenPixel>(
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3433
      outerRect, PixelCastJustification::LayoutDeviceIsScreenForTabDims);
248782
eec75d3d0344987dd38941ac23d4d7ac420d5ddb Bug 1125325 - Make TabParent/TabChild UpdateDimensions messages aware of the display scale. r=kats
David Parks <davidp99@gmail.com>
parents: 248198
diff changeset
  3434
}
eec75d3d0344987dd38941ac23d4d7ac420d5ddb Bug 1125325 - Make TabParent/TabChild UpdateDimensions messages aware of the display scale. r=kats
David Parks <davidp99@gmail.com>
parents: 248198
diff changeset
  3435
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3436
void BrowserChild::PaintWhileInterruptingJS(
495354
7f2441f2f26e90459c47e1249d694d76e7625f18 Bug 1582042 - Remove useless threading of aForceRepaint around various IPC messages. r=mconley
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495352
diff changeset
  3437
    const layers::LayersObserverEpoch& aEpoch) {
398051
707a2b0aede11d52aa5ab818a975170f894ba550 Bug 1397426 - Make TabParent's assume they're rendering layers by default on construction. r=billm
Mike Conley <mconley@mozilla.com>
parents: 398046
diff changeset
  3438
  if (!IPCOpen() || !mPuppetWidget || !mPuppetWidget->HasLayerManager()) {
314674
a536a062f1d921f0f0b1855c0eafe8ff3e2284e6 Bug 1303967 - Don't set mIPCOpen until TabChild is initialized (r=mrbkap)
Bill McCloskey <billm@mozilla.com>
parents: 314603
diff changeset
  3439
    // Don't bother doing anything now. Better to wait until we receive the
a536a062f1d921f0f0b1855c0eafe8ff3e2284e6 Bug 1303967 - Don't set mIPCOpen until TabChild is initialized (r=mrbkap)
Bill McCloskey <billm@mozilla.com>
parents: 314603
diff changeset
  3440
    // message on the PContent channel.
a536a062f1d921f0f0b1855c0eafe8ff3e2284e6 Bug 1303967 - Don't set mIPCOpen until TabChild is initialized (r=mrbkap)
Bill McCloskey <billm@mozilla.com>
parents: 314603
diff changeset
  3441
    return;
a536a062f1d921f0f0b1855c0eafe8ff3e2284e6 Bug 1303967 - Don't set mIPCOpen until TabChild is initialized (r=mrbkap)
Bill McCloskey <billm@mozilla.com>
parents: 314603
diff changeset
  3442
  }
a536a062f1d921f0f0b1855c0eafe8ff3e2284e6 Bug 1303967 - Don't set mIPCOpen until TabChild is initialized (r=mrbkap)
Bill McCloskey <billm@mozilla.com>
parents: 314603
diff changeset
  3443
485555
67af85c419976072424def712c414d65ae43aab5 Bug 1568051 - Don't paint during interrupt callbacks if it's not safe to run script. r=bzbarsky
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 485191
diff changeset
  3444
  MOZ_DIAGNOSTIC_ASSERT(nsContentUtils::IsSafeToRunScript());
314336
cfcd8c4f3a36b958002010a9c6d461a7769996d5 Bug 1279086 - Allow painting for tab switch when JS is running (r=dvander,mconley,mrbkap)
Bill McCloskey <billm@mozilla.com>
parents: 314305
diff changeset
  3445
  nsAutoScriptBlocker scriptBlocker;
495354
7f2441f2f26e90459c47e1249d694d76e7625f18 Bug 1582042 - Remove useless threading of aForceRepaint around various IPC messages. r=mconley
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 495352
diff changeset
  3446
  RecvRenderLayers(true /* aEnabled */, aEpoch);
314336
cfcd8c4f3a36b958002010a9c6d461a7769996d5 Bug 1279086 - Allow painting for tab switch when JS is running (r=dvander,mconley,mrbkap)
Bill McCloskey <billm@mozilla.com>
parents: 314305
diff changeset
  3447
}
cfcd8c4f3a36b958002010a9c6d461a7769996d5 Bug 1279086 - Allow painting for tab switch when JS is running (r=dvander,mconley,mrbkap)
Bill McCloskey <billm@mozilla.com>
parents: 314305
diff changeset
  3448
472044
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3449
nsresult BrowserChild::CanCancelContentJS(
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3450
    nsIRemoteTab::NavigationType aNavigationType, int32_t aNavigationIndex,
472045
100acc204e5e0c5e8767740c4861c906e21139f5 Bug 1493225, part 3 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 472044
diff changeset
  3451
    nsIURI* aNavigationURI, int32_t aEpoch, bool* aCanCancel) {
472044
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3452
  nsresult rv;
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3453
  *aCanCancel = false;
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3454
472045
100acc204e5e0c5e8767740c4861c906e21139f5 Bug 1493225, part 3 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 472044
diff changeset
  3455
  if (aEpoch <= mCancelContentJSEpoch) {
100acc204e5e0c5e8767740c4861c906e21139f5 Bug 1493225, part 3 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 472044
diff changeset
  3456
    // The next page loaded before we got here, so we shouldn't try to cancel
100acc204e5e0c5e8767740c4861c906e21139f5 Bug 1493225, part 3 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 472044
diff changeset
  3457
    // the content JS.
100acc204e5e0c5e8767740c4861c906e21139f5 Bug 1493225, part 3 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 472044
diff changeset
  3458
    return NS_OK;
100acc204e5e0c5e8767740c4861c906e21139f5 Bug 1493225, part 3 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 472044
diff changeset
  3459
  }
100acc204e5e0c5e8767740c4861c906e21139f5 Bug 1493225, part 3 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 472044
diff changeset
  3460
548923
7502521982a7b5318bb7a8edc738218613f75fdd Bug 1662410 - Part 1: Fix usage of ChildSHistory.legacySHistory . r=peterv
Andreas Farre <farre@mozilla.com>
parents: 548036
diff changeset
  3461
  // If we have session history in the parent we've already performed
7502521982a7b5318bb7a8edc738218613f75fdd Bug 1662410 - Part 1: Fix usage of ChildSHistory.legacySHistory . r=peterv
Andreas Farre <farre@mozilla.com>
parents: 548036
diff changeset
  3462
  // the checks following, so we can return early.
550543
9e97625c96156fd70f015763abc84ad89faf3dbb Bug 1667449 - Hide fission.sessionHistoryInParent pref getter behind a function r=peterv
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 550506
diff changeset
  3463
  if (mozilla::SessionHistoryInParent()) {
548923
7502521982a7b5318bb7a8edc738218613f75fdd Bug 1662410 - Part 1: Fix usage of ChildSHistory.legacySHistory . r=peterv
Andreas Farre <farre@mozilla.com>
parents: 548036
diff changeset
  3464
    *aCanCancel = true;
7502521982a7b5318bb7a8edc738218613f75fdd Bug 1662410 - Part 1: Fix usage of ChildSHistory.legacySHistory . r=peterv
Andreas Farre <farre@mozilla.com>
parents: 548036
diff changeset
  3465
    return NS_OK;
7502521982a7b5318bb7a8edc738218613f75fdd Bug 1662410 - Part 1: Fix usage of ChildSHistory.legacySHistory . r=peterv
Andreas Farre <farre@mozilla.com>
parents: 548036
diff changeset
  3466
  }
7502521982a7b5318bb7a8edc738218613f75fdd Bug 1662410 - Part 1: Fix usage of ChildSHistory.legacySHistory . r=peterv
Andreas Farre <farre@mozilla.com>
parents: 548036
diff changeset
  3467
7502521982a7b5318bb7a8edc738218613f75fdd Bug 1662410 - Part 1: Fix usage of ChildSHistory.legacySHistory . r=peterv
Andreas Farre <farre@mozilla.com>
parents: 548036
diff changeset
  3468
  nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
7502521982a7b5318bb7a8edc738218613f75fdd Bug 1662410 - Part 1: Fix usage of ChildSHistory.legacySHistory . r=peterv
Andreas Farre <farre@mozilla.com>
parents: 548036
diff changeset
  3469
  nsCOMPtr<nsISHistory> history;
7502521982a7b5318bb7a8edc738218613f75fdd Bug 1662410 - Part 1: Fix usage of ChildSHistory.legacySHistory . r=peterv
Andreas Farre <farre@mozilla.com>
parents: 548036
diff changeset
  3470
  if (docShell) {
7502521982a7b5318bb7a8edc738218613f75fdd Bug 1662410 - Part 1: Fix usage of ChildSHistory.legacySHistory . r=peterv
Andreas Farre <farre@mozilla.com>
parents: 548036
diff changeset
  3471
    history = nsDocShell::Cast(docShell)->GetSessionHistory()->LegacySHistory();
7502521982a7b5318bb7a8edc738218613f75fdd Bug 1662410 - Part 1: Fix usage of ChildSHistory.legacySHistory . r=peterv
Andreas Farre <farre@mozilla.com>
parents: 548036
diff changeset
  3472
  }
7502521982a7b5318bb7a8edc738218613f75fdd Bug 1662410 - Part 1: Fix usage of ChildSHistory.legacySHistory . r=peterv
Andreas Farre <farre@mozilla.com>
parents: 548036
diff changeset
  3473
472044
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3474
  if (!history) {
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3475
    return NS_ERROR_FAILURE;
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3476
  }
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3477
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3478
  int32_t current;
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3479
  rv = history->GetIndex(&current);
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3480
  NS_ENSURE_SUCCESS(rv, rv);
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3481
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3482
  if (current == -1) {
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3483
    // This tab has no history! Just return.
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3484
    return NS_OK;
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3485
  }
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3486
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3487
  nsCOMPtr<nsISHEntry> entry;
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3488
  rv = history->GetEntryAtIndex(current, getter_AddRefs(entry));
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3489
  NS_ENSURE_SUCCESS(rv, rv);
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3490
476843
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3491
  nsCOMPtr<nsIURI> currentURI = entry->GetURI();
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3492
  if (!currentURI->SchemeIs("http") && !currentURI->SchemeIs("https") &&
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3493
      !currentURI->SchemeIs("file")) {
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3494
    // Only cancel content JS for http(s) and file URIs. Other URIs are probably
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3495
    // internal and we should just let them run to completion.
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3496
    return NS_OK;
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3497
  }
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3498
472044
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3499
  if (aNavigationType == nsIRemoteTab::NAVIGATE_BACK) {
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3500
    aNavigationIndex = current - 1;
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3501
  } else if (aNavigationType == nsIRemoteTab::NAVIGATE_FORWARD) {
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3502
    aNavigationIndex = current + 1;
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3503
  } else if (aNavigationType == nsIRemoteTab::NAVIGATE_URL) {
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3504
    if (!aNavigationURI) {
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3505
      return NS_ERROR_FAILURE;
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3506
    }
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3507
501204
099cebd1bbd76fe79c944e6456fa0eb640659ba4 Bug 1592470 - Don't cancel content JS when "navigating" to javascript: URLs; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 499421
diff changeset
  3508
    if (aNavigationURI->SchemeIs("javascript")) {
099cebd1bbd76fe79c944e6456fa0eb640659ba4 Bug 1592470 - Don't cancel content JS when "navigating" to javascript: URLs; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 499421
diff changeset
  3509
      // "javascript:" URIs don't (necessarily) trigger navigation to a
099cebd1bbd76fe79c944e6456fa0eb640659ba4 Bug 1592470 - Don't cancel content JS when "navigating" to javascript: URLs; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 499421
diff changeset
  3510
      // different page, so don't allow the current page's JS to terminate.
099cebd1bbd76fe79c944e6456fa0eb640659ba4 Bug 1592470 - Don't cancel content JS when "navigating" to javascript: URLs; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 499421
diff changeset
  3511
      return NS_OK;
099cebd1bbd76fe79c944e6456fa0eb640659ba4 Bug 1592470 - Don't cancel content JS when "navigating" to javascript: URLs; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 499421
diff changeset
  3512
    }
099cebd1bbd76fe79c944e6456fa0eb640659ba4 Bug 1592470 - Don't cancel content JS when "navigating" to javascript: URLs; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 499421
diff changeset
  3513
476843
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3514
    // If navigating directly to a URL (e.g. via hitting Enter in the location
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3515
    // bar), then we can cancel anytime the next URL is different from the
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3516
    // current, *excluding* the ref ("#").
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3517
    bool equals;
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3518
    rv = currentURI->EqualsExceptRef(aNavigationURI, &equals);
472044
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3519
    NS_ENSURE_SUCCESS(rv, rv);
476843
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3520
    *aCanCancel = !equals;
472044
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3521
    return NS_OK;
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3522
  }
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3523
  // Note: aNavigationType may also be NAVIGATE_INDEX, in which case we don't
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3524
  // need to do anything special.
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3525
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3526
  int32_t delta = aNavigationIndex > current ? 1 : -1;
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3527
  for (int32_t i = current + delta; i != aNavigationIndex + delta; i += delta) {
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3528
    nsCOMPtr<nsISHEntry> nextEntry;
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3529
    // If `i` happens to be negative, this call will fail (which is what we
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3530
    // would want to happen).
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3531
    rv = history->GetEntryAtIndex(i, getter_AddRefs(nextEntry));
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3532
    NS_ENSURE_SUCCESS(rv, rv);
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3533
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3534
    nsCOMPtr<nsISHEntry> laterEntry = delta == 1 ? nextEntry : entry;
476843
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3535
    nsCOMPtr<nsIURI> thisURI = entry->GetURI();
472044
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3536
    nsCOMPtr<nsIURI> nextURI = nextEntry->GetURI();
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3537
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3538
    // If we changed origin and the load wasn't in a subframe, we know it was
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3539
    // a full document load, so we can cancel the content JS safely.
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3540
    if (!laterEntry->GetIsSubFrame()) {
476843
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3541
      nsAutoCString thisHost;
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3542
      rv = thisURI->GetPrePath(thisHost);
472044
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3543
      NS_ENSURE_SUCCESS(rv, rv);
476843
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3544
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3545
      nsAutoCString nextHost;
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3546
      rv = nextURI->GetPrePath(nextHost);
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3547
      NS_ENSURE_SUCCESS(rv, rv);
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3548
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3549
      if (!thisHost.Equals(nextHost)) {
04d9dba72f221b5808f077e3aac5522147008438 Bug 1552017 - Expand the kinds of URLs that can cancel content JS when navigating; r=smaug
Jim Porter <jporter@mozilla.com>
parents: 476652
diff changeset
  3550
        *aCanCancel = true;
472044
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3551
        return NS_OK;
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3552
      }
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3553
    }
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3554
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3555
    entry = nextEntry;
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3556
  }
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3557
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3558
  return NS_OK;
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3559
}
a7fa3041bff04a25fa39fb6f714071314f3cc69b Bug 1493225, part 2 - Cancel content JS when navigating through history to prevent hangs r=smaug
Jim Porter <jporter@mozilla.com>
parents: 471447
diff changeset
  3560
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3561
nsresult BrowserChild::GetHasSiblings(bool* aHasSiblings) {
427329
5d45c705980a056136fc9c0c85334fcbe95a3da6 Bug 1350642 - Keep the tabCountResizable property in sync; r=dao
Haik Aftandilian <haftandilian@mozilla.com>
parents: 427328
diff changeset
  3562
  *aHasSiblings = mHasSiblings;
5d45c705980a056136fc9c0c85334fcbe95a3da6 Bug 1350642 - Keep the tabCountResizable property in sync; r=dao
Haik Aftandilian <haftandilian@mozilla.com>
parents: 427328
diff changeset
  3563
  return NS_OK;
5d45c705980a056136fc9c0c85334fcbe95a3da6 Bug 1350642 - Keep the tabCountResizable property in sync; r=dao
Haik Aftandilian <haftandilian@mozilla.com>
parents: 427328
diff changeset
  3564
}
5d45c705980a056136fc9c0c85334fcbe95a3da6 Bug 1350642 - Keep the tabCountResizable property in sync; r=dao
Haik Aftandilian <haftandilian@mozilla.com>
parents: 427328
diff changeset
  3565
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3566
nsresult BrowserChild::SetHasSiblings(bool aHasSiblings) {
427329
5d45c705980a056136fc9c0c85334fcbe95a3da6 Bug 1350642 - Keep the tabCountResizable property in sync; r=dao
Haik Aftandilian <haftandilian@mozilla.com>
parents: 427328
diff changeset
  3567
  mHasSiblings = aHasSiblings;
5d45c705980a056136fc9c0c85334fcbe95a3da6 Bug 1350642 - Keep the tabCountResizable property in sync; r=dao
Haik Aftandilian <haftandilian@mozilla.com>
parents: 427328
diff changeset
  3568
  return NS_OK;
5d45c705980a056136fc9c0c85334fcbe95a3da6 Bug 1350642 - Keep the tabCountResizable property in sync; r=dao
Haik Aftandilian <haftandilian@mozilla.com>
parents: 427328
diff changeset
  3569
}
5d45c705980a056136fc9c0c85334fcbe95a3da6 Bug 1350642 - Keep the tabCountResizable property in sync; r=dao
Haik Aftandilian <haftandilian@mozilla.com>
parents: 427328
diff changeset
  3570
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3571
NS_IMETHODIMP BrowserChild::OnStateChange(nsIWebProgress* aWebProgress,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3572
                                          nsIRequest* aRequest,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3573
                                          uint32_t aStateFlags,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3574
                                          nsresult aStatus) {
475428
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3575
  if (!IPCOpen() || !mShouldSendWebProgressEventsToParent) {
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3576
    return NS_OK;
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3577
  }
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3578
519073
06a61ba9c44415c7e84eb2c1548f53a95bd651e0 Bug 1620875 - Suppress extra onStateChange(STATE_START) notifications from RemoteWebProgress when switching DocumentChannel with a real channel. r=Gijs,nika
Matt Woodrow <mwoodrow@mozilla.com>
parents: 519053
diff changeset
  3579
  // We shouldn't need to notify the parent of redirect state changes, since
06a61ba9c44415c7e84eb2c1548f53a95bd651e0 Bug 1620875 - Suppress extra onStateChange(STATE_START) notifications from RemoteWebProgress when switching DocumentChannel with a real channel. r=Gijs,nika
Matt Woodrow <mwoodrow@mozilla.com>
parents: 519053
diff changeset
  3580
  // with DocumentChannel that only happens when we switch to the real channel,
06a61ba9c44415c7e84eb2c1548f53a95bd651e0 Bug 1620875 - Suppress extra onStateChange(STATE_START) notifications from RemoteWebProgress when switching DocumentChannel with a real channel. r=Gijs,nika
Matt Woodrow <mwoodrow@mozilla.com>
parents: 519053
diff changeset
  3581
  // and that's an implementation detail that we can hide.
06a61ba9c44415c7e84eb2c1548f53a95bd651e0 Bug 1620875 - Suppress extra onStateChange(STATE_START) notifications from RemoteWebProgress when switching DocumentChannel with a real channel. r=Gijs,nika
Matt Woodrow <mwoodrow@mozilla.com>
parents: 519053
diff changeset
  3582
  if (aStateFlags & nsIWebProgressListener::STATE_IS_REDIRECTED_DOCUMENT) {
06a61ba9c44415c7e84eb2c1548f53a95bd651e0 Bug 1620875 - Suppress extra onStateChange(STATE_START) notifications from RemoteWebProgress when switching DocumentChannel with a real channel. r=Gijs,nika
Matt Woodrow <mwoodrow@mozilla.com>
parents: 519053
diff changeset
  3583
    return NS_OK;
06a61ba9c44415c7e84eb2c1548f53a95bd651e0 Bug 1620875 - Suppress extra onStateChange(STATE_START) notifications from RemoteWebProgress when switching DocumentChannel with a real channel. r=Gijs,nika
Matt Woodrow <mwoodrow@mozilla.com>
parents: 519053
diff changeset
  3584
  }
06a61ba9c44415c7e84eb2c1548f53a95bd651e0 Bug 1620875 - Suppress extra onStateChange(STATE_START) notifications from RemoteWebProgress when switching DocumentChannel with a real channel. r=Gijs,nika
Matt Woodrow <mwoodrow@mozilla.com>
parents: 519053
diff changeset
  3585
570295
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3586
  // Our OnStateChange call must have provided the nsIDocShell which the source
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3587
  // comes from. We'll use this to locate the corresponding BrowsingContext in
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3588
  // the parent process.
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3589
  nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(aWebProgress);
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3590
  if (!docShell) {
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3591
    MOZ_ASSERT_UNREACHABLE("aWebProgress is null or not a nsIDocShell?");
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3592
    return NS_ERROR_UNEXPECTED;
475428
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3593
  }
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3594
570295
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3595
  WebProgressData webProgressData;
475428
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3596
  Maybe<WebProgressStateChangeData> stateChangeData;
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3597
  RequestData requestData;
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3598
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3599
  MOZ_TRY(PrepareProgressListenerData(aWebProgress, aRequest, webProgressData,
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3600
                                      requestData));
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3601
570295
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3602
  RefPtr<BrowsingContext> browsingContext = docShell->GetBrowsingContext();
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3603
  if (browsingContext->IsTopContent()) {
475428
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3604
    stateChangeData.emplace();
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3605
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3606
    stateChangeData->isNavigating() = docShell->GetIsNavigating();
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3607
    stateChangeData->mayEnableCharacterEncodingMenu() =
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3608
        docShell->GetMayEnableCharacterEncodingMenu();
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3609
570295
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3610
    RefPtr<Document> document = browsingContext->GetExtantDocument();
475428
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3611
    if (document && aStateFlags & nsIWebProgressListener::STATE_STOP) {
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3612
      document->GetContentType(stateChangeData->contentType());
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3613
      document->GetCharacterSet(stateChangeData->charset());
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3614
      stateChangeData->documentURI() = document->GetDocumentURIObject();
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3615
    } else {
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3616
      stateChangeData->contentType().SetIsVoid(true);
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3617
      stateChangeData->charset().SetIsVoid(true);
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3618
    }
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3619
  }
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3620
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3621
  Unused << SendOnStateChange(webProgressData, requestData, aStateFlags,
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3622
                              aStatus, stateChangeData);
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3623
9c779a0d65aeaacc948bb8c29dcc3c7e70f521f4 Bug 1510569 - Port onStateChange notifications inside WebProgressChild.jsm to C++ r=baku,kmag
Barret Rennie <barret@brennie.ca>
parents: 475425
diff changeset
  3624
  return NS_OK;
455444
712eb70b540a195fb7435e3f390eb44dbe792840 Bug 1520879 - Port the onContentBlockingEvent notifications inside WebProgressChild.jsm to C++; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 454520
diff changeset
  3625
}
712eb70b540a195fb7435e3f390eb44dbe792840 Bug 1520879 - Port the onContentBlockingEvent notifications inside WebProgressChild.jsm to C++; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 454520
diff changeset
  3626
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3627
NS_IMETHODIMP BrowserChild::OnProgressChange(nsIWebProgress* aWebProgress,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3628
                                             nsIRequest* aRequest,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3629
                                             int32_t aCurSelfProgress,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3630
                                             int32_t aMaxSelfProgress,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3631
                                             int32_t aCurTotalProgress,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3632
                                             int32_t aMaxTotalProgress) {
475425
7718aebfcc5203dd29e5e7609aca8aa8ff1e446c Bug 1510569 - Only forward nsIWebProgress events to the BrowserParent after the WebProgressChild has loaded r=kmag,mconley
Barret Rennie <barret@brennie.ca>
parents: 475093
diff changeset
  3633
  if (!IPCOpen() || !mShouldSendWebProgressEventsToParent) {
467882
e1fbefe38944eb82d3c2e87a0307b121daf0e830 Bug 1510569 - Port onProgressChange notifications inside WebProgressChild.jsm to C++ r=baku
Barret Rennie <barret@brennie.ca>
parents: 467881
diff changeset
  3634
    return NS_OK;
e1fbefe38944eb82d3c2e87a0307b121daf0e830 Bug 1510569 - Port onProgressChange notifications inside WebProgressChild.jsm to C++ r=baku
Barret Rennie <barret@brennie.ca>
parents: 467881
diff changeset
  3635
  }
e1fbefe38944eb82d3c2e87a0307b121daf0e830 Bug 1510569 - Port onProgressChange notifications inside WebProgressChild.jsm to C++ r=baku
Barret Rennie <barret@brennie.ca>
parents: 467881
diff changeset
  3636
570295
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3637
  // FIXME: We currently ignore ProgressChange events from out-of-process
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3638
  // subframes both here and in BrowserParent. We may want to change this
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3639
  // behaviour in the future.
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3640
  if (!GetBrowsingContext()->IsTopContent()) {
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3641
    return NS_OK;
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3642
  }
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3643
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3644
  // As we're being filtered by nsBrowserStatusFilter, we will be passed either
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3645
  // nullptr or 0 for all arguments other than aCurTotalProgress and
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3646
  // aMaxTotalProgress. Don't bother sending them.
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3647
  MOZ_ASSERT(!aWebProgress);
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3648
  MOZ_ASSERT(!aRequest);
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3649
  MOZ_ASSERT(aCurSelfProgress == 0);
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3650
  MOZ_ASSERT(aMaxSelfProgress == 0);
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3651
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3652
  Unused << SendOnProgressChange(aCurTotalProgress, aMaxTotalProgress);
467882
e1fbefe38944eb82d3c2e87a0307b121daf0e830 Bug 1510569 - Port onProgressChange notifications inside WebProgressChild.jsm to C++ r=baku
Barret Rennie <barret@brennie.ca>
parents: 467881
diff changeset
  3653
e1fbefe38944eb82d3c2e87a0307b121daf0e830 Bug 1510569 - Port onProgressChange notifications inside WebProgressChild.jsm to C++ r=baku
Barret Rennie <barret@brennie.ca>
parents: 467881
diff changeset
  3654
  return NS_OK;
455444
712eb70b540a195fb7435e3f390eb44dbe792840 Bug 1520879 - Port the onContentBlockingEvent notifications inside WebProgressChild.jsm to C++; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 454520
diff changeset
  3655
}
712eb70b540a195fb7435e3f390eb44dbe792840 Bug 1520879 - Port the onContentBlockingEvent notifications inside WebProgressChild.jsm to C++; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 454520
diff changeset
  3656
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3657
NS_IMETHODIMP BrowserChild::OnLocationChange(nsIWebProgress* aWebProgress,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3658
                                             nsIRequest* aRequest,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3659
                                             nsIURI* aLocation,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3660
                                             uint32_t aFlags) {
478771
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3661
  if (!IPCOpen() || !mShouldSendWebProgressEventsToParent) {
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3662
    return NS_OK;
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3663
  }
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3664
570295
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3665
  nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(aWebProgress);
478771
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3666
  if (!docShell) {
570295
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3667
    MOZ_ASSERT_UNREACHABLE("aWebProgress is null or not a nsIDocShell?");
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3668
    return NS_ERROR_UNEXPECTED;
478771
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3669
  }
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3670
570295
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3671
  RefPtr<BrowsingContext> browsingContext = docShell->GetBrowsingContext();
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3672
  RefPtr<Document> document = browsingContext->GetExtantDocument();
478771
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3673
  if (!document) {
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3674
    return NS_OK;
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3675
  }
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3676
570295
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3677
  WebProgressData webProgressData;
478771
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3678
  RequestData requestData;
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3679
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3680
  MOZ_TRY(PrepareProgressListenerData(aWebProgress, aRequest, webProgressData,
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3681
                                      requestData));
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3682
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3683
  Maybe<WebProgressLocationChangeData> locationChangeData;
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3684
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3685
  bool canGoBack = false;
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3686
  bool canGoForward = false;
570295
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3687
  if (!mozilla::SessionHistoryInParent()) {
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3688
    MOZ_TRY(WebNavigation()->GetCanGoBack(&canGoBack));
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3689
    MOZ_TRY(WebNavigation()->GetCanGoForward(&canGoForward));
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3690
  }
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3691
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3692
  if (browsingContext->IsTopContent()) {
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3693
    MOZ_ASSERT(
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3694
        browsingContext == GetBrowsingContext(),
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3695
        "Toplevel content BrowsingContext which isn't GetBrowsingContext()?");
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3696
478771
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3697
    locationChangeData.emplace();
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3698
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3699
    document->GetContentType(locationChangeData->contentType());
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3700
    locationChangeData->isNavigating() = docShell->GetIsNavigating();
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3701
    locationChangeData->documentURI() = document->GetDocumentURIObject();
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3702
    document->GetTitle(locationChangeData->title());
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3703
    document->GetCharacterSet(locationChangeData->charset());
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3704
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3705
    locationChangeData->mayEnableCharacterEncodingMenu() =
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3706
        docShell->GetMayEnableCharacterEncodingMenu();
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3707
490458
ac49017fe65e926f46238e7d7b399009a0237826 Bug 1510569 - Use nsIPrincipal and nsIContentSecurityPolicy in WebProgressLocationChangeData directly r=nika
Barret Rennie <barret@brennie.ca>
parents: 490457
diff changeset
  3708
    locationChangeData->contentPrincipal() = document->NodePrincipal();
533661
344054b10c44ef135413b110e2239039b73a80d0 Bug 1639833 - IntrisincStoragePrincipal should always be partitioned - part 2 - Expose PartitionedPrincipal, r=dimi
Andrea Marchesini <amarchesini@mozilla.com>
parents: 533477
diff changeset
  3709
    locationChangeData->contentPartitionedPrincipal() =
344054b10c44ef135413b110e2239039b73a80d0 Bug 1639833 - IntrisincStoragePrincipal should always be partitioned - part 2 - Expose PartitionedPrincipal, r=dimi
Andrea Marchesini <amarchesini@mozilla.com>
parents: 533477
diff changeset
  3710
        document->PartitionedPrincipal();
490458
ac49017fe65e926f46238e7d7b399009a0237826 Bug 1510569 - Use nsIPrincipal and nsIContentSecurityPolicy in WebProgressLocationChangeData directly r=nika
Barret Rennie <barret@brennie.ca>
parents: 490457
diff changeset
  3711
    locationChangeData->csp() = document->GetCsp();
485140
a388bf88311cd9d7cc0b5191857e3a38b95da648 Bug 1561079 - Add `referrerInfo` to <browser> r=ckerschb
James Willcox <snorp@snorp.net>
parents: 484792
diff changeset
  3712
    locationChangeData->referrerInfo() = document->ReferrerInfo();
478771
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3713
    locationChangeData->isSyntheticDocument() = document->IsSyntheticDocument();
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3714
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3715
    if (nsCOMPtr<nsILoadGroup> loadGroup = document->GetDocumentLoadGroup()) {
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3716
      uint64_t requestContextID = 0;
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3717
      MOZ_TRY(loadGroup->GetRequestContextID(&requestContextID));
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3718
      locationChangeData->requestContextID() = Some(requestContextID);
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3719
    }
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3720
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3721
#ifdef MOZ_CRASHREPORTER
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3722
    if (CrashReporter::GetEnabled()) {
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3723
      nsCOMPtr<nsIURI> annotationURI;
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3724
550009
1f4532c736251ab25bacbfde219264a5b9b492ef Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Simon Giesecke <sgiesecke@mozilla.com>
parents: 549579
diff changeset
  3725
      nsresult rv =
1f4532c736251ab25bacbfde219264a5b9b492ef Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Simon Giesecke <sgiesecke@mozilla.com>
parents: 549579
diff changeset
  3726
          NS_MutateURI(aLocation).SetUserPass(""_ns).Finalize(annotationURI);
478771
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3727
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3728
      if (NS_FAILED(rv)) {
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3729
        // Ignore failures on about: URIs.
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3730
        annotationURI = aLocation;
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3731
      }
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3732
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3733
      CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::URL,
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3734
                                         annotationURI->GetSpecOrDefault());
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3735
    }
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3736
#endif
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3737
  }
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3738
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3739
  Unused << SendOnLocationChange(webProgressData, requestData, aLocation,
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3740
                                 aFlags, canGoBack, canGoForward,
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3741
                                 locationChangeData);
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3742
63ed84a799d9a54311cc1246574bf2fe8fc4b98c Bug 1510569 - Port onLocationChange notifications inside WebProgressChild.jsm to C++ r=Ehsan
Barret Rennie <barret@brennie.ca>
parents: 478750
diff changeset
  3743
  return NS_OK;
455444
712eb70b540a195fb7435e3f390eb44dbe792840 Bug 1520879 - Port the onContentBlockingEvent notifications inside WebProgressChild.jsm to C++; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 454520
diff changeset
  3744
}
712eb70b540a195fb7435e3f390eb44dbe792840 Bug 1520879 - Port the onContentBlockingEvent notifications inside WebProgressChild.jsm to C++; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 454520
diff changeset
  3745
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3746
NS_IMETHODIMP BrowserChild::OnStatusChange(nsIWebProgress* aWebProgress,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3747
                                           nsIRequest* aRequest,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3748
                                           nsresult aStatus,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3749
                                           const char16_t* aMessage) {
475425
7718aebfcc5203dd29e5e7609aca8aa8ff1e446c Bug 1510569 - Only forward nsIWebProgress events to the BrowserParent after the WebProgressChild has loaded r=kmag,mconley
Barret Rennie <barret@brennie.ca>
parents: 475093
diff changeset
  3750
  if (!IPCOpen() || !mShouldSendWebProgressEventsToParent) {
467879
791382b2c9bf60371b68c0dd4d2ed26e4b846901 Bug 1510569 - Port onStatusChange notifications inside WebProgressChild.jsm to C++ r=baku
Barret Rennie <barret@brennie.ca>
parents: 467871
diff changeset
  3751
    return NS_OK;
791382b2c9bf60371b68c0dd4d2ed26e4b846901 Bug 1510569 - Port onStatusChange notifications inside WebProgressChild.jsm to C++ r=baku
Barret Rennie <barret@brennie.ca>
parents: 467871
diff changeset
  3752
  }
791382b2c9bf60371b68c0dd4d2ed26e4b846901 Bug 1510569 - Port onStatusChange notifications inside WebProgressChild.jsm to C++ r=baku
Barret Rennie <barret@brennie.ca>
parents: 467871
diff changeset
  3753
570295
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3754
  // FIXME: We currently ignore StatusChange from out-of-process subframes both
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3755
  // here and in BrowserParent. We may want to change this behaviour in the
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3756
  // future.
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3757
  if (!GetBrowsingContext()->IsTopContent()) {
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3758
    return NS_OK;
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3759
  }
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3760
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3761
  // As we're being filtered by nsBrowserStatusFilter, we will be passed either
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3762
  // nullptr or NS_OK for all arguments other than aMessage. Don't bother
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3763
  // sending them.
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3764
  MOZ_ASSERT(!aWebProgress);
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3765
  MOZ_ASSERT(!aRequest);
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3766
  MOZ_ASSERT(aStatus == NS_OK);
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3767
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3768
  Unused << SendOnStatusChange(nsDependentString(aMessage));
467879
791382b2c9bf60371b68c0dd4d2ed26e4b846901 Bug 1510569 - Port onStatusChange notifications inside WebProgressChild.jsm to C++ r=baku
Barret Rennie <barret@brennie.ca>
parents: 467871
diff changeset
  3769
791382b2c9bf60371b68c0dd4d2ed26e4b846901 Bug 1510569 - Port onStatusChange notifications inside WebProgressChild.jsm to C++ r=baku
Barret Rennie <barret@brennie.ca>
parents: 467871
diff changeset
  3770
  return NS_OK;
455444
712eb70b540a195fb7435e3f390eb44dbe792840 Bug 1520879 - Port the onContentBlockingEvent notifications inside WebProgressChild.jsm to C++; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 454520
diff changeset
  3771
}
467879
791382b2c9bf60371b68c0dd4d2ed26e4b846901 Bug 1510569 - Port onStatusChange notifications inside WebProgressChild.jsm to C++ r=baku
Barret Rennie <barret@brennie.ca>
parents: 467871
diff changeset
  3772
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3773
NS_IMETHODIMP BrowserChild::OnSecurityChange(nsIWebProgress* aWebProgress,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3774
                                             nsIRequest* aRequest,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3775
                                             uint32_t aState) {
532306
7260fe4cacc25514f11b6fcbd775a70160314a1e Bug 1631405 - Move nsISecureBrowserUI to be owned by the canonical browsing context instead of docshell. r=nika,ckerschb,Gijs,webcompat-reviewers,twisniewski
Matt Woodrow <mwoodrow@mozilla.com>
parents: 532281
diff changeset
  3776
  // Security changes are now handled entirely in the parent process
7260fe4cacc25514f11b6fcbd775a70160314a1e Bug 1631405 - Move nsISecureBrowserUI to be owned by the canonical browsing context instead of docshell. r=nika,ckerschb,Gijs,webcompat-reviewers,twisniewski
Matt Woodrow <mwoodrow@mozilla.com>
parents: 532281
diff changeset
  3777
  // so we don't need to worry about forwarding them (and we shouldn't
7260fe4cacc25514f11b6fcbd775a70160314a1e Bug 1631405 - Move nsISecureBrowserUI to be owned by the canonical browsing context instead of docshell. r=nika,ckerschb,Gijs,webcompat-reviewers,twisniewski
Matt Woodrow <mwoodrow@mozilla.com>
parents: 532281
diff changeset
  3778
  // be receiving any to forward).
490456
e27459aad2c9c752b01c197f2039b0b3ba8c8e41 Bug 1510569 - Port onSecurityChange from WebProgressChild.jsm to C++; remove WebProgressChild r=Ehsan,ochameau
Barret Rennie <barret@brennie.ca>
parents: 490447
diff changeset
  3779
  return NS_OK;
455444
712eb70b540a195fb7435e3f390eb44dbe792840 Bug 1520879 - Port the onContentBlockingEvent notifications inside WebProgressChild.jsm to C++; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 454520
diff changeset
  3780
}
490456
e27459aad2c9c752b01c197f2039b0b3ba8c8e41 Bug 1510569 - Port onSecurityChange from WebProgressChild.jsm to C++; remove WebProgressChild r=Ehsan,ochameau
Barret Rennie <barret@brennie.ca>
parents: 490447
diff changeset
  3781
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3782
NS_IMETHODIMP BrowserChild::OnContentBlockingEvent(nsIWebProgress* aWebProgress,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3783
                                                   nsIRequest* aRequest,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3784
                                                   uint32_t aEvent) {
509952
462cef293a4581482054feb99188869ae7d2e4a7 Bug 1599043 - Part 8: Remove the unnecessary OnContentBlockingEvent event in PBrowser. r=dimi,Ehsan
Tim Huang <tihuang@mozilla.com>
parents: 509949
diff changeset
  3785
  // The OnContentBlockingEvent only happenes in the parent process. It should
462cef293a4581482054feb99188869ae7d2e4a7 Bug 1599043 - Part 8: Remove the unnecessary OnContentBlockingEvent event in PBrowser. r=dimi,Ehsan
Tim Huang <tihuang@mozilla.com>
parents: 509949
diff changeset
  3786
  // not be seen in the content process.
462cef293a4581482054feb99188869ae7d2e4a7 Bug 1599043 - Part 8: Remove the unnecessary OnContentBlockingEvent event in PBrowser. r=dimi,Ehsan
Tim Huang <tihuang@mozilla.com>
parents: 509949
diff changeset
  3787
  MOZ_DIAGNOSTIC_ASSERT(
462cef293a4581482054feb99188869ae7d2e4a7 Bug 1599043 - Part 8: Remove the unnecessary OnContentBlockingEvent event in PBrowser. r=dimi,Ehsan
Tim Huang <tihuang@mozilla.com>
parents: 509949
diff changeset
  3788
      false, "OnContentBlockingEvent should not be seen in content process.");
462cef293a4581482054feb99188869ae7d2e4a7 Bug 1599043 - Part 8: Remove the unnecessary OnContentBlockingEvent event in PBrowser. r=dimi,Ehsan
Tim Huang <tihuang@mozilla.com>
parents: 509949
diff changeset
  3789
  return NS_ERROR_NOT_IMPLEMENTED;
455444
712eb70b540a195fb7435e3f390eb44dbe792840 Bug 1520879 - Port the onContentBlockingEvent notifications inside WebProgressChild.jsm to C++; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 454520
diff changeset
  3790
}
712eb70b540a195fb7435e3f390eb44dbe792840 Bug 1520879 - Port the onContentBlockingEvent notifications inside WebProgressChild.jsm to C++; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 454520
diff changeset
  3791
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3792
NS_IMETHODIMP BrowserChild::OnProgressChange64(nsIWebProgress* aWebProgress,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3793
                                               nsIRequest* aRequest,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3794
                                               int64_t aCurSelfProgress,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3795
                                               int64_t aMaxSelfProgress,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3796
                                               int64_t aCurTotalProgress,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3797
                                               int64_t aMaxTotalProgress) {
467882
e1fbefe38944eb82d3c2e87a0307b121daf0e830 Bug 1510569 - Port onProgressChange notifications inside WebProgressChild.jsm to C++ r=baku
Barret Rennie <barret@brennie.ca>
parents: 467881
diff changeset
  3798
  // All the events we receive are filtered through an nsBrowserStatusFilter,
e1fbefe38944eb82d3c2e87a0307b121daf0e830 Bug 1510569 - Port onProgressChange notifications inside WebProgressChild.jsm to C++ r=baku
Barret Rennie <barret@brennie.ca>
parents: 467881
diff changeset
  3799
  // which accepts ProgressChange64 events, but truncates the progress values to
e1fbefe38944eb82d3c2e87a0307b121daf0e830 Bug 1510569 - Port onProgressChange notifications inside WebProgressChild.jsm to C++ r=baku
Barret Rennie <barret@brennie.ca>
parents: 467881
diff changeset
  3800
  // uint32_t and calls OnProgressChange.
467881
1028814583232487b52b9c20d47e3b38dc1c288a Bug 1510569 - Implement nsIWebProgressListener2 for TabChild r=baku
Barret Rennie <barret@brennie.ca>
parents: 467879
diff changeset
  3801
  return NS_ERROR_NOT_IMPLEMENTED;
1028814583232487b52b9c20d47e3b38dc1c288a Bug 1510569 - Implement nsIWebProgressListener2 for TabChild r=baku
Barret Rennie <barret@brennie.ca>
parents: 467879
diff changeset
  3802
}
1028814583232487b52b9c20d47e3b38dc1c288a Bug 1510569 - Implement nsIWebProgressListener2 for TabChild r=baku
Barret Rennie <barret@brennie.ca>
parents: 467879
diff changeset
  3803
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3804
NS_IMETHODIMP BrowserChild::OnRefreshAttempted(nsIWebProgress* aWebProgress,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3805
                                               nsIURI* aRefreshURI,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3806
                                               int32_t aMillis, bool aSameURI,
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3807
                                               bool* aOut) {
467883
52e8c16849b3a871a3ea6434c884d32af568337d Bug 1510569 - Port onRefreshAttempted from WebProgressChild.jsm to C++ r=baku
Barret Rennie <barret@brennie.ca>
parents: 467882
diff changeset
  3808
  NS_ENSURE_ARG_POINTER(aOut);
52e8c16849b3a871a3ea6434c884d32af568337d Bug 1510569 - Port onRefreshAttempted from WebProgressChild.jsm to C++ r=baku
Barret Rennie <barret@brennie.ca>
parents: 467882
diff changeset
  3809
  *aOut = true;
52e8c16849b3a871a3ea6434c884d32af568337d Bug 1510569 - Port onRefreshAttempted from WebProgressChild.jsm to C++ r=baku
Barret Rennie <barret@brennie.ca>
parents: 467882
diff changeset
  3810
52e8c16849b3a871a3ea6434c884d32af568337d Bug 1510569 - Port onRefreshAttempted from WebProgressChild.jsm to C++ r=baku
Barret Rennie <barret@brennie.ca>
parents: 467882
diff changeset
  3811
  return NS_OK;
467881
1028814583232487b52b9c20d47e3b38dc1c288a Bug 1510569 - Implement nsIWebProgressListener2 for TabChild r=baku
Barret Rennie <barret@brennie.ca>
parents: 467879
diff changeset
  3812
}
1028814583232487b52b9c20d47e3b38dc1c288a Bug 1510569 - Implement nsIWebProgressListener2 for TabChild r=baku
Barret Rennie <barret@brennie.ca>
parents: 467879
diff changeset
  3813
478774
ec8bf3fa989d552b6730b1fcad10ecad305e0769 Bug 1510569 - Port Content:LoadURIResult message to IPDL r=mconley
Barret Rennie <barret@brennie.ca>
parents: 478771
diff changeset
  3814
NS_IMETHODIMP BrowserChild::NotifyNavigationFinished() {
ec8bf3fa989d552b6730b1fcad10ecad305e0769 Bug 1510569 - Port Content:LoadURIResult message to IPDL r=mconley
Barret Rennie <barret@brennie.ca>
parents: 478771
diff changeset
  3815
  Unused << SendNavigationFinished();
ec8bf3fa989d552b6730b1fcad10ecad305e0769 Bug 1510569 - Port Content:LoadURIResult message to IPDL r=mconley
Barret Rennie <barret@brennie.ca>
parents: 478771
diff changeset
  3816
  return NS_OK;
ec8bf3fa989d552b6730b1fcad10ecad305e0769 Bug 1510569 - Port Content:LoadURIResult message to IPDL r=mconley
Barret Rennie <barret@brennie.ca>
parents: 478771
diff changeset
  3817
}
ec8bf3fa989d552b6730b1fcad10ecad305e0769 Bug 1510569 - Port Content:LoadURIResult message to IPDL r=mconley
Barret Rennie <barret@brennie.ca>
parents: 478771
diff changeset
  3818
570295
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3819
nsresult BrowserChild::PrepareRequestData(nsIRequest* aRequest,
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3820
                                          RequestData& aRequestData) {
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3821
  nsCOMPtr<nsIChannel> channel = do_QueryInterface(aRequest);
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3822
  if (!channel) {
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3823
    aRequestData.requestURI() = nullptr;
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3824
    return NS_OK;
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3825
  }
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3826
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3827
  nsresult rv = channel->GetURI(getter_AddRefs(aRequestData.requestURI()));
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3828
  NS_ENSURE_SUCCESS(rv, rv);
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3829
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3830
  rv = channel->GetOriginalURI(
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3831
      getter_AddRefs(aRequestData.originalRequestURI()));
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3832
  NS_ENSURE_SUCCESS(rv, rv);
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3833
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3834
  nsCOMPtr<nsIClassifiedChannel> classifiedChannel = do_QueryInterface(channel);
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3835
  if (classifiedChannel) {
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3836
    rv = classifiedChannel->GetMatchedList(aRequestData.matchedList());
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3837
    NS_ENSURE_SUCCESS(rv, rv);
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3838
  }
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3839
  return NS_OK;
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3840
}
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3841
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3842
nsresult BrowserChild::PrepareProgressListenerData(
455444
712eb70b540a195fb7435e3f390eb44dbe792840 Bug 1520879 - Port the onContentBlockingEvent notifications inside WebProgressChild.jsm to C++; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 454520
diff changeset
  3843
    nsIWebProgress* aWebProgress, nsIRequest* aRequest,
570295
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3844
    WebProgressData& aWebProgressData, RequestData& aRequestData) {
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3845
  nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(aWebProgress);
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3846
  if (!docShell) {
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3847
    MOZ_ASSERT_UNREACHABLE("aWebProgress is null or not a nsIDocShell?");
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3848
    return NS_ERROR_UNEXPECTED;
455444
712eb70b540a195fb7435e3f390eb44dbe792840 Bug 1520879 - Port the onContentBlockingEvent notifications inside WebProgressChild.jsm to C++; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 454520
diff changeset
  3849
  }
712eb70b540a195fb7435e3f390eb44dbe792840 Bug 1520879 - Port the onContentBlockingEvent notifications inside WebProgressChild.jsm to C++; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 454520
diff changeset
  3850
570295
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3851
  aWebProgressData.browsingContext() = docShell->GetBrowsingContext();
581851
866026daf2b27a3837fac56feb7e476b8ea3de54 Bug 1709346 - Part 1: Track BrowsingContextWebProgress for subframes, r=mattwoodrow,kmag,necko-reviewers
Nika Layzell <nika@thelayzells.com>
parents: 581832
diff changeset
  3852
  nsresult rv = aWebProgress->GetLoadType(&aWebProgressData.loadType());
570295
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3853
  NS_ENSURE_SUCCESS(rv, rv);
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3854
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3855
  return PrepareRequestData(aRequest, aRequestData);
455444
712eb70b540a195fb7435e3f390eb44dbe792840 Bug 1520879 - Port the onContentBlockingEvent notifications inside WebProgressChild.jsm to C++; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 454520
diff changeset
  3856
}
712eb70b540a195fb7435e3f390eb44dbe792840 Bug 1520879 - Port the onContentBlockingEvent notifications inside WebProgressChild.jsm to C++; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 454520
diff changeset
  3857
581623
6b4440c599e177e7b3dc6a0be0ae2c50f6867212 Bug 1706445 - Handle `isFinal` updates through native code, r=nika
Kashav Madan <kshvmdn@gmail.com>
parents: 580707
diff changeset
  3858
bool BrowserChild::UpdateSessionStore() {
472766
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
  3859
  if (!mSessionStoreListener) {
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
  3860
    return false;
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
  3861
  }
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
  3862
  RefPtr<ContentSessionStore> store = mSessionStoreListener->GetSessionStore();
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
  3863
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
  3864
  Maybe<nsCString> docShellCaps;
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
  3865
  if (store->IsDocCapChanged()) {
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
  3866
    docShellCaps.emplace(store->GetDocShellCaps());
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
  3867
  }
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
  3868
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
  3869
  Maybe<bool> privatedMode;
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
  3870
  if (store->IsPrivateChanged()) {
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
  3871
    privatedMode.emplace(store->GetPrivateModeEnabled());
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
  3872
  }
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
  3873
580707
ce5a3250a87f2e9d91065f9c091beafaa2331369 Part 7: Bug 1700623 - Make session storage session store work with Fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 580663
diff changeset
  3874
  Unused << SendSessionStoreUpdate(docShellCaps, privatedMode,
573215
018c3b3935934a697d422ba551b60894e773c202 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Andreas Farre <farre@mozilla.com>
parents: 573108
diff changeset
  3875
                                   store->GetAndClearSHistoryChanged(),
581623
6b4440c599e177e7b3dc6a0be0ae2c50f6867212 Bug 1706445 - Handle `isFinal` updates through native code, r=nika
Kashav Madan <kshvmdn@gmail.com>
parents: 580707
diff changeset
  3876
                                   mSessionStoreListener->GetEpoch());
472766
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
  3877
  return true;
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
  3878
}
3288c43195a26565edec3d59a8f8bce6018be592 Bug 1474130 - Implement ScrollPosition/Privacy/DocCapability listeners in C++ r=peterv
Alphan Chen <alchen@mozilla.com>
parents: 472400
diff changeset
  3879
495119
018d0ca2f7ae12f693cdcac7f13fc0ebda7fc953 Bug 1581855:Part 2 - Present VR output to VR Host r=kip,jrmuizel,sotaro,bryce
thomasmo <thomasmo@mozilla.com>
parents: 495038
diff changeset
  3880
#ifdef XP_WIN
497470
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3881
RefPtr<PBrowserChild::IsWindowSupportingProtectedMediaPromise>
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3882
BrowserChild::DoesWindowSupportProtectedMedia() {
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3883
  MOZ_ASSERT(
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3884
      NS_IsMainThread(),
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3885
      "Protected media support check should be done on main thread only.");
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3886
  if (mWindowSupportsProtectedMedia) {
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3887
    // If we've already checked and have a cached result, resolve with that.
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3888
    return IsWindowSupportingProtectedMediaPromise::CreateAndResolve(
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3889
        mWindowSupportsProtectedMedia.value(), __func__);
495119
018d0ca2f7ae12f693cdcac7f13fc0ebda7fc953 Bug 1581855:Part 2 - Present VR output to VR Host r=kip,jrmuizel,sotaro,bryce
thomasmo <thomasmo@mozilla.com>
parents: 495038
diff changeset
  3890
  }
497470
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3891
  RefPtr<BrowserChild> self = this;
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3892
  // We chain off the promise rather than passing it directly so we can cache
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3893
  // the result and use that for future calls.
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3894
  return SendIsWindowSupportingProtectedMedia(ChromeOuterWindowID())
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3895
      ->Then(
536720
48eaa84c206dbdda637c57b55ddbd07e975ba103 Bug 1637500 - P2. Rename methods as they are not always dealing with "threads". r=froydnj
Jean-Yves Avenard <jyavenard@mozilla.com>
parents: 536712
diff changeset
  3896
          GetCurrentSerialEventTarget(), __func__,
497470
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3897
          [self](bool isSupported) {
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3898
            // If a result was cached while this check was inflight, ensure the
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3899
            // results match.
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3900
            MOZ_ASSERT_IF(
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3901
                self->mWindowSupportsProtectedMedia,
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3902
                self->mWindowSupportsProtectedMedia.value() == isSupported);
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3903
            // Cache the response as it will not change during the lifetime
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3904
            // of this object.
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3905
            self->mWindowSupportsProtectedMedia = Some(isSupported);
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3906
            return IsWindowSupportingProtectedMediaPromise::CreateAndResolve(
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3907
                self->mWindowSupportsProtectedMedia.value(), __func__);
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3908
          },
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3909
          [](ResponseRejectReason reason) {
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3910
            return IsWindowSupportingProtectedMediaPromise::CreateAndReject(
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3911
                reason, __func__);
8ea163ea6721438aa8a352b3d3f297fe2895373c Bug 1586347 - Have BrowserChild internally take care of caching logic when checking if windows support protected media. r=dminor,rhunt
Bryce Seager van Dyk <bvandyk@mozilla.com>
parents: 497225
diff changeset
  3912
          });
495119
018d0ca2f7ae12f693cdcac7f13fc0ebda7fc953 Bug 1581855:Part 2 - Present VR output to VR Host r=kip,jrmuizel,sotaro,bryce
thomasmo <thomasmo@mozilla.com>
parents: 495038
diff changeset
  3913
}
018d0ca2f7ae12f693cdcac7f13fc0ebda7fc953 Bug 1581855:Part 2 - Present VR output to VR Host r=kip,jrmuizel,sotaro,bryce
thomasmo <thomasmo@mozilla.com>
parents: 495038
diff changeset
  3914
#endif
018d0ca2f7ae12f693cdcac7f13fc0ebda7fc953 Bug 1581855:Part 2 - Present VR output to VR Host r=kip,jrmuizel,sotaro,bryce
thomasmo <thomasmo@mozilla.com>
parents: 495038
diff changeset
  3915
509949
88500327ad5535201afb61cb61f0bf3fa6b7a93e Bug 1599043 - Part 5: Add an IPC message to allow content process to notify the OnContentBlockingEvent in the parent. r=dimi,Ehsan
Tim Huang <tihuang@mozilla.com>
parents: 509918
diff changeset
  3916
void BrowserChild::NotifyContentBlockingEvent(
513360
8dd0cbba42f465caf284d31a28546e53c2b1c47d Bug 1614353 - Remove the remaining usages of nsIPrincipal::GetURI() in AntiTrackingCommon.cpp; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 513179
diff changeset
  3917
    uint32_t aEvent, nsIChannel* aChannel, bool aBlocked,
8dd0cbba42f465caf284d31a28546e53c2b1c47d Bug 1614353 - Remove the remaining usages of nsIPrincipal::GetURI() in AntiTrackingCommon.cpp; r=baku
Ehsan Akhgari <ehsan@mozilla.com>
parents: 513179
diff changeset
  3918
    const nsACString& aTrackingOrigin,
509949
88500327ad5535201afb61cb61f0bf3fa6b7a93e Bug 1599043 - Part 5: Add an IPC message to allow content process to notify the OnContentBlockingEvent in the parent. r=dimi,Ehsan
Tim Huang <tihuang@mozilla.com>
parents: 509918
diff changeset
  3919
    const nsTArray<nsCString>& aTrackingFullHashes,
533663
399c1423e90adb7647628ea6c97a91d8c9b57edf Bug 1639833 - IntrisincStoragePrincipal should always be partitioned - part 4 - Renaming storage access permission methods, r=dimi
Andrea Marchesini <amarchesini@mozilla.com>
parents: 533661
diff changeset
  3920
    const Maybe<
399c1423e90adb7647628ea6c97a91d8c9b57edf Bug 1639833 - IntrisincStoragePrincipal should always be partitioned - part 4 - Renaming storage access permission methods, r=dimi
Andrea Marchesini <amarchesini@mozilla.com>
parents: 533661
diff changeset
  3921
        mozilla::ContentBlockingNotifier::StorageAccessPermissionGrantedReason>&
509949
88500327ad5535201afb61cb61f0bf3fa6b7a93e Bug 1599043 - Part 5: Add an IPC message to allow content process to notify the OnContentBlockingEvent in the parent. r=dimi,Ehsan
Tim Huang <tihuang@mozilla.com>
parents: 509918
diff changeset
  3922
        aReason) {
88500327ad5535201afb61cb61f0bf3fa6b7a93e Bug 1599043 - Part 5: Add an IPC message to allow content process to notify the OnContentBlockingEvent in the parent. r=dimi,Ehsan
Tim Huang <tihuang@mozilla.com>
parents: 509918
diff changeset
  3923
  if (!IPCOpen()) {
88500327ad5535201afb61cb61f0bf3fa6b7a93e Bug 1599043 - Part 5: Add an IPC message to allow content process to notify the OnContentBlockingEvent in the parent. r=dimi,Ehsan
Tim Huang <tihuang@mozilla.com>
parents: 509918
diff changeset
  3924
    return;
88500327ad5535201afb61cb61f0bf3fa6b7a93e Bug 1599043 - Part 5: Add an IPC message to allow content process to notify the OnContentBlockingEvent in the parent. r=dimi,Ehsan
Tim Huang <tihuang@mozilla.com>
parents: 509918
diff changeset
  3925
  }
88500327ad5535201afb61cb61f0bf3fa6b7a93e Bug 1599043 - Part 5: Add an IPC message to allow content process to notify the OnContentBlockingEvent in the parent. r=dimi,Ehsan
Tim Huang <tihuang@mozilla.com>
parents: 509918
diff changeset
  3926
88500327ad5535201afb61cb61f0bf3fa6b7a93e Bug 1599043 - Part 5: Add an IPC message to allow content process to notify the OnContentBlockingEvent in the parent. r=dimi,Ehsan
Tim Huang <tihuang@mozilla.com>
parents: 509918
diff changeset
  3927
  RequestData requestData;
570295
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3928
  if (NS_SUCCEEDED(PrepareRequestData(aChannel, requestData))) {
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3929
    Unused << SendNotifyContentBlockingEvent(
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3930
        aEvent, requestData, aBlocked, PromiseFlatCString(aTrackingOrigin),
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3931
        aTrackingFullHashes, aReason);
10a646d0c74ac68c3621e0698a62dd1e847a8796 Bug 1663757 - Part 1: Include BrowsingContext info in WebProgressData, r=mattwoodrow
Nika Layzell <nika@thelayzells.com>
parents: 570217
diff changeset
  3932
  }
509949
88500327ad5535201afb61cb61f0bf3fa6b7a93e Bug 1599043 - Part 5: Add an IPC message to allow content process to notify the OnContentBlockingEvent in the parent. r=dimi,Ehsan
Tim Huang <tihuang@mozilla.com>
parents: 509918
diff changeset
  3933
}
88500327ad5535201afb61cb61f0bf3fa6b7a93e Bug 1599043 - Part 5: Add an IPC message to allow content process to notify the OnContentBlockingEvent in the parent. r=dimi,Ehsan
Tim Huang <tihuang@mozilla.com>
parents: 509918
diff changeset
  3934
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3935
BrowserChildMessageManager::BrowserChildMessageManager(
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3936
    BrowserChild* aBrowserChild)
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3937
    : ContentFrameMessageManager(new nsFrameMessageManager(aBrowserChild)),
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3938
      mBrowserChild(aBrowserChild) {}
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3939
517195
67e20c1982b17d734640113eb4228e1def605c74 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in dom/ipc. r=smaug
Simon Giesecke <sgiesecke@mozilla.com>
parents: 516803
diff changeset
  3940
BrowserChildMessageManager::~BrowserChildMessageManager() = default;
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3941
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3942
NS_IMPL_CYCLE_COLLECTION_CLASS(BrowserChildMessageManager)
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3943
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3944
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(BrowserChildMessageManager,
242749
2e84c560ac0b2607fc36b83c1fb051ff67e95db6 Bug 1156875 - patch 1 - URL.createObjectURL leaks in JS sandbox, r=bholley
Andrea Marchesini <amarchesini@mozilla.com>
parents: 242171
diff changeset
  3945
                                                DOMEventTargetHelper)
2e84c560ac0b2607fc36b83c1fb051ff67e95db6 Bug 1156875 - patch 1 - URL.createObjectURL leaks in JS sandbox, r=bholley
Andrea Marchesini <amarchesini@mozilla.com>
parents: 242171
diff changeset
  3946
  NS_IMPL_CYCLE_COLLECTION_UNLINK(mMessageManager);
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3947
  NS_IMPL_CYCLE_COLLECTION_UNLINK(mBrowserChild);
515516
1c7a70ea55e881a42d6bbe2375945f8b532edbb5 Bug 1535617: Part 2 - Clear weak references for most cycle collected objects on unlink. r=mccr8
Kris Maglione <maglione.k@gmail.com>
parents: 515492
diff changeset
  3948
  NS_IMPL_CYCLE_COLLECTION_UNLINK_WEAK_REFERENCE
242749
2e84c560ac0b2607fc36b83c1fb051ff67e95db6 Bug 1156875 - patch 1 - URL.createObjectURL leaks in JS sandbox, r=bholley
Andrea Marchesini <amarchesini@mozilla.com>
parents: 242171
diff changeset
  3949
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
2e84c560ac0b2607fc36b83c1fb051ff67e95db6 Bug 1156875 - patch 1 - URL.createObjectURL leaks in JS sandbox, r=bholley
Andrea Marchesini <amarchesini@mozilla.com>
parents: 242171
diff changeset
  3950
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3951
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(BrowserChildMessageManager,
242749
2e84c560ac0b2607fc36b83c1fb051ff67e95db6 Bug 1156875 - patch 1 - URL.createObjectURL leaks in JS sandbox, r=bholley
Andrea Marchesini <amarchesini@mozilla.com>
parents: 242171
diff changeset
  3952
                                                  DOMEventTargetHelper)
2e84c560ac0b2607fc36b83c1fb051ff67e95db6 Bug 1156875 - patch 1 - URL.createObjectURL leaks in JS sandbox, r=bholley
Andrea Marchesini <amarchesini@mozilla.com>
parents: 242171
diff changeset
  3953
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMessageManager)
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3954
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBrowserChild)
242749
2e84c560ac0b2607fc36b83c1fb051ff67e95db6 Bug 1156875 - patch 1 - URL.createObjectURL leaks in JS sandbox, r=bholley
Andrea Marchesini <amarchesini@mozilla.com>
parents: 242171
diff changeset
  3955
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
46683
416375517820bf550a6bf64a0d5a4ba729eb6d97 Bug 542242 - E10s, content process event handlers, r=jst, r=bsmedberg
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46682
diff changeset
  3956
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3957
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(BrowserChildMessageManager)
103563
5acb2a155d121f7686460c30e2dacd40cea315a4 Bug 776825 - Separate message managers into senders and broadcasters. r=smaug
Philipp von Weitershausen <philipp@weitershausen.de>
parents: 103467
diff changeset
  3958
  NS_INTERFACE_MAP_ENTRY(nsIMessageSender)
433215
ddba7fcc0d3b5493f7039d5dd61a77d647cb03f3 Bug 1484373: Part 1 - Allow querying to ContentFrameMessageManager. r=smaug
Kris Maglione <maglione.k@gmail.com>
parents: 432645
diff changeset
  3959
  NS_INTERFACE_MAP_ENTRY(ContentFrameMessageManager)
225381
ce1ab99f8af891f71a7a4063eb3f5eececc570e1 Bug 1123016 - Clarify the ownership of DOMEventTargetHelper::mParentObject/mOwnerWindow; r=smaug
Ehsan Akhgari <ehsan@mozilla.com>
parents: 225343
diff changeset
  3960
  NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
176477
8560fc7e284964200de406d17b0d7033c3ef10dd Bug 984269 Rename nsDOMEventTargetHelper to mozilla::DOMEventTargetHelper r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 175870
diff changeset
  3961
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
8560fc7e284964200de406d17b0d7033c3ef10dd Bug 984269 Rename nsDOMEventTargetHelper to mozilla::DOMEventTargetHelper r=smaug
Masayuki Nakano <masayuki@d-toybox.com>
parents: 175870
diff changeset
  3962
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3963
NS_IMPL_ADDREF_INHERITED(BrowserChildMessageManager, DOMEventTargetHelper)
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3964
NS_IMPL_RELEASE_INHERITED(BrowserChildMessageManager, DOMEventTargetHelper)
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3965
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3966
JSObject* BrowserChildMessageManager::WrapObject(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3967
    JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
431547
c7a263321e999b1806b8facd31177ca026a7a33f Bug 1480244: Part 4 - Make child message managers non-global objects. r=bz
Kris Maglione <maglione.k@gmail.com>
parents: 431542
diff changeset
  3968
  return ContentFrameMessageManager_Binding::Wrap(aCx, this, aGivenProto);
409299
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  3969
}
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  3970
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3971
void BrowserChildMessageManager::MarkForCC() {
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3972
  if (mBrowserChild) {
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3973
    mBrowserChild->MarkScopesForCC();
230725
b48e92517844ec24126a6718698a0430a2cfd05d Bug 1136322 - Optimize anon scopes from CC graph, r=mccr8
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 230535
diff changeset
  3974
  }
252510
f5009c3eb3845394bfa51adcde11ddc0025002d3 Bug 1182772, optimize ProcessGlobal out from CC graph (and also TabChild's EventListeners), r=mccr8
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 252494
diff changeset
  3975
  EventListenerManager* elm = GetExistingListenerManager();
f5009c3eb3845394bfa51adcde11ddc0025002d3 Bug 1182772, optimize ProcessGlobal out from CC graph (and also TabChild's EventListeners), r=mccr8
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 252494
diff changeset
  3976
  if (elm) {
f5009c3eb3845394bfa51adcde11ddc0025002d3 Bug 1182772, optimize ProcessGlobal out from CC graph (and also TabChild's EventListeners), r=mccr8
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 252494
diff changeset
  3977
    elm->MarkForCC();
f5009c3eb3845394bfa51adcde11ddc0025002d3 Bug 1182772, optimize ProcessGlobal out from CC graph (and also TabChild's EventListeners), r=mccr8
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 252494
diff changeset
  3978
  }
411586
b8eff76f4ae6d9cc2166fb04b69331de96a5134b Bug 1448850 - Remove nsIMessageListener and nsIMessageListenerManager. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 411583
diff changeset
  3979
  MessageManagerGlobal::MarkForCC();
409299
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  3980
}
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  3981
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3982
Nullable<WindowProxyHolder> BrowserChildMessageManager::GetContent(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3983
    ErrorResult& aError) {
452279
18f95c6c1eb340c325e47b36223464625dd76a45 Bug 1353867 - Change WindowProxyHolder's native type to BrowsingContext. r=bzbarsky
Peter Van der Beken <peterv@propagandism.org>
parents: 452278
diff changeset
  3984
  nsCOMPtr<nsIDocShell> docShell = GetDocShell(aError);
18f95c6c1eb340c325e47b36223464625dd76a45 Bug 1353867 - Change WindowProxyHolder's native type to BrowsingContext. r=bzbarsky
Peter Van der Beken <peterv@propagandism.org>
parents: 452278
diff changeset
  3985
  if (!docShell) {
409299
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  3986
    return nullptr;
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  3987
  }
487022
a887ffaf4090e957d86b2463585745d0a65ac04f Bug 1570773: Move browsingContext getter to nsIDocShellTreeItem and add notxpcom variant. r=nika
Kris Maglione <maglione.k@gmail.com>
parents: 486649
diff changeset
  3988
  return WindowProxyHolder(docShell->GetBrowsingContext());
108266
0cbe950173a83dea4f9dbd43f7b53796678b864b Bug 779809 part 2 - Don't safe-forward [notxpcom] methods; r=khuey,bz
Aryeh Gregor <ayg@aryeh.name>
parents: 108124
diff changeset
  3989
}
0cbe950173a83dea4f9dbd43f7b53796678b864b Bug 779809 part 2 - Don't safe-forward [notxpcom] methods; r=khuey,bz
Aryeh Gregor <ayg@aryeh.name>
parents: 108124
diff changeset
  3990
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3991
already_AddRefed<nsIDocShell> BrowserChildMessageManager::GetDocShell(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  3992
    ErrorResult& aError) {
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3993
  if (!mBrowserChild) {
409299
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  3994
    aError.Throw(NS_ERROR_NULL_POINTER);
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  3995
    return nullptr;
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  3996
  }
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3997
  nsCOMPtr<nsIDocShell> window =
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  3998
      do_GetInterface(mBrowserChild->WebNavigation());
409299
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  3999
  return window.forget();
46683
416375517820bf550a6bf64a0d5a4ba729eb6d97 Bug 542242 - E10s, content process event handlers, r=jst, r=bsmedberg
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46682
diff changeset
  4000
}
416375517820bf550a6bf64a0d5a4ba729eb6d97 Bug 542242 - E10s, content process event handlers, r=jst, r=bsmedberg
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46682
diff changeset
  4001
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  4002
already_AddRefed<nsIEventTarget>
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  4003
BrowserChildMessageManager::GetTabEventTarget() {
409299
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  4004
  nsCOMPtr<nsIEventTarget> target = EventTargetFor(TaskCategory::Other);
187b9827d11a6c89a6606ec13bc08e584b6eefe6 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
Peter Van der Beken <peterv@propagandism.org>
parents: 409297
diff changeset
  4005
  return target.forget();
46701
cb282c640aed7f6b31d9c4e3822aea00f31081fb Bug 549884 - [E10s] add .docShell to TabChildGlobal, r=dougt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46696
diff changeset
  4006
}
cb282c640aed7f6b31d9c4e3822aea00f31081fb Bug 549884 - [E10s] add .docShell to TabChildGlobal, r=dougt
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46696
diff changeset
  4007
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  4008
nsresult BrowserChildMessageManager::Dispatch(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  4009
    TaskCategory aCategory, already_AddRefed<nsIRunnable>&& aRunnable) {
420862
b54db66223586b4e04f5cb926fccdacf8a176b91 Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
Emilio Cobos Álvarez <emilio@crisal.io>
parents: 419219
diff changeset
  4010
  return DispatcherTrait::Dispatch(aCategory, std::move(aRunnable));
367552
7a401b1e5f9854a1b49f567374d380e3e0e1100a Bug 1378298 - Make TabChildGlobal override DispatcherTrait using TabChild::TabGroup(). r=billm
Bevis Tseng <btseng@mozilla.com>
parents: 366935
diff changeset
  4011
}
7a401b1e5f9854a1b49f567374d380e3e0e1100a Bug 1378298 - Make TabChildGlobal override DispatcherTrait using TabChild::TabGroup(). r=billm
Bevis Tseng <btseng@mozilla.com>
parents: 366935
diff changeset
  4012
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  4013
nsISerialEventTarget* BrowserChildMessageManager::EventTargetFor(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  4014
    TaskCategory aCategory) const {
367552
7a401b1e5f9854a1b49f567374d380e3e0e1100a Bug 1378298 - Make TabChildGlobal override DispatcherTrait using TabChild::TabGroup(). r=billm
Bevis Tseng <btseng@mozilla.com>
parents: 366935
diff changeset
  4015
  return DispatcherTrait::EventTargetFor(aCategory);
7a401b1e5f9854a1b49f567374d380e3e0e1100a Bug 1378298 - Make TabChildGlobal override DispatcherTrait using TabChild::TabGroup(). r=billm
Bevis Tseng <btseng@mozilla.com>
parents: 366935
diff changeset
  4016
}
7a401b1e5f9854a1b49f567374d380e3e0e1100a Bug 1378298 - Make TabChildGlobal override DispatcherTrait using TabChild::TabGroup(). r=billm
Bevis Tseng <btseng@mozilla.com>
parents: 366935
diff changeset
  4017
470938
9813ce146bc725dd83e8ff6f41bfc36dd17d935b Bug 1534395 - Rename TabChild to BrowserChild. r=nika
Ryan Hunt <rhunt@eqrion.net>
parents: 470937
diff changeset
  4018
AbstractThread* BrowserChildMessageManager::AbstractMainThreadFor(
448947
6f3709b3878117466168c40affa7bca0b60cf75b Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
Sylvestre Ledru <sledru@mozilla.com>
parents: 448665
diff changeset
  4019
    TaskCategory aCategory) {
367552
7a401b1e5f9854a1b49f567374d380e3e0e1100a Bug 1378298 - Make TabChildGlobal override DispatcherTrait using TabChild::TabGroup(). r=billm
Bevis Tseng <btseng@mozilla.com>
parents: 366935
diff changeset
  4020
  return DispatcherTrait::AbstractMainThreadFor(aCategory);
7a401b1e5f9854a1b49f567374d380e3e0e1100a Bug 1378298 - Make TabChildGlobal override DispatcherTrait using TabChild::TabGroup(). r=billm
Bevis Tseng <btseng@mozilla.com>
parents: 366935
diff changeset
  4021
}