summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-23 17:56:25 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-23 17:56:25 +0000
commitcccf9093e5f184e3a3d8667f0ab664864d401ab7 (patch)
treed43bc2ccef5436b5ac2d66f466e33910a6333d4f /chrome/common
parent6727ddddb2d81a5e94844873ccdcc6de4b1987ef (diff)
downloadchromium_src-cccf9093e5f184e3a3d8667f0ab664864d401ab7.zip
chromium_src-cccf9093e5f184e3a3d8667f0ab664864d401ab7.tar.gz
chromium_src-cccf9093e5f184e3a3d8667f0ab664864d401ab7.tar.bz2
Implement granular cross-origin XHR for extensions.
I left the temporary hack that allows all origins until we are ready to break everything all at once. Also, I still need to devise some way to test this. BUG=12129 Review URL: http://codereview.chromium.org/173166 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24089 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/render_messages.h20
-rw-r--r--chrome/common/render_messages_internal.h8
2 files changed, 27 insertions, 1 deletions
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index fcbf0a4..aeda43d 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -17,6 +17,7 @@
#include "chrome/common/common_param_traits.h"
#include "chrome/common/css_colors.h"
#include "chrome/common/extensions/update_manifest.h"
+#include "chrome/common/extensions/url_pattern.h"
#include "chrome/common/filter_policy.h"
#include "chrome/common/modal_dialog_event.h"
#include "chrome/common/page_transition_types.h"
@@ -2103,6 +2104,25 @@ struct ParamTraits<UpdateManifest::Result> {
}
};
+// Traits for URLPattern.
+template <>
+struct ParamTraits<URLPattern> {
+ typedef URLPattern param_type;
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, p.GetAsString());
+ }
+ static bool Read(const Message* m, void** iter, param_type* p) {
+ std::string spec;
+ if (!ReadParam(m, iter, &spec))
+ return false;
+
+ return p->Parse(spec);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ LogParam(p.GetAsString(), l);
+ }
+};
+
} // namespace IPC
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index 6f15991..45a409b 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -600,10 +600,16 @@ IPC_BEGIN_MESSAGES(View)
// Tell the renderer process which permissions the given extension has. See
// Extension::Permissions for which elements correspond to which permissions.
- IPC_MESSAGE_CONTROL2(ViewMsg_Extension_SetPermissions,
+ IPC_MESSAGE_CONTROL2(ViewMsg_Extension_SetAPIPermissions,
std::string /* extension_id */,
std::vector<std::string> /* permissions */)
+ // Tell the renderer process which host permissions the given extension has.
+ IPC_MESSAGE_CONTROL2(
+ ViewMsg_Extension_SetHostPermissions,
+ GURL /* source extension's origin */,
+ std::vector<URLPattern> /* URLPatterns the extension can access */)
+
// Tell the renderer process all known page action ids for a particular
// extension.
IPC_MESSAGE_CONTROL2(ViewMsg_Extension_UpdatePageActions,