diff options
Diffstat (limited to 'chrome/browser/ui')
6 files changed, 17 insertions, 38 deletions
diff --git a/chrome/browser/ui/webui/chrome_url_data_manager.cc b/chrome/browser/ui/webui/chrome_url_data_manager.cc index 43ede09..16f8647 100644 --- a/chrome/browser/ui/webui/chrome_url_data_manager.cc +++ b/chrome/browser/ui/webui/chrome_url_data_manager.cc @@ -8,7 +8,6 @@ #include "base/i18n/rtl.h" #include "base/memory/ref_counted_memory.h" -#include "base/memory/scoped_ptr.h" #include "base/message_loop.h" #include "base/string_util.h" #include "base/synchronization/lock.h" @@ -32,15 +31,16 @@ ChromeURLDataManager::DataSources* ChromeURLDataManager::data_sources_ = NULL; // Invoked on the IO thread to do the actual adding of the DataSource. static void AddDataSourceOnIOThread( - const base::Callback<ChromeURLDataManagerBackend*(void)>& backend, + scoped_refptr<net::URLRequestContextGetter> context_getter, scoped_refptr<ChromeURLDataManager::DataSource> data_source) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - backend.Run()->AddDataSource(data_source.get()); + static_cast<ChromeURLRequestContext*>( + context_getter->GetURLRequestContext())-> + chrome_url_data_manager_backend()->AddDataSource(data_source.get()); } -ChromeURLDataManager::ChromeURLDataManager( - const base::Callback<ChromeURLDataManagerBackend*(void)>& backend) - : backend_(backend) { +ChromeURLDataManager::ChromeURLDataManager(Profile* profile) + : profile_(profile) { } ChromeURLDataManager::~ChromeURLDataManager() { @@ -51,7 +51,7 @@ void ChromeURLDataManager::AddDataSource(DataSource* source) { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, NewRunnableFunction(AddDataSourceOnIOThread, - backend_, + make_scoped_refptr(profile_->GetRequestContext()), make_scoped_refptr(source))); } diff --git a/chrome/browser/ui/webui/chrome_url_data_manager.h b/chrome/browser/ui/webui/chrome_url_data_manager.h index 7cff56a..9bf894b 100644 --- a/chrome/browser/ui/webui/chrome_url_data_manager.h +++ b/chrome/browser/ui/webui/chrome_url_data_manager.h @@ -8,7 +8,6 @@ #include <string> -#include "base/callback.h" #include "base/memory/ref_counted.h" #include "base/task.h" #include "content/browser/browser_thread.h" @@ -141,8 +140,7 @@ class ChromeURLDataManager { ChromeURLDataManagerBackend* backend_; }; - explicit ChromeURLDataManager( - const base::Callback<ChromeURLDataManagerBackend*(void)>& backend); + explicit ChromeURLDataManager(Profile* profile); ~ChromeURLDataManager(); // Adds a DataSource to the collection of data sources. This *must* be invoked @@ -173,10 +171,7 @@ class ChromeURLDataManager { // was invoked). static bool IsScheduledForDeletion(const DataSource* 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_; + Profile* profile_; // Lock used when accessing |data_sources_|. static base::Lock delete_lock_; diff --git a/chrome/browser/ui/webui/chrome_url_data_manager_backend.cc b/chrome/browser/ui/webui/chrome_url_data_manager_backend.cc index 10a0123..a2344d0 100644 --- a/chrome/browser/ui/webui/chrome_url_data_manager_backend.cc +++ b/chrome/browser/ui/webui/chrome_url_data_manager_backend.cc @@ -19,7 +19,6 @@ #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/url_constants.h" -#include "content/browser/appcache/chrome_appcache_service.h" #include "content/browser/browser_thread.h" #include "googleurl/src/url_util.h" #include "grit/platform_locale_settings.h" @@ -228,10 +227,8 @@ bool IsViewAppCacheInternalsURL(const GURL& url) { class ChromeProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler { public: - ChromeProtocolHandler( - ChromeURLDataManagerBackend* backend, - ChromeAppCacheService* appcache_service, - webkit_blob::BlobStorageController* blob_storage_controller); + ChromeProtocolHandler(ChromeURLDataManagerBackend* backend, + ChromeAppCacheService* appcache_service); ~ChromeProtocolHandler(); virtual net::URLRequestJob* MaybeCreateJob( @@ -241,18 +238,15 @@ class ChromeProtocolHandler // These members are owned by ProfileIOData, which owns this ProtocolHandler. ChromeURLDataManagerBackend* const backend_; ChromeAppCacheService* const appcache_service_; - webkit_blob::BlobStorageController* const blob_storage_controller_; DISALLOW_COPY_AND_ASSIGN(ChromeProtocolHandler); }; ChromeProtocolHandler::ChromeProtocolHandler( ChromeURLDataManagerBackend* backend, - ChromeAppCacheService* appcache_service, - webkit_blob::BlobStorageController* blob_storage_controller) + ChromeAppCacheService* appcache_service) : backend_(backend), - appcache_service_(appcache_service), - blob_storage_controller_(blob_storage_controller) {} + appcache_service_(appcache_service) {} ChromeProtocolHandler::~ChromeProtocolHandler() {} @@ -271,8 +265,7 @@ net::URLRequestJob* ChromeProtocolHandler::MaybeCreateJob( // Next check for chrome://blob-internals/, which uses its own job type. if (ViewBlobInternalsJobFactory::IsSupportedURL(request->url())) - return ViewBlobInternalsJobFactory::CreateJobForRequest( - request, blob_storage_controller_); + return ViewBlobInternalsJobFactory::CreateJobForRequest(request); // Fall back to using a custom handler return new URLRequestChromeJob(request, backend_); @@ -297,13 +290,10 @@ ChromeURLDataManagerBackend::~ChromeURLDataManagerBackend() { net::URLRequestJobFactory::ProtocolHandler* ChromeURLDataManagerBackend::CreateProtocolHandler( ChromeURLDataManagerBackend* backend, - ChromeAppCacheService* appcache_service, - webkit_blob::BlobStorageController* blob_storage_controller) { + ChromeAppCacheService* appcache_service) { DCHECK(appcache_service); - DCHECK(blob_storage_controller); DCHECK(backend); - return new ChromeProtocolHandler( - backend, appcache_service, blob_storage_controller); + return new ChromeProtocolHandler(backend, appcache_service); } void ChromeURLDataManagerBackend::AddDataSource( diff --git a/chrome/browser/ui/webui/chrome_url_data_manager_backend.h b/chrome/browser/ui/webui/chrome_url_data_manager_backend.h index 1f8cd74..55ef74a 100644 --- a/chrome/browser/ui/webui/chrome_url_data_manager_backend.h +++ b/chrome/browser/ui/webui/chrome_url_data_manager_backend.h @@ -27,9 +27,6 @@ namespace net { class URLRequest; class URLRequestJob; } -namespace webkit_blob { -class BlobStorageController; -} // ChromeURLDataManagerBackend is used internally by ChromeURLDataManager on the // IO thread. In most cases you can use the API in ChromeURLDataManager and @@ -45,8 +42,7 @@ class ChromeURLDataManagerBackend { // Invoked to create the protocol handler for chrome://. static net::URLRequestJobFactory::ProtocolHandler* CreateProtocolHandler( ChromeURLDataManagerBackend* backend, - ChromeAppCacheService* appcache_service, - webkit_blob::BlobStorageController* blob_storage_controller); + ChromeAppCacheService* appcache_service); // Adds a DataSource to the collection of data sources. void AddDataSource(ChromeURLDataManager::DataSource* source); diff --git a/chrome/browser/ui/webui/devtools_ui.cc b/chrome/browser/ui/webui/devtools_ui.cc index afe8e32..3999c5e 100644 --- a/chrome/browser/ui/webui/devtools_ui.cc +++ b/chrome/browser/ui/webui/devtools_ui.cc @@ -4,7 +4,6 @@ #include "chrome/browser/ui/webui/devtools_ui.h" -#include "base/memory/scoped_ptr.h" #include "base/string_util.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/profiles/profile.h" diff --git a/chrome/browser/ui/webui/options/cookies_view_handler.cc b/chrome/browser/ui/webui/options/cookies_view_handler.cc index b2c1c7c..2f3b7d3 100644 --- a/chrome/browser/ui/webui/options/cookies_view_handler.cc +++ b/chrome/browser/ui/webui/options/cookies_view_handler.cc @@ -14,7 +14,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/cookies_tree_model_util.h" #include "grit/generated_resources.h" -#include "net/url_request/url_request_context_getter.h" #include "ui/base/l10n/l10n_util.h" CookiesViewHandler::CookiesViewHandler() : batch_update_(false) { |