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

Unified Diff: native_client_sdk/src/libraries/nacl_io/mount_http.cc

Issue 13488007: [NaCl SDK] Make the SDK examples buildable as a packaged app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix license headers Created 7 years, 8 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: native_client_sdk/src/libraries/nacl_io/mount_http.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_http.cc b/native_client_sdk/src/libraries/nacl_io/mount_http.cc
index ea3f93f21fbe9103a32fc1fb52b76dc0779da104..c50d9fec4f2c05035e2824f61696616eb291330d 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount_http.cc
+++ b/native_client_sdk/src/libraries/nacl_io/mount_http.cc
@@ -233,11 +233,14 @@ int MountNodeHttp::GetStat(struct stat* stat) {
size_t entity_length;
- if (ParseContentLength(response_headers, &entity_length))
+ if (ParseContentLength(response_headers, &entity_length)) {
SetCachedSize(static_cast<off_t>(entity_length));
- else
+ } else if (cache_content_ && !has_cached_size_) {
+ DownloadToCache();
+ } else {
// Don't use SetCachedSize here -- it is actually unknown.
stat_.st_size = 0;
+ }
stat_.st_atime = 0; // TODO(binji): Use "Last-Modified".
stat_.st_mtime = 0;
« no previous file with comments | « native_client_sdk/src/examples/websocket/websocket.cc ('k') | native_client_sdk/src/libraries/nacl_io/mount_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698