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

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

Issue 340353006: [webcrypto] Replace KeyAlgorithm interfaces with an Object. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove const reference and make v8value a value 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 | « no previous file | Source/bindings/core/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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 class SpeechRecognitionResult; 59 class SpeechRecognitionResult;
60 class SpeechRecognitionResultList; 60 class SpeechRecognitionResultList;
61 class Storage; 61 class Storage;
62 class TrackBase; 62 class TrackBase;
63 class VoidCallback; 63 class VoidCallback;
64 64
65 class Dictionary { 65 class Dictionary {
66 ALLOW_ONLY_INLINE_ALLOCATION(); 66 ALLOW_ONLY_INLINE_ALLOCATION();
67 public: 67 public:
68 Dictionary(); 68 Dictionary();
69 // Creates an empty dictionary
70 explicit Dictionary(v8::Isolate*);
69 Dictionary(const v8::Handle<v8::Value>& options, v8::Isolate*); 71 Dictionary(const v8::Handle<v8::Value>& options, v8::Isolate*);
70 ~Dictionary(); 72 ~Dictionary();
71 73
72 Dictionary& operator=(const Dictionary&); 74 Dictionary& operator=(const Dictionary&);
73 75
74 bool isObject() const; 76 bool isObject() const;
75 bool isUndefinedOrNull() const; 77 bool isUndefinedOrNull() const;
76 78
77 bool get(const String&, bool&) const; 79 bool get(const String&, bool&) const;
78 bool get(const String&, int32_t&) const; 80 bool get(const String&, int32_t&) const;
(...skipping 22 matching lines...) Expand all
101 bool get(const String&, RefPtrWillBeMember<EventTarget>&) const; 103 bool get(const String&, RefPtrWillBeMember<EventTarget>&) const;
102 bool get(const String&, HashSet<AtomicString>&) const; 104 bool get(const String&, HashSet<AtomicString>&) const;
103 bool get(const String&, Dictionary&) const; 105 bool get(const String&, Dictionary&) const;
104 bool get(const String&, Vector<String>&) const; 106 bool get(const String&, Vector<String>&) const;
105 bool get(const String&, ArrayValue&) const; 107 bool get(const String&, ArrayValue&) const;
106 bool get(const String&, RefPtrWillBeMember<DOMError>&) const; 108 bool get(const String&, RefPtrWillBeMember<DOMError>&) const;
107 bool get(const String&, v8::Local<v8::Value>&) const; 109 bool get(const String&, v8::Local<v8::Value>&) const;
108 bool get(const String&, RefPtr<HeaderMap>&) const; 110 bool get(const String&, RefPtr<HeaderMap>&) const;
109 bool get(const String&, RefPtr<Headers>&) const; 111 bool get(const String&, RefPtr<Headers>&) const;
110 112
113 // Sets properties using default attributes.
114 bool set(const String&, const v8::Handle<v8::Value>&);
115 bool set(const String&, const String&);
116 bool set(const String&, unsigned);
117 bool set(const String&, const Dictionary&);
118
119 v8::Handle<v8::Value> v8Value() const { return m_options; }
120
111 class ConversionContext { 121 class ConversionContext {
112 public: 122 public:
113 ConversionContext(const String& interfaceName, const String& methodName, ExceptionState& exceptionState) 123 ConversionContext(const String& interfaceName, const String& methodName, ExceptionState& exceptionState)
114 : m_interfaceName(interfaceName) 124 : m_interfaceName(interfaceName)
115 , m_methodName(methodName) 125 , m_methodName(methodName)
116 , m_exceptionState(exceptionState) 126 , m_exceptionState(exceptionState)
117 , m_dirty(true) 127 , m_dirty(true)
118 { 128 {
119 resetPerPropertyContext(); 129 resetPerPropertyContext();
120 } 130 }
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 if (context.isNullable() && WebCore::isUndefinedOrNull(v8Value)) 356 if (context.isNullable() && WebCore::isUndefinedOrNull(v8Value))
347 return true; 357 return true;
348 358
349 context.throwTypeError(ExceptionMessages::incorrectPropertyType(key, "does n ot have a " + context.typeName() + " type.")); 359 context.throwTypeError(ExceptionMessages::incorrectPropertyType(key, "does n ot have a " + context.typeName() + " type."));
350 return false; 360 return false;
351 } 361 }
352 362
353 } 363 }
354 364
355 #endif // Dictionary_h 365 #endif // Dictionary_h
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/core/v8/Dictionary.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698