| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/nacl/browser/pnacl_host.h" | 5 #include "components/nacl/browser/pnacl_host.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 render_view_id(0), | 92 render_view_id(0), |
| 93 nexe_fd(NULL), | 93 nexe_fd(NULL), |
| 94 got_nexe_fd(false), | 94 got_nexe_fd(false), |
| 95 got_cache_reply(false), | 95 got_cache_reply(false), |
| 96 got_cache_hit(false), | 96 got_cache_hit(false), |
| 97 is_incognito(false), | 97 is_incognito(false), |
| 98 callback(NexeFdCallback()), | 98 callback(NexeFdCallback()), |
| 99 cache_info(nacl::PnaclCacheInfo()) { | 99 cache_info(nacl::PnaclCacheInfo()) { |
| 100 } | 100 } |
| 101 | 101 |
| 102 PnaclHost::PendingTranslation::PendingTranslation( |
| 103 const PendingTranslation& other) = default; |
| 104 |
| 102 PnaclHost::PendingTranslation::~PendingTranslation() { | 105 PnaclHost::PendingTranslation::~PendingTranslation() { |
| 103 if (nexe_fd) | 106 if (nexe_fd) |
| 104 delete nexe_fd; | 107 delete nexe_fd; |
| 105 } | 108 } |
| 106 | 109 |
| 107 bool PnaclHost::TranslationMayBeCached( | 110 bool PnaclHost::TranslationMayBeCached( |
| 108 const PendingTranslationMap::iterator& entry) { | 111 const PendingTranslationMap::iterator& entry) { |
| 109 return !entry->second.is_incognito && | 112 return !entry->second.is_incognito && |
| 110 !entry->second.cache_info.has_no_store_header; | 113 !entry->second.cache_info.has_no_store_header; |
| 111 } | 114 } |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 DCHECK(pending_backend_operations_ >= 0); | 689 DCHECK(pending_backend_operations_ >= 0); |
| 687 if (pending_translations_.empty() && | 690 if (pending_translations_.empty() && |
| 688 pending_backend_operations_ <= 0 && | 691 pending_backend_operations_ <= 0 && |
| 689 cache_state_ == CacheReady) { | 692 cache_state_ == CacheReady) { |
| 690 cache_state_ = CacheUninitialized; | 693 cache_state_ = CacheUninitialized; |
| 691 disk_cache_.reset(); | 694 disk_cache_.reset(); |
| 692 } | 695 } |
| 693 } | 696 } |
| 694 | 697 |
| 695 } // namespace pnacl | 698 } // namespace pnacl |
| OLD | NEW |