Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(640)

Unified Diff: shell/application_manager/local_fetcher.cc

Issue 1157783002: Update to newer network service implementation and mojoms from monet (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: shell/application_manager/local_fetcher.cc
diff --git a/shell/application_manager/local_fetcher.cc b/shell/application_manager/local_fetcher.cc
index 58d2a2dde0e53d57fe40e3723bc8cc7e96493c7d..a975b0f59e8dfb2b17ae7e7f10ee7122ee3db190 100644
--- a/shell/application_manager/local_fetcher.cc
+++ b/shell/application_manager/local_fetcher.cc
@@ -60,12 +60,17 @@ mojo::URLResponsePtr LocalFetcher::AsURLResponse(base::TaskRunner* task_runner,
response->body = data_pipe.consumer_handle.Pass();
base::stat_wrapper_t stat_result;
if (stat64(path_.value().c_str(), &stat_result) == 0) {
- response->headers = mojo::Array<mojo::String>(2);
- response->headers[0] =
- base::StringPrintf("Content-Length: %" PRId64, stat_result.st_size);
- response->headers[1] = base::StringPrintf(
- "ETag: \"%" PRId64 "-%" PRId64 "-%" PRId64 "\"", stat_result.st_dev,
+ auto content_length_header = mojo::HttpHeader::New();
+ content_length_header->name = "Content-Length";
+ content_length_header->value =
+ base::StringPrintf("%" PRId64, stat_result.st_size);
+ response->headers.push_back(content_length_header.Pass());
+ auto etag_header = mojo::HttpHeader::New();
+ etag_header->name = "ETag";
+ etag_header->value = base::StringPrintf(
+ "\"%" PRId64 "-%" PRId64 "-%" PRId64 "\"", stat_result.st_dev,
stat_result.st_ino, static_cast<uint64_t>(stat_result.st_mtime));
+ response->headers.push_back(etag_header.Pass());
}
mojo::common::CopyFromFile(path_, data_pipe.producer_handle.Pass(), skip,
task_runner, base::Bind(&IgnoreResult));
« no previous file with comments | « services/url_response_disk_cache/url_response_disk_cache_impl.cc ('k') | shell/application_manager/network_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698