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

Unified Diff: shell/application_manager/local_fetcher.cc

Issue 1327033004: Allow building mojo_shell and non-graphical apps/services on a Mac (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 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 ce753853dc976a82efe4f24d7a30eb9024822314..cc2989dbf05479a7794389893e2d637e2fc3564a 100644
--- a/shell/application_manager/local_fetcher.cc
+++ b/shell/application_manager/local_fetcher.cc
@@ -59,8 +59,13 @@ mojo::URLResponsePtr LocalFetcher::AsURLResponse(base::TaskRunner* task_runner,
response->url = mojo::String::From(url_);
mojo::DataPipe data_pipe;
response->body = data_pipe.consumer_handle.Pass();
+#if defined(OS_MACOSX)
viettrungluu 2015/09/10 18:11:09 You should include build/build_config.h.
+ struct stat stat_result;
+ if (stat(path_.value().c_str(), &stat_result) == 0) {
+#else
base::stat_wrapper_t stat_result;
viettrungluu 2015/09/10 18:11:09 Probably we should just use "struct stat64" here,
if (stat64(path_.value().c_str(), &stat_result) == 0) {
+#endif
auto content_length_header = mojo::HttpHeader::New();
content_length_header->name = "Content-Length";
content_length_header->value =
@@ -69,8 +74,9 @@ mojo::URLResponsePtr LocalFetcher::AsURLResponse(base::TaskRunner* task_runner,
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));
+ "\"%" PRId64 "-%" PRId64 "-%" PRId64 "\"",
+ static_cast<uint64_t>(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,

Powered by Google App Engine
This is Rietveld 408576698