| 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 2536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2547 if (child_process_launcher_) { | 2547 if (child_process_launcher_) { |
| 2548 DCHECK(child_process_launcher_->GetProcess().IsValid()); | 2548 DCHECK(child_process_launcher_->GetProcess().IsValid()); |
| 2549 DCHECK(!is_process_backgrounded_); | 2549 DCHECK(!is_process_backgrounded_); |
| 2550 | 2550 |
| 2551 // Not all platforms launch processes in the same backgrounded state. Make | 2551 // Not all platforms launch processes in the same backgrounded state. Make |
| 2552 // sure |is_process_backgrounded_| reflects this platform's initial process | 2552 // sure |is_process_backgrounded_| reflects this platform's initial process |
| 2553 // state. | 2553 // state. |
| 2554 is_process_backgrounded_ = | 2554 is_process_backgrounded_ = |
| 2555 child_process_launcher_->GetProcess().IsProcessBackgrounded(); | 2555 child_process_launcher_->GetProcess().IsProcessBackgrounded(); |
| 2556 | 2556 |
| 2557 #if defined(OS_WIN) | 2557 // Disable updating process priority on startup for now as it incorrectly |
| 2558 // Experiment with not setting the initial priority of a renderer, as this | 2558 // results in backgrounding foreground navigations until their first commit |
| 2559 // might be a visible tab but since no widgets are currently present, it | 2559 // is made. A better long term solution would be to be aware of the tab's |
| 2560 // will get backgrounded. See https://crbug.com/560446. | 2560 // visibility at this point. https://crbug.com/560446. |
| 2561 if (base::FeatureList::IsEnabled( | 2561 // Except on Android for now because of https://crbug.com/601184 :-(. |
| 2562 features::kUpdateRendererPriorityOnStartup)) { | 2562 #if defined(OS_ANDROID) |
| 2563 UpdateProcessPriority(); | |
| 2564 } | |
| 2565 #else | |
| 2566 UpdateProcessPriority(); | 2563 UpdateProcessPriority(); |
| 2567 #endif | 2564 #endif |
| 2568 } | 2565 } |
| 2569 | 2566 |
| 2570 // NOTE: This needs to be before sending queued messages because | 2567 // NOTE: This needs to be before sending queued messages because |
| 2571 // ExtensionService uses this notification to initialize the renderer process | 2568 // ExtensionService uses this notification to initialize the renderer process |
| 2572 // with state that must be there before any JavaScript executes. | 2569 // with state that must be there before any JavaScript executes. |
| 2573 // | 2570 // |
| 2574 // The queued messages contain such things as "navigate". If this notification | 2571 // The queued messages contain such things as "navigate". If this notification |
| 2575 // was after, we can end up executing JavaScript before the initialization | 2572 // was after, we can end up executing JavaScript before the initialization |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2791 | 2788 |
| 2792 // Skip widgets in other processes. | 2789 // Skip widgets in other processes. |
| 2793 if (rvh->GetProcess()->GetID() != GetID()) | 2790 if (rvh->GetProcess()->GetID() != GetID()) |
| 2794 continue; | 2791 continue; |
| 2795 | 2792 |
| 2796 rvh->OnWebkitPreferencesChanged(); | 2793 rvh->OnWebkitPreferencesChanged(); |
| 2797 } | 2794 } |
| 2798 } | 2795 } |
| 2799 | 2796 |
| 2800 } // namespace content | 2797 } // namespace content |
| OLD | NEW |