| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/offline_resource_handler.h" | 5 #include "chrome/browser/renderer_host/offline_resource_handler.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 11 #include "base/singleton.h" | 11 #include "base/singleton.h" |
| 12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "chrome/browser/browser_thread.h" | 13 #include "chrome/browser/browser_thread.h" |
| 14 #include "chrome/browser/chromeos/network_state_notifier.h" | 14 #include "chrome/browser/chromeos/network_state_notifier.h" |
| 15 #include "chrome/browser/chromeos/offline/offline_load_page.h" | 15 #include "chrome/browser/chromeos/offline/offline_load_page.h" |
| 16 #include "chrome/browser/chromeos/offline/offline_load_service.h" | 16 #include "chrome/browser/chromeos/offline/offline_load_service.h" |
| 17 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 17 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
| 18 #include "chrome/browser/renderer_host/resource_dispatcher_host_request_info.h" | 18 #include "chrome/browser/renderer_host/resource_dispatcher_host_request_info.h" |
| 19 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
| 20 | 20 |
| 21 OfflineResourceHandler::OfflineResourceHandler( | 21 OfflineResourceHandler::OfflineResourceHandler( |
| 22 ResourceHandler* handler, | 22 ResourceHandler* handler, |
| 23 int host_id, | 23 int host_id, |
| 24 int route_id, | 24 int route_id, |
| 25 ResourceDispatcherHost* rdh, | 25 ResourceDispatcherHost* rdh, |
| 26 URLRequest* request) | 26 net::URLRequest* request) |
| 27 : next_handler_(handler), | 27 : next_handler_(handler), |
| 28 process_host_id_(host_id), | 28 process_host_id_(host_id), |
| 29 render_view_id_(route_id), | 29 render_view_id_(route_id), |
| 30 rdh_(rdh), | 30 rdh_(rdh), |
| 31 request_(request), | 31 request_(request), |
| 32 deferred_request_id_(-1) { | 32 deferred_request_id_(-1) { |
| 33 } | 33 } |
| 34 | 34 |
| 35 bool OfflineResourceHandler::OnUploadProgress(int request_id, | 35 bool OfflineResourceHandler::OnUploadProgress(int request_id, |
| 36 uint64 position, | 36 uint64 position, |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 DVLOG(1) << "Resume load: this=" << this << ", request id=" << request_id; | 151 DVLOG(1) << "Resume load: this=" << this << ", request id=" << request_id; |
| 152 next_handler_->OnWillStart(request_id, url, &defer); | 152 next_handler_->OnWillStart(request_id, url, &defer); |
| 153 if (!defer) | 153 if (!defer) |
| 154 rdh_->StartDeferredRequest(process_host_id_, request_id); | 154 rdh_->StartDeferredRequest(process_host_id_, request_id); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void OfflineResourceHandler::ShowOfflinePage() { | 157 void OfflineResourceHandler::ShowOfflinePage() { |
| 158 chromeos::OfflineLoadPage::Show( | 158 chromeos::OfflineLoadPage::Show( |
| 159 process_host_id_, render_view_id_, deferred_url_, this); | 159 process_host_id_, render_view_id_, deferred_url_, this); |
| 160 } | 160 } |
| OLD | NEW |