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

Side by Side Diff: third_party/WebKit/Source/modules/background_sync/SyncManager.cpp

Issue 1773813007: blink: Rename modules/ method to prefix with get when they collide. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clash-modules: rebase-fixes Created 4 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "modules/background_sync/SyncManager.h" 5 #include "modules/background_sync/SyncManager.h"
6 6
7 #include "bindings/core/v8/CallbackPromiseAdapter.h" 7 #include "bindings/core/v8/CallbackPromiseAdapter.h"
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptPromiseResolver.h" 9 #include "bindings/core/v8/ScriptPromiseResolver.h"
10 #include "bindings/core/v8/ScriptState.h" 10 #include "bindings/core/v8/ScriptState.h"
(...skipping 26 matching lines...) Expand all
37 { 37 {
38 ASSERT(registration); 38 ASSERT(registration);
39 } 39 }
40 40
41 ScriptPromise SyncManager::registerFunction(ScriptState* scriptState, ExecutionC ontext* context, const String& tag) 41 ScriptPromise SyncManager::registerFunction(ScriptState* scriptState, ExecutionC ontext* context, const String& tag)
42 { 42 {
43 // TODO(jkarlin): Wait for the registration to become active instead of reje cting. See crbug.com/542437. 43 // TODO(jkarlin): Wait for the registration to become active instead of reje cting. See crbug.com/542437.
44 if (!m_registration->active()) 44 if (!m_registration->active())
45 return ScriptPromise::rejectWithDOMException(scriptState, DOMException:: create(AbortError, "Registration failed - no active Service Worker")); 45 return ScriptPromise::rejectWithDOMException(scriptState, DOMException:: create(AbortError, "Registration failed - no active Service Worker"));
46 46
47 if (scriptState->executionContext()->isDocument()) { 47 if (scriptState->getExecutionContext()->isDocument()) {
48 Document* document = toDocument(scriptState->executionContext()); 48 Document* document = toDocument(scriptState->getExecutionContext());
49 if (!document->domWindow() || !document->frame()) 49 if (!document->domWindow() || !document->frame())
50 return ScriptPromise::rejectWithDOMException(scriptState, DOMExcepti on::create(InvalidStateError, "Document is detached from window.")); 50 return ScriptPromise::rejectWithDOMException(scriptState, DOMExcepti on::create(InvalidStateError, "Document is detached from window."));
51 if (!document->frame()->isMainFrame()) 51 if (!document->frame()->isMainFrame())
52 return ScriptPromise::rejectWithDOMException(scriptState, DOMExcepti on::create(AbortError, "Registration failed - not called from a main frame.")); 52 return ScriptPromise::rejectWithDOMException(scriptState, DOMExcepti on::create(AbortError, "Registration failed - not called from a main frame."));
53 } 53 }
54 54
55 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ; 55 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ;
56 ScriptPromise promise = resolver->promise(); 56 ScriptPromise promise = resolver->promise();
57 57
58 WebSyncRegistration* webSyncRegistration = new WebSyncRegistration( 58 WebSyncRegistration* webSyncRegistration = new WebSyncRegistration(
(...skipping 15 matching lines...) Expand all
74 74
75 return promise; 75 return promise;
76 } 76 }
77 77
78 DEFINE_TRACE(SyncManager) 78 DEFINE_TRACE(SyncManager)
79 { 79 {
80 visitor->trace(m_registration); 80 visitor->trace(m_registration);
81 } 81 }
82 82
83 } // namespace blink 83 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698