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

Side by Side Diff: Source/bindings/core/v8/CallbackPromiseAdapter.h

Issue 464073002: Pass through geofencing API calls to the content layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: get rid of UndefinedValue class Created 6 years, 4 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
« no previous file with comments | « no previous file | Source/modules/geofencing/CircularRegion.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 return; 101 return;
102 } 102 }
103 m_resolver->reject(T::take(m_resolver.get(), error)); 103 m_resolver->reject(T::take(m_resolver.get(), error));
104 } 104 }
105 105
106 private: 106 private:
107 RefPtr<ScriptPromiseResolver> m_resolver; 107 RefPtr<ScriptPromiseResolver> m_resolver;
108 WTF_MAKE_NONCOPYABLE(CallbackPromiseAdapter); 108 WTF_MAKE_NONCOPYABLE(CallbackPromiseAdapter);
109 }; 109 };
110 110
111 template<typename T>
112 class CallbackPromiseAdapter<void, T> FINAL : public blink::WebCallbacks<void, t ypename T::WebType> {
113 public:
114 CallbackPromiseAdapter(PassRefPtr<ScriptPromiseResolver> resolver)
esprehn 2014/08/19 19:24:53 explicit
115 : m_resolver(resolver)
116 {
117 ASSERT(m_resolver);
118 }
119 virtual ~CallbackPromiseAdapter() { }
120
121 virtual void onSuccess() OVERRIDE
122 {
123 if (!m_resolver->executionContext() || m_resolver->executionContext()->a ctiveDOMObjectsAreStopped()) {
124 return;
125 }
126 m_resolver->resolve(V8UndefinedType());
127 }
128
129 virtual void onError(typename T::WebType* error) OVERRIDE
130 {
131 if (!m_resolver->executionContext() || m_resolver->executionContext()->a ctiveDOMObjectsAreStopped()) {
132 T::dispose(error);
133 return;
134 }
135 m_resolver->reject(T::take(m_resolver.get(), error));
136 }
137
138 private:
139 RefPtr<ScriptPromiseResolver> m_resolver;
140 WTF_MAKE_NONCOPYABLE(CallbackPromiseAdapter);
141 };
142
111 } // namespace blink 143 } // namespace blink
112 144
113 #endif 145 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/modules/geofencing/CircularRegion.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698