Chromium Code Reviews| 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading |
| 6 | 6 |
| 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 971 filter_ = NULL; | 971 filter_ = NULL; |
| 972 return handled; | 972 return handled; |
| 973 } | 973 } |
| 974 | 974 |
| 975 void ResourceDispatcherHostImpl::OnRequestResource( | 975 void ResourceDispatcherHostImpl::OnRequestResource( |
| 976 int routing_id, | 976 int routing_id, |
| 977 int request_id, | 977 int request_id, |
| 978 const ResourceHostMsg_Request& request_data) { | 978 const ResourceHostMsg_Request& request_data) { |
| 979 // When logging time-to-network only care about main frame and non-transfer | 979 // When logging time-to-network only care about main frame and non-transfer |
| 980 // navigations. | 980 // navigations. |
| 981 if (request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME && | 981 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 982 switches::kEnableBrowserSideNavigation) && | |
|
nasko
2015/02/02 18:28:53
nit: Checking the resource type is a very simple c
carlosk
2015/02/03 11:00:04
Done. I wasn't aware it was expensive.
nasko
2015/02/03 23:51:56
It is "expensive" relatively speaking. It is a loo
carlosk
2015/02/04 10:21:32
Acknowledged.
| |
| 983 request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME && | |
| 982 request_data.transferred_request_request_id == -1) { | 984 request_data.transferred_request_request_id == -1) { |
| 983 BrowserThread::PostTask( | 985 BrowserThread::PostTask( |
| 984 BrowserThread::UI, | 986 BrowserThread::UI, |
| 985 FROM_HERE, | 987 FROM_HERE, |
| 986 base::Bind(&LogResourceRequestTimeOnUI, | 988 base::Bind(&LogResourceRequestTimeOnUI, |
| 987 TimeTicks::Now(), | 989 TimeTicks::Now(), |
| 988 filter_->child_id(), | 990 filter_->child_id(), |
| 989 request_data.render_frame_id, | 991 request_data.render_frame_id, |
| 990 request_data.url)); | 992 request_data.url)); |
| 991 } | 993 } |
| (...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2367 | 2369 |
| 2368 // Add a flag to selectively bypass the data reduction proxy if the resource | 2370 // Add a flag to selectively bypass the data reduction proxy if the resource |
| 2369 // type is not an image. | 2371 // type is not an image. |
| 2370 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) | 2372 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) |
| 2371 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; | 2373 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; |
| 2372 | 2374 |
| 2373 return load_flags; | 2375 return load_flags; |
| 2374 } | 2376 } |
| 2375 | 2377 |
| 2376 } // namespace content | 2378 } // namespace content |
| OLD | NEW |