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

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

Issue 12595005: Parsing filesystem url before giving it to media player (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase change Created 7 years, 9 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/media_resource_getter_impl.h
diff --git a/content/browser/android/media_resource_getter_impl.h b/content/browser/android/media_resource_getter_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..20ba44f2dd98f840806a1967640041c6809601f7
--- /dev/null
+++ b/content/browser/android/media_resource_getter_impl.h
@@ -0,0 +1,79 @@
+// Copyright (c) 2013 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_MEDIA_RESOURCE_GETTER_IMPL_H_
+#define CONTENT_BROWSER_ANDROID_MEDIA_RESOURCE_GETTER_IMPL_H_
+
+#include <string>
+
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "base/synchronization/waitable_event.h"
+#include "media/base/android/media_resource_getter.h"
+#include "net/cookies/canonical_cookie.h"
+
+namespace fileapi {
+class FileSystemContext;
+}
+
+namespace net {
+class URLRequestContextGetter;
+}
+
+namespace content {
+
+class BrowserContext;
+class ResourceContext;
+
+// This class implements media::MediaResourceGetter to retrieve resources
+// asynchronously on the UI thread.
+class MediaResourceGetterImpl : public media::MediaResourceGetter {
+ public:
+ // Construct a MediaResourceGetterImpl object. |browser_context| and
+ // |renderer_id| are passed to retrieve the CookieStore.
+ // |file_system_context| are used to get the platform path.
+ MediaResourceGetterImpl(BrowserContext* browser_context,
+ fileapi::FileSystemContext* file_system_context,
+ int renderer_id, int routing_id);
+ virtual ~MediaResourceGetterImpl();
+
+ // media::MediaResourceGetter implementation.
+ // Must be called on the UI thread.
+ virtual void GetCookies(const GURL& url,
+ const GURL& first_party_for_cookies,
+ const GetCookieCB& callback) OVERRIDE;
+ virtual void GetPlatformPathFromFileSystemURL(
+ const GURL& url,
+ const GetPlatformPathCB& callback) OVERRIDE;
+
+ private:
+ // Called when GetCookies() finishes.
+ void GetCookiesCallback(
+ const GetCookieCB& callback, const std::string& cookies);
+
+ // Called when GetPlatformPathFromFileSystemURL() finishes.
+ void GetPlatformPathCallback(
+ const GetPlatformPathCB& callback, const std::string& platform_path);
+
+ // BrowserContext to retrieve URLRequestContext and ResourceContext.
+ BrowserContext* browser_context_;
+
+ // FileSystemContext to be used on FILE thread.
+ fileapi::FileSystemContext* file_system_context_;
+
+ // Used to post tasks.
+ base::WeakPtrFactory<MediaResourceGetterImpl> weak_this_;
+
+ // Render process id, used to check whether the process can access cookies.
+ int renderer_id_;
+
+ // Routing id for the render view, used to check tab specific cookie policy.
+ int routing_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(MediaResourceGetterImpl);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_ANDROID_MEDIA_RESOURCE_GETTER_IMPL_H_
« no previous file with comments | « content/browser/android/media_player_manager_android.cc ('k') | content/browser/android/media_resource_getter_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698