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

Side by Side Diff: extensions/renderer/api_last_error.h

Issue 2762623003: [Extensions Bindings] Add lastError utilities to APIBindingJSUtil (Closed)
Patch Set: Rebase Created 3 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #ifndef EXTENSIONS_RENDERER_API_LAST_ERROR_H_ 5 #ifndef EXTENSIONS_RENDERER_API_LAST_ERROR_H_
6 #define EXTENSIONS_RENDERER_API_LAST_ERROR_H_ 6 #define EXTENSIONS_RENDERER_API_LAST_ERROR_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 15 matching lines...) Expand all
26 APILastError(APILastError&& other); 26 APILastError(APILastError&& other);
27 ~APILastError(); 27 ~APILastError();
28 28
29 // Sets the last error for the given |context| to |error|. 29 // Sets the last error for the given |context| to |error|.
30 void SetError(v8::Local<v8::Context> context, const std::string& error); 30 void SetError(v8::Local<v8::Context> context, const std::string& error);
31 31
32 // Clears the last error in the given |context|. If |report_if_unchecked| is 32 // Clears the last error in the given |context|. If |report_if_unchecked| is
33 // true and the developer didn't check the error, this throws an exception. 33 // true and the developer didn't check the error, this throws an exception.
34 void ClearError(v8::Local<v8::Context> context, bool report_if_unchecked); 34 void ClearError(v8::Local<v8::Context> context, bool report_if_unchecked);
35 35
36 // Returns true if the given context has an active error.
37 bool HasError(v8::Local<v8::Context> context);
38
36 private: 39 private:
37 GetParent get_parent_; 40 GetParent get_parent_;
38 41
39 DISALLOW_COPY_AND_ASSIGN(APILastError); 42 DISALLOW_COPY_AND_ASSIGN(APILastError);
40 }; 43 };
41 44
42 } // namespace extensions 45 } // namespace extensions
43 46
44 #endif // EXTENSIONS_RENDERER_API_LAST_ERROR_H_ 47 #endif // EXTENSIONS_RENDERER_API_LAST_ERROR_H_
OLDNEW
« no previous file with comments | « extensions/renderer/api_bindings_system_unittest.cc ('k') | extensions/renderer/api_last_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698