diff options
author | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-07 17:45:54 +0000 |
---|---|---|
committer | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-07 17:45:54 +0000 |
commit | 1edc16b82bd98eb06188a94e62c668d439035e6e (patch) | |
tree | 3edaea7ad20c2981febbc5e081bb2d499d97e671 /chrome/renderer | |
parent | 7d769c36ccaf6663c49e3c89d959a47b9449f68a (diff) | |
download | chromium_src-1edc16b82bd98eb06188a94e62c668d439035e6e.zip chromium_src-1edc16b82bd98eb06188a94e62c668d439035e6e.tar.gz chromium_src-1edc16b82bd98eb06188a94e62c668d439035e6e.tar.bz2 |
Adds new messages and widens some existing messages between the renderer and browser processes to support an implementation of the HTML5AppCache spec with most of the logic running in the browser process. The gist of most of the changes are to indicate which frame each resource request is coming from, and to indicate which appcache each response was retrieved from (if any).See https://docs.google.com/a/google.com/Doc?docid=agv6ghfsqr_15f749cgt3&hl=en
Review URL: http://codereview.chromium.org/9712
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13258 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/media/data_source_impl.cc | 5 | ||||
-rw-r--r-- | chrome/renderer/render_thread.cc | 17 | ||||
-rw-r--r-- | chrome/renderer/render_thread.h | 3 | ||||
-rw-r--r-- | chrome/renderer/renderer_glue.cc | 4 |
4 files changed, 27 insertions, 2 deletions
diff --git a/chrome/renderer/media/data_source_impl.cc b/chrome/renderer/media/data_source_impl.cc index 9ee3331..20aee22 100644 --- a/chrome/renderer/media/data_source_impl.cc +++ b/chrome/renderer/media/data_source_impl.cc @@ -13,6 +13,7 @@ #include "media/base/pipeline.h" #include "net/base/load_flags.h" #include "net/base/net_errors.h" +#include "webkit/glue/webappcachecontext.h" DataSourceImpl::DataSourceImpl(WebMediaPlayerDelegateImpl* delegate) : delegate_(delegate), @@ -215,6 +216,10 @@ void DataSourceImpl::OnInitialize(std::string uri) { base::GetCurrentProcId(), ResourceType::MEDIA, 0, + // TODO(michaeln): delegate->mediaplayer->frame-> + // app_cache_context()->context_id() + // For now don't service media resource requests from the appcache. + WebAppCacheContext::kNoAppCacheContextId, delegate_->view()->routing_id()); // Start the resource loading. resource_loader_bridge_->Start(this); diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc index 8eb1c21..330c754 100644 --- a/chrome/renderer/render_thread.cc +++ b/chrome/renderer/render_thread.cc @@ -10,6 +10,8 @@ #include "base/command_line.h" #include "base/shared_memory.h" #include "base/stats_table.h" +#include "chrome/common/app_cache/app_cache_context_impl.h" +#include "chrome/common/app_cache/app_cache_dispatcher.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/render_messages.h" #include "chrome/common/notification_service.h" @@ -91,8 +93,13 @@ void RenderThread::SendHistograms() { return histogram_snapshots_->SendHistograms(); } +static WebAppCacheContext* CreateAppCacheContextForRenderer() { + return new AppCacheContextImpl(RenderThread::current()); +} + void RenderThread::Init() { - // TODO(darin): Why do we need COM here? This is probably bogus. + // TODO(darin): Why do we need COM here? This is probably bogus. Perhaps + // this is for InProcessPlugin support? #if defined(OS_WIN) // The renderer thread should wind-up COM. CoInitialize(0); @@ -107,11 +114,15 @@ 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); } void RenderThread::CleanUp() { // Shutdown in reverse of the initialization order. + WebAppCacheContext::SetFactory(NULL); + app_cache_dispatcher_.reset(); histogram_snapshots_.reset(); dns_master_.reset(); user_script_slave_.reset(); @@ -154,6 +165,10 @@ void RenderThread::OnSetExtensionFunctionNames( } void RenderThread::OnControlMessageReceived(const IPC::Message& msg) { + // App cache messages are handled by a delegate. + if (app_cache_dispatcher_->OnMessageReceived(msg)) + return; + IPC_BEGIN_MESSAGE_MAP(RenderThread, msg) IPC_MESSAGE_HANDLER(ViewMsg_VisitedLink_NewTable, OnUpdateVisitedLinks) IPC_MESSAGE_HANDLER(ViewMsg_SetNextPageID, OnSetNextPageID) diff --git a/chrome/renderer/render_thread.h b/chrome/renderer/render_thread.h index 5340b0e..0d5da09 100644 --- a/chrome/renderer/render_thread.h +++ b/chrome/renderer/render_thread.h @@ -14,6 +14,7 @@ #include "chrome/common/child_thread.h" #include "chrome/renderer/renderer_histogram_snapshots.h" +class AppCacheDispatcher; class FilePath; class NotificationService; class RenderDnsMaster; @@ -148,6 +149,8 @@ class RenderThread : public RenderThreadBase, scoped_ptr<RendererWebKitClientImpl> webkit_client_; + scoped_ptr<AppCacheDispatcher> app_cache_dispatcher_; + DISALLOW_COPY_AND_ASSIGN(RenderThread); }; diff --git a/chrome/renderer/renderer_glue.cc b/chrome/renderer/renderer_glue.cc index 09f6676..c907c23 100644 --- a/chrome/renderer/renderer_glue.cc +++ b/chrome/renderer/renderer_glue.cc @@ -232,12 +232,14 @@ ResourceLoaderBridge* ResourceLoaderBridge::Create( int load_flags, int origin_pid, ResourceType::Type resource_type, + int app_cache_context_id, int routing_id) { ResourceDispatcher* dispatch = RenderThread::current()->resource_dispatcher(); return dispatch->CreateBridge(method, url, policy_url, referrer, frame_origin, main_frame_origin, headers, default_mime_type, load_flags, origin_pid, - resource_type, 0, routing_id); + resource_type, 0, + app_cache_context_id, routing_id); } void NotifyCacheStats() { |