Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2156)

Unified Diff: chrome/renderer/extensions/extension_dispatcher.cc

Issue 10804020: Introduce runtime.onSuspendCanceled() event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: respond to comments Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/extensions/extension_dispatcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/extension_dispatcher.cc
diff --git a/chrome/renderer/extensions/extension_dispatcher.cc b/chrome/renderer/extensions/extension_dispatcher.cc
index 896946d0ec6ce3cb684230c9d7fd2af216fa3c61..362517c656f90ffc4c98db22fdb38303407d5e82 100644
--- a/chrome/renderer/extensions/extension_dispatcher.cc
+++ b/chrome/renderer/extensions/extension_dispatcher.cc
@@ -110,6 +110,7 @@ static const int64 kInitialExtensionIdleHandlerDelayMs = 5*1000;
static const int64 kMaxExtensionIdleHandlerDelayMs = 5*60*1000;
static const char kEventDispatchFunction[] = "Event.dispatchJSON";
static const char kOnUnloadEvent[] = "runtime.onSuspend";
+static const char kOnSuspendCanceledEvent[] = "runtime.onSuspendCanceled";
class ChromeHiddenNativeHandler : public NativeHandler {
public:
@@ -325,6 +326,7 @@ bool ExtensionDispatcher::OnControlMessageReceived(
IPC_MESSAGE_HANDLER(ExtensionMsg_UsingWebRequestAPI, OnUsingWebRequestAPI)
IPC_MESSAGE_HANDLER(ExtensionMsg_ShouldUnload, OnShouldUnload)
IPC_MESSAGE_HANDLER(ExtensionMsg_Unload, OnUnload)
+ IPC_MESSAGE_HANDLER(ExtensionMsg_CancelUnload, OnCancelUnload)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -1001,6 +1003,14 @@ void ExtensionDispatcher::OnUnload(const std::string& extension_id) {
RenderThread::Get()->Send(new ExtensionHostMsg_UnloadAck(extension_id));
}
+void ExtensionDispatcher::OnCancelUnload(const std::string& extension_id) {
+ ListValue args;
+ args.Set(0, Value::CreateStringValue(kOnSuspendCanceledEvent));
+ args.Set(1, Value::CreateStringValue("[]"));
+ v8_context_set_.DispatchChromeHiddenMethod(
+ extension_id, kEventDispatchFunction, args, NULL, GURL());
+}
+
Feature::Context ExtensionDispatcher::ClassifyJavaScriptContext(
const std::string& extension_id,
int extension_group,
« no previous file with comments | « chrome/renderer/extensions/extension_dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698