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 const GlobalRoutingID& routing_id, |
| 16 const GURL& url, |
| 17 const net::LoadStateWithParam& load_state, |
| 18 uint64_t upload_position, |
| 19 uint64_t upload_size) { |
| 20 BrowserThread::PostTask( |
| 21 BrowserThread::UI, FROM_HERE, |
| 22 base::Bind(&LoaderDelegateImpl::NotifyLoadStateChangedOnUI, |
| 23 base::Unretained(this), routing_id, url, load_state, |
| 24 upload_position, upload_size)); |
| 25 } |
| 26 |
| 27 void LoaderDelegateImpl::NotifyLoadStateChangedOnUI( |
| 28 const GlobalRoutingID& routing_id, |
| 29 const GURL& url, |
| 30 const net::LoadStateWithParam& load_state, |
| 31 uint64_t upload_position, |
| 32 uint64_t upload_size) { |
| 33 RenderViewHostImpl* view = |
| 34 RenderViewHostImpl::FromID(routing_id.child_id, routing_id.route_id); |
| 35 if (view) |
| 36 view->LoadStateChanged(url, load_state, upload_position, upload_size); |
| 37 } |
| 38 |
| 39 } // namespace content |
| 40 |
OLD | NEW |