Merge last green changeset of mozilla-inbound to mozilla-central

This commit is contained in:
Ed Morley 2011-11-12 12:43:56 +00:00
Родитель 2d26cc32f0 65a5f3ea90
Коммит 6c23d7d46c
23 изменённых файлов: 231 добавлений и 192 удалений

Просмотреть файл

@ -61,7 +61,7 @@ pref("extensions.strictCompatibility", true);
// Preferences for AMO integration
pref("extensions.getAddons.cache.enabled", true);
pref("extensions.getAddons.maxResults", 15);
pref("extensions.getAddons.get.url", "https://services.addons.mozilla.org/%LOCALE%/firefox/api/%API_VERSION%/search/guid:%IDS%?src=firefox&appOS=%OS%&appVersion=%VERSION%&tMain=%TIME_MAIN%&tFirstPaint=%TIME_FIRST_PAINT%&tSessionRestored=%TIME_SESSION_RESTORED%");
pref("extensions.getAddons.get.url", "https://services.addons.mozilla.org/%LOCALE%/firefox/api/%API_VERSION%/search/guid:%IDS%?src=firefox&appOS=%OS%&appVersion=%VERSION%");
pref("extensions.getAddons.search.browseURL", "https://addons.mozilla.org/%LOCALE%/firefox/search?q=%TERMS%");
pref("extensions.getAddons.search.url", "https://services.addons.mozilla.org/%LOCALE%/firefox/api/%API_VERSION%/search/%TERMS%/all/%MAX_RESULTS%/%OS%/%VERSION%?src=firefox");
pref("extensions.webservice.discoverURL", "https://services.addons.mozilla.org/%LOCALE%/firefox/discovery/pane/%VERSION%/%OS%");

Просмотреть файл

@ -140,7 +140,7 @@ let RemoteTabViewer = {
, "folderPicker"
, "loadInSidebar"
, "keyword" ]
});
}, window.top);
},
bookmarkSelectedTabs: function() {
@ -160,7 +160,7 @@ let RemoteTabViewer = {
, type: "folder"
, URIList: URIs
, hiddenRows: [ "description" ]
});
}, window.top);
}
},

Просмотреть файл

