summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation/automation_util.h
diff options
context:
space:
mode:
authorcreis@google.com <creis@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-15 22:45:09 +0000
committercreis@google.com <creis@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-15 22:45:09 +0000
commitd969667a1e558d2ba53e556233598cdc75d24678 (patch)
tree5b848ba7627e1240c0ef2855bf5780db83a027b7 /chrome/browser/automation/automation_util.h
parent71e2f0a1ba62594c2cb555dd291810aaa7775779 (diff)
downloadchromium_src-d969667a1e558d2ba53e556233598cdc75d24678.zip
chromium_src-d969667a1e558d2ba53e556233598cdc75d24678.tar.gz
chromium_src-d969667a1e558d2ba53e556233598cdc75d24678.tar.bz2
Initial support for partitioning cookies for isolated apps.
This CL adds experimental support for letting installed apps request isolated storage in their manifest. An isolated app will have its own cookie store that is not shared with other apps or normal pages, even if they share an origin. The feature is currently behind a --enable-experimental-app-manifests flag. BUG=69335 TEST=ExtensionManifestTest.IsolatedApps TEST=IsolatedAppApiTest.CookieIsolation* Review URL: http://codereview.chromium.org/6201005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78301 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation/automation_util.h')
-rw-r--r--chrome/browser/automation/automation_util.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/chrome/browser/automation/automation_util.h b/chrome/browser/automation/automation_util.h
new file mode 100644
index 0000000..bb38344
--- /dev/null
+++ b/chrome/browser/automation/automation_util.h
@@ -0,0 +1,72 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_UTIL_H_
+#define CHROME_BROWSER_AUTOMATION_AUTOMATION_UTIL_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "chrome/browser/automation/automation_provider.h"
+#include "content/browser/tab_contents/tab_contents.h"
+
+class DictionaryValue;
+
+// This file contains automation utility functions.
+
+namespace automation_util {
+
+// Gets the size and value of the cookie string for |url| in the given tab.
+// Can be called from any thread.
+void GetCookies(const GURL& url,
+ TabContents* contents,
+ int* value_size,
+ std::string* value);
+
+// Sets a cookie for |url| in the given tab. Can be called from any thread.
+void SetCookie(const GURL& url,
+ const std::string value,
+ TabContents* contents,
+ int* response_value);
+
+// Deletes a cookie for |url| in the given tab. Can be called from any thread.
+void DeleteCookie(const GURL& url,
+ const std::string& cookie_name,
+ TabContents* contents,
+ bool* success);
+
+// Gets the cookies for the given URL. Uses the JSON interface.
+// Example:
+// input: { "windex": 1, "tab_index": 1, "url": "http://www.google.com" }
+// output: { "cookies": "PREF=12012" }
+void GetCookiesJSON(AutomationProvider* provider,
+ DictionaryValue* args,
+ IPC::Message* reply_message);
+
+// Deletes the cookie with the given name for the URL. Uses the JSON interface.
+// Example:
+// input: { "windex": 1,
+// "tab_index": 1,
+// "url": "http://www.google.com",
+// "name": "my_cookie"
+// }
+// output: none
+void DeleteCookieJSON(AutomationProvider* provider,
+ DictionaryValue* args,
+ IPC::Message* reply_message);
+
+// Sets a cookie for the given URL. Uses the JSON interface.
+// Example:
+// input: { "windex": 1,
+// "tab_index": 1,
+// "url": "http://www.google.com",
+// "cookie": "PREF=21321"
+// }
+// output: none
+void SetCookieJSON(AutomationProvider* provider,
+ DictionaryValue* args,
+ IPC::Message* reply_message);
+
+} // namespace automation_util
+
+#endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_UTIL_H_