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

Side by Side Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.cpp

Issue 2389693002: service worker: Add NavigationPreload runtime flag and skeleton interface (Closed)
Patch Set: Created 4 years, 2 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 18 matching lines...) Expand all
29 */ 29 */
30 30
31 #include "modules/serviceworkers/ServiceWorker.h" 31 #include "modules/serviceworkers/ServiceWorker.h"
32 32
33 #include "bindings/core/v8/ExceptionState.h" 33 #include "bindings/core/v8/ExceptionState.h"
34 #include "core/dom/ExceptionCode.h" 34 #include "core/dom/ExceptionCode.h"
35 #include "core/dom/MessagePort.h" 35 #include "core/dom/MessagePort.h"
36 #include "core/events/Event.h" 36 #include "core/events/Event.h"
37 #include "core/inspector/ConsoleMessage.h" 37 #include "core/inspector/ConsoleMessage.h"
38 #include "modules/EventTargetModules.h" 38 #include "modules/EventTargetModules.h"
39 #include "modules/serviceworkers/NavigationPreloadOptions.h"
39 #include "modules/serviceworkers/ServiceWorkerContainerClient.h" 40 #include "modules/serviceworkers/ServiceWorkerContainerClient.h"
40 #include "public/platform/WebMessagePortChannel.h" 41 #include "public/platform/WebMessagePortChannel.h"
41 #include "public/platform/WebSecurityOrigin.h" 42 #include "public/platform/WebSecurityOrigin.h"
42 #include "public/platform/WebString.h" 43 #include "public/platform/WebString.h"
43 #include "public/platform/modules/serviceworker/WebServiceWorkerState.h" 44 #include "public/platform/modules/serviceworker/WebServiceWorkerState.h"
44 #include <memory> 45 #include <memory>
45 46
46 namespace blink { 47 namespace blink {
47 48
48 const AtomicString& ServiceWorker::interfaceName() const { 49 const AtomicString& ServiceWorker::interfaceName() const {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 case WebServiceWorkerStateActivated: 116 case WebServiceWorkerStateActivated:
116 return "activated"; 117 return "activated";
117 case WebServiceWorkerStateRedundant: 118 case WebServiceWorkerStateRedundant:
118 return "redundant"; 119 return "redundant";
119 default: 120 default:
120 ASSERT_NOT_REACHED(); 121 ASSERT_NOT_REACHED();
121 return nullAtom; 122 return nullAtom;
122 } 123 }
123 } 124 }
124 125
126 ScriptPromise ServiceWorker::getNavigationPreload(ScriptState* scriptState) {
127 NOTIMPLEMENTED();
128 return ScriptPromise();
129 }
130
131 ScriptPromise ServiceWorker::setNavigationPreload(
132 ScriptState* scriptState,
133 const NavigationPreloadOptions& options) {
134 NOTIMPLEMENTED();
135 return ScriptPromise();
136 }
137
125 ServiceWorker* ServiceWorker::from( 138 ServiceWorker* ServiceWorker::from(
126 ExecutionContext* executionContext, 139 ExecutionContext* executionContext,
127 std::unique_ptr<WebServiceWorker::Handle> handle) { 140 std::unique_ptr<WebServiceWorker::Handle> handle) {
128 return getOrCreate(executionContext, std::move(handle)); 141 return getOrCreate(executionContext, std::move(handle));
129 } 142 }
130 143
131 bool ServiceWorker::hasPendingActivity() const { 144 bool ServiceWorker::hasPendingActivity() const {
132 if (m_wasStopped) 145 if (m_wasStopped)
133 return false; 146 return false;
134 return m_handle->serviceWorker()->state() != WebServiceWorkerStateRedundant; 147 return m_handle->serviceWorker()->state() != WebServiceWorkerStateRedundant;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 m_handle->serviceWorker()->setProxy(this); 180 m_handle->serviceWorker()->setProxy(this);
168 } 181 }
169 182
170 ServiceWorker::~ServiceWorker() {} 183 ServiceWorker::~ServiceWorker() {}
171 184
172 DEFINE_TRACE(ServiceWorker) { 185 DEFINE_TRACE(ServiceWorker) {
173 AbstractWorker::trace(visitor); 186 AbstractWorker::trace(visitor);
174 } 187 }
175 188
176 } // namespace blink 189 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698