Chromium Code Reviews| Index: chrome/browser/automation/automation_cookie_util.h |
| diff --git a/chrome/browser/automation/automation_cookie_util.h b/chrome/browser/automation/automation_cookie_util.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..803b5bdb3e71e35b4ff228c70bd3d43543d93ed2 |
| --- /dev/null |
| +++ b/chrome/browser/automation/automation_cookie_util.h |
| @@ -0,0 +1,58 @@ |
| +// 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_COOKIE_UTIL_H_ |
|
Paweł Hajdan Jr.
2011/03/08 07:49:01
Just automation_util please, I know another review
Charlie Reis
2011/03/08 20:44:41
Done.
|
| +#define CHROME_BROWSER_AUTOMATION_AUTOMATION_COOKIE_UTIL_H_ |
| +#pragma once |
| + |
| +#include "base/basictypes.h" |
| +#include "content/browser/tab_contents/tab_contents.h" |
| +#include "net/url_request/url_request_context.h" |
| + |
| +// This file contains utility functions for accessing cookies for a TabContents |
| +// on the correct thread. |
| + |
| +namespace automation_cookie_util { |
| + |
| +void GetCookiesOnIOThread( |
|
Paweł Hajdan Jr.
2011/03/08 07:49:01
Those OnIOThread functions should be in anonymous
Charlie Reis
2011/03/08 20:44:41
Yes, it's better to hide them. There were a few n
|
| + const GURL& url, |
| + const scoped_refptr<URLRequestContextGetter>& context_getter, |
| + base::WaitableEvent* event, |
| + std::string* cookies); |
| + |
| +void SetCookieOnIOThread( |
| + const GURL& url, |
| + const std::string& value, |
| + const scoped_refptr<URLRequestContextGetter>& context_getter, |
| + base::WaitableEvent* event, |
| + bool* success); |
| + |
| +void DeleteCookieOnIOThread( |
| + const GURL& url, |
| + const std::string& name, |
| + const scoped_refptr<URLRequestContextGetter>& context_getter, |
| + base::WaitableEvent* event); |
| + |
| +// 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); |
| + |
| +} // namespace automation_cookie_util |
| + |
| +#endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_COOKIE_UTIL_H_ |