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

Side by Side Diff: third_party/WebKit/Source/modules/fetch/Response.cpp

Issue 2668903003: Replace WTF::emptyString{16Bit}() with a static global (Closed)
Patch Set: Replace WTF::emptyString{16Bit}() with a static global Created 3 years, 10 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 // 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 "modules/fetch/Response.h" 5 #include "modules/fetch/Response.h"
6 6
7 #include "bindings/core/v8/Dictionary.h" 7 #include "bindings/core/v8/Dictionary.h"
8 #include "bindings/core/v8/ExceptionState.h" 8 #include "bindings/core/v8/ExceptionState.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "bindings/core/v8/V8ArrayBuffer.h" 10 #include "bindings/core/v8/V8ArrayBuffer.h"
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 ASSERT_NOT_REACHED(); 331 ASSERT_NOT_REACHED();
332 return ""; 332 return "";
333 } 333 }
334 334
335 String Response::url() const { 335 String Response::url() const {
336 // "The url attribute's getter must return the empty string if response's 336 // "The url attribute's getter must return the empty string if response's
337 // url is null and response's url, serialized with the exclude fragment 337 // url is null and response's url, serialized with the exclude fragment
338 // flag set, otherwise." 338 // flag set, otherwise."
339 const KURL* responseURL = m_response->url(); 339 const KURL* responseURL = m_response->url();
340 if (!responseURL) 340 if (!responseURL)
341 return emptyString(); 341 return emptyString;
342 if (!responseURL->hasFragmentIdentifier()) 342 if (!responseURL->hasFragmentIdentifier())
343 return *responseURL; 343 return *responseURL;
344 KURL url(*responseURL); 344 KURL url(*responseURL);
345 url.removeFragmentIdentifier(); 345 url.removeFragmentIdentifier();
346 return url; 346 return url;
347 } 347 }
348 348
349 bool Response::redirected() const { 349 bool Response::redirected() const {
350 return m_response->urlList().size() > 1; 350 return m_response->urlList().size() > 1;
351 } 351 }
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 V8HiddenValue::internalBodyBuffer(scriptState->isolate()), bodyBuffer); 457 V8HiddenValue::internalBodyBuffer(scriptState->isolate()), bodyBuffer);
458 } 458 }
459 459
460 DEFINE_TRACE(Response) { 460 DEFINE_TRACE(Response) {
461 Body::trace(visitor); 461 Body::trace(visitor);
462 visitor->trace(m_response); 462 visitor->trace(m_response);
463 visitor->trace(m_headers); 463 visitor->trace(m_headers);
464 } 464 }
465 465
466 } // namespace blink 466 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698