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 "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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 BrowserThread::IO, FROM_HERE, base::Bind(callback, true)); | 42 BrowserThread::IO, FROM_HERE, base::Bind(callback, true)); |
43 } else { | 43 } else { |
44 RenderViewHost* render_view_host = | 44 RenderViewHost* render_view_host = |
45 RenderViewHost::FromID(render_process_id, render_view_id); | 45 RenderViewHost::FromID(render_process_id, render_view_id); |
46 WebContents* web_contents = render_view_host ? | 46 WebContents* web_contents = render_view_host ? |
47 render_view_host->delegate()->GetAsWebContents() : NULL; | 47 render_view_host->delegate()->GetAsWebContents() : NULL; |
48 // There is a chance that the tab closed after we decided to show | 48 // There is a chance that the tab closed after we decided to show |
49 // the offline page on the IO thread and before we actually show the | 49 // the offline page on the IO thread and before we actually show the |
50 // offline page here on the UI thread. | 50 // offline page here on the UI thread. |
51 if (web_contents) | 51 if (web_contents) |
52 (new chromeos::OfflineLoadPage(web_contents, url, callback))->Show(); | 52 new chromeos::OfflineLoadPage(web_contents, url, callback); |
53 } | 53 } |
54 } | 54 } |
55 | 55 |
56 } // namespace | 56 } // namespace |
57 | 57 |
58 OfflineResourceHandler::OfflineResourceHandler( | 58 OfflineResourceHandler::OfflineResourceHandler( |
59 ResourceHandler* handler, | 59 ResourceHandler* handler, |
60 int host_id, | 60 int host_id, |
61 int route_id, | 61 int route_id, |
62 ResourceDispatcherHost* rdh, | 62 ResourceDispatcherHost* rdh, |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 const GURL url = deferred_url_; | 216 const GURL url = deferred_url_; |
217 int request_id = deferred_request_id_; | 217 int request_id = deferred_request_id_; |
218 ClearRequestInfo(); | 218 ClearRequestInfo(); |
219 | 219 |
220 bool defer = false; | 220 bool defer = false; |
221 DVLOG(1) << "Resume load: this=" << this << ", request id=" << request_id; | 221 DVLOG(1) << "Resume load: this=" << this << ", request id=" << request_id; |
222 next_handler_->OnWillStart(request_id, url, &defer); | 222 next_handler_->OnWillStart(request_id, url, &defer); |
223 if (!defer) | 223 if (!defer) |
224 rdh_->StartDeferredRequest(process_host_id_, request_id); | 224 rdh_->StartDeferredRequest(process_host_id_, request_id); |
225 } | 225 } |
OLD | NEW |