summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common')
-rw-r--r--[-rwxr-xr-x]chrome/common/render_messages.h7
-rw-r--r--chrome/common/render_messages_internal.h18
-rw-r--r--chrome/common/resource_dispatcher.cc9
-rw-r--r--chrome/common/resource_dispatcher.h1
4 files changed, 31 insertions, 4 deletions
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index 462d853..048a0a6 100755..100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -377,6 +377,9 @@ struct ParamTraits<ResourceType::Type> {
case ResourceType::OBJECT:
type = L"OBJECT";
break;
+ case ResourceType::MEDIA:
+ type = L"MEDIA";
+ break;
default:
type = L"UNKNOWN";
break;
@@ -1334,6 +1337,7 @@ struct ParamTraits<ResourceResponseHead> {
ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Write(m, p);
WriteParam(m, p.status);
WriteParam(m, p.filter_policy);
+ WriteParam(m, p.response_data_file);
}
static bool Read(const Message* m, void** iter, param_type* r) {
return
@@ -1341,7 +1345,8 @@ struct ParamTraits<ResourceResponseHead> {
iter,
r) &&
ReadParam(m, iter, &r->status) &&
- ReadParam(m, iter, &r->filter_policy);
+ ReadParam(m, iter, &r->filter_policy) &&
+ ReadParam(m, iter, &r->response_data_file);
}
static void Log(const param_type& p, std::wstring* l) {
// log more?
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index 6416a4b..5ebe6e9 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -168,7 +168,14 @@ IPC_BEGIN_MESSAGES(View)
int /* request_id */,
ResourceResponseHead)
- // Sent as upload progress is being made
+ // Sent as download progress is being made, size of the resource may be
+ // unknown, in that case |size| is -1.
+ IPC_MESSAGE_ROUTED3(ViewMsg_Resource_DownloadProgress,
+ int /* request_id */,
+ int64 /* position */,
+ int64 /* size */)
+
+ // Sent as upload progress is being made.
IPC_MESSAGE_ROUTED3(ViewMsg_Resource_UploadProgress,
int /* request_id */,
int64 /* position */,
@@ -1104,8 +1111,13 @@ IPC_BEGIN_MESSAGES(ViewHost)
GURL /* last url */,
GURL /* url redirected to */)
- // Sent when the renderer process to acknowlege receipt of and UploadProgress
- // message.
+ // Sent by the renderer process to acknowledge receipt of a
+ // DownloadProgress message.
+ IPC_MESSAGE_ROUTED1(ViewHostMsg_DownloadProgress_ACK,
+ int /* request_id */)
+
+ // Sent by the renderer process to acknowledge receipt of a
+ // UploadProgress message.
IPC_MESSAGE_ROUTED1(ViewHostMsg_UploadProgress_ACK,
int /* request_id */)
diff --git a/chrome/common/resource_dispatcher.cc b/chrome/common/resource_dispatcher.cc
index 61c5013..32f15b1 100644
--- a/chrome/common/resource_dispatcher.cc
+++ b/chrome/common/resource_dispatcher.cc
@@ -275,6 +275,13 @@ bool ResourceDispatcher::OnMessageReceived(const IPC::Message& message) {
return true;
}
+void ResourceDispatcher::OnDownloadProgress(
+ int request_id, int64 position, int64 size) {
+ // TODO(hclam): delegate this message to
+ // ResourceLoaderBridge::Peer::OnDownloadProgress and send an ACK message
+ // back to ResourceDispatcherHost.
+}
+
void ResourceDispatcher::OnUploadProgress(
const IPC::Message& message, int request_id, int64 position, int64 size) {
PendingRequestList::iterator it = pending_requests_.find(request_id);
@@ -453,6 +460,7 @@ void ResourceDispatcher::SetDefersLoading(int request_id, bool value) {
void ResourceDispatcher::DispatchMessage(const IPC::Message& message) {
IPC_BEGIN_MESSAGE_MAP(ResourceDispatcher, message)
IPC_MESSAGE_HANDLER(ViewMsg_Resource_UploadProgress, OnUploadProgress)
+ IPC_MESSAGE_HANDLER(ViewMsg_Resource_DownloadProgress, OnDownloadProgress)
IPC_MESSAGE_HANDLER(ViewMsg_Resource_ReceivedResponse, OnReceivedResponse)
IPC_MESSAGE_HANDLER(ViewMsg_Resource_ReceivedRedirect, OnReceivedRedirect)
IPC_MESSAGE_HANDLER(ViewMsg_Resource_DataReceived, OnReceivedData)
@@ -502,6 +510,7 @@ webkit_glue::ResourceLoaderBridge* ResourceDispatcher::CreateBridge(
bool ResourceDispatcher::IsResourceMessage(const IPC::Message& message) const {
switch (message.type()) {
+ case ViewMsg_Resource_DownloadProgress::ID:
case ViewMsg_Resource_UploadProgress::ID:
case ViewMsg_Resource_ReceivedResponse::ID:
case ViewMsg_Resource_ReceivedRedirect::ID:
diff --git a/chrome/common/resource_dispatcher.h b/chrome/common/resource_dispatcher.h
index 3cdf1ee..04db7a1 100644
--- a/chrome/common/resource_dispatcher.h
+++ b/chrome/common/resource_dispatcher.h
@@ -98,6 +98,7 @@ class ResourceDispatcher {
int request_id,
int64 position,
int64 size);
+ void OnDownloadProgress(int request_id, int64 position, int64 size);
void OnReceivedResponse(int request_id, const ResourceResponseHead&);
void OnReceivedRedirect(int request_id, const GURL& new_url);
void OnReceivedData(const IPC::Message& message,