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

Side by Side Diff: Source/modules/serviceworkers/WaitUntilObserver.cpp

Issue 210833004: Inform the client when the Service Worker rejects an install event (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "config.h" 5 #include "config.h"
6 #include "modules/serviceworkers/WaitUntilObserver.h" 6 #include "modules/serviceworkers/WaitUntilObserver.h"
7 7
8 #include "bindings/v8/ScriptFunction.h" 8 #include "bindings/v8/ScriptFunction.h"
9 #include "bindings/v8/ScriptPromise.h" 9 #include "bindings/v8/ScriptPromise.h"
10 #include "bindings/v8/ScriptValue.h" 10 #include "bindings/v8/ScriptValue.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 incrementPendingActivity(); 77 incrementPendingActivity();
78 ScriptPromise::cast(value).then( 78 ScriptPromise::cast(value).then(
79 ThenFunction::create(this, ThenFunction::Fulfilled), 79 ThenFunction::create(this, ThenFunction::Fulfilled),
80 ThenFunction::create(this, ThenFunction::Rejected)); 80 ThenFunction::create(this, ThenFunction::Rejected));
81 } 81 }
82 82
83 WaitUntilObserver::WaitUntilObserver(ExecutionContext* context, int eventID) 83 WaitUntilObserver::WaitUntilObserver(ExecutionContext* context, int eventID)
84 : ContextLifecycleObserver(context) 84 : ContextLifecycleObserver(context)
85 , m_eventID(eventID) 85 , m_eventID(eventID)
86 , m_pendingActivity(0) 86 , m_pendingActivity(0)
87 , m_error(false)
87 { 88 {
88 } 89 }
89 90
90 void WaitUntilObserver::reportError(const ScriptValue& value) 91 void WaitUntilObserver::reportError(const ScriptValue& value)
91 { 92 {
92 // FIXME: Propagate error message to the client for onerror handling. 93 // FIXME: Propagate error message to the client for onerror handling.
93 notImplemented(); 94 notImplemented();
95
96 m_error = true;
94 } 97 }
95 98
96 void WaitUntilObserver::incrementPendingActivity() 99 void WaitUntilObserver::incrementPendingActivity()
97 { 100 {
98 ++m_pendingActivity; 101 ++m_pendingActivity;
99 } 102 }
100 103
101 void WaitUntilObserver::decrementPendingActivity() 104 void WaitUntilObserver::decrementPendingActivity()
102 { 105 {
103 ASSERT(m_pendingActivity > 0); 106 ASSERT(m_pendingActivity > 0);
104 if (--m_pendingActivity || !executionContext()) 107 if (--m_pendingActivity || !executionContext())
105 return; 108 return;
106 109
107 ServiceWorkerGlobalScopeClient::from(executionContext())->didHandleInstallEv ent(m_eventID); 110 ServiceWorkerGlobalScopeClient::from(executionContext())->didHandleInstallEv ent(m_eventID, m_error);
108 observeContext(0); 111 observeContext(0);
109 } 112 }
110 113
111 } // namespace WebCore 114 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698