| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } | 59 } |
| 60 | 60 |
| 61 ChromeRenderMessageFilter::~ChromeRenderMessageFilter() { | 61 ChromeRenderMessageFilter::~ChromeRenderMessageFilter() { |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool ChromeRenderMessageFilter::OnMessageReceived(const IPC::Message& message) { | 64 bool ChromeRenderMessageFilter::OnMessageReceived(const IPC::Message& message) { |
| 65 bool handled = true; | 65 bool handled = true; |
| 66 IPC_BEGIN_MESSAGE_MAP(ChromeRenderMessageFilter, message) | 66 IPC_BEGIN_MESSAGE_MAP(ChromeRenderMessageFilter, message) |
| 67 IPC_MESSAGE_HANDLER(NetworkHintsMsg_DNSPrefetch, OnDnsPrefetch) | 67 IPC_MESSAGE_HANDLER(NetworkHintsMsg_DNSPrefetch, OnDnsPrefetch) |
| 68 IPC_MESSAGE_HANDLER(NetworkHintsMsg_Preconnect, OnPreconnect) | 68 IPC_MESSAGE_HANDLER(NetworkHintsMsg_Preconnect, OnPreconnect) |
| 69 IPC_MESSAGE_HANDLER(NetworkHintsMsg_NavigationHint, OnNavigationHint) |
| 69 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_UpdatedCacheStats, | 70 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_UpdatedCacheStats, |
| 70 OnUpdatedCacheStats) | 71 OnUpdatedCacheStats) |
| 71 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_AllowDatabase, OnAllowDatabase) | 72 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_AllowDatabase, OnAllowDatabase) |
| 72 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_AllowDOMStorage, OnAllowDOMStorage) | 73 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_AllowDOMStorage, OnAllowDOMStorage) |
| 73 IPC_MESSAGE_HANDLER_DELAY_REPLY( | 74 IPC_MESSAGE_HANDLER_DELAY_REPLY( |
| 74 ChromeViewHostMsg_RequestFileSystemAccessSync, | 75 ChromeViewHostMsg_RequestFileSystemAccessSync, |
| 75 OnRequestFileSystemAccessSync) | 76 OnRequestFileSystemAccessSync) |
| 76 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_RequestFileSystemAccessAsync, | 77 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_RequestFileSystemAccessAsync, |
| 77 OnRequestFileSystemAccessAsync) | 78 OnRequestFileSystemAccessAsync) |
| 78 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_AllowIndexedDB, OnAllowIndexedDB) | 79 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_AllowIndexedDB, OnAllowIndexedDB) |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 return; | 122 return; |
| 122 } | 123 } |
| 123 if (predictor_ && url.is_valid() && url.has_host() && url.has_scheme() && | 124 if (predictor_ && url.is_valid() && url.has_host() && url.has_scheme() && |
| 124 url.SchemeIsHTTPOrHTTPS()) { | 125 url.SchemeIsHTTPOrHTTPS()) { |
| 125 predictor_->PreconnectUrl(url, GURL(), | 126 predictor_->PreconnectUrl(url, GURL(), |
| 126 chrome_browser_net::UrlInfo::EARLY_LOAD_MOTIVATED, | 127 chrome_browser_net::UrlInfo::EARLY_LOAD_MOTIVATED, |
| 127 allow_credentials, count); | 128 allow_credentials, count); |
| 128 } | 129 } |
| 129 } | 130 } |
| 130 | 131 |
| 132 void ChromeRenderMessageFilter::OnNavigationHint( |
| 133 const GURL& url, |
| 134 blink::WebNavigationHintType type) { |
| 135 // TODO(horo): We don't need to have this method in //chrome. Move it to |
| 136 // //content while mojoifing network_hints. (crbug.com/610750) |
| 137 // TODO(horo): Implement this. |
| 138 } |
| 139 |
| 131 void ChromeRenderMessageFilter::OnUpdatedCacheStats( | 140 void ChromeRenderMessageFilter::OnUpdatedCacheStats( |
| 132 uint64_t min_dead_capacity, | 141 uint64_t min_dead_capacity, |
| 133 uint64_t max_dead_capacity, | 142 uint64_t max_dead_capacity, |
| 134 uint64_t capacity, | 143 uint64_t capacity, |
| 135 uint64_t live_size, | 144 uint64_t live_size, |
| 136 uint64_t dead_size) { | 145 uint64_t dead_size) { |
| 137 web_cache::WebCacheManager::GetInstance()->ObserveStats( | 146 web_cache::WebCacheManager::GetInstance()->ObserveStats( |
| 138 render_process_id_, min_dead_capacity, max_dead_capacity, capacity, | 147 render_process_id_, min_dead_capacity, max_dead_capacity, capacity, |
| 139 live_size, dead_size); | 148 live_size, dead_size); |
| 140 } | 149 } |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 rappor::SampleString(g_browser_process->rappor_service(), metric, | 360 rappor::SampleString(g_browser_process->rappor_service(), metric, |
| 352 rappor::ETLD_PLUS_ONE_RAPPOR_TYPE, sample); | 361 rappor::ETLD_PLUS_ONE_RAPPOR_TYPE, sample); |
| 353 } | 362 } |
| 354 | 363 |
| 355 void ChromeRenderMessageFilter::OnRecordRapporURL(const std::string& metric, | 364 void ChromeRenderMessageFilter::OnRecordRapporURL(const std::string& metric, |
| 356 const GURL& sample) { | 365 const GURL& sample) { |
| 357 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 366 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 358 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), | 367 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), |
| 359 metric, sample); | 368 metric, sample); |
| 360 } | 369 } |
| OLD | NEW |