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

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: review feedback 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
« no previous file with comments | « shell/BUILD.gn ('k') | shell/application_manager/network_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0f3e80fb112f27db106c05168b9850f23d17936a 100644
--- a/shell/application_manager/local_fetcher.cc
+++ b/shell/application_manager/local_fetcher.cc
@@ -14,6 +14,7 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
+#include "build/build_config.h"
#include "mojo/converters/url/url_type_converters.h"
#include "mojo/data_pipe_utils/data_pipe_utils.h"
#include "url/url_util.h"
@@ -60,7 +61,11 @@ mojo::URLResponsePtr LocalFetcher::AsURLResponse(base::TaskRunner* task_runner,
mojo::DataPipe data_pipe;
response->body = data_pipe.consumer_handle.Pass();
base::stat_wrapper_t stat_result;
+#if defined(OS_MACOSX)
+ if (stat(path_.value().c_str(), &stat_result) == 0) {
+#else
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,
« no previous file with comments | « shell/BUILD.gn ('k') | shell/application_manager/network_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698