@ -388,13 +388,13 @@ var PlacesCommandHook = {
, "loadInSidebar"
, "folderPicker"
, "keyword" ]
});
}, window);
}
else {
PlacesUIUtils.showBookmarkDialog({ action: "edit"
, type: "bookmark"
, itemId: itemId
});
}, window);
}
},
@ -427,7 +427,7 @@ var PlacesCommandHook = {
, type: "folder"
, URIList: pages
, hiddenRows: [ "description" ]
});
}, window);
}
},
@ -478,7 +478,7 @@ var PlacesCommandHook = {
, hiddenRows: [ "feedLocation"
, "siteLocation"
, "description" ]
});
}, window);
},
/**

Просмотреть файл

@ -3165,7 +3165,7 @@ var bookmarksButtonObserver = {
, "loadInSidebar"
, "folderPicker"
, "keyword" ]
});
}, window);
} catch(ex) { }
},
@ -5794,7 +5794,7 @@ function contentAreaClick(event, isPanelClick)
, "location"
, "folderPicker"
, "keyword" ]
});
}, window);
event.preventDefault();
return true;
}
@ -6841,7 +6841,7 @@ function AddKeywordForSearchField() {
, hiddenRows: [ "location"
, "loadInSidebar"
, "folderPicker" ]
});
}, window);
}
function SwitchDocumentDirection(aWindow) {

Просмотреть файл

@ -1408,13 +1408,13 @@ nsContextMenu.prototype = {
, "loadInSidebar"
, "folderPicker"
, "keyword" ]
});
}, window.top);
}
else {
PlacesUIUtils.showBookmarkDialog({ action: "edit"
, type: "bookmark"
, itemId: itemId
});
}, window.top);
}
},

Просмотреть файл

@ -309,10 +309,11 @@ PlacesController.prototype = {
, hiddenRows: [ "description"
, "keyword"
, "location"
, "folderPicker"
, "loadInSidebar" ]
, uri: NetUtil.newURI(node.uri)
, title: node.title
}, window.top, true);
}, window.top);
break;
}
},
@ -768,7 +769,7 @@ PlacesController.prototype = {
, type: aType
, defaultInsertionPoint: ip
, hiddenRows: [ "folderPicker" ]
}, window);
}, window.top);
if (performed) {
// Select the new item.
let insertedNodeId = PlacesUtils.bookmarks

Просмотреть файл

@ -111,11 +111,12 @@ function (aTitle, aContentURL, aCustomizeURL, aPersist)
, hiddenRows: [ "description"
, "keyword"
, "location"
, "folderPicker"
, "loadInSidebar" ]
, uri: uri
, title: aTitle
, loadBookmarkInSidebar: true
}, win, true);
}, win);
}
nsSidebar.prototype.validateSearchEngine =

Просмотреть файл

@ -1377,8 +1377,6 @@ fi
# but that breaks when you have a 64 bit kernel with a 32 bit userland.
OS_TEST="${target_cpu}"
_COMPILER_PREFIX=
HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`
#######################################################################
@ -1861,8 +1859,8 @@ if test "$GNU_CC"; then
DSO_CFLAGS=''
DSO_PIC_CFLAGS='-fPIC'
ASFLAGS="$ASFLAGS -fPIC"
_MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti
_MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti
_MOZ_RTTI_FLAGS_ON=-frtti
_MOZ_RTTI_FLAGS_OFF=-fno-rtti
# Turn on GNU specific features
# -Wall - turn on all warnings
@ -1954,7 +1952,7 @@ if test "$GNU_CXX"; then
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
_SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-extended-offsetof"
CXXFLAGS="$CXXFLAGS -Wno-extended-offsetof"
AC_TRY_COMPILE([$configure_static_assert_macros
#ifndef __has_warning
#define __has_warning(x) 0
@ -1966,7 +1964,7 @@ if test "$GNU_CXX"; then
AC_LANG_RESTORE
])
if test "$ac_has_wno_extended_offsetof" = "yes"; then
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-extended-offsetof"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-extended-offsetof"
fi
AC_CACHE_CHECK(whether the compiler supports -Wno-invalid-offsetof,
@ -1975,7 +1973,7 @@ if test "$GNU_CXX"; then
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
_SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
CXXFLAGS="$CXXFLAGS -Wno-invalid-offsetof"
AC_TRY_COMPILE([],
[return(0);],
ac_has_wno_invalid_offsetof="yes",
@ -1984,7 +1982,7 @@ if test "$GNU_CXX"; then
AC_LANG_RESTORE
])
if test "$ac_has_wno_invalid_offsetof" = "yes"; then
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-invalid-offsetof"
fi
AC_CACHE_CHECK(whether the compiler supports -Wno-variadic-macros,
@ -1993,7 +1991,7 @@ if test "$GNU_CXX"; then
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
_SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-variadic-macros"
CXXFLAGS="$CXXFLAGS -Wno-variadic-macros"
AC_TRY_COMPILE([],
[return(0);],
ac_has_wno_variadic_macros="yes",
@ -2002,7 +2000,7 @@ if test "$GNU_CXX"; then
AC_LANG_RESTORE
])
if test "$ac_has_wno_variadic_macros" = "yes"; then
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-variadic-macros"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-variadic-macros"
fi
AC_CACHE_CHECK(whether the compiler supports -Werror=return-type,
@ -7815,7 +7813,7 @@ MOZ_ARG_DISABLE_BOOL(pedantic,
_PEDANTIC= )
if test "$_PEDANTIC"; then
_SAVE_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-pedantic ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
CXXFLAGS="$CXXFLAGS -pedantic ${_WARNINGS_CXXFLAGS} -Wno-long-long"
AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
AC_TRY_COMPILE([$configure_static_assert_macros],
[CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
@ -7825,8 +7823,8 @@ if test "$_PEDANTIC"; then
case "$result" in
no)
_WARNINGS_CFLAGS="${_COMPILER_PREFIX}-pedantic ${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
_WARNINGS_CXXFLAGS="${_COMPILER_PREFIX}-pedantic ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
_WARNINGS_CFLAGS="-pedantic ${_WARNINGS_CFLAGS} -Wno-long-long"
_WARNINGS_CXXFLAGS="-pedantic ${_WARNINGS_CXXFLAGS} -Wno-long-long"
;;
yes)
AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ])

Просмотреть файл

@ -2485,9 +2485,8 @@ _setvalue(NPP npp, NPPVariable variable, void *result)
}
case NPPVpluginKeepLibraryInMemory: {
// This variable is not supported any more but we'll pretend it is
// so that plugins don't fail on an error return.
return NS_OK;
NPBool bCached = (result != nsnull);
return inst->SetCached(bCached);
}
case NPPVpluginUsesDOMForCursorBool: {

Просмотреть файл

@ -100,6 +100,7 @@ nsNPAPIPluginInstance::nsNPAPIPluginInstance(nsNPAPIPlugin* plugin)
mWindowless(false),
mWindowlessLocal(false),
mTransparent(false),
mCached(false),
mUsesDOMForCursor(false),
mInPluginInitCall(false),
mPlugin(plugin),
@ -167,6 +168,12 @@ nsNPAPIPluginInstance::Destroy()
mPlugin = nsnull;
}
TimeStamp
nsNPAPIPluginInstance::StopTime()
{
return mStopTime;
}
nsresult nsNPAPIPluginInstance::Initialize(nsIPluginInstanceOwner* aOwner, const char* aMIMEType)
{
PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("nsNPAPIPluginInstance::Initialize this=%p\n",this));
@ -225,6 +232,7 @@ nsresult nsNPAPIPluginInstance::Stop()
{
AsyncCallbackAutoLock lock;
mRunning = DESTROYING;
mStopTime = TimeStamp::Now();
}
OnPluginDestroy(&mNPP);
@ -955,6 +963,19 @@ nsNPAPIPluginInstance::DefineJavaProperties()
return NS_OK;
}
nsresult
nsNPAPIPluginInstance::SetCached(bool aCache)
{
mCached = aCache;
return NS_OK;
}
bool
nsNPAPIPluginInstance::ShouldCache()
{
return mCached;
}
nsresult
nsNPAPIPluginInstance::IsWindowless(bool* isWindowless)
{

Просмотреть файл

@ -102,6 +102,7 @@ public:
nsresult IsRemoteDrawingCoreAnimation(bool* aDrawing);
nsresult GetJSObject(JSContext *cx, JSObject** outObject);
nsresult DefineJavaProperties();
bool ShouldCache();
nsresult IsWindowless(bool* isWindowless);
nsresult AsyncSetWindow(NPWindow* window);
nsresult GetImage(ImageContainer* aContainer, Image** aImage);
@ -187,6 +188,12 @@ public:
return mRunning == RUNNING || mRunning == DESTROYING;
}
// return is only valid when the plugin is not running
mozilla::TimeStamp StopTime();
// cache this NPAPI plugin
nsresult SetCached(bool aCache);
already_AddRefed<nsPIDOMWindow> GetDOMWindow();
nsresult PrivateModeStateChanged();
@ -246,6 +253,7 @@ protected:
bool mWindowless;
bool mWindowlessLocal;
bool mTransparent;
bool mCached;
bool mUsesDOMForCursor;
public:
@ -274,6 +282,10 @@ private:
// non-null during a HandleEvent call
void* mCurrentPluginEvent;
// Timestamp for the last time this plugin was stopped.
// This is only valid when the plugin is actually stopped!
mozilla::TimeStamp mStopTime;
nsCOMPtr<nsIURI> mURI;
bool mUsePluginLayersPref;

Просмотреть файл

@ -231,6 +231,10 @@ PRLogModuleInfo* nsPluginLogging::gPluginLog = nsnull;
#define BRAND_PROPERTIES_URL "chrome://branding/locale/brand.properties"
#define PLUGIN_PROPERTIES_URL "chrome://global/locale/downloadProgress.properties"
// #defines for plugin cache and prefs
#define NS_PREF_MAX_NUM_CACHED_INSTANCES "browser.plugins.max_num_cached_plugins"
#define DEFAULT_NUMBER_OF_STOPPED_INSTANCES 10
#ifdef CALL_SAFETY_ON
// By default we run OOPP, so we don't want to cover up crashes.
bool gSkipPluginSafeCalls = true;
@ -3204,13 +3208,34 @@ nsPluginHost::StopPluginInstance(nsNPAPIPluginInstance* aInstance)
return NS_OK;
}
nsPluginTag* pluginTag = TagForPlugin(aInstance->GetPlugin());
aInstance->Stop();
// if the instance does not want to be 'cached' just remove it
bool doCache = aInstance->ShouldCache();
if (doCache) {
// try to get the max cached instances from a pref or use default
PRUint32 cachedInstanceLimit;
nsresult rv = NS_ERROR_FAILURE;
if (mPrefService)
rv = mPrefService->GetIntPref(NS_PREF_MAX_NUM_CACHED_INSTANCES, (int*)&cachedInstanceLimit);
if (NS_FAILED(rv))
cachedInstanceLimit = DEFAULT_NUMBER_OF_STOPPED_INSTANCES;
if (StoppedInstanceCount() >= cachedInstanceLimit) {
nsNPAPIPluginInstance *oldestInstance = FindOldestStoppedInstance();
if (oldestInstance) {
nsPluginTag* pluginTag = TagForPlugin(oldestInstance->GetPlugin());
oldestInstance->Destroy();
mInstances.RemoveElement(oldestInstance);
OnPluginInstanceDestroyed(pluginTag);
}
}
} else {
nsPluginTag* pluginTag = TagForPlugin(aInstance->GetPlugin());
aInstance->Destroy();
mInstances.RemoveElement(aInstance);
OnPluginInstanceDestroyed(pluginTag);
}
return NS_OK;
}
@ -3936,6 +3961,38 @@ nsPluginHost::FindInstance(const char *mimetype)
return nsnull;
}
nsNPAPIPluginInstance*
nsPluginHost::FindOldestStoppedInstance()
{
nsNPAPIPluginInstance *oldestInstance = nsnull;
TimeStamp oldestTime = TimeStamp::Now();
for (PRUint32 i = 0; i < mInstances.Length(); i++) {
nsNPAPIPluginInstance *instance = mInstances[i];
if (instance->IsRunning())
continue;
TimeStamp time = instance->StopTime();
if (time < oldestTime) {
oldestTime = time;
oldestInstance = instance;
}
}
return oldestInstance;
}
PRUint32
nsPluginHost::StoppedInstanceCount()
{
PRUint32 stoppedCount = 0;
for (PRUint32 i = 0; i < mInstances.Length(); i++) {
nsNPAPIPluginInstance *instance = mInstances[i];
if (!instance->IsRunning())
stoppedCount++;
}
return stoppedCount;
}
nsTArray< nsRefPtr<nsNPAPIPluginInstance> >*
nsPluginHost::InstanceArray()
{

Просмотреть файл

@ -205,6 +205,8 @@ public:
const nsAString& browserDumpID);
nsNPAPIPluginInstance *FindInstance(const char *mimetype);
nsNPAPIPluginInstance *FindOldestStoppedInstance();
PRUint32 StoppedInstanceCount();
nsTArray< nsRefPtr<nsNPAPIPluginInstance> > *InstanceArray();
@ -253,6 +255,9 @@ private:
nsPluginTag*
FindPluginEnabledForExtension(const char* aExtension, const char* &aMimeType);
nsresult
FindStoppedPluginForURL(nsIURI* aURL, nsIPluginInstanceOwner *aOwner);
nsresult
FindPlugins(bool aCreatePluginList, bool * aPluginsChanged);

Просмотреть файл

@ -378,7 +378,7 @@ jsds_FilterHook (JSDContext *jsdc, JSDThreadState *state)
jsuword pc = JSD_GetPCForStackFrame (jsdc, state, frame);
nsDependentCString url(JSD_GetScriptFilename (jsdc, script));
nsCString url(JSD_GetScriptFilename (jsdc, script));
if (url.IsEmpty()) {
NS_WARNING ("Script with no filename");
return false;

Просмотреть файл

@ -1303,8 +1303,6 @@ fi
# but that breaks when you have a 64 bit kernel with a 32 bit userland.
OS_TEST="${target_cpu}"
_COMPILER_PREFIX=
HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`
#######################################################################
@ -1799,8 +1797,8 @@ if test "$GNU_CC"; then
DSO_CFLAGS=''
DSO_PIC_CFLAGS='-fPIC'
ASFLAGS="$ASFLAGS -fPIC"
_MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti
_MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti
_MOZ_RTTI_FLAGS_ON=-frtti
_MOZ_RTTI_FLAGS_OFF=-fno-rtti
# Turn on GNU specific features
# -Wall - turn on all warnings
@ -1889,7 +1887,7 @@ if test "$GNU_CXX"; then
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
_SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-extended-offsetof"
CXXFLAGS="$CXXFLAGS -Wno-extended-offsetof"
AC_TRY_COMPILE([$configure_static_assert_macros
#ifndef __has_warning
#define __has_warning(x) 0
@ -1901,7 +1899,7 @@ if test "$GNU_CXX"; then
AC_LANG_RESTORE
])
if test "$ac_has_wno_extended_offsetof" = "yes"; then
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-extended-offsetof"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-extended-offsetof"
fi
AC_CACHE_CHECK(whether the compiler supports -Wno-invalid-offsetof,
@ -1910,7 +1908,7 @@ if test "$GNU_CXX"; then
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
_SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
CXXFLAGS="$CXXFLAGS -Wno-invalid-offsetof"
AC_TRY_COMPILE([],
[return(0);],
ac_has_wno_invalid_offsetof="yes",
@ -1919,7 +1917,7 @@ if test "$GNU_CXX"; then
AC_LANG_RESTORE
])
if test "$ac_has_wno_invalid_offsetof" = "yes"; then
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-invalid-offsetof"
fi
AC_CACHE_CHECK(whether the compiler supports -Wno-variadic-macros,
@ -1928,7 +1926,7 @@ if test "$GNU_CXX"; then
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
_SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-variadic-macros"
CXXFLAGS="$CXXFLAGS -Wno-variadic-macros"
AC_TRY_COMPILE([],
[return(0);],
ac_has_wno_variadic_macros="yes",
@ -1937,7 +1935,7 @@ if test "$GNU_CXX"; then
AC_LANG_RESTORE
])
if test "$ac_has_wno_variadic_macros" = "yes"; then
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-variadic-macros"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-variadic-macros"
fi
AC_CACHE_CHECK(whether the compiler supports -Werror=return-type,
@ -4875,7 +4873,7 @@ MOZ_ARG_DISABLE_BOOL(pedantic,
_PEDANTIC= )
if test "$_PEDANTIC"; then
_SAVE_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-pedantic ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
CXXFLAGS="$CXXFLAGS -pedantic ${_WARNINGS_CXXFLAGS} -Wno-long-long"
AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
AC_TRY_COMPILE([$configure_static_assert_macros],
[CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
@ -4885,8 +4883,8 @@ if test "$_PEDANTIC"; then
case "$result" in
no)
_WARNINGS_CFLAGS="${_COMPILER_PREFIX}-pedantic ${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
_WARNINGS_CXXFLAGS="${_COMPILER_PREFIX}-pedantic ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
_WARNINGS_CFLAGS="-pedantic ${_WARNINGS_CFLAGS} -Wno-long-long"
_WARNINGS_CXXFLAGS="-pedantic ${_WARNINGS_CXXFLAGS} -Wno-long-long"
;;
yes)
AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ])

Просмотреть файл

@ -128,7 +128,7 @@
# define MOZ_DELETE /* = delete */
# endif
#else
# define MOZ_DELETE /* unknown C++11 deleted function support */
# define MOZ_DELETE /* no = delete support, or unknown support */
#endif
#endif /* __cplusplus */

