| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 size_t size) { | 392 size_t size) { |
| 393 // Let the browser know we generated cacheable metadata for this resource. The | 393 // Let the browser know we generated cacheable metadata for this resource. The |
| 394 // browser may cache it and return it on subsequent responses to speed | 394 // browser may cache it and return it on subsequent responses to speed |
| 395 // the processing of this resource. | 395 // the processing of this resource. |
| 396 std::vector<char> copy(data, data + size); | 396 std::vector<char> copy(data, data + size); |
| 397 RenderThread::Get()->Send( | 397 RenderThread::Get()->Send( |
| 398 new RenderProcessHostMsg_DidGenerateCacheableMetadata( | 398 new RenderProcessHostMsg_DidGenerateCacheableMetadata( |
| 399 url, base::Time::FromInternalValue(response_time), copy)); | 399 url, base::Time::FromInternalValue(response_time), copy)); |
| 400 } | 400 } |
| 401 | 401 |
| 402 void RendererBlinkPlatformImpl::cacheMetadataInCacheStorage( |
| 403 const blink::WebURL& url, |
| 404 int64_t response_time, |
| 405 const char* data, |
| 406 size_t size, |
| 407 const blink::WebSecurityOrigin& cacheStorageOrigin, |
| 408 const blink::WebString& cacheStorageCacheName) { |
| 409 // Let the browser know we generated cacheable metadata for this resource in |
| 410 // CacheStorage. The browser may cache it and return it on subsequent |
| 411 // responses to speed the processing of this resource. |
| 412 std::vector<char> copy(data, data + size); |
| 413 RenderThread::Get()->Send( |
| 414 new RenderProcessHostMsg_DidGenerateCacheableMetadataInCacheStorage( |
| 415 url, base::Time::FromInternalValue(response_time), copy, |
| 416 cacheStorageOrigin, cacheStorageCacheName.utf8())); |
| 417 } |
| 418 |
| 402 WebString RendererBlinkPlatformImpl::defaultLocale() { | 419 WebString RendererBlinkPlatformImpl::defaultLocale() { |
| 403 return base::ASCIIToUTF16(RenderThread::Get()->GetLocale()); | 420 return base::ASCIIToUTF16(RenderThread::Get()->GetLocale()); |
| 404 } | 421 } |
| 405 | 422 |
| 406 void RendererBlinkPlatformImpl::suddenTerminationChanged(bool enabled) { | 423 void RendererBlinkPlatformImpl::suddenTerminationChanged(bool enabled) { |
| 407 if (enabled) { | 424 if (enabled) { |
| 408 // We should not get more enables than disables, but we want it to be a | 425 // We should not get more enables than disables, but we want it to be a |
| 409 // non-fatal error if it does happen. | 426 // non-fatal error if it does happen. |
| 410 DCHECK_GT(sudden_termination_disables_, 0); | 427 DCHECK_GT(sudden_termination_disables_, 0); |
| 411 sudden_termination_disables_ = std::max(sudden_termination_disables_ - 1, | 428 sudden_termination_disables_ = std::max(sudden_termination_disables_ - 1, |
| (...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1302 } | 1319 } |
| 1303 | 1320 |
| 1304 //------------------------------------------------------------------------------ | 1321 //------------------------------------------------------------------------------ |
| 1305 | 1322 |
| 1306 blink::WebTrialTokenValidator* | 1323 blink::WebTrialTokenValidator* |
| 1307 RendererBlinkPlatformImpl::trialTokenValidator() { | 1324 RendererBlinkPlatformImpl::trialTokenValidator() { |
| 1308 return &trial_token_validator_; | 1325 return &trial_token_validator_; |
| 1309 } | 1326 } |
| 1310 | 1327 |
| 1311 } // namespace content | 1328 } // namespace content |
| OLD | NEW |