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

Unified Diff: chrome/browser/webui/chrome_url_data_manager.h

Issue 6546078: Makes a handful of DataSources not replace the existing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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: chrome/browser/webui/chrome_url_data_manager.h
diff --git a/chrome/browser/webui/chrome_url_data_manager.h b/chrome/browser/webui/chrome_url_data_manager.h
index be4cab04adf9c4a030649170c8758f5f09fe4793..ec77efbd4e1da8460e59456465ba7d7fe1009c87 100644
--- a/chrome/browser/webui/chrome_url_data_manager.h
+++ b/chrome/browser/webui/chrome_url_data_manager.h
@@ -6,8 +6,6 @@
#define CHROME_BROWSER_WEBUI_CHROME_URL_DATA_MANAGER_H_
#pragma once
-#include <map>
-#include <set>
#include <string>
#include "base/ref_counted.h"
@@ -95,6 +93,15 @@ class ChromeURLDataManager {
const std::string& source_name() const { return source_name_; }
+ // Returns true if this DataSource should replace an existing DataSource
+ // with the same name that has already been registered. The default is
+ // true.
+ //
+ // WARNING: this is invoked on the IO thread.
+ //
+ // TODO: nuke this and convert all callers to not replace.
+ virtual bool ShouldReplaceExistingSource() const;
+
static void SetFontAndTextDirection(DictionaryValue* localized_strings);
protected:
@@ -144,9 +151,6 @@ class ChromeURLDataManager {
// destructed in the same thread as they are constructed (the UI thread).
void AddDataSource(DataSource* source);
- // Returns true if a DataSource has been added with the given name.
- bool IsRegistered(const std::string& name);
-
// Deletes any data sources no longer referenced. This is normally invoked
// for you, but can be invoked to force deletion (such as during shutdown).
static void DeleteDataSources();
@@ -165,12 +169,6 @@ class ChromeURLDataManager {
Profile* profile_;
- // Names of the DataSources that have been registered.
- // By caching this rather than accessing ChromeURLDataManagerBackend we avoid
- // a delay between when AddDataSource is invoked and when the IO thread
- // processes it.
- std::set<std::string> registered_source_names_;
-
// Lock used when accessing |data_sources_|.
static base::Lock delete_lock_;

Powered by Google App Engine
This is Rietveld 408576698