OLD | NEW |
1 | 1 |
2 // Copyright 2014 The Chromium Authors. All rights reserved. | 2 // Copyright 2014 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #include "modules/serviceworkers/ServiceWorkerContainer.h" | 6 #include "modules/serviceworkers/ServiceWorkerContainer.h" |
7 | 7 |
8 #include "bindings/core/v8/Dictionary.h" | 8 #include "bindings/core/v8/Dictionary.h" |
9 #include "bindings/core/v8/ScriptFunction.h" | 9 #include "bindings/core/v8/ScriptFunction.h" |
10 #include "bindings/core/v8/ScriptPromise.h" | 10 #include "bindings/core/v8/ScriptPromise.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 m_page.clear(); | 157 m_page.clear(); |
158 V8GCController::collectAllGarbageForTesting(isolate()); | 158 V8GCController::collectAllGarbageForTesting(isolate()); |
159 } | 159 } |
160 | 160 |
161 ExecutionContext* getExecutionContext() { return &(m_page->document()); } | 161 ExecutionContext* getExecutionContext() { return &(m_page->document()); } |
162 v8::Isolate* isolate() { return v8::Isolate::GetCurrent(); } | 162 v8::Isolate* isolate() { return v8::Isolate::GetCurrent(); } |
163 ScriptState* getScriptState() { return ScriptState::forMainWorld(m_page->doc
ument().frame()); } | 163 ScriptState* getScriptState() { return ScriptState::forMainWorld(m_page->doc
ument().frame()); } |
164 | 164 |
165 void provide(PassOwnPtr<WebServiceWorkerProvider> provider) | 165 void provide(PassOwnPtr<WebServiceWorkerProvider> provider) |
166 { | 166 { |
167 HeapSupplement<Document>::provideTo(m_page->document(), ServiceWorkerCon
tainerClient::supplementName(), ServiceWorkerContainerClient::create(provider)); | 167 Supplement<Document>::provideTo(m_page->document(), ServiceWorkerContain
erClient::supplementName(), ServiceWorkerContainerClient::create(provider)); |
168 } | 168 } |
169 | 169 |
170 void setPageURL(const String& url) | 170 void setPageURL(const String& url) |
171 { | 171 { |
172 // For URL completion. | 172 // For URL completion. |
173 m_page->document().setURL(KURL(KURL(), url)); | 173 m_page->document().setURL(KURL(KURL(), url)); |
174 | 174 |
175 // The basis for security checks. | 175 // The basis for security checks. |
176 m_page->document().setSecurityOrigin(SecurityOrigin::createFromString(ur
l)); | 176 m_page->document().setSecurityOrigin(SecurityOrigin::createFromString(ur
l)); |
177 } | 177 } |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 container->getRegistration(getScriptState(), ""); | 356 container->getRegistration(getScriptState(), ""); |
357 EXPECT_EQ(1ul, stubProvider.getRegistrationCallCount()); | 357 EXPECT_EQ(1ul, stubProvider.getRegistrationCallCount()); |
358 EXPECT_EQ(WebURL(KURL(KURL(), "http://localhost/x/index.html")), stubPro
vider.getRegistrationURL()); | 358 EXPECT_EQ(WebURL(KURL(KURL(), "http://localhost/x/index.html")), stubPro
vider.getRegistrationURL()); |
359 } | 359 } |
360 | 360 |
361 container->willBeDetachedFromFrame(); | 361 container->willBeDetachedFromFrame(); |
362 } | 362 } |
363 | 363 |
364 } // namespace | 364 } // namespace |
365 } // namespace blink | 365 } // namespace blink |
OLD | NEW |