Index: content/browser/webui/url_data_manager.h |
=================================================================== |
--- content/browser/webui/url_data_manager.h (revision 178359) |
+++ content/browser/webui/url_data_manager.h (working copy) |
@@ -2,27 +2,28 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_H_ |
-#define CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_H_ |
+#ifndef CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_H_ |
+#define CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_H_ |
#include <string> |
#include <vector> |
-#include "base/callback.h" |
#include "base/memory/ref_counted.h" |
+#include "base/memory/scoped_ptr.h" |
#include "base/sequenced_task_runner_helpers.h" |
+#include "base/supports_user_data.h" |
#include "base/synchronization/lock.h" |
-#include "chrome/browser/profiles/profile_keyed_service.h" |
+#include "content/common/content_export.h" |
class ChromeURLDataManagerBackend; |
class MessageLoop; |
-class Profile; |
namespace base { |
class RefCountedMemory; |
} |
namespace content { |
+class BrowserContext; |
class URLDataSource; |
class WebUIDataSource; |
} |
@@ -34,10 +35,10 @@ |
// with AddDataSource. DataSources must be added on the UI thread (they are also |
// deleted on the UI thread). Internally the DataSources are maintained by |
// ChromeURLDataManagerBackend, see it for details. |
-class ChromeURLDataManager : public ProfileKeyedService { |
+class CONTENT_EXPORT ChromeURLDataManager |
+ : public base::SupportsUserData::Data { |
public: |
- explicit ChromeURLDataManager( |
- const base::Callback<ChromeURLDataManagerBackend*(void)>& backend); |
+ explicit ChromeURLDataManager(content::BrowserContext* browser_context); |
virtual ~ChromeURLDataManager(); |
// Adds a DataSource to the collection of data sources. This *must* be invoked |
@@ -56,15 +57,17 @@ |
// for you, but can be invoked to force deletion (such as during shutdown). |
static void DeleteDataSources(); |
- // Convenience wrapper function to add |source| to |profile|'s |
+ // Convenience wrapper function to add |source| to |browser_context|'s |
// |ChromeURLDataManager|. Creates a URLDataSourceImpl to wrap the given |
// source. |
- static void AddDataSource(Profile* profile, |
- content::URLDataSource* source); |
+ static void AddDataSource( |
+ content::BrowserContext* browser_context, |
+ content::URLDataSource* source); |
- // Adds a WebUI data source to |profile|'s |ChromeURLDataManager|. |
- static void AddWebUIDataSource(Profile* profile, |
- content::WebUIDataSource* source); |
+ // Adds a WebUI data source to |browser_context|'s |ChromeURLDataManager|. |
+ static void AddWebUIDataSource( |
+ content::BrowserContext* browser_context, |
+ content::WebUIDataSource* source); |
private: |
friend class URLDataSourceImpl; |
@@ -80,10 +83,7 @@ |
// was invoked). |
static bool IsScheduledForDeletion(const URLDataSourceImpl* data_source); |
- // A callback that returns the ChromeURLDataManagerBackend. Only accessible on |
- // the IO thread. This is necessary because ChromeURLDataManager is created on |
- // the UI thread, but ChromeURLDataManagerBackend lives on the IO thread. |
- const base::Callback<ChromeURLDataManagerBackend*(void)> backend_; |
+ content::BrowserContext* browser_context_; |
// |data_sources_| that are no longer referenced and scheduled for deletion. |
// Protected by g_delete_lock in the .cc file. |
@@ -164,4 +164,4 @@ |
scoped_ptr<content::URLDataSource> source_; |
}; |
-#endif // CHROME_BROWSER_UI_WEBUI_CHROME_URL_DATA_MANAGER_H_ |
+#endif // CONTENT_BROWSER_WEBUI_URL_DATA_MANAGER_H_ |