forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow extensions to unload while notifications are active.
NotificationDelegates kept a reference counted pointer to the ApiFunction, thus preventing the extension from unloading until the delegate was destroyed. This allows notifications to inform the delegate when the ApiFunction (and its RenderViewHost) are no longer needed, after all the image downloads have completed. BUG=177563 Review URL: https://chromiumcodereview.appspot.com/13872023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196601 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
dewittj@chromium.org
committed
Apr 26, 2013
1 parent
eaaef97
commit 5cad896
Showing
9 changed files
with
158 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
chrome/test/data/extensions/api_test/notifications/api/unload/background.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
const notifications = chrome.notifications; | ||
|
||
var idString = "foo"; | ||
|
||
var testBasicEvents = function() { | ||
var incidents = 0; | ||
|
||
var onCreateCallback = function(id) { | ||
chrome.test.assertTrue(id.length > 0); | ||
chrome.test.assertEq(idString, id); | ||
chrome.test.succeed(); | ||
} | ||
|
||
var red_dot = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA" + | ||
"AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO" + | ||
"9TXL0Y4OHwAAAABJRU5ErkJggg=="; | ||
|
||
var options = { | ||
type: "basic", | ||
iconUrl: red_dot, | ||
title: "Attention!", | ||
message: "Check out Cirque du Soleil" | ||
}; | ||
notifications.create(idString, options, onCreateCallback); | ||
}; | ||
|
||
chrome.test.runTests([ testBasicEvents ]); |
13 changes: 13 additions & 0 deletions
13
chrome/test/data/extensions/api_test/notifications/api/unload/manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "chrome.notifications", | ||
"version": "0.1", | ||
"description": "chrome.notifications API events", | ||
"app": { | ||
"background": { | ||
"scripts": ["background.js"] | ||
} | ||
}, | ||
"permissions": [ | ||
"notifications" | ||
] | ||
} |