| 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" |
| 10 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 11 #include "base/metrics/stats_counters.h" | 12 #include "base/metrics/stats_counters.h" |
| 12 #include "base/string16.h" | 13 #include "base/string16.h" |
| 13 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
| 14 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 15 #include "base/sys_info.h" | 16 #include "base/sys_info.h" |
| 16 #include "base/time.h" | 17 #include "base/time.h" |
| 17 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
| 18 #include "content/browser/browser_plugin/browser_plugin_embedder.h" | 19 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
| 19 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 20 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| (...skipping 2306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2326 void WebContentsImpl::OnSetSelectedColorInColorChooser(int color_chooser_id, | 2327 void WebContentsImpl::OnSetSelectedColorInColorChooser(int color_chooser_id, |
| 2327 SkColor color) { | 2328 SkColor color) { |
| 2328 if (color_chooser_ && | 2329 if (color_chooser_ && |
| 2329 color_chooser_id == color_chooser_->identifier()) | 2330 color_chooser_id == color_chooser_->identifier()) |
| 2330 color_chooser_->SetSelectedColor(color); | 2331 color_chooser_->SetSelectedColor(color); |
| 2331 } | 2332 } |
| 2332 | 2333 |
| 2333 void WebContentsImpl::OnPepperPluginHung(int plugin_child_id, | 2334 void WebContentsImpl::OnPepperPluginHung(int plugin_child_id, |
| 2334 const FilePath& path, | 2335 const FilePath& path, |
| 2335 bool is_hung) { | 2336 bool is_hung) { |
| 2337 HISTOGRAM_COUNTS("Pepper.PluginHung", 1); |
| 2338 |
| 2339 // Determine how often hangs happen when using worker pool versus |
| 2340 // FILE thread. kFieldTrialName needs to match the value in |
| 2341 // pepper_file_message_filter.cc, but plumbing that through would be |
| 2342 // disruptive for temporary code. |
| 2343 // TODO(shess): Remove once the workpool is proven superior. |
| 2344 // http://crbug.com/153383 |
| 2345 static const char* const kFieldTrialName = "FlapperIOThread"; |
| 2346 static const bool hung_trial_exists = |
| 2347 base::FieldTrialList::TrialExists(kFieldTrialName); |
| 2348 if (hung_trial_exists) { |
| 2349 HISTOGRAM_COUNTS(base::FieldTrial::MakeName("Pepper.PluginHung", |
| 2350 kFieldTrialName), 1); |
| 2351 } |
| 2352 |
| 2336 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2353 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 2337 PluginHungStatusChanged(plugin_child_id, path, is_hung)); | 2354 PluginHungStatusChanged(plugin_child_id, path, is_hung)); |
| 2338 } | 2355 } |
| 2339 | 2356 |
| 2340 // This exists for render views that don't have a WebUI, but do have WebUI | 2357 // This exists for render views that don't have a WebUI, but do have WebUI |
| 2341 // bindings enabled. | 2358 // bindings enabled. |
| 2342 void WebContentsImpl::OnWebUISend(const GURL& source_url, | 2359 void WebContentsImpl::OnWebUISend(const GURL& source_url, |
| 2343 const std::string& name, | 2360 const std::string& name, |
| 2344 const base::ListValue& args) { | 2361 const base::ListValue& args) { |
| 2345 if (delegate_) | 2362 if (delegate_) |
| (...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3390 } | 3407 } |
| 3391 } | 3408 } |
| 3392 | 3409 |
| 3393 content::BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { | 3410 content::BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { |
| 3394 return browser_plugin_guest_.get(); | 3411 return browser_plugin_guest_.get(); |
| 3395 } | 3412 } |
| 3396 | 3413 |
| 3397 content::BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { | 3414 content::BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { |
| 3398 return browser_plugin_embedder_.get(); | 3415 return browser_plugin_embedder_.get(); |
| 3399 } | 3416 } |
| OLD | NEW |