summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-08 18:33:30 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-08 18:33:30 +0000
commit5bfb1eb0a729e8d1adb448b0a84580564a883d2e (patch)
treebdac0bcedc000d43f2b65fedac764bfdfa4b7c60 /chrome/common
parentd8cc3a679233604df94571b882ac912614cb2bbe (diff)
downloadchromium_src-5bfb1eb0a729e8d1adb448b0a84580564a883d2e.zip
chromium_src-5bfb1eb0a729e8d1adb448b0a84580564a883d2e.tar.gz
chromium_src-5bfb1eb0a729e8d1adb448b0a84580564a883d2e.tar.bz2
Try one more time to check in http://codereview.chromium.org/60112
Added this test to the list of skipped purify tests as it is experience the same issue as ExtensionView test. I also found an unrelated memory leak and created a patch separately: http://codereview.chromium.org/63073 Review URL: http://codereview.chromium.org/63075 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13369 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/extensions/user_script.cc6
-rw-r--r--chrome/common/extensions/user_script.h9
2 files changed, 15 insertions, 0 deletions
diff --git a/chrome/common/extensions/user_script.cc b/chrome/common/extensions/user_script.cc
index 69fe5f4..abe9280 100644
--- a/chrome/common/extensions/user_script.cc
+++ b/chrome/common/extensions/user_script.cc
@@ -40,6 +40,9 @@ void UserScript::Pickle(::Pickle* pickle) const {
// Write the run location.
pickle->WriteInt(run_location());
+ // Write the extension id.
+ pickle->WriteString(extension_id());
+
// Write globs.
pickle->WriteSize(globs_.size());
for (std::vector<std::string>::const_iterator glob = globs_.begin();
@@ -76,6 +79,9 @@ void UserScript::Unpickle(const ::Pickle& pickle, void** iter) {
CHECK(run_location >= 0 && run_location < RUN_LOCATION_LAST);
run_location_ = static_cast<RunLocation>(run_location);
+ // Read the extension ID.
+ CHECK(pickle.ReadString(iter, &extension_id_));
+
// Read globs.
size_t num_globs = 0;
CHECK(pickle.ReadSize(iter, &num_globs));
diff --git a/chrome/common/extensions/user_script.h b/chrome/common/extensions/user_script.h
index 1a8d6df..070ead3 100644
--- a/chrome/common/extensions/user_script.h
+++ b/chrome/common/extensions/user_script.h
@@ -111,6 +111,11 @@ class UserScript {
FileList& css_scripts() { return css_scripts_; }
const FileList& css_scripts() const { return css_scripts_; }
+ const std::string& extension_id() const { return extension_id_; }
+ void set_extension_id(const std::string& id) { extension_id_ = id; }
+
+ bool is_standalone() { return extension_id_.empty(); }
+
// Returns true if the script should be applied to the specified URL, false
// otherwise.
bool MatchesUrl(const GURL& url);
@@ -141,6 +146,10 @@ class UserScript {
// List of css scripts defined in content_scripts
FileList css_scripts_;
+
+ // The ID of the extension this script is a part of, if any. Can be empty if
+ // the script is a "standlone" user script.
+ std::string extension_id_;
};
typedef std::vector<UserScript> UserScriptList;