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

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

Issue 9958147: Fix some uses of global variables in transient pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
Index: chrome/renderer/extensions/context_menus_custom_bindings.cc
diff --git a/chrome/renderer/extensions/context_menus_custom_bindings.cc b/chrome/renderer/extensions/context_menus_custom_bindings.cc
index db3b3d9b4e438f3fb105538929733e65306f3e05..7181a5d6fe507419214e356dd80bf7b6518da7e2 100644
--- a/chrome/renderer/extensions/context_menus_custom_bindings.cc
+++ b/chrome/renderer/extensions/context_menus_custom_bindings.cc
@@ -4,17 +4,18 @@
#include "chrome/renderer/extensions/context_menus_custom_bindings.h"
+#include "chrome/common/extensions/extension_messages.h"
+#include "content/public/renderer/render_thread.h"
#include "grit/renderer_resources.h"
#include "v8/include/v8.h"
namespace {
v8::Handle<v8::Value> GetNextContextMenuId(const v8::Arguments& args) {
- // Note: this works because contextMenus.create() only works in the
- // extension process. If that API is opened up to content scripts, this
- // will need to change. See crbug.com/77023
- static int next_context_menu_id = 1;
- return v8::Integer::New(next_context_menu_id++);
+ int context_menu_id = -1;
+ content::RenderThread::Get()->Send(
+ new ExtensionHostMsg_GenerateUniqueID(&context_menu_id));
+ return v8::Integer::New(context_menu_id);
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698