Просмотреть файл

@ -356,8 +356,9 @@ public:
return NS_OK;
}
mozIStorageAsyncStatement* stmt =
History::GetService()->GetIsVisitedStatement();
History* history = History::GetService();
NS_ENSURE_STATE(history);
mozIStorageAsyncStatement* stmt = history->GetIsVisitedStatement();
NS_ENSURE_STATE(stmt);
// Bind by index for performance.
@ -400,7 +401,9 @@ public:
nsresult NotifyVisitedStatus()
{
if (mIsVisited) {
History::GetService()->NotifyVisited(mURI);
History* history = History::GetService();
NS_ENSURE_STATE(history);
history->NotifyVisited(mURI);
}
nsCOMPtr<nsIObserverService> observerService =
@ -477,7 +480,9 @@ public:
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Could not notify observers");
}
History::GetService()->NotifyVisited(uri);
History* history = History::GetService();
NS_ENSURE_STATE(history);
history->NotifyVisited(uri);
return NS_OK;
}

Просмотреть файл

@ -83,57 +83,6 @@ XPCOMUtils.defineLazyServiceGetter(this, "idleService",
"@mozilla.org/widget/idleservice;1",
"nsIIdleService");
/**
* Returns a set of histograms that can be converted into JSON
* @return a snapshot of the histograms of form:
* { histogram_name: {range:[minvalue,maxvalue], bucket_count:<number of buckets>,
* histogram_type: <0 for exponential, 1 for linear>, bucketX:countX, ....} ...}
* where bucket[XY], count[XY] are positive integers.
*/
function getHistograms() {
let hls = Telemetry.histogramSnapshots;
let ret = {};
for (let key in hls) {
let hgram = hls[key];
if (!hgram.static)
continue;
let r = hgram.ranges;
let c = hgram.counts;
let retgram = {
range: [r[1], r[r.length - 1]],
bucket_count: r.length,
histogram_type: hgram.histogram_type,
values: {},
sum: hgram.sum
};
let first = true;
let last = 0;
for (let i = 0; i < c.length; i++) {
let value = c[i];
if (!value)
continue;
// add a lower bound
if (i && first) {
first = false;
retgram.values[r[i - 1]] = 0;
}
first = false;
last = i + 1;
retgram.values[r[i]] = value;
}
// add an upper bound
if (last && last < c.length)
retgram.values[r[last]] = 0;
ret[key] = retgram;
}
return ret;
}
function generateUUID() {
let str = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator).generateUUID().toString();
// strip {}
@ -221,6 +170,63 @@ TelemetryPing.prototype = {
_histograms: {},
_initialized: false,
_prevValues: {},
_sqliteOverhead: {},
/**
* Returns a set of histograms that can be converted into JSON
* @return a snapshot of the histograms of form:
* { histogram_name: {range:[minvalue,maxvalue], bucket_count:<number of buckets>,
* histogram_type: <0 for exponential, 1 for linear>, bucketX:countX, ....} ...}
* where bucket[XY], count[XY] are positive integers.
*/
getHistograms: function getHistograms() {
let hls = Telemetry.histogramSnapshots;
let ret = {};
// bug 701583: report sqlite overhead on startup
for (let key in this._sqliteOverhead) {
hls[key] = this._sqliteOverhead[key];
}
for (let key in hls) {
let hgram = hls[key];
if (!hgram.static)
continue;
let r = hgram.ranges;
let c = hgram.counts;
let retgram = {
range: [r[1], r[r.length - 1]],
bucket_count: r.length,
histogram_type: hgram.histogram_type,
values: {},
sum: hgram.sum
};
let first = true;
let last = 0;
for (let i = 0; i < c.length; i++) {
let value = c[i];
if (!value)
continue;
// add a lower bound
if (i && first) {
first = false;
retgram.values[r[i - 1]] = 0;
}
first = false;
last = i + 1;
retgram.values[r[i]] = value;
}
// add an upper bound
if (last && last < c.length)
retgram.values[r[last]] = 0;
ret[key] = retgram;
}
return ret;
},
addValue: function addValue(name, id, val) {
let h = this._histograms[name];
@ -337,6 +343,18 @@ TelemetryPing.prototype = {
}
},
/**
* Make a copy of sqlite histograms on startup
*/
gatherStartupSqlite: function gatherStartupSqlite() {
let hls = Telemetry.histogramSnapshots;
let sqlite_re = /SQLITE/;
for (let key in hls) {
if (sqlite_re.test(key))
this._sqliteOverhead["STARTUP_" + key] = hls[key];
}
},
/**
* Send data to the server. Record success/send-time in histograms
*/
@ -347,7 +365,7 @@ TelemetryPing.prototype = {
ver: PAYLOAD_VERSION,
info: this.getMetadata(reason),
simpleMeasurements: getSimpleMeasurements(),
histograms: getHistograms()
histograms: this.getHistograms()
};
let isTestPing = (reason == "test-ping");
@ -423,6 +441,7 @@ TelemetryPing.prototype = {
}
Services.obs.addObserver(this, "private-browsing", false);
Services.obs.addObserver(this, "profile-before-change", false);
Services.obs.addObserver(this, "sessionstore-windows-restored", false);
// Delay full telemetry initialization to give the browser time to
// run various late initializers. Otherwise our gathered memory
@ -443,6 +462,7 @@ TelemetryPing.prototype = {
*/
uninstall: function uninstall() {
this.detachObservers()
Services.obs.removeObserver(this, "sessionstore-windows-restored");
Services.obs.removeObserver(this, "profile-before-change");
Services.obs.removeObserver(this, "private-browsing");
},
@ -480,6 +500,9 @@ TelemetryPing.prototype = {
this.attachObservers()
}
break;
case "sessionstore-windows-restored":
this.gatherStartupSqlite();
break;
case "idle-daily":
// Enqueue to main-thread, otherwise components may be inited by the
// idle-daily category and miss the gather-telemetry notification.

Просмотреть файл

@ -757,7 +757,7 @@ function onToolbarDragStart(aEvent)
function onToolbarDragOver(aEvent)
{
var documentId = gToolboxDocument.documentElement.id;
if (!aEvent.dataTransfer.types.contains("text/toolbarwrapper-id/" + documentId))
if (!aEvent.dataTransfer.types.contains("text/toolbarwrapper-id/" + documentId.toLowerCase()))
return;
var toolbar = aEvent.target;
@ -917,7 +917,7 @@ function onToolbarDrop(aEvent)
function onPaletteDragOver(aEvent)
{
var documentId = gToolboxDocument.documentElement.id;
if (aEvent.dataTransfer.types.contains("text/toolbarwrapper-id/" + documentId))
if (aEvent.dataTransfer.types.contains("text/toolbarwrapper-id/" + documentId.toLowerCase()))
aEvent.preventDefault();
}

Просмотреть файл

@ -734,10 +734,6 @@ var AddonRepository = {
* The callback to pass results to
*/
getAddonsByIDs: function(aIDs, aCallback) {
let startupInfo = Cc["@mozilla.org/toolkit/app-startup;1"].
getService(Ci.nsIAppStartup).
getStartupInfo();
let ids = aIDs.slice(0);
let params = {
@ -745,16 +741,6 @@ var AddonRepository = {
IDS : ids.map(encodeURIComponent).join(',')
};
if (startupInfo.process) {
if (startupInfo.main)
params.TIME_MAIN = startupInfo.main - startupInfo.process;
if (startupInfo.firstPaint)
params.TIME_FIRST_PAINT = startupInfo.firstPaint - startupInfo.process;
if (startupInfo.sessionRestored)
params.TIME_SESSION_RESTORED = startupInfo.sessionRestored -
startupInfo.process;
};
let url = this._formatURLPref(PREF_GETADDONS_BYIDS, params);
let self = this;

Просмотреть файл

@ -96,7 +96,6 @@ _TEST_FILES = \
head.js \
browser_bug557956.js \
browser_bug616841.js \
browser_bug623950.js \
browser_updatessl.js \
browser_installssl.js \
browser_newaddon.js \

Просмотреть файл

@ -1,68 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
// Tests that the metadata request includes startup time measurements
Components.utils.import("resource://gre/modules/AddonRepository.jsm");
var gManagerWindow;
var gProvider;
function parseParams(aQuery) {
let params = {};
aQuery.split("&").forEach(function(aParam) {
let [key, value] = aParam.split("=");
params[key] = value;
});
return params;
}
function test() {
waitForExplicitFinish();
var gSeenRequest = false;
gProvider = new MockProvider();
gProvider.createAddons([{
id: "test1@tests.mozilla.org",
name: "Test add-on"
}]);
function observe(aSubject, aTopic, aData) {
aSubject.QueryInterface(Ci.nsIChannel);
let url = aSubject.URI.QueryInterface(Ci.nsIURL);
if (url.filePath != "/extensions-dummy/metadata")
return;
info(url.query);
let params = parseParams(url.query);
is(params.appOS, Services.appinfo.OS, "OS should be correct");
is(params.appVersion, Services.appinfo.version, "Version should be correct");
ok(params.tMain >= 0, "Should be a sensible tMain");
ok(params.tFirstPaint >= 0, "Should be a sensible tFirstPaint");
ok(params.tSessionRestored >= 0, "Should be a sensible tSessionRestored");
gSeenRequest = true;
}
// Watch HTTP requests
Services.obs.addObserver(observe, "http-on-modify-request", false);
Services.prefs.setCharPref("extensions.getAddons.get.url",
"http://127.0.0.1:8888/extensions-dummy/metadata?appOS=%OS%&appVersion=%VERSION%&tMain=%TIME_MAIN%&tFirstPaint=%TIME_FIRST_PAINT%&tSessionRestored=%TIME_SESSION_RESTORED%");
registerCleanupFunction(function() {
Services.obs.removeObserver(observe, "http-on-modify-request");
Services.prefs.clearUserPref("extensions.getAddons.get.url");
});
AddonRepository.getAddonsByIDs(["test1@tests.mozilla.org"], {
searchFailed: function() {
ok(gSeenRequest, "Should have seen metadata request");
finish();
}
});
}

Просмотреть файл

@ -681,6 +681,8 @@ AndroidBridge::PerformHapticFeedback(bool aIsLongPress)
void
AndroidBridge::Vibrate(const nsTArray<PRUint32>& aPattern)
{
AutoLocalJNIFrame frame;
ALOG_BRIDGE("AndroidBridge::Vibrate");
PRUint32 len = aPattern.Length();