| 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 #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> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/debug/dump_without_crashing.h" | |
| 15 #include "base/feature_list.h" | 14 #include "base/feature_list.h" |
| 16 #include "base/i18n/rtl.h" | 15 #include "base/i18n/rtl.h" |
| 17 #include "base/json/json_reader.h" | 16 #include "base/json/json_reader.h" |
| 18 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
| 19 #include "base/metrics/field_trial.h" | 18 #include "base/metrics/field_trial.h" |
| 20 #include "base/metrics/histogram_macros.h" | 19 #include "base/metrics/histogram_macros.h" |
| 21 #include "base/metrics/user_metrics.h" | 20 #include "base/metrics/user_metrics.h" |
| 22 #include "base/stl_util.h" | 21 #include "base/stl_util.h" |
| 23 #include "base/strings/string_number_conversions.h" | 22 #include "base/strings/string_number_conversions.h" |
| 24 #include "base/strings/string_util.h" | 23 #include "base/strings/string_util.h" |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 // initialized it) or may not (we have our own process or the old process | 270 // initialized it) or may not (we have our own process or the old process |
| 272 // crashed) have been initialized. Calling Init multiple times will be | 271 // crashed) have been initialized. Calling Init multiple times will be |
| 273 // ignored, so this is safe. | 272 // ignored, so this is safe. |
| 274 if (!GetProcess()->Init()) | 273 if (!GetProcess()->Init()) |
| 275 return false; | 274 return false; |
| 276 DCHECK(GetProcess()->HasConnection()); | 275 DCHECK(GetProcess()->HasConnection()); |
| 277 DCHECK(GetProcess()->GetBrowserContext()); | 276 DCHECK(GetProcess()->GetBrowserContext()); |
| 278 CHECK(main_frame_routing_id_ != MSG_ROUTING_NONE || | 277 CHECK(main_frame_routing_id_ != MSG_ROUTING_NONE || |
| 279 proxy_route_id != MSG_ROUTING_NONE); | 278 proxy_route_id != MSG_ROUTING_NONE); |
| 280 | 279 |
| 281 // We should not set both main_frame_routing_id_ and proxy_route_id. Log | 280 // We should not set both main_frame_routing_id_ and proxy_route_id. |
| 282 // cases that this happens (without crashing) to track down | 281 DCHECK(main_frame_routing_id_ == MSG_ROUTING_NONE || |
| 283 // https://crbug.com/575245. | 282 proxy_route_id == MSG_ROUTING_NONE); |
| 284 // TODO(creis): Remove this once we've found the cause. | |
| 285 if (main_frame_routing_id_ != MSG_ROUTING_NONE && | |
| 286 proxy_route_id != MSG_ROUTING_NONE) | |
| 287 base::debug::DumpWithoutCrashing(); | |
| 288 | 283 |
| 289 GetWidget()->set_renderer_initialized(true); | 284 GetWidget()->set_renderer_initialized(true); |
| 290 | 285 |
| 291 mojom::CreateViewParamsPtr params = mojom::CreateViewParams::New(); | 286 mojom::CreateViewParamsPtr params = mojom::CreateViewParams::New(); |
| 292 params->renderer_preferences = | 287 params->renderer_preferences = |
| 293 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext()); | 288 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext()); |
| 294 GetPlatformSpecificPrefs(¶ms->renderer_preferences); | 289 GetPlatformSpecificPrefs(¶ms->renderer_preferences); |
| 295 params->web_preferences = GetWebkitPreferences(); | 290 params->web_preferences = GetWebkitPreferences(); |
| 296 params->view_id = GetRoutingID(); | 291 params->view_id = GetRoutingID(); |
| 297 params->main_frame_routing_id = main_frame_routing_id_; | 292 params->main_frame_routing_id = main_frame_routing_id_; |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 } | 953 } |
| 959 | 954 |
| 960 void RenderViewHostImpl::ClosePageTimeout() { | 955 void RenderViewHostImpl::ClosePageTimeout() { |
| 961 if (delegate_->ShouldIgnoreUnresponsiveRenderer()) | 956 if (delegate_->ShouldIgnoreUnresponsiveRenderer()) |
| 962 return; | 957 return; |
| 963 | 958 |
| 964 ClosePageIgnoringUnloadEvents(); | 959 ClosePageIgnoringUnloadEvents(); |
| 965 } | 960 } |
| 966 | 961 |
| 967 } // namespace content | 962 } // namespace content |
| OLD | NEW |