| Index: webkit/appcache/view_appcache_internals_job.cc
|
| ===================================================================
|
| --- webkit/appcache/view_appcache_internals_job.cc (revision 106339)
|
| +++ webkit/appcache/view_appcache_internals_job.cc (working copy)
|
| @@ -185,13 +185,16 @@
|
|
|
| std::string FormViewEntryAnchor(const GURL& base_url,
|
| const GURL& manifest_url, const GURL& entry_url,
|
| - int64 response_id) {
|
| + int64 response_id,
|
| + int64 group_id) {
|
| std::string manifest_url_base64;
|
| std::string entry_url_base64;
|
| std::string response_id_string;
|
| + std::string group_id_string;
|
| base::Base64Encode(manifest_url.spec(), &manifest_url_base64);
|
| base::Base64Encode(entry_url.spec(), &entry_url_base64);
|
| response_id_string = base::Int64ToString(response_id);
|
| + group_id_string = base::Int64ToString(group_id);
|
|
|
| std::string query(kViewEntryCommand);
|
| query.push_back('=');
|
| @@ -200,6 +203,8 @@
|
| query.append(entry_url_base64);
|
| query.push_back('|');
|
| query.append(response_id_string);
|
| + query.push_back('|');
|
| + query.append(group_id_string);
|
|
|
| GURL::Replacements replacements;
|
| replacements.SetQuery(query.data(),
|
| @@ -215,6 +220,7 @@
|
| const GURL& base_url,
|
| const GURL& manifest_url,
|
| const AppCacheResourceInfoVector& resource_infos,
|
| + int64 group_id,
|
| std::string* out) {
|
| out->append("<table border='0'>\n");
|
| out->append("<tr>");
|
| @@ -228,7 +234,8 @@
|
| out->append("<tr>");
|
| EmitTableData(FormFlagsString(*iter), false, false, out);
|
| EmitTableData(FormViewEntryAnchor(base_url, manifest_url,
|
| - iter->url, iter->response_id),
|
| + iter->url, iter->response_id,
|
| + group_id),
|
| false, false, out);
|
| EmitTableData(UTF16ToUTF8(FormatBytesUnlocalized(iter->size)),
|
| true, false, out);
|
| @@ -455,7 +462,9 @@
|
| EmitAppCacheInfo(base_url, appcache_service_, &appcache_info_, out);
|
| EmitAppCacheResourceInfoVector(base_url,
|
| manifest_url_,
|
| - resource_infos_, out);
|
| + resource_infos_,
|
| + appcache_info_.group_id,
|
| + out);
|
| }
|
| EmitPageEnd(out);
|
| return true;
|
| @@ -472,6 +481,7 @@
|
| DCHECK_EQ(manifest_url_, manifest_url);
|
| if (group && group->newest_complete_cache()) {
|
| appcache_info_.manifest_url = manifest_url;
|
| + appcache_info_.group_id = group->group_id();
|
| appcache_info_.size = group->newest_complete_cache()->cache_size();
|
| appcache_info_.creation_time = group->creation_time();
|
| appcache_info_.last_update_time =
|
| @@ -497,17 +507,17 @@
|
| ViewEntryJob(
|
| net::URLRequest* request, AppCacheService* service,
|
| const GURL& manifest_url, const GURL& entry_url,
|
| - int64 response_id)
|
| + int64 response_id, int64 group_id)
|
| : BaseInternalsJob(request, service),
|
| manifest_url_(manifest_url), entry_url_(entry_url),
|
| - response_id_(response_id), amount_read_(0),
|
| + response_id_(response_id), group_id_(group_id), amount_read_(0),
|
| ALLOW_THIS_IN_INITIALIZER_LIST(read_callback_(
|
| this, &ViewEntryJob::OnReadComplete)) {}
|
|
|
| virtual void Start() {
|
| DCHECK(request_);
|
| appcache_service_->storage()->LoadResponseInfo(
|
| - manifest_url_, response_id_, this);
|
| + manifest_url_, group_id_, response_id_, this);
|
| }
|
|
|
| // Produces a page containing the response headers and data.
|
| @@ -559,7 +569,7 @@
|
| response_data_ = new net::IOBuffer(amount_to_read);
|
|
|
| reader_.reset(appcache_service_->storage()->CreateResponseReader(
|
| - manifest_url_, response_id_));
|
| + manifest_url_, group_id_, response_id_));
|
| reader_->ReadData(
|
| response_data_, amount_to_read, &read_callback_);
|
| }
|
| @@ -575,6 +585,7 @@
|
| GURL manifest_url_;
|
| GURL entry_url_;
|
| int64 response_id_;
|
| + int64 group_id_;
|
| scoped_refptr<AppCacheResponseInfo> response_info_;
|
| scoped_refptr<net::IOBuffer> response_data_;
|
| int amount_read_;
|
| @@ -603,13 +614,14 @@
|
|
|
| std::vector<std::string> tokens;
|
| int64 response_id;
|
| - if (command == kViewEntryCommand &&
|
| - Tokenize(param, "|", &tokens) == 3u &&
|
| - base::StringToInt64(tokens[2], &response_id)) {
|
| + int64 group_id;
|
| + if (command == kViewEntryCommand && Tokenize(param, "|", &tokens) == 4u &&
|
| + base::StringToInt64(tokens[2], &response_id) &&
|
| + base::StringToInt64(tokens[3], &group_id)) {
|
| return new ViewEntryJob(request, service,
|
| DecodeBase64URL(tokens[0]), // manifest url
|
| DecodeBase64URL(tokens[1]), // entry url
|
| - response_id);
|
| + response_id, group_id);
|
| }
|
|
|
| return new RedirectToMainPageJob(request, service);
|
|
|