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

Side by Side Diff: third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp

Issue 2886663002: DataSaver support for off-main-thread-fetch (Closed)
Patch Set: rebase on TOT Created 3 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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 ProvideIndexedDBClientToWorker(worker_clients, 338 ProvideIndexedDBClientToWorker(worker_clients,
339 IndexedDBClientImpl::Create(*worker_clients)); 339 IndexedDBClientImpl::Create(*worker_clients));
340 340
341 if (RuntimeEnabledFeatures::offMainThreadFetchEnabled()) { 341 if (RuntimeEnabledFeatures::offMainThreadFetchEnabled()) {
342 std::unique_ptr<WebWorkerFetchContext> web_worker_fetch_context = 342 std::unique_ptr<WebWorkerFetchContext> web_worker_fetch_context =
343 client_->CreateWorkerFetchContext( 343 client_->CreateWorkerFetchContext(
344 WebLocalFrameBase::FromFrame(main_frame_->GetFrame()) 344 WebLocalFrameBase::FromFrame(main_frame_->GetFrame())
345 ->DataSource() 345 ->DataSource()
346 ->GetServiceWorkerNetworkProvider()); 346 ->GetServiceWorkerNetworkProvider());
347 DCHECK(web_worker_fetch_context); 347 DCHECK(web_worker_fetch_context);
348 // TODO(horo): Set more information about the context (ex: DataSaverEnabled) 348 // TODO(horo): Set more information about the context (ex: AppCacheHostID)
349 // to |web_worker_fetch_context|. 349 // to |web_worker_fetch_context|.
350 web_worker_fetch_context->SetDataSaverEnabled(
351 document->GetFrame()->GetSettings()->GetDataSaverEnabled());
350 ProvideWorkerFetchContextToWorker(worker_clients, 352 ProvideWorkerFetchContextToWorker(worker_clients,
351 std::move(web_worker_fetch_context)); 353 std::move(web_worker_fetch_context));
352 } 354 }
353 355
354 ContentSecurityPolicy* content_security_policy = 356 ContentSecurityPolicy* content_security_policy =
355 main_script_loader_->ReleaseContentSecurityPolicy(); 357 main_script_loader_->ReleaseContentSecurityPolicy();
356 WorkerThreadStartMode start_mode = 358 WorkerThreadStartMode start_mode =
357 worker_inspector_proxy_->WorkerStartMode(document); 359 worker_inspector_proxy_->WorkerStartMode(document);
358 std::unique_ptr<WorkerSettings> worker_settings = 360 std::unique_ptr<WorkerSettings> worker_settings =
359 WTF::WrapUnique(new WorkerSettings(document->GetSettings())); 361 WTF::WrapUnique(new WorkerSettings(document->GetSettings()));
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 if (devtools_agent) 437 if (devtools_agent)
436 devtools_agent->DispatchOnInspectorBackend(session_id, call_id, method, 438 devtools_agent->DispatchOnInspectorBackend(session_id, call_id, method,
437 message); 439 message);
438 } 440 }
439 441
440 WebSharedWorker* WebSharedWorker::Create(WebSharedWorkerClient* client) { 442 WebSharedWorker* WebSharedWorker::Create(WebSharedWorkerClient* client) {
441 return new WebSharedWorkerImpl(client); 443 return new WebSharedWorkerImpl(client);
442 } 444 }
443 445
444 } // namespace blink 446 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp ('k') | third_party/WebKit/public/platform/WebWorkerFetchContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698