Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_ANDROID_COOKIES_RETRIEVER_IMPL_H_ | |
| 6 #define CONTENT_BROWSER_ANDROID_COOKIES_RETRIEVER_IMPL_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "media/base/android/cookies_retriever.h" | |
| 11 | |
| 12 namespace net { | |
| 13 class URLRequestContextGetter; | |
| 14 } | |
| 15 | |
| 16 namespace content { | |
| 17 | |
| 18 // This class implements net::CookiesRetriever to retrive cookies | |
|
Yaron
2012/09/05 07:03:56
media
qinmin
2012/09/05 19:34:42
Done.
| |
| 19 // asynchronously on the UI thread. | |
| 20 class CookiesRetrieverImpl : public media::CookiesRetriever { | |
| 21 public: | |
| 22 explicit CookiesRetrieverImpl(net::URLRequestContextGetter* context_getter); | |
| 23 virtual ~CookiesRetrieverImpl(); | |
| 24 | |
| 25 // Need to be called on the UI thread. | |
| 26 virtual void GetCookiesAsync(std::string url, | |
| 27 const media::CookiesRetriever::GetCookieCB& callback) OVERRIDE; | |
| 28 | |
| 29 // Helper Methods for posting tasks. | |
| 30 void RequestCookies(); | |
| 31 void ReturnCookies(const std::string& cookies); | |
| 32 void GetCookiesCallback(); | |
| 33 | |
| 34 private: | |
| 35 std::string url_; | |
| 36 std::string cookies_; | |
| 37 net::URLRequestContextGetter* context_getter_; | |
| 38 media::CookiesRetriever::GetCookieCB get_cookies_cb_; | |
| 39 | |
| 40 DISALLOW_COPY_AND_ASSIGN(CookiesRetrieverImpl); | |
| 41 }; | |
| 42 | |
| 43 } // namespace content | |
| 44 | |
| 45 #endif // CONTENT_BROWSER_ANDROID_COOKIES_RETRIEVER_IMPL_H_ | |
| OLD | NEW |