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

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: add comments in render_process_messages.h 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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698