| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "modules/serviceworkers/Headers.h" | 6 #include "modules/serviceworkers/Headers.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/Dictionary.h" | 8 #include "bindings/core/v8/Dictionary.h" |
| 9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
| 10 #include "core/fetch/CrossOriginAccessControl.h" | 10 #include "core/fetch/CrossOriginAccessControl.h" |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 } | 290 } |
| 291 } | 291 } |
| 292 | 292 |
| 293 Headers::Headers() | 293 Headers::Headers() |
| 294 : m_headerList(FetchHeaderList::create()) | 294 : m_headerList(FetchHeaderList::create()) |
| 295 , m_guard(NoneGuard) | 295 , m_guard(NoneGuard) |
| 296 { | 296 { |
| 297 ScriptWrappable::init(this); | 297 ScriptWrappable::init(this); |
| 298 } | 298 } |
| 299 | 299 |
| 300 // Called when creating Request or Responce. | 300 // Called when creating Request or Response. |
| 301 Headers::Headers(FetchHeaderList* headerList) | 301 Headers::Headers(FetchHeaderList* headerList) |
| 302 : m_headerList(headerList) | 302 : m_headerList(headerList) |
| 303 , m_guard(NoneGuard) | 303 , m_guard(NoneGuard) |
| 304 { | 304 { |
| 305 ScriptWrappable::init(this); | 305 ScriptWrappable::init(this); |
| 306 } | 306 } |
| 307 | 307 |
| 308 void Headers::forEachInternal(PassOwnPtr<HeadersForEachCallback> callback, Scrip
tValue* thisArg) | 308 void Headers::forEachInternal(PassOwnPtr<HeadersForEachCallback> callback, Scrip
tValue* thisArg) |
| 309 { | 309 { |
| 310 TrackExceptionState exceptionState; | 310 TrackExceptionState exceptionState; |
| 311 for (size_t i = 0; i < m_headerList->size(); ++i) { | 311 for (size_t i = 0; i < m_headerList->size(); ++i) { |
| 312 if (thisArg) | 312 if (thisArg) |
| 313 callback->handleItem(*thisArg, m_headerList->list()[i]->second, m_he
aderList->list()[i]->first, this); | 313 callback->handleItem(*thisArg, m_headerList->list()[i]->second, m_he
aderList->list()[i]->first, this); |
| 314 else | 314 else |
| 315 callback->handleItem(m_headerList->list()[i]->second, m_headerList->
list()[i]->first, this); | 315 callback->handleItem(m_headerList->list()[i]->second, m_headerList->
list()[i]->first, this); |
| 316 if (exceptionState.hadException()) | 316 if (exceptionState.hadException()) |
| 317 break; | 317 break; |
| 318 } | 318 } |
| 319 } | 319 } |
| 320 | 320 |
| 321 } // namespace WebCore | 321 } // namespace WebCore |
| OLD | NEW |