Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(970)

Unified Diff: content/browser/android/cookie_getter_impl.h

Issue 10919075: Move android mediaplayer from render process to browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing comments Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/android/cookie_getter_impl.h
diff --git a/content/browser/android/cookie_getter_impl.h b/content/browser/android/cookie_getter_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..57154fe62fc9ec42738f6f2d43bcb90e362560d4
--- /dev/null
+++ b/content/browser/android/cookie_getter_impl.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2012 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 CONTENT_BROWSER_ANDROID_COOKIE_GETTER_IMPL_H_
+#define CONTENT_BROWSER_ANDROID_COOKIE_GETTER_IMPL_H_
+
+#include <string>
+
+#include "base/memory/weak_ptr.h"
+#include "media/base/android/cookie_getter.h"
+
+namespace net {
+class URLRequestContextGetter;
+}
+
+namespace content {
+
+// This class implements media::CookieGetter to retrive cookies
+// asynchronously on the UI thread.
+class CookieGetterImpl : public media::CookieGetter {
+ public:
+ // Construct a CookieGetterImpl by passing a URLRequestContextGetter object
+ // to retrieve the CookieStore later.
+ explicit CookieGetterImpl(net::URLRequestContextGetter* context_getter);
+ virtual ~CookieGetterImpl();
+
+ // media::CookieGetter implementation.
+ // Must be called on the UI thread.
+ virtual void GetCookies(
+ const std::string& url, const GetCookieCB& callback) OVERRIDE;
+
+ private:
+ void GetCookiesCallback(
+ const std::string& cookies, const GetCookieCB& callback);
+ void RequestCookies(const std::string& url, const GetCookieCB& callback);
+ void ReturnCookies(const GetCookieCB& callback, const std::string& cookies);
+
+ // Context getter used to get the CookieStore.
+ net::URLRequestContextGetter* context_getter_;
+
+ // Used to post tasks.
+ base::WeakPtrFactory<CookieGetterImpl> weak_this_;
+
+ DISALLOW_COPY_AND_ASSIGN(CookieGetterImpl);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_ANDROID_COOKIE_GETTER_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698