tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

PRDD.ipdl (4979B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3  * License, v. 2.0. If a copy of the MPL was not distributed with this
      4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 include CrashReporterInitArgs;
      7 include GraphicsMessages;
      8 include MemoryReportTypes;
      9 include PrefsTypes;
     10 
     11 include protocol PProfiler;
     12 include protocol PRemoteMediaManager;
     13 include protocol PVideoBridge;
     14 
     15 #if defined(MOZ_SANDBOX) && defined(MOZ_DEBUG) && defined(ENABLE_TESTS)
     16 include protocol PSandboxTesting;
     17 #endif
     18 
     19 include "mozilla/ipc/ByteBufUtils.h";
     20 
     21 using mozilla::dom::ContentParentId from "mozilla/dom/ipc/IdType.h";
     22 using mozilla::dom::NativeThreadId from "mozilla/dom/NativeThreadId.h";
     23 using mozilla::media::MediaCodecsSupported from "MediaCodecsSupport.h";
     24 
     25 // Telemetry
     26 using mozilla::Telemetry::HistogramAccumulation from "mozilla/TelemetryComms.h";
     27 using mozilla::Telemetry::KeyedHistogramAccumulation from "mozilla/TelemetryComms.h";
     28 using mozilla::Telemetry::ScalarAction from "mozilla/TelemetryComms.h";
     29 using mozilla::Telemetry::KeyedScalarAction from "mozilla/TelemetryComms.h";
     30 using mozilla::Telemetry::ChildEventData from "mozilla/TelemetryComms.h";
     31 using mozilla::Telemetry::DiscardedData from "mozilla/TelemetryComms.h";
     32 
     33 #if defined(XP_WIN)
     34 [MoveOnly] using mozilla::UntrustedModulesData from "mozilla/UntrustedModulesData.h";
     35 [MoveOnly] using mozilla::ModulePaths from "mozilla/UntrustedModulesData.h";
     36 [MoveOnly] using mozilla::ModulesMapResult from "mozilla/UntrustedModulesData.h";
     37 #endif  // defined(XP_WIN)
     38 
     39 namespace mozilla {
     40 
     41 // This protocol allows the UI process to talk to the RDD
     42 // (RemoteDataDecoder) process. There is one instance of this protocol,
     43 // with the RDDParent living on the main thread of the RDD process and
     44 // the RDDChild living on the main thread of the UI process.
     45 [NeedsOtherPid, ParentProc=RDD, ChildProc=Parent]
     46 protocol PRDD
     47 {
     48 parent:
     49 
     50   async Init(GfxVarUpdate[] vars, FileDescriptor? sandboxBroker,
     51              bool canRecordReleaseTelemetry,
     52              bool aIsReadyForBackgroundProcessing);
     53 
     54   async InitProfiler(Endpoint<PProfilerChild> endpoint);
     55 
     56   async NewContentRemoteMediaManager(
     57             Endpoint<PRemoteMediaManagerParent> endpoint, ContentParentId childId);
     58 
     59   async RequestMemoryReport(uint32_t generation,
     60                             bool anonymize,
     61                             bool minimizeMemoryUsage,
     62                             FileDescriptor? DMDFile)
     63       returns (uint32_t aGeneration);
     64 
     65   async PreferenceUpdate(Pref pref);
     66 
     67   async UpdateVar(GfxVarUpdate[] var);
     68 
     69   async InitVideoBridge(Endpoint<PVideoBridgeChild> endpoint,
     70                         bool createHardwareDevice,
     71                         ContentDeviceData contentDeviceData);
     72 
     73 #if defined(XP_WIN)
     74   async GetUntrustedModulesData() returns (UntrustedModulesData? data);
     75 
     76   /**
     77   * This method is used to notifty a child process to start
     78   * processing module loading events in UntrustedModulesProcessor.
     79   * This should be called when the parent process has gone idle.
     80   */
     81   async UnblockUntrustedModulesThread();
     82 #endif  // defined(XP_WIN)
     83 
     84 #if defined(MOZ_SANDBOX) && defined(MOZ_DEBUG) && defined(ENABLE_TESTS)
     85   async InitSandboxTesting(Endpoint<PSandboxTestingChild> aEndpoint);
     86 #endif
     87 
     88   // Tells the RDD process to flush any pending telemetry.
     89   // Used in tests and ping assembly. Buffer contains bincoded Rust structs.
     90   // https://firefox-source-docs.mozilla.org/toolkit/components/glean/dev/ipc.html
     91   async FlushFOGData() returns (ByteBuf buf);
     92 
     93   // Test-only method.
     94   // Asks the RDD process to trigger test-only instrumentation.
     95   // The unused returned value is to have a promise we can await.
     96   async TestTriggerMetrics() returns (bool unused);
     97 
     98   async TestTelemetryProbes();
     99 
    100 child:
    101 
    102   async InitCrashReporter(CrashReporterInitArgs aInitArgs);
    103 
    104   async AddMemoryReport(MemoryReport aReport);
    105 
    106 #if defined(XP_WIN)
    107   async GetModulesTrust(ModulePaths aModPaths, bool aRunAtNormalPriority)
    108       returns (ModulesMapResult? modMapResult);
    109 #endif  // defined(XP_WIN)
    110 
    111   // Update the cached list of codec supported following a check in the
    112   // RDD parent.
    113   async UpdateMediaCodecsSupported(MediaCodecsSupported aSupported);
    114 
    115   // Messages for sending telemetry to parent process.
    116   async AccumulateChildHistograms(HistogramAccumulation[] accumulations);
    117   async AccumulateChildKeyedHistograms(KeyedHistogramAccumulation[] accumulations);
    118   async UpdateChildScalars(ScalarAction[] actions);
    119   async UpdateChildKeyedScalars(KeyedScalarAction[] actions);
    120   async RecordChildEvents(ChildEventData[] events);
    121   async RecordDiscardedData(DiscardedData data);
    122 
    123   // Sent from time-to-time to limit the amount of telemetry vulnerable to loss
    124   // Buffer contains bincoded Rust structs.
    125   // https://firefox-source-docs.mozilla.org/toolkit/components/glean/dev/ipc.html
    126   async FOGData(ByteBuf buf);
    127 };
    128 
    129 } // namespace mozilla