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

Side by Side Diff: Source/bindings/v8/Dictionary.h

Issue 340353006: [webcrypto] Replace KeyAlgorithm interfaces with an Object. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase onto master Created 6 years, 5 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
« no previous file with comments | « Source/bindings/modules/v8/custom/custom.gypi ('k') | Source/bindings/v8/Dictionary.cpp » ('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) 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 class SpeechRecognitionResult; 58 class SpeechRecognitionResult;
59 class SpeechRecognitionResultList; 59 class SpeechRecognitionResultList;
60 class Storage; 60 class Storage;
61 class TrackBase; 61 class TrackBase;
62 class VoidCallback; 62 class VoidCallback;
63 63
64 class Dictionary { 64 class Dictionary {
65 ALLOW_ONLY_INLINE_ALLOCATION(); 65 ALLOW_ONLY_INLINE_ALLOCATION();
66 public: 66 public:
67 Dictionary(); 67 Dictionary();
68 // Creates an empty dictionary
69 explicit Dictionary(v8::Isolate*);
haraken 2014/07/08 04:28:08 Instead of using a constructor, we might want to i
eroman 2014/07/08 19:24:21 I will send you this change in a new changelist! (
68 Dictionary(const v8::Handle<v8::Value>& options, v8::Isolate*); 70 Dictionary(const v8::Handle<v8::Value>& options, v8::Isolate*);
69 ~Dictionary(); 71 ~Dictionary();
70 72
71 Dictionary& operator=(const Dictionary&); 73 Dictionary& operator=(const Dictionary&);
72 74
73 bool isObject() const; 75 bool isObject() const;
74 bool isUndefinedOrNull() const; 76 bool isUndefinedOrNull() const;
75 77
76 bool get(const String&, bool&) const; 78 bool get(const String&, bool&) const;
77 bool get(const String&, int32_t&) const; 79 bool get(const String&, int32_t&) const;
(...skipping 22 matching lines...) Expand all
100 bool get(const String&, RefPtrWillBeMember<EventTarget>&) const; 102 bool get(const String&, RefPtrWillBeMember<EventTarget>&) const;
101 bool get(const String&, HashSet<AtomicString>&) const; 103 bool get(const String&, HashSet<AtomicString>&) const;
102 bool get(const String&, Dictionary&) const; 104 bool get(const String&, Dictionary&) const;
103 bool get(const String&, Vector<String>&) const; 105 bool get(const String&, Vector<String>&) const;
104 bool get(const String&, ArrayValue&) const; 106 bool get(const String&, ArrayValue&) const;
105 bool get(const String&, RefPtrWillBeMember<DOMError>&) const; 107 bool get(const String&, RefPtrWillBeMember<DOMError>&) const;
106 bool get(const String&, v8::Local<v8::Value>&) const; 108 bool get(const String&, v8::Local<v8::Value>&) const;
107 bool get(const String&, RefPtr<HeaderMap>&) const; 109 bool get(const String&, RefPtr<HeaderMap>&) const;
108 bool get(const String&, RefPtr<Headers>&) const; 110 bool get(const String&, RefPtr<Headers>&) const;
109 111
112 // Sets properties using default attributes.
113 bool set(const String&, const v8::Handle<v8::Value>&);
114 bool set(const String&, const String&);
115 bool set(const String&, unsigned);
116 bool set(const String&, const Dictionary&);
117
118 const v8::Handle<v8::Value>& v8Value() const { return m_options; }
abarth-chromium 2014/07/08 02:07:05 No need to return a v8::Handle by const reference.
119
110 class ConversionContext { 120 class ConversionContext {
111 public: 121 public:
112 ConversionContext(const String& interfaceName, const String& methodName, ExceptionState& exceptionState) 122 ConversionContext(const String& interfaceName, const String& methodName, ExceptionState& exceptionState)
113 : m_interfaceName(interfaceName) 123 : m_interfaceName(interfaceName)
114 , m_methodName(methodName) 124 , m_methodName(methodName)
115 , m_exceptionState(exceptionState) 125 , m_exceptionState(exceptionState)
116 , m_dirty(true) 126 , m_dirty(true)
117 { 127 {
118 resetPerPropertyContext(); 128 resetPerPropertyContext();
119 } 129 }
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 if (context.isNullable() && WebCore::isUndefinedOrNull(v8Value)) 354 if (context.isNullable() && WebCore::isUndefinedOrNull(v8Value))
345 return true; 355 return true;
346 356
347 context.throwTypeError(ExceptionMessages::incorrectPropertyType(key, "does n ot have a " + context.typeName() + " type.")); 357 context.throwTypeError(ExceptionMessages::incorrectPropertyType(key, "does n ot have a " + context.typeName() + " type."));
348 return false; 358 return false;
349 } 359 }
350 360
351 } 361 }
352 362
353 #endif // Dictionary_h 363 #endif // Dictionary_h
OLDNEW
« no previous file with comments | « Source/bindings/modules/v8/custom/custom.gypi ('k') | Source/bindings/v8/Dictionary.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698