| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/net/view_http_cache_job_factory.h" | 5 #include "content/browser/net/view_http_cache_job_factory.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 ViewHttpCacheJob(net::URLRequest* request, | 27 ViewHttpCacheJob(net::URLRequest* request, |
| 28 net::NetworkDelegate* network_delegate) | 28 net::NetworkDelegate* network_delegate) |
| 29 : net::URLRequestJob(request, network_delegate), | 29 : net::URLRequestJob(request, network_delegate), |
| 30 core_(new Core), | 30 core_(new Core), |
| 31 callback_(base::Bind(&ViewHttpCacheJob::OnStartCompleted, | 31 callback_(base::Bind(&ViewHttpCacheJob::OnStartCompleted, |
| 32 base::Unretained(this))), | 32 base::Unretained(this))), |
| 33 weak_factory_(this) { | 33 weak_factory_(this) { |
| 34 } | 34 } |
| 35 | 35 |
| 36 // net::URLRequestJob implementation. | 36 // net::URLRequestJob implementation. |
| 37 virtual void Start() OVERRIDE; | 37 virtual void Start() override; |
| 38 virtual void Kill() OVERRIDE; | 38 virtual void Kill() override; |
| 39 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE{ | 39 virtual bool GetMimeType(std::string* mime_type) const override{ |
| 40 return core_->GetMimeType(mime_type); | 40 return core_->GetMimeType(mime_type); |
| 41 } | 41 } |
| 42 virtual bool GetCharset(std::string* charset) OVERRIDE{ | 42 virtual bool GetCharset(std::string* charset) override{ |
| 43 return core_->GetCharset(charset); | 43 return core_->GetCharset(charset); |
| 44 } | 44 } |
| 45 virtual bool ReadRawData(net::IOBuffer* buf, | 45 virtual bool ReadRawData(net::IOBuffer* buf, |
| 46 int buf_size, int *bytes_read) OVERRIDE{ | 46 int buf_size, int *bytes_read) override{ |
| 47 return core_->ReadRawData(buf, buf_size, bytes_read); | 47 return core_->ReadRawData(buf, buf_size, bytes_read); |
| 48 } | 48 } |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 class Core : public base::RefCounted<Core> { | 51 class Core : public base::RefCounted<Core> { |
| 52 public: | 52 public: |
| 53 Core() | 53 Core() |
| 54 : data_offset_(0), | 54 : data_offset_(0), |
| 55 callback_(base::Bind(&Core::OnIOComplete, this)) { | 55 callback_(base::Bind(&Core::OnIOComplete, this)) { |
| 56 } | 56 } |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 url.host() == kChromeUINetworkViewCacheHost; | 195 url.host() == kChromeUINetworkViewCacheHost; |
| 196 } | 196 } |
| 197 | 197 |
| 198 // Static. | 198 // Static. |
| 199 net::URLRequestJob* ViewHttpCacheJobFactory::CreateJobForRequest( | 199 net::URLRequestJob* ViewHttpCacheJobFactory::CreateJobForRequest( |
| 200 net::URLRequest* request, net::NetworkDelegate* network_delegate) { | 200 net::URLRequest* request, net::NetworkDelegate* network_delegate) { |
| 201 return new ViewHttpCacheJob(request, network_delegate); | 201 return new ViewHttpCacheJob(request, network_delegate); |
| 202 } | 202 } |
| 203 | 203 |
| 204 } // namespace content | 204 } // namespace content |
| OLD | NEW |