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

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

Issue 287363004: ServiceWorker: support Response.{status,statusText,headers} [blink] (2/3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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/v8/Dictionary.h ('k') | Source/modules/modules.gypi » ('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 11 matching lines...) Expand all
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #include "config.h" 26 #include "config.h"
27 #include "bindings/v8/Dictionary.h" 27 #include "bindings/v8/Dictionary.h"
28 28
29 #include "V8DOMError.h" 29 #include "V8DOMError.h"
30 #include "V8EventTarget.h" 30 #include "V8EventTarget.h"
31 #include "V8Gamepad.h" 31 #include "V8Gamepad.h"
32 #include "V8HeaderMap.h"
32 #include "V8IDBKeyRange.h" 33 #include "V8IDBKeyRange.h"
33 #include "V8MIDIPort.h" 34 #include "V8MIDIPort.h"
34 #include "V8MediaKeyError.h" 35 #include "V8MediaKeyError.h"
35 #include "V8MessagePort.h" 36 #include "V8MessagePort.h"
36 #include "V8SpeechRecognitionError.h" 37 #include "V8SpeechRecognitionError.h"
37 #include "V8SpeechRecognitionResult.h" 38 #include "V8SpeechRecognitionResult.h"
38 #include "V8SpeechRecognitionResultList.h" 39 #include "V8SpeechRecognitionResultList.h"
39 #include "V8Storage.h" 40 #include "V8Storage.h"
40 #include "V8VoidCallback.h" 41 #include "V8VoidCallback.h"
41 #include "V8Window.h" 42 #include "V8Window.h"
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 564
564 if (v8Value->IsObject()) { 565 if (v8Value->IsObject()) {
565 ASSERT(m_isolate); 566 ASSERT(m_isolate);
566 ASSERT(m_isolate == v8::Isolate::GetCurrent()); 567 ASSERT(m_isolate == v8::Isolate::GetCurrent());
567 value = Dictionary(v8Value, m_isolate); 568 value = Dictionary(v8Value, m_isolate);
568 } 569 }
569 570
570 return true; 571 return true;
571 } 572 }
572 573
574 bool Dictionary::get(const String& key, RefPtr<HeaderMap>& value) const
575 {
576 v8::Local<v8::Value> v8Value;
577 if (!getKey(key, v8Value))
578 return false;
579
580 value = V8HeaderMap::toNativeWithTypeCheck(m_isolate, v8Value);
581 return true;
582 }
583
573 bool Dictionary::convert(ConversionContext& context, const String& key, Dictiona ry& value) const 584 bool Dictionary::convert(ConversionContext& context, const String& key, Dictiona ry& value) const
574 { 585 {
575 ConversionContextScope scope(context); 586 ConversionContextScope scope(context);
576 587
577 v8::Local<v8::Value> v8Value; 588 v8::Local<v8::Value> v8Value;
578 if (!getKey(key, v8Value)) 589 if (!getKey(key, v8Value))
579 return true; 590 return true;
580 591
581 if (v8Value->IsObject()) 592 if (v8Value->IsObject())
582 return get(key, value); 593 return get(key, value);
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 749
739 return *this; 750 return *this;
740 } 751 }
741 752
742 void Dictionary::ConversionContext::throwTypeError(const String& detail) 753 void Dictionary::ConversionContext::throwTypeError(const String& detail)
743 { 754 {
744 exceptionState().throwTypeError(detail); 755 exceptionState().throwTypeError(detail);
745 } 756 }
746 757
747 } // namespace WebCore 758 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/Dictionary.h ('k') | Source/modules/modules.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698