diff options
author | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-21 21:46:31 +0000 |
---|---|---|
committer | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-21 21:46:31 +0000 |
commit | f430b57130adff68db69f340c68b6afe5746edc5 (patch) | |
tree | 3c1e56173a34f7ea652ebe6c450c22ba9ddce0ae /chrome/renderer | |
parent | 8177d9bbcda50fdba18f19f131024a4704c376f8 (diff) | |
download | chromium_src-f430b57130adff68db69f340c68b6afe5746edc5.zip chromium_src-f430b57130adff68db69f340c68b6afe5746edc5.tar.gz chromium_src-f430b57130adff68db69f340c68b6afe5746edc5.tar.bz2 |
Retrofit the pre-existing appache message dispatching with the new WebKit APIs and concrete classes defined in our new appcache library, and get rid of the old files.
There are many files in the CL, mostly to pickup constant values now defined in our new appcache library, and to reflect a terminilogy change (from 'context' to 'host').
TEST=some existing unit tests apply
BUG=none
Review URL: http://codereview.chromium.org/170003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24022 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/render_thread.cc | 12 | ||||
-rw-r--r-- | chrome/renderer/render_thread.h | 6 | ||||
-rw-r--r-- | chrome/renderer/render_view.cc | 3 | ||||
-rw-r--r-- | chrome/renderer/renderer_glue.cc | 4 | ||||
-rw-r--r-- | chrome/renderer/renderer_webkitclient_impl.cc | 10 | ||||
-rw-r--r-- | chrome/renderer/renderer_webkitclient_impl.h | 2 |
6 files changed, 24 insertions, 13 deletions
diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc index ecddc2de2..b160bed 100644 --- a/chrome/renderer/render_thread.cc +++ b/chrome/renderer/render_thread.cc @@ -12,8 +12,7 @@ #include "base/shared_memory.h" #include "base/stats_table.h" #include "base/thread_local.h" -#include "chrome/common/app_cache/app_cache_context_impl.h" -#include "chrome/common/app_cache/app_cache_dispatcher.h" +#include "chrome/common/appcache/appcache_dispatcher.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/db_message_filter.h" #include "chrome/common/render_messages.h" @@ -61,9 +60,6 @@ namespace { static const unsigned int kCacheStatsDelayMS = 2000 /* milliseconds */; static base::LazyInstance<base::ThreadLocalPointer<RenderThread> > lazy_tls( base::LINKER_INITIALIZED); -static WebAppCacheContext* CreateAppCacheContextForRenderer() { - return new AppCacheContextImpl(RenderThread::current()); -} #if defined(OS_POSIX) class SuicideOnChannelErrorFilter : public IPC::ChannelProxy::MessageFilter { @@ -116,8 +112,7 @@ void RenderThread::Init() { user_script_slave_.reset(new UserScriptSlave()); dns_master_.reset(new RenderDnsMaster()); histogram_snapshots_.reset(new RendererHistogramSnapshots()); - app_cache_dispatcher_.reset(new AppCacheDispatcher()); - WebAppCacheContext::SetFactory(CreateAppCacheContextForRenderer); + appcache_dispatcher_.reset(new AppCacheDispatcher(this)); devtools_agent_filter_ = new DevToolsAgentFilter(); AddFilter(devtools_agent_filter_.get()); db_message_filter_ = new DBMessageFilter(); @@ -134,7 +129,6 @@ RenderThread::~RenderThread() { RemoveFilter(devtools_agent_filter_.get()); RemoveFilter(db_message_filter_.get()); db_message_filter_ = NULL; - WebAppCacheContext::SetFactory(NULL); if (webkit_client_.get()) WebKit::shutdown(); @@ -210,7 +204,7 @@ void RenderThread::OnExtensionSetPermissions( void RenderThread::OnControlMessageReceived(const IPC::Message& msg) { // App cache messages are handled by a delegate. - if (app_cache_dispatcher_->OnMessageReceived(msg)) + if (appcache_dispatcher_->OnMessageReceived(msg)) return; IPC_BEGIN_MESSAGE_MAP(RenderThread, msg) diff --git a/chrome/renderer/render_thread.h b/chrome/renderer/render_thread.h index f90a6a9..4df083f 100644 --- a/chrome/renderer/render_thread.h +++ b/chrome/renderer/render_thread.h @@ -95,6 +95,10 @@ class RenderThread : public RenderThreadBase, return user_script_slave_.get(); } + AppCacheDispatcher* appcache_dispatcher() const { + return appcache_dispatcher_.get(); + } + bool plugin_refresh_allowed() const { return plugin_refresh_allowed_; } // Do DNS prefetch resolution of a hostname. @@ -161,7 +165,7 @@ class RenderThread : public RenderThreadBase, scoped_ptr<VisitedLinkSlave> visited_link_slave_; scoped_ptr<UserScriptSlave> user_script_slave_; scoped_ptr<RenderDnsMaster> dns_master_; - scoped_ptr<AppCacheDispatcher> app_cache_dispatcher_; + scoped_ptr<AppCacheDispatcher> appcache_dispatcher_; scoped_refptr<DevToolsAgentFilter> devtools_agent_filter_; scoped_ptr<RendererHistogramSnapshots> histogram_snapshots_; scoped_ptr<RendererWebKitClientImpl> webkit_client_; diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 5bd7c24..23c916b 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -71,6 +71,7 @@ #include "webkit/api/public/WebURLRequest.h" #include "webkit/api/public/WebURLResponse.h" #include "webkit/api/public/WebVector.h" +#include "webkit/appcache/appcache_interfaces.h" #include "webkit/default_plugin/default_plugin_shared.h" #include "webkit/glue/glue_serialize.h" #include "webkit/glue/dom_operations.h" @@ -1983,7 +1984,7 @@ WebKit::WebMediaPlayer* RenderView::CreateWebMediaPlayer( "null", // frame origin "null", // main_frame_origin base::GetCurrentProcId(), - WebAppCacheContext::kNoAppCacheContextId, + appcache::kNoHostId, routing_id()); if (!cmd_line->HasSwitch(switches::kSimpleDataSource)) { diff --git a/chrome/renderer/renderer_glue.cc b/chrome/renderer/renderer_glue.cc index affb348..c42e8a6 100644 --- a/chrome/renderer/renderer_glue.cc +++ b/chrome/renderer/renderer_glue.cc @@ -220,13 +220,13 @@ ResourceLoaderBridge* ResourceLoaderBridge::Create( int load_flags, int origin_pid, ResourceType::Type resource_type, - int app_cache_context_id, + int appcache_host_id, int routing_id) { ResourceDispatcher* dispatch = ChildThread::current()->resource_dispatcher(); return dispatch->CreateBridge(method, url, first_party_for_cookies, referrer, frame_origin, main_frame_origin, headers, load_flags, origin_pid, resource_type, 0, - app_cache_context_id, routing_id); + appcache_host_id, routing_id); } void NotifyCacheStats() { diff --git a/chrome/renderer/renderer_webkitclient_impl.cc b/chrome/renderer/renderer_webkitclient_impl.cc index a9bbc43..4ae32a34 100644 --- a/chrome/renderer/renderer_webkitclient_impl.cc +++ b/chrome/renderer/renderer_webkitclient_impl.cc @@ -7,6 +7,7 @@ #include "base/command_line.h" #include "base/file_path.h" #include "base/platform_file.h" +#include "chrome/common/appcache/appcache_dispatcher.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/db_message_filter.h" #include "chrome/common/render_messages.h" @@ -18,6 +19,7 @@ #include "chrome/renderer/visitedlink_slave.h" #include "webkit/api/public/WebString.h" #include "webkit/api/public/WebURL.h" +#include "webkit/appcache/web_application_cache_host_impl.h" #include "webkit/glue/glue_util.h" #include "webkit/glue/webkit_glue.h" @@ -25,6 +27,8 @@ #include "chrome/renderer/renderer_sandbox_support_linux.h" #endif +using WebKit::WebApplicationCacheHost; +using WebKit::WebApplicationCacheHostClient; using WebKit::WebStorageArea; using WebKit::WebStorageNamespace; using WebKit::WebString; @@ -137,6 +141,12 @@ WebStorageNamespace* RendererWebKitClientImpl::createSessionStorageNamespace() { return new RendererWebStorageNamespaceImpl(false); } +WebApplicationCacheHost* RendererWebKitClientImpl::createApplicationCacheHost( + WebApplicationCacheHostClient* client) { + return new appcache::WebApplicationCacheHostImpl(client, + RenderThread::current()->appcache_dispatcher()->backend_proxy()); +} + //------------------------------------------------------------------------------ WebString RendererWebKitClientImpl::MimeRegistry::mimeTypeForExtension( diff --git a/chrome/renderer/renderer_webkitclient_impl.h b/chrome/renderer/renderer_webkitclient_impl.h index c9bd464..633f3cd 100644 --- a/chrome/renderer/renderer_webkitclient_impl.h +++ b/chrome/renderer/renderer_webkitclient_impl.h @@ -48,6 +48,8 @@ class RendererWebKitClientImpl : public webkit_glue::WebKitClientImpl { virtual bool databaseDeleteFile(const WebKit::WebString& file_name); virtual long databaseGetFileAttributes(const WebKit::WebString& file_name); virtual long long databaseGetFileSize(const WebKit::WebString& file_name); + virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost( + WebKit::WebApplicationCacheHostClient*); private: class MimeRegistry : public webkit_glue::SimpleWebMimeRegistryImpl { |