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/renderer/ppb_nacl_private_impl.h" | 5 #include "components/nacl/renderer/ppb_nacl_private_impl.h" |
6 | 6 |
7 #include <numeric> | 7 #include <numeric> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1612 HistogramEnumerate("NaCl.Perf.PNaClCache.IsHit", cache_hit, 2); | 1612 HistogramEnumerate("NaCl.Perf.PNaClCache.IsHit", cache_hit, 2); |
1613 if (cache_hit) { | 1613 if (cache_hit) { |
1614 stream_handler_->DidCacheHit(stream_handler_user_data_, file_handle); | 1614 stream_handler_->DidCacheHit(stream_handler_user_data_, file_handle); |
1615 | 1615 |
1616 // We delete the PexeDownloader at this point since we successfully got a | 1616 // We delete the PexeDownloader at this point since we successfully got a |
1617 // cached, translated nexe. | 1617 // cached, translated nexe. |
1618 delete this; | 1618 delete this; |
1619 return; | 1619 return; |
1620 } | 1620 } |
1621 stream_handler_->DidCacheMiss(stream_handler_user_data_, | 1621 stream_handler_->DidCacheMiss(stream_handler_user_data_, |
1622 expected_content_length_); | 1622 expected_content_length_, |
| 1623 file_handle); |
1623 | 1624 |
1624 // No translated nexe was found in the cache, so we should download the | 1625 // No translated nexe was found in the cache, so we should download the |
1625 // file to start streaming it. | 1626 // file to start streaming it. |
1626 url_loader_->setDefersLoading(false); | 1627 url_loader_->setDefersLoading(false); |
1627 } | 1628 } |
1628 | 1629 |
1629 virtual void didReceiveData(blink::WebURLLoader* loader, | 1630 virtual void didReceiveData(blink::WebURLLoader* loader, |
1630 const char* data, | 1631 const char* data, |
1631 int data_length, | 1632 int data_length, |
1632 int encoded_data_length) { | 1633 int encoded_data_length) { |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1744 &StreamPexe | 1745 &StreamPexe |
1745 }; | 1746 }; |
1746 | 1747 |
1747 } // namespace | 1748 } // namespace |
1748 | 1749 |
1749 const PPB_NaCl_Private* GetNaClPrivateInterface() { | 1750 const PPB_NaCl_Private* GetNaClPrivateInterface() { |
1750 return &nacl_interface; | 1751 return &nacl_interface; |
1751 } | 1752 } |
1752 | 1753 |
1753 } // namespace nacl | 1754 } // namespace nacl |
OLD | NEW |