summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/sandboxed_extension_unpacker.h
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-18 21:43:34 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-18 21:43:34 +0000
commit5c851620114bf518835e3ba723b595382d673425 (patch)
tree1f34e812fad9783c365a6a8f30b70008dae030ed /chrome/browser/extensions/sandboxed_extension_unpacker.h
parent3f8bf470f51ae847a1fa97ad154cf4b3f244649a (diff)
downloadchromium_src-5c851620114bf518835e3ba723b595382d673425.zip
chromium_src-5c851620114bf518835e3ba723b595382d673425.tar.gz
chromium_src-5c851620114bf518835e3ba723b595382d673425.tar.bz2
Force an app's orgin to be the origin of the URL the crx is
downloaded from. Added machinery to be able to switch this behavior off, so that in the future, we can turn it off for the gallery. BUG=32361 Review URL: http://codereview.chromium.org/890002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41994 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/sandboxed_extension_unpacker.h')
-rw-r--r--chrome/browser/extensions/sandboxed_extension_unpacker.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/chrome/browser/extensions/sandboxed_extension_unpacker.h b/chrome/browser/extensions/sandboxed_extension_unpacker.h
index fd44a6a..25d77b6 100644
--- a/chrome/browser/extensions/sandboxed_extension_unpacker.h
+++ b/chrome/browser/extensions/sandboxed_extension_unpacker.h
@@ -96,6 +96,11 @@ class SandboxedExtensionUnpacker : public UtilityProcessHost::Client {
ResourceDispatcherHost* rdh,
SandboxedExtensionUnpackerClient* cilent);
+ const GURL& app_origin_override() const { return app_origin_override_; }
+ void set_app_origin_override(const GURL& val) {
+ app_origin_override_ = val;
+ }
+
// Start unpacking the extension. The client is called with the results.
void Start();
@@ -137,15 +142,37 @@ class SandboxedExtensionUnpacker : public UtilityProcessHost::Client {
bool RewriteImageFiles();
bool RewriteCatalogFiles();
+ // The path to the CRX to unpack.
FilePath crx_path_;
+
+ // Our client's thread. This is the thread we respond on.
ChromeThread::ID thread_identifier_;
+
+ // ResourceDispatcherHost to pass to the utility process.
ResourceDispatcherHost* rdh_;
+
+ // Our client.
scoped_refptr<SandboxedExtensionUnpackerClient> client_;
+
+ // A temporary directory to use for unpacking.
ScopedTempDir temp_dir_;
+
+ // The root directory of the unpacked extension. This is a child of temp_dir_.
FilePath extension_root_;
+
+ // Represents the extension we're unpacking.
scoped_ptr<Extension> extension_;
+
+ // Whether we've received a response from the utility process yet.
bool got_response_;
+
+ // The public key that was extracted from the CRX header.
std::string public_key_;
+
+ // If the unpacked extension is an app, its origin will be forced to this
+ // value. This is used when an app is self-hosted. The only valid origin
+ // is the origin it is served from.
+ GURL app_origin_override_;
};
#endif // CHROME_BROWSER_EXTENSIONS_SANDBOXED_EXTENSION_UNPACKER_H_