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

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

Issue 373613004: [ServiceWorker] Make Response class better conformance with the spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
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 24 matching lines...) Expand all
35 #include "bindings/core/v8/V8EventTarget.h" 35 #include "bindings/core/v8/V8EventTarget.h"
36 #include "bindings/core/v8/V8MediaKeyError.h" 36 #include "bindings/core/v8/V8MediaKeyError.h"
37 #include "bindings/core/v8/V8MessagePort.h" 37 #include "bindings/core/v8/V8MessagePort.h"
38 #include "bindings/core/v8/V8Storage.h" 38 #include "bindings/core/v8/V8Storage.h"
39 #include "bindings/core/v8/V8TextTrack.h" 39 #include "bindings/core/v8/V8TextTrack.h"
40 #include "bindings/core/v8/V8VoidCallback.h" 40 #include "bindings/core/v8/V8VoidCallback.h"
41 #include "bindings/core/v8/V8Window.h" 41 #include "bindings/core/v8/V8Window.h"
42 #include "bindings/core/v8/custom/V8ArrayBufferViewCustom.h" 42 #include "bindings/core/v8/custom/V8ArrayBufferViewCustom.h"
43 #include "bindings/core/v8/custom/V8Uint8ArrayCustom.h" 43 #include "bindings/core/v8/custom/V8Uint8ArrayCustom.h"
44 #include "bindings/modules/v8/V8Gamepad.h" 44 #include "bindings/modules/v8/V8Gamepad.h"
45 #include "bindings/modules/v8/V8HeaderMap.h"
46 #include "bindings/modules/v8/V8Headers.h" 45 #include "bindings/modules/v8/V8Headers.h"
47 #include "bindings/modules/v8/V8IDBKeyRange.h" 46 #include "bindings/modules/v8/V8IDBKeyRange.h"
48 #include "bindings/modules/v8/V8MIDIPort.h" 47 #include "bindings/modules/v8/V8MIDIPort.h"
49 #include "bindings/modules/v8/V8MediaStream.h" 48 #include "bindings/modules/v8/V8MediaStream.h"
50 #include "bindings/modules/v8/V8SpeechRecognitionResult.h" 49 #include "bindings/modules/v8/V8SpeechRecognitionResult.h"
51 #include "bindings/modules/v8/V8SpeechRecognitionResultList.h" 50 #include "bindings/modules/v8/V8SpeechRecognitionResultList.h"
52 #include "core/html/track/TrackBase.h" 51 #include "core/html/track/TrackBase.h"
53 #include "modules/gamepad/Gamepad.h" 52 #include "modules/gamepad/Gamepad.h"
54 #include "modules/indexeddb/IDBKeyRange.h" 53 #include "modules/indexeddb/IDBKeyRange.h"
55 #include "modules/mediastream/MediaStream.h" 54 #include "modules/mediastream/MediaStream.h"
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 561
563 if (v8Value->IsObject()) { 562 if (v8Value->IsObject()) {
564 ASSERT(m_isolate); 563 ASSERT(m_isolate);
565 ASSERT(m_isolate == v8::Isolate::GetCurrent()); 564 ASSERT(m_isolate == v8::Isolate::GetCurrent());
566 value = Dictionary(v8Value, m_isolate); 565 value = Dictionary(v8Value, m_isolate);
567 } 566 }
568 567
569 return true; 568 return true;
570 } 569 }
571 570
572 bool Dictionary::get(const String& key, RefPtr<HeaderMap>& value) const
573 {
574 v8::Local<v8::Value> v8Value;
575 if (!getKey(key, v8Value))
576 return false;
577
578 value = V8HeaderMap::toNativeWithTypeCheck(m_isolate, v8Value);
579 return true;
580 }
581
582 bool Dictionary::get(const String& key, RefPtr<Headers>& value) const 571 bool Dictionary::get(const String& key, RefPtr<Headers>& value) const
583 { 572 {
584 v8::Local<v8::Value> v8Value; 573 v8::Local<v8::Value> v8Value;
585 if (!getKey(key, v8Value)) 574 if (!getKey(key, v8Value))
586 return false; 575 return false;
587 576
588 value = V8Headers::toNativeWithTypeCheck(m_isolate, v8Value); 577 value = V8Headers::toNativeWithTypeCheck(m_isolate, v8Value);
589 return true; 578 return true;
590 } 579 }
591 580
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 746
758 return *this; 747 return *this;
759 } 748 }
760 749
761 void Dictionary::ConversionContext::throwTypeError(const String& detail) 750 void Dictionary::ConversionContext::throwTypeError(const String& detail)
762 { 751 {
763 exceptionState().throwTypeError(detail); 752 exceptionState().throwTypeError(detail);
764 } 753 }
765 754
766 } // namespace WebCore 755 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698