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

Side by Side Diff: third_party/WebKit/Source/platform/json/JSONValues.cpp

Issue 2795393002: Make JSONArray::at() a const member function. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/platform/json/JSONValues.h ('k') | no next file » | 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 void JSONArray::pushObject(std::unique_ptr<JSONObject> value) { 476 void JSONArray::pushObject(std::unique_ptr<JSONObject> value) {
477 DCHECK(value); 477 DCHECK(value);
478 m_data.push_back(std::move(value)); 478 m_data.push_back(std::move(value));
479 } 479 }
480 480
481 void JSONArray::pushArray(std::unique_ptr<JSONArray> value) { 481 void JSONArray::pushArray(std::unique_ptr<JSONArray> value) {
482 DCHECK(value); 482 DCHECK(value);
483 m_data.push_back(std::move(value)); 483 m_data.push_back(std::move(value));
484 } 484 }
485 485
486 JSONValue* JSONArray::at(size_t index) { 486 JSONValue* JSONArray::at(size_t index) const {
487 DCHECK_LT(index, m_data.size()); 487 DCHECK_LT(index, m_data.size());
488 return m_data[index].get(); 488 return m_data[index].get();
489 } 489 }
490 490
491 } // namespace blink 491 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/json/JSONValues.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698