| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
| 6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
| 7 | 7 |
| 8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 std::string UintVectorToString(const std::vector<unsigned>& vector) { | 439 std::string UintVectorToString(const std::vector<unsigned>& vector) { |
| 440 std::string str; | 440 std::string str; |
| 441 for (auto it : vector) { | 441 for (auto it : vector) { |
| 442 if (!str.empty()) | 442 if (!str.empty()) |
| 443 str += ","; | 443 str += ","; |
| 444 str += base::UintToString(it); | 444 str += base::UintToString(it); |
| 445 } | 445 } |
| 446 return str; | 446 return str; |
| 447 } | 447 } |
| 448 | 448 |
| 449 // Copies kEnableFeatures and kDisableFeatures to the renderer command line. | |
| 450 // Generates them from the FeatureList override state, to take into account | |
| 451 // overrides from FieldTrials. | |
| 452 void CopyEnableDisableFeatureFlagsToRenderer(base::CommandLine* renderer_cmd) { | |
| 453 std::string enabled_features; | |
| 454 std::string disabled_features; | |
| 455 base::FeatureList::GetInstance()->GetFeatureOverrides(&enabled_features, | |
| 456 &disabled_features); | |
| 457 if (!enabled_features.empty()) { | |
| 458 renderer_cmd->AppendSwitchASCII(switches::kEnableFeatures, | |
| 459 enabled_features); | |
| 460 } | |
| 461 if (!disabled_features.empty()) { | |
| 462 renderer_cmd->AppendSwitchASCII(switches::kDisableFeatures, | |
| 463 disabled_features); | |
| 464 } | |
| 465 } | |
| 466 | |
| 467 } // namespace | 449 } // namespace |
| 468 | 450 |
| 469 RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL; | 451 RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL; |
| 470 | 452 |
| 471 base::MessageLoop* g_in_process_thread; | 453 base::MessageLoop* g_in_process_thread; |
| 472 | 454 |
| 473 base::MessageLoop* | 455 base::MessageLoop* |
| 474 RenderProcessHostImpl::GetInProcessRendererThreadForTesting() { | 456 RenderProcessHostImpl::GetInProcessRendererThreadForTesting() { |
| 475 return g_in_process_thread; | 457 return g_in_process_thread; |
| 476 } | 458 } |
| (...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1551 #if defined(USE_OZONE) | 1533 #if defined(USE_OZONE) |
| 1552 switches::kOzonePlatform, | 1534 switches::kOzonePlatform, |
| 1553 #endif | 1535 #endif |
| 1554 #if defined(OS_CHROMEOS) | 1536 #if defined(OS_CHROMEOS) |
| 1555 switches::kDisableVaapiAcceleratedVideoEncode, | 1537 switches::kDisableVaapiAcceleratedVideoEncode, |
| 1556 #endif | 1538 #endif |
| 1557 }; | 1539 }; |
| 1558 renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames, | 1540 renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames, |
| 1559 arraysize(kSwitchNames)); | 1541 arraysize(kSwitchNames)); |
| 1560 | 1542 |
| 1561 CopyEnableDisableFeatureFlagsToRenderer(renderer_cmd); | 1543 ChildProcessHostImpl::CopyEnableDisableFeatureFlags(renderer_cmd); |
| 1562 | 1544 |
| 1563 if (browser_cmd.HasSwitch(switches::kTraceStartup) && | 1545 if (browser_cmd.HasSwitch(switches::kTraceStartup) && |
| 1564 BrowserMainLoop::GetInstance()->is_tracing_startup_for_duration()) { | 1546 BrowserMainLoop::GetInstance()->is_tracing_startup_for_duration()) { |
| 1565 // Pass kTraceStartup switch to renderer only if startup tracing has not | 1547 // Pass kTraceStartup switch to renderer only if startup tracing has not |
| 1566 // finished. | 1548 // finished. |
| 1567 renderer_cmd->AppendSwitchASCII( | 1549 renderer_cmd->AppendSwitchASCII( |
| 1568 switches::kTraceStartup, | 1550 switches::kTraceStartup, |
| 1569 browser_cmd.GetSwitchValueASCII(switches::kTraceStartup)); | 1551 browser_cmd.GetSwitchValueASCII(switches::kTraceStartup)); |
| 1570 } | 1552 } |
| 1571 | 1553 |
| (...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2796 | 2778 |
| 2797 // Skip widgets in other processes. | 2779 // Skip widgets in other processes. |
| 2798 if (rvh->GetProcess()->GetID() != GetID()) | 2780 if (rvh->GetProcess()->GetID() != GetID()) |
| 2799 continue; | 2781 continue; |
| 2800 | 2782 |
| 2801 rvh->OnWebkitPreferencesChanged(); | 2783 rvh->OnWebkitPreferencesChanged(); |
| 2802 } | 2784 } |
| 2803 } | 2785 } |
| 2804 | 2786 |
| 2805 } // namespace content | 2787 } // namespace content |
| OLD | NEW |