Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 1306423004: [NetInfo] Browser changes to support connection.downlinkMax (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clean up Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "content/browser/renderer_host/render_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 487
488 // Certain GPU features might have been blacklisted. 488 // Certain GPU features might have been blacklisted.
489 GpuDataManagerImpl::GetInstance()->UpdateRendererWebPrefs(&prefs); 489 GpuDataManagerImpl::GetInstance()->UpdateRendererWebPrefs(&prefs);
490 490
491 if (ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( 491 if (ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings(
492 GetProcess()->GetID())) { 492 GetProcess()->GetID())) {
493 prefs.loads_images_automatically = true; 493 prefs.loads_images_automatically = true;
494 prefs.javascript_enabled = true; 494 prefs.javascript_enabled = true;
495 } 495 }
496 496
497 prefs.connection_type = net::NetworkChangeNotifier::GetConnectionType(); 497 prefs.net_info_connection_type =
498 prefs.is_online = 498 net::NetworkChangeNotifier::GetConnectionType();
499 prefs.connection_type != net::NetworkChangeNotifier::CONNECTION_NONE; 499 prefs.net_info_max_bandwidth_mbps =
500 net::NetworkChangeNotifier::GetMaxBandwidth();
pauljensen 2015/09/11 14:25:37 This looks racy. Connection type could have chang
jkarlin 2015/09/11 20:15:21 Ugh, I forgot NCN was thread safe. Okay, changed G
501 prefs.is_online = prefs.net_info_connection_type !=
502 net::NetworkChangeNotifier::CONNECTION_NONE;
500 503
501 prefs.number_of_cpu_cores = base::SysInfo::NumberOfProcessors(); 504 prefs.number_of_cpu_cores = base::SysInfo::NumberOfProcessors();
502 505
503 prefs.viewport_enabled = 506 prefs.viewport_enabled =
504 command_line.HasSwitch(switches::kEnableViewport) || 507 command_line.HasSwitch(switches::kEnableViewport) ||
505 prefs.viewport_meta_enabled; 508 prefs.viewport_meta_enabled;
506 509
507 prefs.main_frame_resizes_are_orientation_changes = 510 prefs.main_frame_resizes_are_orientation_changes =
508 command_line.HasSwitch(switches::kMainFrameResizesAreOrientationChanges); 511 command_line.HasSwitch(switches::kMainFrameResizesAreOrientationChanges);
509 512
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
1430 if (!policy->CanReadFile(GetProcess()->GetID(), file)) 1433 if (!policy->CanReadFile(GetProcess()->GetID(), file))
1431 policy->GrantReadFile(GetProcess()->GetID(), file); 1434 policy->GrantReadFile(GetProcess()->GetID(), file);
1432 } 1435 }
1433 } 1436 }
1434 1437
1435 void RenderViewHostImpl::SelectWordAroundCaret() { 1438 void RenderViewHostImpl::SelectWordAroundCaret() {
1436 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); 1439 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID()));
1437 } 1440 }
1438 1441
1439 } // namespace content 1442 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698