summaryrefslogtreecommitdiffstats
path: root/components/bookmarks
diff options
context:
space:
mode:
authortfarina <tfarina@chromium.org>2015-07-03 10:59:44 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-03 18:01:33 +0000
commite6b7345adcbe460f4c4c750cd01b5a4f5db5bdd5 (patch)
tree389f295069c863297cb1ad7d0e8820033b40a76f /components/bookmarks
parent7387b615a19f1df715798b777541a9cf21966315 (diff)
downloadchromium_src-e6b7345adcbe460f4c4c750cd01b5a4f5db5bdd5.zip
chromium_src-e6b7345adcbe460f4c4c750cd01b5a4f5db5bdd5.tar.gz
chromium_src-e6b7345adcbe460f4c4c750cd01b5a4f5db5bdd5.tar.bz2
bookmarks: Remove includes of basictypes.h.
We can just use the standard integer types from stdint.h now that our supported toolchain supports it and for the DISALLOW_COPY_AND_ASSIGN macro variants we should just include base/macros.h instead. BUG=138542 TEST=components_unittests R=sky@chromium.org Review URL: https://codereview.chromium.org/1220813007 Cr-Commit-Position: refs/heads/master@{#337320}
Diffstat (limited to 'components/bookmarks')
-rw-r--r--components/bookmarks/browser/base_bookmark_model_observer.h3
-rw-r--r--components/bookmarks/browser/bookmark_codec.cc20
-rw-r--r--components/bookmarks/browser/bookmark_codec.h17
-rw-r--r--components/bookmarks/browser/bookmark_index.h2
-rw-r--r--components/bookmarks/browser/bookmark_model.h13
-rw-r--r--components/bookmarks/browser/bookmark_model_unittest.cc3
-rw-r--r--components/bookmarks/browser/bookmark_node_data.cc1
-rw-r--r--components/bookmarks/browser/bookmark_node_data_unittest.cc4
-rw-r--r--components/bookmarks/browser/bookmark_utils.cc12
-rw-r--r--components/bookmarks/browser/startup_task_runner_service.h1
-rw-r--r--components/bookmarks/test/bookmark_test_helpers.cc3
11 files changed, 39 insertions, 40 deletions
diff --git a/components/bookmarks/browser/base_bookmark_model_observer.h b/components/bookmarks/browser/base_bookmark_model_observer.h
index 37a0107..14a184e 100644
--- a/components/bookmarks/browser/base_bookmark_model_observer.h
+++ b/components/bookmarks/browser/base_bookmark_model_observer.h
@@ -5,8 +5,7 @@
#ifndef COMPONENTS_BOOKMARKS_BROWSER_BASE_BOOKMARK_MODEL_OBSERVER_H_
#define COMPONENTS_BOOKMARKS_BROWSER_BASE_BOOKMARK_MODEL_OBSERVER_H_
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "components/bookmarks/browser/bookmark_model_observer.h"
namespace bookmarks {
diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmarks/browser/bookmark_codec.cc
index 9ea5ae4..52f1a94 100644
--- a/components/bookmarks/browser/bookmark_codec.cc
+++ b/components/bookmarks/browser/bookmark_codec.cc
@@ -64,7 +64,7 @@ base::Value* BookmarkCodec::Encode(
const BookmarkNode* other_folder_node,
const BookmarkNode* mobile_folder_node,
const BookmarkNode::MetaInfoMap* model_meta_info_map,
- int64 sync_transaction_version) {
+ int64_t sync_transaction_version) {
ids_reassigned_ = false;
InitializeChecksum();
base::DictionaryValue* roots = new base::DictionaryValue();
@@ -92,7 +92,7 @@ base::Value* BookmarkCodec::Encode(
bool BookmarkCodec::Decode(BookmarkNode* bb_node,
BookmarkNode* other_folder_node,
BookmarkNode* mobile_folder_node,
- int64* max_id,
+ int64_t* max_id,
const base::Value& value) {
ids_.clear();
ids_reassigned_ = false;
@@ -126,9 +126,9 @@ base::Value* BookmarkCodec::EncodeNode(const BookmarkNode* node) {
UpdateChecksumWithUrlNode(id, title, url);
} else {
value->SetString(kTypeKey, kTypeFolder);
- value->SetString(kDateModifiedKey,
- base::Int64ToString(node->date_folder_modified().
- ToInternalValue()));
+ value->SetString(
+ kDateModifiedKey,
+ base::Int64ToString(node->date_folder_modified().ToInternalValue()));
UpdateChecksumWithFolderNode(id, title);
base::ListValue* child_values = new base::ListValue();
@@ -268,7 +268,7 @@ bool BookmarkCodec::DecodeNode(const base::DictionaryValue& value,
}
std::string id_string;
- int64 id = 0;
+ int64_t id = 0;
if (ids_valid_) {
if (!value.GetString(kIdKey, &id_string) ||
!base::StringToInt64(id_string, &id) ||
@@ -287,7 +287,7 @@ bool BookmarkCodec::DecodeNode(const base::DictionaryValue& value,
std::string date_added_string;
if (!value.GetString(kDateAddedKey, &date_added_string))
date_added_string = base::Int64ToString(Time::Now().ToInternalValue());
- int64 internal_time;
+ int64_t internal_time;
base::StringToInt64(date_added_string, &internal_time);
std::string type_string;
@@ -332,7 +332,7 @@ bool BookmarkCodec::DecodeNode(const base::DictionaryValue& value,
}
node->set_type(BookmarkNode::FOLDER);
- int64 internal_time;
+ int64_t internal_time;
base::StringToInt64(last_modified_date, &internal_time);
node->set_date_folder_modified(Time::FromInternalValue(internal_time));
@@ -351,7 +351,7 @@ bool BookmarkCodec::DecodeNode(const base::DictionaryValue& value,
node->SetTitle(title);
node->set_date_added(Time::FromInternalValue(internal_time));
- int64 sync_transaction_version = node->sync_transaction_version();
+ int64_t sync_transaction_version = node->sync_transaction_version();
BookmarkNode::MetaInfoMap meta_info_map;
if (!DecodeMetaInfo(value, &meta_info_map, &sync_transaction_version))
return false;
@@ -370,7 +370,7 @@ bool BookmarkCodec::DecodeNode(const base::DictionaryValue& value,
bool BookmarkCodec::DecodeMetaInfo(const base::DictionaryValue& value,
BookmarkNode::MetaInfoMap* meta_info_map,
- int64* sync_transaction_version) {
+ int64_t* sync_transaction_version) {
DCHECK(meta_info_map);
DCHECK(sync_transaction_version);
meta_info_map->clear();
diff --git a/components/bookmarks/browser/bookmark_codec.h b/components/bookmarks/browser/bookmark_codec.h
index 761ee48..4697e79 100644
--- a/components/bookmarks/browser/bookmark_codec.h
+++ b/components/bookmarks/browser/bookmark_codec.h
@@ -5,10 +5,11 @@
#ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CODEC_H_
#define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CODEC_H_
+#include <stdint.h>
#include <set>
#include <string>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/md5.h"
#include "base/strings/string16.h"
#include "components/bookmarks/browser/bookmark_node.h"
@@ -47,7 +48,7 @@ class BookmarkCodec {
const BookmarkNode* other_folder_node,
const BookmarkNode* mobile_folder_node,
const BookmarkNode::MetaInfoMap* model_meta_info_map,
- int64 sync_transaction_version);
+ int64_t sync_transaction_version);
// Decodes the previously encoded value to the specified nodes as well as
// setting |max_node_id| to the greatest node id. Returns true on success,
@@ -57,7 +58,7 @@ class BookmarkCodec {
bool Decode(BookmarkNode* bb_node,
BookmarkNode* other_folder_node,
BookmarkNode* mobile_folder_node,
- int64* max_node_id,
+ int64_t* max_node_id,
const base::Value& value);
// Returns the checksum computed during last encoding/decoding call.
@@ -76,7 +77,7 @@ class BookmarkCodec {
}
// Return the sync transaction version of the bookmark model root.
- int64 model_sync_transaction_version() const {
+ int64_t model_sync_transaction_version() const {
return model_sync_transaction_version_;
}
@@ -147,7 +148,7 @@ class BookmarkCodec {
// meta_info_map and sync_transaction_version must not be NULL.
bool DecodeMetaInfo(const base::DictionaryValue& value,
BookmarkNode::MetaInfoMap* meta_info_map,
- int64* sync_transaction_version);
+ int64_t* sync_transaction_version);
// Decodes the meta info from the supplied sub-node dictionary. The values
// found will be inserted in meta_info_map with the given prefix added to the
@@ -185,7 +186,7 @@ class BookmarkCodec {
// Contains the id of each of the nodes found in the file. Used to determine
// if we have duplicates.
- std::set<int64> ids_;
+ std::set<int64_t> ids_;
// MD5 context used to compute MD5 hash of all bookmark data.
base::MD5Context md5_context_;
@@ -195,13 +196,13 @@ class BookmarkCodec {
std::string stored_checksum_;
// Maximum ID assigned when decoding data.
- int64 maximum_id_;
+ int64_t maximum_id_;
// Meta info set on bookmark model root.
BookmarkNode::MetaInfoMap model_meta_info_map_;
// Sync transaction version set on bookmark model root.
- int64 model_sync_transaction_version_;
+ int64_t model_sync_transaction_version_;
DISALLOW_COPY_AND_ASSIGN(BookmarkCodec);
};
diff --git a/components/bookmarks/browser/bookmark_index.h b/components/bookmarks/browser/bookmark_index.h
index b639fbf..8763d93 100644
--- a/components/bookmarks/browser/bookmark_index.h
+++ b/components/bookmarks/browser/bookmark_index.h
@@ -10,7 +10,7 @@
#include <string>
#include <vector>
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/strings/string16.h"
#include "components/query_parser/query_parser.h"
diff --git a/components/bookmarks/browser/bookmark_model.h b/components/bookmarks/browser/bookmark_model.h
index 50760c8..dbaf607 100644
--- a/components/bookmarks/browser/bookmark_model.h
+++ b/components/bookmarks/browser/bookmark_model.h
@@ -5,12 +5,13 @@
#ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_
#define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_
+#include <stdint.h>
#include <map>
#include <set>
#include <vector>
-#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
@@ -257,7 +258,7 @@ class BookmarkModel : public KeyedService {
void ClearStore();
// Returns the next node ID.
- int64 next_node_id() const { return next_node_id_; }
+ int64_t next_node_id() const { return next_node_id_; }
// Returns the object responsible for tracking the set of expanded nodes in
// the bookmark editor.
@@ -294,7 +295,7 @@ class BookmarkModel : public KeyedService {
// Sets the sync transaction version of |node|.
void SetNodeSyncTransactionVersion(const BookmarkNode* node,
- int64 sync_transaction_version);
+ int64_t sync_transaction_version);
// Notify BookmarkModel that the favicons for |urls| have changed and have to
// be refetched. This notification is sent by BookmarkClient.
@@ -387,12 +388,12 @@ class BookmarkModel : public KeyedService {
void EndGroupedChanges();
// Generates and returns the next node ID.
- int64 generate_next_node_id();
+ int64_t generate_next_node_id();
// Sets the maximum node ID to the given value.
// This is used by BookmarkCodec to report the maximum ID after it's done
// decoding since during decoding codec assigns node IDs.
- void set_next_node_id(int64 id) { next_node_id_ = id; }
+ void set_next_node_id(int64_t id) { next_node_id_ = id; }
// Creates and returns a new BookmarkLoadDetails. It's up to the caller to
// delete the returned object.
@@ -413,7 +414,7 @@ class BookmarkModel : public KeyedService {
BookmarkPermanentNode* mobile_node_;
// The maximum ID assigned to the bookmark nodes in the model.
- int64 next_node_id_;
+ int64_t next_node_id_;
// The observers.
base::ObserverList<BookmarkModelObserver> observers_;
diff --git a/components/bookmarks/browser/bookmark_model_unittest.cc b/components/bookmarks/browser/bookmark_model_unittest.cc
index bf4f917..37d6bf6 100644
--- a/components/bookmarks/browser/bookmark_model_unittest.cc
+++ b/components/bookmarks/browser/bookmark_model_unittest.cc
@@ -8,7 +8,6 @@
#include <string>
#include "base/base_paths.h"
-#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/containers/hash_tables.h"
@@ -202,7 +201,7 @@ void VerifyModelMatchesNode(TestNode* expected, const BookmarkNode* actual) {
void VerifyNoDuplicateIDs(BookmarkModel* model) {
ui::TreeNodeIterator<const BookmarkNode> it(model->root_node());
- base::hash_set<int64> ids;
+ base::hash_set<int64_t> ids;
while (it.has_next())
ASSERT_TRUE(ids.insert(it.Next()->id()).second);
}
diff --git a/components/bookmarks/browser/bookmark_node_data.cc b/components/bookmarks/browser/bookmark_node_data.cc
index 36b1bdd..da1d675 100644
--- a/components/bookmarks/browser/bookmark_node_data.cc
+++ b/components/bookmarks/browser/bookmark_node_data.cc
@@ -6,7 +6,6 @@
#include <string>
-#include "base/basictypes.h"
#include "base/pickle.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
diff --git a/components/bookmarks/browser/bookmark_node_data_unittest.cc b/components/bookmarks/browser/bookmark_node_data_unittest.cc
index 3e11e3e..56449bd 100644
--- a/components/bookmarks/browser/bookmark_node_data_unittest.cc
+++ b/components/bookmarks/browser/bookmark_node_data_unittest.cc
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/basictypes.h"
+#include "components/bookmarks/browser/bookmark_node_data.h"
+
#include "base/files/scoped_temp_dir.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "components/bookmarks/browser/bookmark_model.h"
-#include "components/bookmarks/browser/bookmark_node_data.h"
#include "components/bookmarks/test/bookmark_test_helpers.h"
#include "components/bookmarks/test/test_bookmark_client.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/components/bookmarks/browser/bookmark_utils.cc b/components/bookmarks/browser/bookmark_utils.cc
index 13f999a..ab62858 100644
--- a/components/bookmarks/browser/bookmark_utils.cc
+++ b/components/bookmarks/browser/bookmark_utils.cc
@@ -4,14 +4,15 @@
#include "components/bookmarks/browser/bookmark_utils.h"
+#include <stdint.h>
#include <utility>
-#include "base/basictypes.h"
#include "base/bind.h"
#include "base/containers/hash_tables.h"
#include "base/files/file_path.h"
#include "base/i18n/case_conversion.h"
#include "base/i18n/string_search.h"
+#include "base/macros.h"
#include "base/metrics/user_metrics_action.h"
#include "base/prefs/pref_service.h"
#include "base/strings/string_util.h"
@@ -124,7 +125,7 @@ bool HasSelectedAncestor(BookmarkModel* model,
return HasSelectedAncestor(model, selected_nodes, node->parent());
}
-const BookmarkNode* GetNodeByID(const BookmarkNode* node, int64 id) {
+const BookmarkNode* GetNodeByID(const BookmarkNode* node, int64_t id) {
if (node->id() == id)
return node;
@@ -466,10 +467,10 @@ const BookmarkNode* GetParentForNewNodes(
}
void DeleteBookmarkFolders(BookmarkModel* model,
- const std::vector<int64>& ids) {
+ const std::vector<int64_t>& ids) {
// Remove the folders that were removed. This has to be done after all the
// other changes have been committed.
- for (std::vector<int64>::const_iterator iter = ids.begin();
+ for (std::vector<int64_t>::const_iterator iter = ids.begin();
iter != ids.end();
++iter) {
const BookmarkNode* node = GetBookmarkNodeByID(model, *iter);
@@ -537,7 +538,8 @@ bool IsBookmarkedByUser(BookmarkModel* model, const GURL& url) {
return false;
}
-const BookmarkNode* GetBookmarkNodeByID(const BookmarkModel* model, int64 id) {
+const BookmarkNode* GetBookmarkNodeByID(const BookmarkModel* model,
+ int64_t id) {
// TODO(sky): TreeNode needs a method that visits all nodes using a predicate.
return GetNodeByID(model->root_node(), id);
}
diff --git a/components/bookmarks/browser/startup_task_runner_service.h b/components/bookmarks/browser/startup_task_runner_service.h
index 68d25c9..b39819a 100644
--- a/components/bookmarks/browser/startup_task_runner_service.h
+++ b/components/bookmarks/browser/startup_task_runner_service.h
@@ -5,7 +5,6 @@
#ifndef COMPONENTS_BOOKMARKS_BROWSER_STARTUP_TASK_RUNNER_SERVICE_H_
#define COMPONENTS_BOOKMARKS_BROWSER_STARTUP_TASK_RUNNER_SERVICE_H_
-#include "base/basictypes.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/threading/non_thread_safe.h"
diff --git a/components/bookmarks/test/bookmark_test_helpers.cc b/components/bookmarks/test/bookmark_test_helpers.cc
index a8c6d94..b10afa6 100644
--- a/components/bookmarks/test/bookmark_test_helpers.cc
+++ b/components/bookmarks/test/bookmark_test_helpers.cc
@@ -4,10 +4,9 @@
#include "components/bookmarks/test/bookmark_test_helpers.h"
-#include "base/basictypes.h"
#include "base/callback.h"
-#include "base/compiler_specific.h"
#include "base/logging.h"
+#include "base/macros.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "components/bookmarks/browser/base_bookmark_model_observer.h"