Mozilla Home
Privacy
Cookies
Legal
Bugzilla
Browse
Advanced Search
New Bug
Reports
Documentation
Log In
Log In with GitHub
or
Remember me
Browse
Advanced Search
New Bug
Reports
Documentation
Attachment 9031577 Details for
Bug 1513366
[patch]
Part 2 - Update MemoryTelemetry to use do_ImportModule
base-b59899313798 (text/plain), 3.27 KB, created by
Kris Maglione [:kmag]
(
hide
)
Description:
Part 2 - Update MemoryTelemetry to use do_ImportModule
Filename:
MIME Type:
Creator:
Kris Maglione [:kmag]
Size:
3.27 KB
patch
obsolete
># HG changeset patch ># User Kris Maglione <maglione.k@gmail.com> ># Date 1544563739 28800 ># Tue Dec 11 13:28:59 2018 -0800 ># Node ID 88a3ab48829d048c6c2395072f9719edb0447f34 ># Parent 1ce08218955fbd967e57b50e28fe84a49477c8e0 >Bug 1513366: Part 2 - Update MemoryTelemetry to use do_ImportModule. r=erahm > >It makes things much simpler. > >Differential Revision: https://phabricator.services.mozilla.com/D14210 > >diff --git xpcom/base/MemoryTelemetry.cpp xpcom/base/MemoryTelemetry.cpp >--- xpcom/base/MemoryTelemetry.cpp >+++ xpcom/base/MemoryTelemetry.cpp >@@ -3,32 +3,32 @@ > /* This Source Code Form is subject to the terms of the Mozilla Public > * License, v. 2.0. If a copy of the MPL was not distributed with this > * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ > > #include "MemoryTelemetry.h" > #include "nsMemoryReporterManager.h" > > #include "GCTelemetry.h" >-#include "mozJSComponentLoader.h" > #include "mozilla/ClearOnShutdown.h" > #include "mozilla/Result.h" > #include "mozilla/ResultExtensions.h" > #include "mozilla/Services.h" > #include "mozilla/SimpleEnumerator.h" > #include "mozilla/SystemGroup.h" > #include "mozilla/Telemetry.h" > #include "mozilla/TimeStamp.h" > #include "mozilla/dom/ContentParent.h" > #include "mozilla/dom/ScriptSettings.h" > #include "nsContentUtils.h" > #include "nsIBrowserDOMWindow.h" > #include "nsIDOMChromeWindow.h" > #include "nsIMemoryReporter.h" > #include "nsIWindowMediator.h" >+#include "nsImportModule.h" > #include "nsNetCID.h" > #include "nsObserverService.h" > #include "nsReadableUtils.h" > #include "nsThreadUtils.h" > #include "nsXULAppAPI.h" > #include "xpcpublic.h" > > #include <cstdlib> >@@ -43,29 +43,21 @@ static constexpr uint32_t kTelemetryInte > > static constexpr const char* kTopicCycleCollectorBegin = > "cycle-collector-begin"; > > // How long to wait in millis for all the child memory reports to come in > static constexpr uint32_t kTotalMemoryCollectorTimeout = 200; > > static Result<nsCOMPtr<mozIGCTelemetry>, nsresult> GetGCTelemetry() { >- AutoJSAPI jsapi; >- MOZ_ALWAYS_TRUE(jsapi.Init(xpc::PrivilegedJunkScope())); >- JSContext* cx = jsapi.cx(); >+ nsresult rv; > >- JS::RootedObject global(cx); >- JS::RootedObject exports(cx); >- MOZ_TRY(mozJSComponentLoader::Get()->Import( >- cx, NS_LITERAL_CSTRING("resource://gre/modules/GCTelemetry.jsm"), &global, >- &exports)); >- >- nsCOMPtr<mozIGCTelemetryJSM> jsm; >- MOZ_TRY(nsContentUtils::XPConnect()->WrapJS( >- cx, exports, NS_GET_IID(mozIGCTelemetryJSM), getter_AddRefs(jsm))); >+ nsCOMPtr<mozIGCTelemetryJSM> jsm = >+ do_ImportModule("resource://gre/modules/GCTelemetry.jsm", &rv); >+ MOZ_TRY(rv); > > nsCOMPtr<mozIGCTelemetry> gcTelemetry; > MOZ_TRY(jsm->GetGCTelemetry(getter_AddRefs(gcTelemetry))); > > return std::move(gcTelemetry); > } > > namespace { >diff --git xpcom/base/moz.build xpcom/base/moz.build >--- xpcom/base/moz.build >+++ xpcom/base/moz.build >@@ -214,17 +214,16 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wi > > include('/ipc/chromium/chromium-config.mozbuild') > > FINAL_LIBRARY = 'xul' > > LOCAL_INCLUDES += [ > '../build', > '/dom/base', >- '/js/xpconnect/loader', # for mozJSComponentLoader.h > '/mfbt', > '/xpcom/ds', > ] > > if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: > CXXFLAGS += CONFIG['TK_CFLAGS'] > > if CONFIG['ENABLE_CLANG_PLUGIN'] and CONFIG['CC_TYPE'] == 'clang-cl':
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
|
Review
Attachments on
bug 1513366
:
9030587
|
9030588
|
9030590
|
9030592
|
9030971
| 9031577