| 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/renderer/renderer_blink_platform_impl.h" | 5 #include "content/renderer/renderer_blink_platform_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 WebMessagePortChannelImpl::CreatePair( | 333 WebMessagePortChannelImpl::CreatePair( |
| 334 default_task_runner_, channel1, channel2); | 334 default_task_runner_, channel1, channel2); |
| 335 } | 335 } |
| 336 | 336 |
| 337 blink::WebPrescientNetworking* | 337 blink::WebPrescientNetworking* |
| 338 RendererBlinkPlatformImpl::prescientNetworking() { | 338 RendererBlinkPlatformImpl::prescientNetworking() { |
| 339 return GetContentClient()->renderer()->GetPrescientNetworking(); | 339 return GetContentClient()->renderer()->GetPrescientNetworking(); |
| 340 } | 340 } |
| 341 | 341 |
| 342 void RendererBlinkPlatformImpl::cacheMetadata(const blink::WebURL& url, | 342 void RendererBlinkPlatformImpl::cacheMetadata(const blink::WebURL& url, |
| 343 double response_time, | |
| 344 const char* data, | |
| 345 size_t size) { | |
| 346 // Let the browser know we generated cacheable metadata for this resource. The | |
| 347 // browser may cache it and return it on subsequent responses to speed | |
| 348 // the processing of this resource. | |
| 349 std::vector<char> copy(data, data + size); | |
| 350 RenderThread::Get()->Send(new ViewHostMsg_DidGenerateCacheableMetadata( | |
| 351 url, base::Time::FromDoubleT(response_time), copy)); | |
| 352 } | |
| 353 | |
| 354 void RendererBlinkPlatformImpl::cacheMetadata(const blink::WebURL& url, | |
| 355 int64 response_time, | 343 int64 response_time, |
| 356 const char* data, | 344 const char* data, |
| 357 size_t size) { | 345 size_t size) { |
| 358 // Let the browser know we generated cacheable metadata for this resource. The | 346 // Let the browser know we generated cacheable metadata for this resource. The |
| 359 // browser may cache it and return it on subsequent responses to speed | 347 // browser may cache it and return it on subsequent responses to speed |
| 360 // the processing of this resource. | 348 // the processing of this resource. |
| 361 std::vector<char> copy(data, data + size); | 349 std::vector<char> copy(data, data + size); |
| 362 RenderThread::Get()->Send(new ViewHostMsg_DidGenerateCacheableMetadata( | 350 RenderThread::Get()->Send(new ViewHostMsg_DidGenerateCacheableMetadata( |
| 363 url, base::Time::FromInternalValue(response_time), copy)); | 351 url, base::Time::FromInternalValue(response_time), copy)); |
| 364 } | 352 } |
| (...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1225 //------------------------------------------------------------------------------ | 1213 //------------------------------------------------------------------------------ |
| 1226 | 1214 |
| 1227 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( | 1215 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( |
| 1228 const blink::WebBatteryStatus& status) { | 1216 const blink::WebBatteryStatus& status) { |
| 1229 if (!g_test_battery_status_listener) | 1217 if (!g_test_battery_status_listener) |
| 1230 return; | 1218 return; |
| 1231 g_test_battery_status_listener->updateBatteryStatus(status); | 1219 g_test_battery_status_listener->updateBatteryStatus(status); |
| 1232 } | 1220 } |
| 1233 | 1221 |
| 1234 } // namespace content | 1222 } // namespace content |
| OLD | NEW |