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/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/field_trial.h" | |
11 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
12 #include "base/metrics/stats_counters.h" | 11 #include "base/metrics/stats_counters.h" |
13 #include "base/string16.h" | 12 #include "base/string16.h" |
14 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
15 #include "base/string_util.h" | 14 #include "base/string_util.h" |
16 #include "base/sys_info.h" | 15 #include "base/sys_info.h" |
17 #include "base/time.h" | 16 #include "base/time.h" |
18 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
19 #include "content/browser/browser_plugin/browser_plugin_embedder.h" | 18 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
20 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 19 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
(...skipping 2315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2336 void WebContentsImpl::OnSetSelectedColorInColorChooser(int color_chooser_id, | 2335 void WebContentsImpl::OnSetSelectedColorInColorChooser(int color_chooser_id, |
2337 SkColor color) { | 2336 SkColor color) { |
2338 if (color_chooser_ && | 2337 if (color_chooser_ && |
2339 color_chooser_id == color_chooser_->identifier()) | 2338 color_chooser_id == color_chooser_->identifier()) |
2340 color_chooser_->SetSelectedColor(color); | 2339 color_chooser_->SetSelectedColor(color); |
2341 } | 2340 } |
2342 | 2341 |
2343 void WebContentsImpl::OnPepperPluginHung(int plugin_child_id, | 2342 void WebContentsImpl::OnPepperPluginHung(int plugin_child_id, |
2344 const FilePath& path, | 2343 const FilePath& path, |
2345 bool is_hung) { | 2344 bool is_hung) { |
2346 UMA_HISTOGRAM_COUNTS("Pepper.PluginHung", 1); | |
2347 | |
2348 // Determine how often hangs happen when using worker pool versus | |
2349 // FILE thread. kFieldTrialName needs to match the value in | |
2350 // pepper_file_message_filter.cc, but plumbing that through would be | |
2351 // disruptive for temporary code. | |
2352 // TODO(shess): Remove once the workpool is proven superior. | |
2353 // http://crbug.com/153383 | |
2354 static const char* const kFieldTrialName = "FlapperIOThread"; | |
2355 static const bool hung_trial_exists = | |
2356 base::FieldTrialList::TrialExists(kFieldTrialName); | |
2357 if (hung_trial_exists) { | |
2358 UMA_HISTOGRAM_COUNTS(base::FieldTrial::MakeName("Pepper.PluginHung", | |
2359 kFieldTrialName), 1); | |
2360 } | |
2361 | |
2362 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2345 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
2363 PluginHungStatusChanged(plugin_child_id, path, is_hung)); | 2346 PluginHungStatusChanged(plugin_child_id, path, is_hung)); |
2364 } | 2347 } |
2365 | 2348 |
2366 // This exists for render views that don't have a WebUI, but do have WebUI | 2349 // This exists for render views that don't have a WebUI, but do have WebUI |
2367 // bindings enabled. | 2350 // bindings enabled. |
2368 void WebContentsImpl::OnWebUISend(const GURL& source_url, | 2351 void WebContentsImpl::OnWebUISend(const GURL& source_url, |
2369 const std::string& name, | 2352 const std::string& name, |
2370 const base::ListValue& args) { | 2353 const base::ListValue& args) { |
2371 if (delegate_) | 2354 if (delegate_) |
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3415 } | 3398 } |
3416 } | 3399 } |
3417 | 3400 |
3418 content::BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { | 3401 content::BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { |
3419 return browser_plugin_guest_.get(); | 3402 return browser_plugin_guest_.get(); |
3420 } | 3403 } |
3421 | 3404 |
3422 content::BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { | 3405 content::BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { |
3423 return browser_plugin_embedder_.get(); | 3406 return browser_plugin_embedder_.get(); |
3424 } | 3407 } |
OLD | NEW |