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

Side by Side Diff: chrome/browser/bookmarks/bookmark_html_writer.cc

Issue 10837044: Correct const accessors in base/values.(h|cc), Part II (ListValue) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/bookmarks/bookmark_html_writer.h" 5 #include "chrome/browser/bookmarks/bookmark_html_writer.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 !Write(kFolderChildren) || 326 !Write(kFolderChildren) ||
327 !Write(kNewline)) { 327 !Write(kNewline)) {
328 return false; 328 return false;
329 } 329 }
330 IncrementIndent(); 330 IncrementIndent();
331 } 331 }
332 332
333 // Write the children. 333 // Write the children.
334 const ListValue* children = static_cast<const ListValue*>(child_values); 334 const ListValue* children = static_cast<const ListValue*>(child_values);
335 for (size_t i = 0; i < children->GetSize(); ++i) { 335 for (size_t i = 0; i < children->GetSize(); ++i) {
336 Value* child_value; 336 const Value* child_value;
337 if (!children->Get(i, &child_value) || 337 if (!children->Get(i, &child_value) ||
338 child_value->GetType() != Value::TYPE_DICTIONARY) { 338 child_value->GetType() != Value::TYPE_DICTIONARY) {
339 NOTREACHED(); 339 NOTREACHED();
340 return false; 340 return false;
341 } 341 }
342 if (!WriteNode(*static_cast<const DictionaryValue*>(child_value), 342 if (!WriteNode(*static_cast<const DictionaryValue*>(child_value),
343 BookmarkNode::FOLDER)) { 343 BookmarkNode::FOLDER)) {
344 return false; 344 return false;
345 } 345 }
346 } 346 }
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 // BookmarkModel isn't thread safe (nor would we want to lock it down 494 // BookmarkModel isn't thread safe (nor would we want to lock it down
495 // for the duration of the write), as such we make a copy of the 495 // for the duration of the write), as such we make a copy of the
496 // BookmarkModel using BookmarkCodec then write from that. 496 // BookmarkModel using BookmarkCodec then write from that.
497 if (fetcher == NULL) { 497 if (fetcher == NULL) {
498 fetcher = new BookmarkFaviconFetcher(profile, path, observer); 498 fetcher = new BookmarkFaviconFetcher(profile, path, observer);
499 fetcher->ExportBookmarks(); 499 fetcher->ExportBookmarks();
500 } 500 }
501 } 501 }
502 502
503 } // namespace bookmark_html_writer 503 } // namespace bookmark_html_writer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698