OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/browser/loader_delegate_impl.h" |
| 6 |
| 7 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 8 #include "content/public/browser/browser_thread.h" |
| 9 |
| 10 namespace content { |
| 11 |
| 12 LoaderDelegateImpl::~LoaderDelegateImpl() {} |
| 13 |
| 14 void LoaderDelegateImpl::LoadStateChanged( |
| 15 int child_id, |
| 16 int route_id, |
| 17 const GURL& url, |
| 18 const net::LoadStateWithParam& load_state, |
| 19 uint64_t upload_position, |
| 20 uint64_t upload_size) { |
| 21 BrowserThread::PostTask( |
| 22 BrowserThread::UI, FROM_HERE, |
| 23 base::Bind(&LoaderDelegateImpl::NotifyLoadStateChangedOnUI, |
| 24 base::Unretained(this), child_id, route_id, url, load_state, |
| 25 upload_position, upload_size)); |
| 26 } |
| 27 |
| 28 void LoaderDelegateImpl::NotifyLoadStateChangedOnUI( |
| 29 int child_id, |
| 30 int route_id, |
| 31 const GURL& url, |
| 32 const net::LoadStateWithParam& load_state, |
| 33 uint64_t upload_position, |
| 34 uint64_t upload_size) { |
| 35 RenderViewHostImpl* view = RenderViewHostImpl::FromID(child_id, route_id); |
| 36 if (view) |
| 37 view->LoadStateChanged(url, load_state, upload_position, upload_size); |
| 38 } |
| 39 |
| 40 } // namespace content |
OLD | NEW |