Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: chrome/browser/renderer_host/chrome_render_message_filter.cc

Issue 2043083002: Speculatively launch Service Workers on mouse/touch events. [2/5] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Same as Patch Set 5 Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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): Implement this.
kinuko 2016/07/18 15:24:45 I really don't think this should go through //chro
horo 2016/07/19 02:09:43 Done.
136 }
137
131 void ChromeRenderMessageFilter::OnUpdatedCacheStats( 138 void ChromeRenderMessageFilter::OnUpdatedCacheStats(
132 uint64_t min_dead_capacity, 139 uint64_t min_dead_capacity,
133 uint64_t max_dead_capacity, 140 uint64_t max_dead_capacity,
134 uint64_t capacity, 141 uint64_t capacity,
135 uint64_t live_size, 142 uint64_t live_size,
136 uint64_t dead_size) { 143 uint64_t dead_size) {
137 web_cache::WebCacheManager::GetInstance()->ObserveStats( 144 web_cache::WebCacheManager::GetInstance()->ObserveStats(
138 render_process_id_, min_dead_capacity, max_dead_capacity, capacity, 145 render_process_id_, min_dead_capacity, max_dead_capacity, capacity,
139 live_size, dead_size); 146 live_size, dead_size);
140 } 147 }
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 rappor::SampleString(g_browser_process->rappor_service(), metric, 358 rappor::SampleString(g_browser_process->rappor_service(), metric,
352 rappor::ETLD_PLUS_ONE_RAPPOR_TYPE, sample); 359 rappor::ETLD_PLUS_ONE_RAPPOR_TYPE, sample);
353 } 360 }
354 361
355 void ChromeRenderMessageFilter::OnRecordRapporURL(const std::string& metric, 362 void ChromeRenderMessageFilter::OnRecordRapporURL(const std::string& metric,
356 const GURL& sample) { 363 const GURL& sample) {
357 DCHECK_CURRENTLY_ON(BrowserThread::UI); 364 DCHECK_CURRENTLY_ON(BrowserThread::UI);
358 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), 365 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(),
359 metric, sample); 366 metric, sample);
360 } 367 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698