diff options
Diffstat (limited to 'chrome/browser/spellchecker')
34 files changed, 190 insertions, 118 deletions
diff --git a/chrome/browser/spellchecker/feedback.cc b/chrome/browser/spellchecker/feedback.cc index fc2c414..17bc4b7 100644 --- a/chrome/browser/spellchecker/feedback.cc +++ b/chrome/browser/spellchecker/feedback.cc @@ -3,7 +3,7 @@ // found in the LICENSE file. // // The |Feedback| object keeps track of each instance of user feedback in a map -// |misspellings_|. This is a map from uint32 hashes to |Misspelling| objects. +// |misspellings_|. This is a map from uint32_t hashes to |Misspelling| objects. // // Each misspelling should be present in only one renderer process. The // |Feedback| objects keeps track of misspelling-renderer relationship in the @@ -32,7 +32,7 @@ Feedback::Feedback(size_t max_total_text_size) Feedback::~Feedback() {} -Misspelling* Feedback::GetMisspelling(uint32 hash) { +Misspelling* Feedback::GetMisspelling(uint32_t hash) { HashMisspellingMap::iterator misspelling_it = misspellings_.find(hash); if (misspelling_it == misspellings_.end()) return NULL; @@ -41,7 +41,7 @@ Misspelling* Feedback::GetMisspelling(uint32 hash) { void Feedback::FinalizeRemovedMisspellings( int renderer_process_id, - const std::vector<uint32>& remaining_markers) { + const std::vector<uint32_t>& remaining_markers) { RendererHashesMap::iterator renderer_it = renderers_.find(renderer_process_id); if (renderer_it == renderers_.end() || renderer_it->second.empty()) @@ -49,10 +49,10 @@ void Feedback::FinalizeRemovedMisspellings( HashCollection& renderer_hashes = renderer_it->second; HashCollection remaining_hashes(remaining_markers.begin(), remaining_markers.end()); - std::vector<uint32> removed_hashes = - base::STLSetDifference<std::vector<uint32>>(renderer_hashes, - remaining_hashes); - for (std::vector<uint32>::const_iterator hash_it = removed_hashes.begin(); + std::vector<uint32_t> removed_hashes = + base::STLSetDifference<std::vector<uint32_t>>(renderer_hashes, + remaining_hashes); + for (std::vector<uint32_t>::const_iterator hash_it = removed_hashes.begin(); hash_it != removed_hashes.end(); ++hash_it) { HashMisspellingMap::iterator misspelling_it = misspellings_.find(*hash_it); if (misspelling_it != misspellings_.end() && @@ -116,7 +116,7 @@ void Feedback::EraseFinalizedMisspellings(int renderer_process_id) { renderers_.erase(renderer_it); } -bool Feedback::HasMisspelling(uint32 hash) const { +bool Feedback::HasMisspelling(uint32_t hash) const { return !!misspellings_.count(hash); } @@ -190,7 +190,7 @@ void Feedback::Clear() { renderers_.clear(); } -const std::set<uint32>& Feedback::FindMisspellings( +const std::set<uint32_t>& Feedback::FindMisspellings( const base::string16& misspelled_text) const { const TextHashesMap::const_iterator text_it = text_.find(misspelled_text); return text_it == text_.end() ? empty_hash_collection_ : text_it->second; diff --git a/chrome/browser/spellchecker/feedback.h b/chrome/browser/spellchecker/feedback.h index d98ba12..c79c0b8 100644 --- a/chrome/browser/spellchecker/feedback.h +++ b/chrome/browser/spellchecker/feedback.h @@ -12,10 +12,14 @@ #ifndef CHROME_BROWSER_SPELLCHECKER_FEEDBACK_H_ #define CHROME_BROWSER_SPELLCHECKER_FEEDBACK_H_ +#include <stddef.h> +#include <stdint.h> + #include <map> #include <set> #include <vector> +#include "base/macros.h" #include "chrome/browser/spellchecker/misspelling.h" namespace spellcheck { @@ -26,7 +30,7 @@ namespace spellcheck { // base::ASCIIToUTF16("Helllo world"), 0, 6, // std::vector<base::string16>(), GenerateRandomHash())); // feedback.FinalizeRemovedMisspellings(renderer_process_id, -// std::vector<uint32>()); +// std::vector<uint32_t>()); // ProcessFeedback(feedback.GetMisspellingsInRenderer(renderer_process_id)); // feedback.EraseFinalizedMisspellings(renderer_process_id); class Feedback { @@ -37,13 +41,13 @@ class Feedback { // Returns the misspelling identified by |hash|. Returns NULL if there's no // misspelling identified by |hash|. Retains the ownership of the result. The // caller should not modify the hash in the returned misspelling. - Misspelling* GetMisspelling(uint32 hash); + Misspelling* GetMisspelling(uint32_t hash); // Finalizes the user actions on misspellings that are removed from the // renderer process with ID |renderer_process_id|. void FinalizeRemovedMisspellings( int renderer_process_id, - const std::vector<uint32>& remaining_markers); + const std::vector<uint32_t>& remaining_markers); // Returns true if the renderer with process ID |renderer_process_id| has // misspellings. @@ -59,7 +63,7 @@ class Feedback { void EraseFinalizedMisspellings(int renderer_process_id); // Returns true if there's a misspelling with |hash| identifier. - bool HasMisspelling(uint32 hash) const; + bool HasMisspelling(uint32_t hash) const; // Adds the |misspelling| to feedback data. If the |misspelling| has a // duplicate hash, then replaces the existing misspelling with the same hash. @@ -81,12 +85,12 @@ class Feedback { void Clear(); // Returns a list of all misspelling identifiers for |misspelled_text|. - const std::set<uint32>& FindMisspellings( + const std::set<uint32_t>& FindMisspellings( const base::string16& misspelled_text) const; private: - typedef std::map<uint32, Misspelling> HashMisspellingMap; - typedef std::set<uint32> HashCollection; + typedef std::map<uint32_t, Misspelling> HashMisspellingMap; + typedef std::set<uint32_t> HashCollection; typedef std::map<int, HashCollection> RendererHashesMap; typedef std::map<base::string16, HashCollection> TextHashesMap; diff --git a/chrome/browser/spellchecker/feedback_sender.cc b/chrome/browser/spellchecker/feedback_sender.cc index 99b1baf..4bfb824 100644 --- a/chrome/browser/spellchecker/feedback_sender.cc +++ b/chrome/browser/spellchecker/feedback_sender.cc @@ -69,7 +69,7 @@ const int kMinIntervalSeconds = 5; // Returns a hash of |session_start|, the current timestamp, and // |suggestion_index|. -uint32 BuildHash(const base::Time& session_start, size_t suggestion_index) { +uint32_t BuildHash(const base::Time& session_start, size_t suggestion_index) { return base::Hash( base::StringPrintf("%" PRId64 "%" PRId64 "%" PRIuS, session_start.ToInternalValue(), @@ -185,7 +185,7 @@ FeedbackSender::FeedbackSender(net::URLRequestContextGetter* request_context, FeedbackSender::~FeedbackSender() { } -void FeedbackSender::SelectedSuggestion(uint32 hash, int suggestion_index) { +void FeedbackSender::SelectedSuggestion(uint32_t hash, int suggestion_index) { Misspelling* misspelling = feedback_.GetMisspelling(hash); // GetMisspelling() returns null for flushed feedback. Feedback is flushed // when the session expires every |kSessionHours| hours. @@ -196,7 +196,7 @@ void FeedbackSender::SelectedSuggestion(uint32 hash, int suggestion_index) { misspelling->timestamp = base::Time::Now(); } -void FeedbackSender::AddedToDictionary(uint32 hash) { +void FeedbackSender::AddedToDictionary(uint32_t hash) { Misspelling* misspelling = feedback_.GetMisspelling(hash); // GetMisspelling() returns null for flushed feedback. Feedback is flushed // when the session expires every |kSessionHours| hours. @@ -204,11 +204,10 @@ void FeedbackSender::AddedToDictionary(uint32 hash) { return; misspelling->action.set_type(SpellcheckAction::TYPE_ADD_TO_DICT); misspelling->timestamp = base::Time::Now(); - const std::set<uint32>& hashes = + const std::set<uint32_t>& hashes = feedback_.FindMisspellings(GetMisspelledString(*misspelling)); - for (std::set<uint32>::const_iterator hash_it = hashes.begin(); - hash_it != hashes.end(); - ++hash_it) { + for (std::set<uint32_t>::const_iterator hash_it = hashes.begin(); + hash_it != hashes.end(); ++hash_it) { Misspelling* duplicate_misspelling = feedback_.GetMisspelling(*hash_it); if (!duplicate_misspelling || duplicate_misspelling->action.IsFinal()) continue; @@ -217,7 +216,7 @@ void FeedbackSender::AddedToDictionary(uint32 hash) { } } -void FeedbackSender::RecordInDictionary(uint32 hash) { +void FeedbackSender::RecordInDictionary(uint32_t hash) { Misspelling* misspelling = feedback_.GetMisspelling(hash); // GetMisspelling() returns null for flushed feedback. Feedback is flushed // when the session expires every |kSessionHours| hours. @@ -226,7 +225,7 @@ void FeedbackSender::RecordInDictionary(uint32 hash) { misspelling->action.set_type(SpellcheckAction::TYPE_IN_DICTIONARY); } -void FeedbackSender::IgnoredSuggestions(uint32 hash) { +void FeedbackSender::IgnoredSuggestions(uint32_t hash) { Misspelling* misspelling = feedback_.GetMisspelling(hash); // GetMisspelling() returns null for flushed feedback. Feedback is flushed // when the session expires every |kSessionHours| hours. @@ -236,7 +235,7 @@ void FeedbackSender::IgnoredSuggestions(uint32 hash) { misspelling->timestamp = base::Time::Now(); } -void FeedbackSender::ManuallyCorrected(uint32 hash, +void FeedbackSender::ManuallyCorrected(uint32_t hash, const base::string16& correction) { Misspelling* misspelling = feedback_.GetMisspelling(hash); // GetMisspelling() returns null for flushed feedback. Feedback is flushed @@ -250,7 +249,7 @@ void FeedbackSender::ManuallyCorrected(uint32 hash, void FeedbackSender::OnReceiveDocumentMarkers( int renderer_process_id, - const std::vector<uint32>& markers) { + const std::vector<uint32_t>& markers) { if ((base::Time::Now() - session_start_).InHours() >= chrome::spellcheck_common::kSessionHours) { FlushFeedback(); @@ -279,7 +278,7 @@ void FeedbackSender::OnSpellcheckResults( // Generate a map of marker offsets to marker hashes. This map helps to // efficiently lookup feedback data based on the position of the misspelling // in text. - typedef std::map<size_t, uint32> MarkerMap; + typedef std::map<size_t, uint32_t> MarkerMap; MarkerMap marker_map; for (size_t i = 0; i < markers.size(); ++i) marker_map[markers[i].offset] = markers[i].hash; @@ -383,7 +382,7 @@ void FeedbackSender::RequestDocumentMarkers() { ++it) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(&FeedbackSender::OnReceiveDocumentMarkers, - AsWeakPtr(), *it, std::vector<uint32>())); + AsWeakPtr(), *it, std::vector<uint32_t>())); } } diff --git a/chrome/browser/spellchecker/feedback_sender.h b/chrome/browser/spellchecker/feedback_sender.h index ec97558..c98d5ba 100644 --- a/chrome/browser/spellchecker/feedback_sender.h +++ b/chrome/browser/spellchecker/feedback_sender.h @@ -5,17 +5,22 @@ // An object to record and send user feedback to spelling service. The spelling // service uses the feedback to improve its suggestions. // -// Assigns uint32 hash identifiers to spelling suggestions from spelling service -// and stores these suggestions. Records user's actions on these suggestions. -// Periodically sends batches of user feedback to the spelling service. +// Assigns uint32_t hash identifiers to spelling suggestions from spelling +// service and stores these suggestions. Records user's actions on these +// suggestions. Periodically sends batches of user feedback to the spelling +// service. #ifndef CHROME_BROWSER_SPELLCHECKER_FEEDBACK_SENDER_H_ #define CHROME_BROWSER_SPELLCHECKER_FEEDBACK_SENDER_H_ +#include <stddef.h> +#include <stdint.h> + #include <map> #include <set> #include <vector> +#include "base/macros.h" #include "base/memory/scoped_vector.h" #include "base/memory/weak_ptr.h" #include "base/timer/timer.h" @@ -61,24 +66,24 @@ class FeedbackSender : public base::SupportsWeakPtr<FeedbackSender>, // Records that user selected suggestion |suggestion_index| for the // misspelling identified by |hash|. - void SelectedSuggestion(uint32 hash, int suggestion_index); + void SelectedSuggestion(uint32_t hash, int suggestion_index); // Records that user added the misspelling identified by |hash| to the // dictionary. - void AddedToDictionary(uint32 hash); + void AddedToDictionary(uint32_t hash); // Records that user right-clicked on the misspelling identified by |hash|, // but did not select any suggestion. - void IgnoredSuggestions(uint32 hash); + void IgnoredSuggestions(uint32_t hash); // Records that user did not choose any suggestion but manually corrected the // misspelling identified by |hash| to string |correction|, which is not in // the list of suggestions. - void ManuallyCorrected(uint32 hash, const base::string16& correction); + void ManuallyCorrected(uint32_t hash, const base::string16& correction); // Records that user has the misspelling in the custom dictionary. The user // will never see the spellcheck suggestions for the misspelling. - void RecordInDictionary(uint32 hash); + void RecordInDictionary(uint32_t hash); // Receives document markers for renderer with process ID |render_process_id| // when the renderer responds to a RequestDocumentMarkers() call. Finalizes @@ -87,7 +92,7 @@ class FeedbackSender : public base::SupportsWeakPtr<FeedbackSender>, // service. If the current session has expired, then refreshes the session // start timestamp and sends out all of the feedback data. void OnReceiveDocumentMarkers(int renderer_process_id, - const std::vector<uint32>& markers); + const std::vector<uint32_t>& markers); // Generates feedback data based on spellcheck results. The new feedback data // is pending. Sets hash identifiers for |results|. Called when spelling diff --git a/chrome/browser/spellchecker/feedback_sender_unittest.cc b/chrome/browser/spellchecker/feedback_sender_unittest.cc index 47a2318..7f3bf90 100644 --- a/chrome/browser/spellchecker/feedback_sender_unittest.cc +++ b/chrome/browser/spellchecker/feedback_sender_unittest.cc @@ -6,6 +6,9 @@ #include "chrome/browser/spellchecker/feedback_sender.h" +#include <stddef.h> +#include <stdint.h> + #include "base/bind.h" #include "base/command_line.h" #include "base/json/json_reader.h" @@ -93,7 +96,7 @@ class FeedbackSenderTest : public testing::Test { feedback_->StartFeedbackCollection(); } - uint32 AddPendingFeedback() { + uint32_t AddPendingFeedback() { std::vector<SpellCheckResult> results(1, BuildSpellCheckResult()); feedback_->OnSpellcheckResults(kRendererProcessId, base::UTF8ToUTF16(kText), @@ -153,14 +156,14 @@ class FeedbackSenderTest : public testing::Test { TEST_F(FeedbackSenderTest, NoFeedback) { EXPECT_FALSE(IsUploadingData()); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_FALSE(IsUploadingData()); } // Do not send data if not aware of which markers are still in the document. TEST_F(FeedbackSenderTest, NoDocumentMarkersReceived) { EXPECT_FALSE(IsUploadingData()); - uint32 hash = AddPendingFeedback(); + uint32_t hash = AddPendingFeedback(); EXPECT_FALSE(IsUploadingData()); static const int kSuggestionIndex = 1; feedback_->SelectedSuggestion(hash, kSuggestionIndex); @@ -170,9 +173,9 @@ TEST_F(FeedbackSenderTest, NoDocumentMarkersReceived) { // Send PENDING feedback message if the marker is still in the document, and the // user has not performed any action on it. TEST_F(FeedbackSenderTest, PendingFeedback) { - uint32 hash = AddPendingFeedback(); + uint32_t hash = AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>(1, hash)); + std::vector<uint32_t>(1, hash)); EXPECT_TRUE(UploadDataContains("\"actionType\":\"PENDING\"")); } @@ -181,17 +184,17 @@ TEST_F(FeedbackSenderTest, PendingFeedback) { TEST_F(FeedbackSenderTest, NoActionFeedback) { AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"actionType\":\"NO_ACTION\"")); } // Send SELECT feedback message if the user has selected a spelling suggestion. TEST_F(FeedbackSenderTest, SelectFeedback) { - uint32 hash = AddPendingFeedback(); + uint32_t hash = AddPendingFeedback(); static const int kSuggestionIndex = 0; feedback_->SelectedSuggestion(hash, kSuggestionIndex); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"actionType\":\"SELECT\"")); EXPECT_TRUE(UploadDataContains("\"actionTargetIndex\":" + kSuggestionIndex)); } @@ -199,51 +202,51 @@ TEST_F(FeedbackSenderTest, SelectFeedback) { // Send ADD_TO_DICT feedback message if the user has added the misspelled word // to the custom dictionary. TEST_F(FeedbackSenderTest, AddToDictFeedback) { - uint32 hash = AddPendingFeedback(); + uint32_t hash = AddPendingFeedback(); feedback_->AddedToDictionary(hash); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"actionType\":\"ADD_TO_DICT\"")); } // Send IN_DICTIONARY feedback message if the user has the misspelled word in // the custom dictionary. TEST_F(FeedbackSenderTest, InDictionaryFeedback) { - uint32 hash = AddPendingFeedback(); + uint32_t hash = AddPendingFeedback(); feedback_->RecordInDictionary(hash); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"actionType\":\"IN_DICTIONARY\"")); } // Send PENDING feedback message if the user saw the spelling suggestion, but // decided to not select it, and the marker is still in the document. TEST_F(FeedbackSenderTest, IgnoreFeedbackMarkerInDocument) { - uint32 hash = AddPendingFeedback(); + uint32_t hash = AddPendingFeedback(); feedback_->IgnoredSuggestions(hash); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>(1, hash)); + std::vector<uint32_t>(1, hash)); EXPECT_TRUE(UploadDataContains("\"actionType\":\"PENDING\"")); } // Send IGNORE feedback message if the user saw the spelling suggestion, but // decided to not select it, and the marker is no longer in the document. TEST_F(FeedbackSenderTest, IgnoreFeedbackMarkerNotInDocument) { - uint32 hash = AddPendingFeedback(); + uint32_t hash = AddPendingFeedback(); feedback_->IgnoredSuggestions(hash); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"actionType\":\"IGNORE\"")); } // Send MANUALLY_CORRECTED feedback message if the user manually corrected the // misspelled word. TEST_F(FeedbackSenderTest, ManuallyCorrectedFeedback) { - uint32 hash = AddPendingFeedback(); + uint32_t hash = AddPendingFeedback(); static const std::string kManualCorrection = "Howdy"; feedback_->ManuallyCorrected(hash, base::ASCIIToUTF16(kManualCorrection)); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"actionType\":\"MANUALLY_CORRECTED\"")); EXPECT_TRUE(UploadDataContains("\"actionTargetValue\":\"" + kManualCorrection + "\"")); @@ -267,15 +270,15 @@ TEST_F(FeedbackSenderTest, BatchFeedback) { std::vector<SpellCheckMarker>(), &results); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"actionType\":\"NO_ACTION\"", 2)); } // Send a series of PENDING feedback messages and one final NO_ACTION feedback // message with the same hash identifier for a single misspelling. TEST_F(FeedbackSenderTest, SameHashFeedback) { - uint32 hash = AddPendingFeedback(); - std::vector<uint32> remaining_markers(1, hash); + uint32_t hash = AddPendingFeedback(); + std::vector<uint32_t> remaining_markers(1, hash); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, remaining_markers); EXPECT_TRUE(UploadDataContains("\"actionType\":\"PENDING\"")); @@ -289,13 +292,13 @@ TEST_F(FeedbackSenderTest, SameHashFeedback) { ClearUploadData(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"actionType\":\"NO_ACTION\"")); EXPECT_TRUE(UploadDataContains(hash_string)); ClearUploadData(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_FALSE(IsUploadingData()); } @@ -315,8 +318,8 @@ TEST_F(FeedbackSenderTest, SessionExpirationFeedback) { base::UTF8ToUTF16(kText), std::vector<SpellCheckMarker>(), &results); - uint32 original_hash = results[0].hash; - std::vector<uint32> remaining_markers(1, original_hash); + uint32_t original_hash = results[0].hash; + std::vector<uint32_t> remaining_markers(1, original_hash); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, remaining_markers); EXPECT_FALSE(UploadDataContains("\"actionType\":\"NO_ACTION\"")); @@ -350,7 +353,7 @@ TEST_F(FeedbackSenderTest, SessionExpirationFeedback) { base::ASCIIToUTF16("Hello")); feedback_->OnSpellcheckResults( kRendererProcessId, base::UTF8ToUTF16(kText), original_markers, &results); - uint32 updated_hash = results[0].hash; + uint32_t updated_hash = results[0].hash; EXPECT_NE(updated_hash, original_hash); remaining_markers[0] = updated_hash; @@ -370,13 +373,13 @@ TEST_F(FeedbackSenderTest, FirstMessageInSessionIndicator) { // Session 1, message 1 AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"isFirstInSession\":true")); // Session 1, message 2 AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"isFirstInSession\":false")); ExpireSession(); @@ -384,19 +387,19 @@ TEST_F(FeedbackSenderTest, FirstMessageInSessionIndicator) { // Session 1, message 3 (last) AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"isFirstInSession\":false")); // Session 2, message 1 AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"isFirstInSession\":true")); // Session 2, message 2 AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"isFirstInSession\":false")); } @@ -414,7 +417,7 @@ TEST_F(FeedbackSenderTest, OnLanguageCountryChange) { TEST_F(FeedbackSenderTest, FeedbackAPI) { AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); std::string actual_data = GetUploadData(); scoped_ptr<base::DictionaryValue> actual(static_cast<base::DictionaryValue*>( base::JSONReader::Read(actual_data).release())); @@ -453,7 +456,7 @@ TEST_F(FeedbackSenderTest, FeedbackAPI) { TEST_F(FeedbackSenderTest, DefaultApiVersion) { AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"apiVersion\":\"v2\"")); EXPECT_FALSE(UploadDataContains("\"apiVersion\":\"v2-internal\"")); } @@ -465,7 +468,7 @@ TEST_F(FeedbackSenderTest, FieldTrialAloneHasSameApiVersion) { AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"apiVersion\":\"v2\"")); EXPECT_FALSE(UploadDataContains("\"apiVersion\":\"v2-internal\"")); @@ -478,7 +481,7 @@ TEST_F(FeedbackSenderTest, CommandLineSwitchAloneHasSameApiVersion) { AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("\"apiVersion\":\"v2\"")); EXPECT_FALSE(UploadDataContains("\"apiVersion\":\"v2-internal\"")); @@ -492,7 +495,7 @@ TEST_F(FeedbackSenderTest, InternalApiVersion) { AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_FALSE(UploadDataContains("\"apiVersion\":\"v2\"")); EXPECT_TRUE(UploadDataContains("\"apiVersion\":\"v2-internal\"")); @@ -500,7 +503,7 @@ TEST_F(FeedbackSenderTest, InternalApiVersion) { // Duplicate spellcheck results should be matched to the existing markers. TEST_F(FeedbackSenderTest, MatchDupliateResultsWithExistingMarkers) { - uint32 hash = AddPendingFeedback(); + uint32_t hash = AddPendingFeedback(); std::vector<SpellCheckResult> results( 1, SpellCheckResult(SpellCheckResult::SPELLING, @@ -509,7 +512,7 @@ TEST_F(FeedbackSenderTest, MatchDupliateResultsWithExistingMarkers) { base::ASCIIToUTF16("Hello"))); std::vector<SpellCheckMarker> markers( 1, SpellCheckMarker(hash, results[0].location)); - EXPECT_EQ(static_cast<uint32>(0), results[0].hash); + EXPECT_EQ(static_cast<uint32_t>(0), results[0].hash); feedback_->OnSpellcheckResults( kRendererProcessId, base::UTF8ToUTF16(kText), markers, &results); EXPECT_EQ(hash, results[0].hash); @@ -538,7 +541,7 @@ TEST_F(FeedbackSenderTest, MultipleAddToDictFeedback) { &results); last_renderer_process_id = kRendererProcessId + i; } - std::vector<uint32> remaining_markers; + std::vector<uint32_t> remaining_markers; for (size_t i = 0; i < results.size(); ++i) remaining_markers.push_back(results[i].hash); feedback_->OnReceiveDocumentMarkers(last_renderer_process_id, @@ -557,12 +560,12 @@ TEST_F(FeedbackSenderTest, MultipleAddToDictFeedback) { // for pending feedback. TEST_F(FeedbackSenderTest, AddToDictOnlyPending) { AddPendingFeedback(); - uint32 add_to_dict_hash = AddPendingFeedback(); - uint32 select_hash = AddPendingFeedback(); + uint32_t add_to_dict_hash = AddPendingFeedback(); + uint32_t select_hash = AddPendingFeedback(); feedback_->SelectedSuggestion(select_hash, 0); feedback_->AddedToDictionary(add_to_dict_hash); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(UploadDataContains("SELECT", 1)); EXPECT_TRUE(UploadDataContains("ADD_TO_DICT", 2)); } @@ -585,7 +588,7 @@ TEST_F(FeedbackSenderTest, IgnoreOutOfBounds) { std::vector<SpellCheckMarker>(), &results); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_FALSE(IsUploadingData()); } @@ -594,7 +597,7 @@ TEST_F(FeedbackSenderTest, CanStopFeedbackCollection) { feedback_->StopFeedbackCollection(); AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_FALSE(IsUploadingData()); } @@ -605,7 +608,7 @@ TEST_F(FeedbackSenderTest, CanResumeFeedbackCollection) { feedback_->StartFeedbackCollection(); AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(IsUploadingData()); } @@ -614,10 +617,10 @@ TEST_F(FeedbackSenderTest, NoFeedbackCollectionWhenStopped) { feedback_->StopFeedbackCollection(); AddPendingFeedback(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); feedback_->StartFeedbackCollection(); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_FALSE(IsUploadingData()); } @@ -633,7 +636,7 @@ TEST_F(FeedbackSenderTest, TrimFeedback) { "the chance to work hard at work worth doing."), std::vector<SpellCheckMarker>(), &results); feedback_->OnReceiveDocumentMarkers(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE( UploadDataContains(",\"originalText\":\"and away teh best prize\",")); EXPECT_TRUE(UploadDataContains(",\"misspelledStart\":9,")); diff --git a/chrome/browser/spellchecker/feedback_unittest.cc b/chrome/browser/spellchecker/feedback_unittest.cc index d8c0485..cc2d1f5 100644 --- a/chrome/browser/spellchecker/feedback_unittest.cc +++ b/chrome/browser/spellchecker/feedback_unittest.cc @@ -6,6 +6,9 @@ #include "chrome/browser/spellchecker/feedback.h" +#include <stddef.h> +#include <stdint.h> + #include "base/strings/utf_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" @@ -22,7 +25,7 @@ const size_t kMaxFeedbackSize = 1024; const int kRendererProcessId = 7; // Hash identifier for a misspelling. -const uint32 kMisspellingHash = 42; +const uint32_t kMisspellingHash = 42; } // namespace @@ -33,7 +36,7 @@ class FeedbackTest : public testing::Test { ~FeedbackTest() override {} protected: - void AddMisspelling(int renderer_process_id, uint32 hash) { + void AddMisspelling(int renderer_process_id, uint32_t hash) { feedback_.AddMisspelling(renderer_process_id, Misspelling(base::string16(), 0, 0, std::vector<base::string16>(), hash)); @@ -77,7 +80,7 @@ TEST_F(FeedbackTest, LimitFeedbackSize) { std::vector<base::string16>(50, base::ASCIIToUTF16("9876543210")), 0)); feedback_.FinalizeRemovedMisspellings(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); feedback_.EraseFinalizedMisspellings(kRendererProcessId); feedback_.AddMisspelling( kRendererProcessId, @@ -103,7 +106,7 @@ TEST_F(FeedbackTest, FinalizeRemovedMisspellings) { static const int kRemainingMisspellingHash = 2; AddMisspelling(kRendererProcessId, kRemovedMisspellingHash); AddMisspelling(kRendererProcessId, kRemainingMisspellingHash); - std::vector<uint32> remaining_markers(1, kRemainingMisspellingHash); + std::vector<uint32_t> remaining_markers(1, kRemainingMisspellingHash); feedback_.FinalizeRemovedMisspellings(kRendererProcessId, remaining_markers); Misspelling* removed_misspelling = feedback_.GetMisspelling(kRemovedMisspellingHash); @@ -119,7 +122,7 @@ TEST_F(FeedbackTest, FinalizeRemovedMisspellings) { TEST_F(FeedbackTest, DuplicateMisspellingFinalization) { AddMisspelling(kRendererProcessId, kMisspellingHash); AddMisspelling(kRendererProcessId, kMisspellingHash); - std::vector<uint32> remaining_markers(1, kMisspellingHash); + std::vector<uint32_t> remaining_markers(1, kMisspellingHash); feedback_.FinalizeRemovedMisspellings(kRendererProcessId, remaining_markers); std::vector<Misspelling> misspellings = feedback_.GetAllMisspellings(); EXPECT_EQ(static_cast<size_t>(1), misspellings.size()); @@ -149,7 +152,7 @@ TEST_F(FeedbackTest, GetMisspellingsInRenderer) { TEST_F(FeedbackTest, EraseFinalizedMisspellings) { AddMisspelling(kRendererProcessId, kMisspellingHash); feedback_.FinalizeRemovedMisspellings(kRendererProcessId, - std::vector<uint32>()); + std::vector<uint32_t>()); EXPECT_TRUE(feedback_.RendererHasMisspellings(kRendererProcessId)); feedback_.EraseFinalizedMisspellings(kRendererProcessId); EXPECT_FALSE(feedback_.RendererHasMisspellings(kRendererProcessId)); @@ -238,7 +241,7 @@ TEST_F(FeedbackTest, FindMisspellingsByText) { static const int kSentenceLength = 14; static const int kNumberOfSentences = 2; static const int kNumberOfRenderers = 2; - uint32 hash = kMisspellingHash; + uint32_t hash = kMisspellingHash; for (int renderer_process_id = kRendererProcessId; renderer_process_id < kRendererProcessId + kNumberOfRenderers; ++renderer_process_id) { @@ -263,12 +266,12 @@ TEST_F(FeedbackTest, FindMisspellingsByText) { std::vector<base::string16>(1, kOtherSuggestion), hash + 1)); static const base::string16 kMisspelledWord = ASCIIToUTF16("Helllo"); - const std::set<uint32>& misspellings = + const std::set<uint32_t>& misspellings = feedback_.FindMisspellings(kMisspelledWord); EXPECT_EQ(static_cast<size_t>(kNumberOfSentences * kNumberOfRenderers), misspellings.size()); - for (std::set<uint32>::const_iterator it = misspellings.begin(); + for (std::set<uint32_t>::const_iterator it = misspellings.begin(); it != misspellings.end(); ++it) { Misspelling* misspelling = feedback_.GetMisspelling(*it); EXPECT_NE(nullptr, misspelling); diff --git a/chrome/browser/spellchecker/misspelling.cc b/chrome/browser/spellchecker/misspelling.cc index 82693f6..86deb0d 100644 --- a/chrome/browser/spellchecker/misspelling.cc +++ b/chrome/browser/spellchecker/misspelling.cc @@ -38,7 +38,7 @@ Misspelling::Misspelling(const base::string16& context, size_t location, size_t length, const std::vector<base::string16>& suggestions, - uint32 hash) + uint32_t hash) : context(context), location(location), length(length), diff --git a/chrome/browser/spellchecker/misspelling.h b/chrome/browser/spellchecker/misspelling.h index d7e4c28..44bd78a 100644 --- a/chrome/browser/spellchecker/misspelling.h +++ b/chrome/browser/spellchecker/misspelling.h @@ -4,7 +4,7 @@ // // An object to store user feedback to a single spellcheck suggestion. // -// Stores the spellcheck suggestion, its uint32 hash identifier, and user's +// Stores the spellcheck suggestion, its uint32_t hash identifier, and user's // feedback. The feedback is indirect, in the sense that we record user's // |action| instead of asking them how they feel about a spellcheck suggestion. // The object can serialize itself. @@ -12,6 +12,9 @@ #ifndef CHROME_BROWSER_SPELLCHECKER_MISSPELLING_H_ #define CHROME_BROWSER_SPELLCHECKER_MISSPELLING_H_ +#include <stddef.h> +#include <stdint.h> + #include <vector> #include "base/time/time.h" @@ -34,7 +37,7 @@ struct Misspelling { size_t location, size_t length, const std::vector<base::string16>& suggestions, - uint32 hash); + uint32_t hash); ~Misspelling(); // A several-word text snippet that immediately surrounds the misspelling. @@ -51,7 +54,7 @@ struct Misspelling { std::vector<base::string16> suggestions; // The hash that identifies the misspelling. - uint32 hash; + uint32_t hash; // User action. SpellcheckAction action; diff --git a/chrome/browser/spellchecker/spellcheck_action_unittest.cc b/chrome/browser/spellchecker/spellcheck_action_unittest.cc index c79e324..48a579f 100644 --- a/chrome/browser/spellchecker/spellcheck_action_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_action_unittest.cc @@ -2,9 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + #include <string> #include "base/json/json_reader.h" +#include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/spellchecker/spellcheck_action.h" diff --git a/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc b/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc index 84a9b52..a0df26f 100644 --- a/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc +++ b/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc @@ -4,6 +4,8 @@ #include "chrome/browser/spellchecker/spellcheck_custom_dictionary.h" +#include <stddef.h> + #include <functional> #include "base/files/file_util.h" diff --git a/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc b/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc index e40d5ec..669e9b7 100644 --- a/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc @@ -4,13 +4,17 @@ #include "chrome/browser/spellchecker/spellcheck_custom_dictionary.h" +#include <stddef.h> + #include <vector> #include "base/files/file_util.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/metrics/histogram_samples.h" #include "base/metrics/statistics_recorder.h" #include "base/strings/string_number_conversions.h" +#include "build/build_config.h" #include "chrome/browser/spellchecker/spellcheck_factory.h" #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" #include "chrome/browser/spellchecker/spellcheck_service.h" diff --git a/chrome/browser/spellchecker/spellcheck_dictionary.h b/chrome/browser/spellchecker/spellcheck_dictionary.h index e9f8b7a..ea94c98 100644 --- a/chrome/browser/spellchecker/spellcheck_dictionary.h +++ b/chrome/browser/spellchecker/spellcheck_dictionary.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_DICTIONARY_H_ #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_DICTIONARY_H_ -#include "base/basictypes.h" +#include "base/macros.h" // Defines a dictionary for use in the spellchecker system and provides access // to words within the dictionary. diff --git a/chrome/browser/spellchecker/spellcheck_factory.h b/chrome/browser/spellchecker/spellcheck_factory.h index 7cdf471..e8eb9f7 100644 --- a/chrome/browser/spellchecker/spellcheck_factory.h +++ b/chrome/browser/spellchecker/spellcheck_factory.h @@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_FACTORY_H_ #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_FACTORY_H_ -#include "base/basictypes.h" #include "base/gtest_prod_util.h" +#include "base/macros.h" #include "base/memory/singleton.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" diff --git a/chrome/browser/spellchecker/spellcheck_host_metrics.cc b/chrome/browser/spellchecker/spellcheck_host_metrics.cc index 4d997f0..4899e10 100644 --- a/chrome/browser/spellchecker/spellcheck_host_metrics.cc +++ b/chrome/browser/spellchecker/spellcheck_host_metrics.cc @@ -4,6 +4,8 @@ #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" +#include <stdint.h> + #include "base/md5.h" #include "base/metrics/histogram.h" @@ -18,7 +20,7 @@ SpellCheckHostMetrics::SpellCheckHostMetrics() last_replaced_word_count_(-1), last_unique_word_count_(-1), start_time_(base::TimeTicks::Now()) { - const uint64 kHistogramTimerDurationInMinutes = 30; + const uint64_t kHistogramTimerDurationInMinutes = 30; recording_timer_.Start(FROM_HERE, base::TimeDelta::FromMinutes(kHistogramTimerDurationInMinutes), this, &SpellCheckHostMetrics::OnHistogramTimerExpired); diff --git a/chrome/browser/spellchecker/spellcheck_host_metrics.h b/chrome/browser/spellchecker/spellcheck_host_metrics.h index d28b09a..fe0df15 100644 --- a/chrome/browser/spellchecker/spellcheck_host_metrics.h +++ b/chrome/browser/spellchecker/spellcheck_host_metrics.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_HOST_METRICS_H_ #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_HOST_METRICS_H_ +#include <stddef.h> + #include <string> #include <vector> diff --git a/chrome/browser/spellchecker/spellcheck_host_metrics_unittest.cc b/chrome/browser/spellchecker/spellcheck_host_metrics_unittest.cc index f66379a..d8b8d51 100644 --- a/chrome/browser/spellchecker/spellcheck_host_metrics_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_host_metrics_unittest.cc @@ -4,13 +4,16 @@ #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" -#include "base/basictypes.h" +#include <stddef.h> + +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" #include "base/metrics/histogram_samples.h" #include "base/metrics/statistics_recorder.h" #include "base/strings/utf_string_conversions.h" #include "base/test/histogram_tester.h" +#include "build/build_config.h" #include "testing/gtest/include/gtest/gtest.h" #if defined(OS_WIN) diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc index fd575c3..ea82a0c 100644 --- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc +++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc @@ -4,12 +4,15 @@ #include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h" +#include <stddef.h> + #include <utility> #include "base/files/file_util.h" #include "base/logging.h" #include "base/message_loop/message_loop.h" #include "base/path_service.h" +#include "build/build_config.h" #include "chrome/browser/spellchecker/spellcheck_platform.h" #include "chrome/browser/spellchecker/spellcheck_service.h" #include "chrome/common/chrome_paths.h" diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h index a53dc00..902d705f 100644 --- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h +++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h @@ -9,6 +9,7 @@ #include "base/files/file.h" #include "base/files/file_path.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/move.h" diff --git a/chrome/browser/spellchecker/spellcheck_message_filter.cc b/chrome/browser/spellchecker/spellcheck_message_filter.cc index 2cd28a1..0519253 100644 --- a/chrome/browser/spellchecker/spellcheck_message_filter.cc +++ b/chrome/browser/spellchecker/spellcheck_message_filter.cc @@ -96,7 +96,7 @@ void SpellCheckMessageFilter::OnNotifyChecked(const base::string16& word, } void SpellCheckMessageFilter::OnRespondDocumentMarkers( - const std::vector<uint32>& markers) { + const std::vector<uint32_t>& markers) { SpellcheckService* spellcheck = GetSpellcheckService(); // Spellcheck service may not be available for a renderer process that is // shutting down. diff --git a/chrome/browser/spellchecker/spellcheck_message_filter.h b/chrome/browser/spellchecker/spellcheck_message_filter.h index 500f22f..43671a8 100644 --- a/chrome/browser/spellchecker/spellcheck_message_filter.h +++ b/chrome/browser/spellchecker/spellcheck_message_filter.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_MESSAGE_FILTER_H_ #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_MESSAGE_FILTER_H_ +#include <stdint.h> + #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/spellchecker/spelling_service_client.h" @@ -32,7 +34,7 @@ class SpellCheckMessageFilter : public content::BrowserMessageFilter { void OnSpellCheckerRequestDictionary(); void OnNotifyChecked(const base::string16& word, bool misspelled); - void OnRespondDocumentMarkers(const std::vector<uint32>& markers); + void OnRespondDocumentMarkers(const std::vector<uint32_t>& markers); #if !defined(USE_BROWSER_SPELLCHECKER) void OnCallSpellingService(int route_id, int identifier, diff --git a/chrome/browser/spellchecker/spellcheck_message_filter_platform.h b/chrome/browser/spellchecker/spellcheck_message_filter_platform.h index 080f5631..1c2d39c 100644 --- a/chrome/browser/spellchecker/spellcheck_message_filter_platform.h +++ b/chrome/browser/spellchecker/spellcheck_message_filter_platform.h @@ -7,6 +7,8 @@ #include <map> +#include "base/macros.h" +#include "build/build_config.h" #include "chrome/browser/spellchecker/spellcheck_message_filter.h" #include "chrome/common/spellcheck_result.h" #include "content/public/browser/browser_message_filter.h" diff --git a/chrome/browser/spellchecker/spellcheck_message_filter_platform_mac_unittest.cc b/chrome/browser/spellchecker/spellcheck_message_filter_platform_mac_unittest.cc index 26897c0..07de381 100644 --- a/chrome/browser/spellchecker/spellcheck_message_filter_platform_mac_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_message_filter_platform_mac_unittest.cc @@ -4,6 +4,10 @@ #include "chrome/browser/spellchecker/spellcheck_message_filter_platform.h" +#include <stddef.h> +#include <stdint.h> + +#include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "chrome/common/spellcheck_messages.h" #include "chrome/common/spellcheck_result.h" @@ -45,8 +49,8 @@ TEST(SpellcheckMessageFilterPlatformMacTest, CombineResults) { } TEST(SpellCheckMessageFilterPlatformMacTest, TestOverrideThread) { - static const uint32 kSpellcheckMessages[] = { - SpellCheckHostMsg_RequestTextCheck::ID, + static const uint32_t kSpellcheckMessages[] = { + SpellCheckHostMsg_RequestTextCheck::ID, }; scoped_refptr<SpellCheckMessageFilterPlatform> filter( new SpellCheckMessageFilterPlatform(0)); diff --git a/chrome/browser/spellchecker/spellcheck_message_filter_unittest.cc b/chrome/browser/spellchecker/spellcheck_message_filter_unittest.cc index fb4c9fc..66a04dc 100644 --- a/chrome/browser/spellchecker/spellcheck_message_filter_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_message_filter_unittest.cc @@ -2,6 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> +#include <stdint.h> + +#include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/spellchecker/spellcheck_factory.h" #include "chrome/browser/spellchecker/spellcheck_message_filter.h" @@ -53,7 +57,7 @@ class TestingSpellCheckMessageFilter : public SpellCheckMessageFilter { }; TEST(SpellCheckMessageFilterTest, TestOverrideThread) { - static const uint32 kSpellcheckMessages[] = { + static const uint32_t kSpellcheckMessages[] = { SpellCheckHostMsg_RequestDictionary::ID, SpellCheckHostMsg_NotifyChecked::ID, SpellCheckHostMsg_RespondDocumentMarkers::ID, diff --git a/chrome/browser/spellchecker/spellcheck_platform_mac_unittest.cc b/chrome/browser/spellchecker/spellcheck_platform_mac_unittest.cc index c8dbe9d..b33262e 100644 --- a/chrome/browser/spellchecker/spellcheck_platform_mac_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_platform_mac_unittest.cc @@ -4,7 +4,10 @@ #include "chrome/browser/spellchecker/spellcheck_platform.h" +#include <stddef.h> + #include "base/bind.h" +#include "base/macros.h" #include "base/message_loop/message_loop.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc index 64083aa..7943c1d 100644 --- a/chrome/browser/spellchecker/spellcheck_service.cc +++ b/chrome/browser/spellchecker/spellcheck_service.cc @@ -10,6 +10,7 @@ #include "base/strings/string_split.h" #include "base/supports_user_data.h" #include "base/synchronization/waitable_event.h" +#include "build/build_config.h" #include "chrome/browser/spellchecker/feedback_sender.h" #include "chrome/browser/spellchecker/spellcheck_factory.h" #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" diff --git a/chrome/browser/spellchecker/spellcheck_service.h b/chrome/browser/spellchecker/spellcheck_service.h index 35e6f3c..643e3fa 100644 --- a/chrome/browser/spellchecker/spellcheck_service.h +++ b/chrome/browser/spellchecker/spellcheck_service.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_SERVICE_H_ #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_SERVICE_H_ +#include <stddef.h> + #include <string> #include <vector> @@ -14,6 +16,7 @@ #include "base/memory/scoped_vector.h" #include "base/memory/weak_ptr.h" #include "base/prefs/pref_change_registrar.h" +#include "build/build_config.h" #include "chrome/browser/spellchecker/spellcheck_custom_dictionary.h" #include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h" #include "components/keyed_service/core/keyed_service.h" diff --git a/chrome/browser/spellchecker/spellcheck_service_browsertest.cc b/chrome/browser/spellchecker/spellcheck_service_browsertest.cc index 55b87bd..506c1b0 100644 --- a/chrome/browser/spellchecker/spellcheck_service_browsertest.cc +++ b/chrome/browser/spellchecker/spellcheck_service_browsertest.cc @@ -2,7 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> +#include <stdint.h> + #include "base/command_line.h" +#include "base/macros.h" #include "base/path_service.h" #include "base/prefs/pref_service.h" #include "base/synchronization/waitable_event.h" @@ -25,16 +29,13 @@ namespace { // A corrupted BDICT data used in DeleteCorruptedBDICT. Please do not use this // BDICT data for other tests. -const uint8 kCorruptedBDICT[] = { - 0x42, 0x44, 0x69, 0x63, 0x02, 0x00, 0x01, 0x00, - 0x20, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, - 0x65, 0x72, 0xe0, 0xac, 0x27, 0xc7, 0xda, 0x66, - 0x6d, 0x1e, 0xa6, 0x35, 0xd1, 0xf6, 0xb7, 0x35, - 0x32, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, - 0x39, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, - 0x0a, 0x0a, 0x41, 0x46, 0x20, 0x30, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xe6, 0x49, 0x00, 0x68, 0x02, - 0x73, 0x06, 0x74, 0x0b, 0x77, 0x11, 0x79, 0x15, +const uint8_t kCorruptedBDICT[] = { + 0x42, 0x44, 0x69, 0x63, 0x02, 0x00, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x3b, 0x00, 0x00, 0x00, 0x65, 0x72, 0xe0, 0xac, 0x27, 0xc7, 0xda, 0x66, + 0x6d, 0x1e, 0xa6, 0x35, 0xd1, 0xf6, 0xb7, 0x35, 0x32, 0x00, 0x00, 0x00, + 0x38, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, + 0x0a, 0x0a, 0x41, 0x46, 0x20, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, + 0x49, 0x00, 0x68, 0x02, 0x73, 0x06, 0x74, 0x0b, 0x77, 0x11, 0x79, 0x15, }; } // namespace diff --git a/chrome/browser/spellchecker/spellcheck_service_unittest.cc b/chrome/browser/spellchecker/spellcheck_service_unittest.cc index ad781ef..3765989 100644 --- a/chrome/browser/spellchecker/spellcheck_service_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_service_unittest.cc @@ -4,7 +4,10 @@ #include "chrome/browser/spellchecker/spellcheck_service.h" +#include <stddef.h> + #include "base/command_line.h" +#include "base/macros.h" #include "base/message_loop/message_loop.h" #include "base/prefs/pref_registry_simple.h" #include "base/prefs/testing_pref_service.h" diff --git a/chrome/browser/spellchecker/spellchecker_session_bridge_android.cc b/chrome/browser/spellchecker/spellchecker_session_bridge_android.cc index c10fedf..03a1bb4 100644 --- a/chrome/browser/spellchecker/spellchecker_session_bridge_android.cc +++ b/chrome/browser/spellchecker/spellchecker_session_bridge_android.cc @@ -4,6 +4,8 @@ #include "chrome/browser/spellchecker/spellchecker_session_bridge_android.h" +#include <stddef.h> + #include "base/android/jni_array.h" #include "base/android/jni_string.h" #include "chrome/common/spellcheck_messages.h" diff --git a/chrome/browser/spellchecker/spellchecker_session_bridge_android.h b/chrome/browser/spellchecker/spellchecker_session_bridge_android.h index 6c56fae..d520b3b 100644 --- a/chrome/browser/spellchecker/spellchecker_session_bridge_android.h +++ b/chrome/browser/spellchecker/spellchecker_session_bridge_android.h @@ -8,6 +8,7 @@ #include <jni.h> #include "base/android/scoped_java_ref.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" diff --git a/chrome/browser/spellchecker/spelling_service_client.cc b/chrome/browser/spellchecker/spelling_service_client.cc index 888af4a..d769b27 100644 --- a/chrome/browser/spellchecker/spelling_service_client.cc +++ b/chrome/browser/spellchecker/spelling_service_client.cc @@ -4,6 +4,8 @@ #include "chrome/browser/spellchecker/spelling_service_client.h" +#include <stddef.h> + #include <algorithm> #include "base/json/json_reader.h" diff --git a/chrome/browser/spellchecker/spelling_service_client_unittest.cc b/chrome/browser/spellchecker/spelling_service_client_unittest.cc index 2e9caa9..652ecf54 100644 --- a/chrome/browser/spellchecker/spelling_service_client_unittest.cc +++ b/chrome/browser/spellchecker/spelling_service_client_unittest.cc @@ -2,11 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <stddef.h> + #include <string> #include <vector> #include "base/bind.h" #include "base/json/json_reader.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/prefs/pref_service.h" #include "base/strings/stringprintf.h" diff --git a/chrome/browser/spellchecker/word_trimmer.h b/chrome/browser/spellchecker/word_trimmer.h index 5b108d3..fdfcc56 100644 --- a/chrome/browser/spellchecker/word_trimmer.h +++ b/chrome/browser/spellchecker/word_trimmer.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_SPELLCHECKER_WORD_TRIMMER_H_ #define CHROME_BROWSER_SPELLCHECKER_WORD_TRIMMER_H_ +#include <stddef.h> + #include "base/strings/string16.h" // Trims |text| to contain only the range from |start| to |end| and |keep| words diff --git a/chrome/browser/spellchecker/word_trimmer_unittest.cc b/chrome/browser/spellchecker/word_trimmer_unittest.cc index 35b8e6a..f35c629 100644 --- a/chrome/browser/spellchecker/word_trimmer_unittest.cc +++ b/chrome/browser/spellchecker/word_trimmer_unittest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/spellchecker/word_trimmer.h" +#include <stddef.h> + #include "base/strings/utf_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" |
