Chromium Code Reviews| 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 "chrome/browser/renderer_host/chrome_render_message_filter.h" | 5 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/metrics/field_trial.h" | |
| 11 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 12 #include "chrome/browser/chrome_notification_types.h" | 13 #include "chrome/browser/chrome_notification_types.h" |
| 13 #include "chrome/browser/content_settings/cookie_settings.h" | 14 #include "chrome/browser/content_settings/cookie_settings.h" |
| 14 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 15 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 15 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" | 16 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" |
| 16 #include "chrome/browser/net/predictor.h" | 17 #include "chrome/browser/net/predictor.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/profiles/profile_manager.h" | 19 #include "chrome/browser/profiles/profile_manager.h" |
| 19 #include "chrome/common/render_messages.h" | 20 #include "chrome/common/render_messages.h" |
| 20 #include "components/web_cache/browser/web_cache_manager.h" | 21 #include "components/web_cache/browser/web_cache_manager.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 IPC_MESSAGE_HANDLER_DELAY_REPLY( | 76 IPC_MESSAGE_HANDLER_DELAY_REPLY( |
| 76 ChromeViewHostMsg_RequestFileSystemAccessSync, | 77 ChromeViewHostMsg_RequestFileSystemAccessSync, |
| 77 OnRequestFileSystemAccessSync) | 78 OnRequestFileSystemAccessSync) |
| 78 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_RequestFileSystemAccessAsync, | 79 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_RequestFileSystemAccessAsync, |
| 79 OnRequestFileSystemAccessAsync) | 80 OnRequestFileSystemAccessAsync) |
| 80 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_AllowIndexedDB, OnAllowIndexedDB) | 81 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_AllowIndexedDB, OnAllowIndexedDB) |
| 81 #if defined(ENABLE_PLUGINS) | 82 #if defined(ENABLE_PLUGINS) |
| 82 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_IsCrashReportingEnabled, | 83 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_IsCrashReportingEnabled, |
| 83 OnIsCrashReportingEnabled) | 84 OnIsCrashReportingEnabled) |
| 84 #endif | 85 #endif |
| 86 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_FieldTrialActivated, | |
| 87 OnFieldTrialActivated) | |
| 85 IPC_MESSAGE_UNHANDLED(handled = false) | 88 IPC_MESSAGE_UNHANDLED(handled = false) |
| 86 IPC_END_MESSAGE_MAP() | 89 IPC_END_MESSAGE_MAP() |
| 87 | 90 |
| 88 return handled; | 91 return handled; |
| 89 } | 92 } |
| 90 | 93 |
| 91 void ChromeRenderMessageFilter::OverrideThreadForMessage( | 94 void ChromeRenderMessageFilter::OverrideThreadForMessage( |
| 92 const IPC::Message& message, BrowserThread::ID* thread) { | 95 const IPC::Message& message, BrowserThread::ID* thread) { |
| 93 switch (message.type()) { | 96 switch (message.type()) { |
| 94 case ChromeViewHostMsg_ResourceTypeStats::ID: | 97 case ChromeViewHostMsg_ResourceTypeStats::ID: |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 354 base::Bind(&TabSpecificContentSettings::IndexedDBAccessed, | 357 base::Bind(&TabSpecificContentSettings::IndexedDBAccessed, |
| 355 render_process_id_, render_frame_id, origin_url, name, | 358 render_process_id_, render_frame_id, origin_url, name, |
| 356 !*allowed)); | 359 !*allowed)); |
| 357 } | 360 } |
| 358 | 361 |
| 359 #if defined(ENABLE_PLUGINS) | 362 #if defined(ENABLE_PLUGINS) |
| 360 void ChromeRenderMessageFilter::OnIsCrashReportingEnabled(bool* enabled) { | 363 void ChromeRenderMessageFilter::OnIsCrashReportingEnabled(bool* enabled) { |
| 361 *enabled = ChromeMetricsServiceAccessor::IsCrashReportingEnabled(); | 364 *enabled = ChromeMetricsServiceAccessor::IsCrashReportingEnabled(); |
| 362 } | 365 } |
| 363 #endif | 366 #endif |
| 367 | |
| 368 void ChromeRenderMessageFilter::OnFieldTrialActivated( | |
| 369 const std::string& trial_name, const std::string& group_name) { | |
|
Alexei Svitkine (slow)
2014/11/05 16:17:14
Nit: If first param is on a new line, each param s
| |
| 370 base::FieldTrialList::FindFullName(trial_name); | |
| 371 } | |
| OLD | NEW |