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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/Dictionary.h

Issue 2519403002: binding: Lets Dictionary::getPropertyNames, etc. rethrow an exception. (Closed)
Patch Set: Fixed DictionaryTest. Created 4 years, 1 month 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 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 NOTREACHED(); 71 NOTREACHED();
72 return v8::Local<v8::Value>(); 72 return v8::Local<v8::Value>();
73 } 73 }
74 } 74 }
75 75
76 bool get(const StringView& key, v8::Local<v8::Value>& value) const { 76 bool get(const StringView& key, v8::Local<v8::Value>& value) const {
77 return m_isolate && getInternal(v8String(m_isolate, key), value); 77 return m_isolate && getInternal(v8String(m_isolate, key), value);
78 } 78 }
79 bool get(const StringView& key, Dictionary&) const; 79 bool get(const StringView& key, Dictionary&) const;
80 80
81 bool getOwnPropertiesAsStringHashMap(HashMap<String, String>&) const; 81 WARN_UNUSED_RESULT bool getOwnPropertiesAsStringHashMap(
82 bool getPropertyNames(Vector<String>&) const; 82 HashMap<String, String>&,
83 ExceptionState&) const;
84 WARN_UNUSED_RESULT bool getPropertyNames(Vector<String>&,
85 ExceptionState&) const;
haraken 2016/11/24 07:22:30 Is it guaranteed that this method returns false if
Yuki 2016/11/24 10:19:32 I like the rule to guarantee that "false in the re
haraken 2016/11/24 12:39:12 I understand your point but other places in the co
Yuki 2016/11/25 08:31:04 Can we change that rule right away? It's a bit er
haraken 2016/11/25 09:14:51 However, then we need to update the entire code ba
Yuki 2016/11/25 09:58:54 Ah, I thought you wanted to return void. You actu
haraken 2016/11/25 10:14:37 Yes. However, my point is that the caller of a me
Yuki 2016/11/25 14:50:25 Per offline discussion, we're going to let the cod
83 86
84 bool hasProperty(const StringView&) const; 87 bool hasProperty(const StringView&) const;
85 88
86 v8::Isolate* isolate() const { return m_isolate; } 89 v8::Isolate* isolate() const { return m_isolate; }
87 v8::Local<v8::Context> v8Context() const { 90 v8::Local<v8::Context> v8Context() const {
88 ASSERT(m_isolate); 91 ASSERT(m_isolate);
89 return m_isolate->GetCurrentContext(); 92 return m_isolate->GetCurrentContext();
90 } 93 }
91 94
92 DictionaryIterator getIterator(ExecutionContext*) const; 95 DictionaryIterator getIterator(ExecutionContext*) const;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 static bool get(const Dictionary&, 146 static bool get(const Dictionary&,
144 const StringView& key, 147 const StringView& key,
145 PointerType<T>& value); 148 PointerType<T>& value);
146 template <typename T> 149 template <typename T>
147 static bool get(const Dictionary&, const StringView& key, Nullable<T>& value); 150 static bool get(const Dictionary&, const StringView& key, Nullable<T>& value);
148 }; 151 };
149 152
150 } // namespace blink 153 } // namespace blink
151 154
152 #endif // Dictionary_h 155 #endif // Dictionary_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698