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

Unified Diff: chrome/common/extensions/manifest_handlers/content_scripts_handler.cc

Issue 495853002: Atomic UserScript ID generation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 4 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/common/extensions/manifest_handlers/content_scripts_handler.cc
diff --git a/chrome/common/extensions/manifest_handlers/content_scripts_handler.cc b/chrome/common/extensions/manifest_handlers/content_scripts_handler.cc
index ff5eb90e3eeec0422079e95d951948c721360675..5bb4af86aa43206dc9104af4f8a7caa32619a13d 100644
--- a/chrome/common/extensions/manifest_handlers/content_scripts_handler.cc
+++ b/chrome/common/extensions/manifest_handlers/content_scripts_handler.cc
@@ -32,9 +32,6 @@ namespace errors = manifest_errors;
namespace {
-// The globally-unique id for a user script.
-int64 g_next_user_script_id = 0;
-
// Helper method that loads either the include_globs or exclude_globs list
// from an entry in the content_script lists of the manifest.
bool LoadGlobsHelper(const base::DictionaryValue* content_script,
@@ -428,7 +425,7 @@ bool ContentScriptsHandler::Parse(Extension* extension, base::string16* error) {
// Greasemonkey matches all frames.
user_script.set_match_all_frames(true);
}
- user_script.set_id(g_next_user_script_id++);
+ user_script.set_id(UserScript::GenerateUserScriptID());
content_scripts_info->content_scripts.push_back(user_script);
}
extension->SetManifestData(keys::kContentScripts,

Powered by Google App Engine
This is Rietveld 408576698