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

Side by Side Diff: content/renderer/renderer_blink_platform_impl.cc

Issue 1915833002: Introduce Platform::cacheMetadataInCacheStorage() to store V8 code cache in CacheStorage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated vogelheim's comment Created 4 years, 7 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 "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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 size_t size) { 394 size_t size) {
395 // Let the browser know we generated cacheable metadata for this resource. The 395 // Let the browser know we generated cacheable metadata for this resource. The
396 // browser may cache it and return it on subsequent responses to speed 396 // browser may cache it and return it on subsequent responses to speed
397 // the processing of this resource. 397 // the processing of this resource.
398 std::vector<char> copy(data, data + size); 398 std::vector<char> copy(data, data + size);
399 RenderThread::Get()->Send( 399 RenderThread::Get()->Send(
400 new RenderProcessHostMsg_DidGenerateCacheableMetadata( 400 new RenderProcessHostMsg_DidGenerateCacheableMetadata(
401 url, base::Time::FromInternalValue(response_time), copy)); 401 url, base::Time::FromInternalValue(response_time), copy));
402 } 402 }
403 403
404 void RendererBlinkPlatformImpl::cacheMetadataInCacheStorage(
405 const blink::WebURL& url,
406 int64_t response_time,
407 const char* data,
408 size_t size,
409 const blink::WebSecurityOrigin& cacheStorageOrigin,
410 const blink::WebString& cacheStorageCacheName) {
411 // Let the browser know we generated cacheable metadata for this resource in
412 // CacheStorage. The browser may cache it and return it on subsequent
413 // responses to speed the processing of this resource.
414 std::vector<char> copy(data, data + size);
415 RenderThread::Get()->Send(
416 new RenderProcessHostMsg_DidGenerateCacheableMetadataInCacheStorage(
417 url, base::Time::FromInternalValue(response_time), copy,
418 cacheStorageOrigin, cacheStorageCacheName.utf8()));
419 }
420
404 WebString RendererBlinkPlatformImpl::defaultLocale() { 421 WebString RendererBlinkPlatformImpl::defaultLocale() {
405 return base::ASCIIToUTF16(RenderThread::Get()->GetLocale()); 422 return base::ASCIIToUTF16(RenderThread::Get()->GetLocale());
406 } 423 }
407 424
408 void RendererBlinkPlatformImpl::suddenTerminationChanged(bool enabled) { 425 void RendererBlinkPlatformImpl::suddenTerminationChanged(bool enabled) {
409 if (enabled) { 426 if (enabled) {
410 // We should not get more enables than disables, but we want it to be a 427 // We should not get more enables than disables, but we want it to be a
411 // non-fatal error if it does happen. 428 // non-fatal error if it does happen.
412 DCHECK_GT(sudden_termination_disables_, 0); 429 DCHECK_GT(sudden_termination_disables_, 0);
413 sudden_termination_disables_ = std::max(sudden_termination_disables_ - 1, 430 sudden_termination_disables_ = std::max(sudden_termination_disables_ - 1,
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
1303 } 1320 }
1304 1321
1305 //------------------------------------------------------------------------------ 1322 //------------------------------------------------------------------------------
1306 1323
1307 blink::WebTrialTokenValidator* 1324 blink::WebTrialTokenValidator*
1308 RendererBlinkPlatformImpl::trialTokenValidator() { 1325 RendererBlinkPlatformImpl::trialTokenValidator() {
1309 return &trial_token_validator_; 1326 return &trial_token_validator_;
1310 } 1327 }
1311 1328
1312 } // namespace content 1329 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698