summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/browser_about_handler.cc3
-rw-r--r--chrome/browser/browser_about_handler.h9
-rw-r--r--chrome/browser/diagnostics/recon_diagnostics.cc2
-rw-r--r--chrome/browser/dom_operation_notification_details.h4
-rw-r--r--chrome/browser/extensions/extension_updater.cc2
-rw-r--r--chrome/browser/extensions/extension_updater.h2
-rw-r--r--chrome/browser/sync/engine/build_and_process_conflict_sets_command.cc10
-rw-r--r--chrome/browser/sync/engine/syncer_util.cc24
-rw-r--r--chrome/browser/sync/engine/syncer_util.h8
-rw-r--r--chrome/browser/sync/syncable/syncable.cc2
-rw-r--r--chrome/browser/sync/syncable/syncable.h8
-rw-r--r--chrome/browser/themes/browser_theme_pack.cc2
-rw-r--r--chrome/browser/themes/browser_theme_pack.h2
-rw-r--r--chrome/common/extensions/extension.cc5
-rw-r--r--chrome/common/extensions/extension.h5
-rw-r--r--chrome/common/extensions/extension_message_bundle.cc2
-rw-r--r--chrome/common/extensions/extension_message_bundle.h2
-rw-r--r--chrome/common/spellcheck_common.cc13
-rw-r--r--chrome/common/spellcheck_common.h8
-rw-r--r--chrome/renderer/spellchecker/spellcheck.cc4
-rw-r--r--chrome/renderer/spellchecker/spellcheck.h2
21 files changed, 82 insertions, 37 deletions
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc
index 188982f..648f1eb 100644
--- a/chrome/browser/browser_about_handler.cc
+++ b/chrome/browser/browser_about_handler.cc
@@ -90,8 +90,7 @@ AboutTcmallocOutputs::AboutTcmallocOutputs() {}
AboutTcmallocOutputs::~AboutTcmallocOutputs() {}
// Glue between the callback task and the method in the singleton.
-void AboutTcmallocRendererCallback(base::ProcessId pid,
- const std::string& output) {
+void AboutTcmallocRendererCallback(base::ProcessId pid, std::string output) {
AboutTcmallocOutputs::GetInstance()->RendererCallback(pid, output);
}
#endif
diff --git a/chrome/browser/browser_about_handler.h b/chrome/browser/browser_about_handler.h
index d319fbe..b894ceb 100644
--- a/chrome/browser/browser_about_handler.h
+++ b/chrome/browser/browser_about_handler.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -52,14 +52,14 @@ class AboutTcmallocOutputs {
AboutTcmallocOutputsType* outputs() { return &outputs_; }
// Records the output for a specified header string.
- void SetOutput(const std::string& header, const std::string& output) {
+ void SetOutput(std::string header, std::string output) {
outputs_[header] = output;
}
// Callback for output returned from renderer processes. Adds
// the output for a canonical renderer header string that
// incorporates the pid.
- void RendererCallback(base::ProcessId pid, const std::string& output) {
+ void RendererCallback(base::ProcessId pid, std::string output) {
SetOutput(StringPrintf("Renderer PID %d", static_cast<int>(pid)), output);
}
@@ -75,8 +75,7 @@ class AboutTcmallocOutputs {
};
// Glue between the callback task and the method in the singleton.
-void AboutTcmallocRendererCallback(base::ProcessId pid,
- const std::string& output);
+void AboutTcmallocRendererCallback(base::ProcessId pid, std::string output);
#endif
#endif // CHROME_BROWSER_BROWSER_ABOUT_HANDLER_H_
diff --git a/chrome/browser/diagnostics/recon_diagnostics.cc b/chrome/browser/diagnostics/recon_diagnostics.cc
index 86666f6..60e4bae 100644
--- a/chrome/browser/diagnostics/recon_diagnostics.cc
+++ b/chrome/browser/diagnostics/recon_diagnostics.cc
@@ -321,7 +321,7 @@ class DiskSpaceTest : public DiagnosticTest {
// Checks that a given json file can be correctly parsed.
class JSONTest : public DiagnosticTest {
public:
- JSONTest(const FilePath& path, const string16& name, int64 max_file_size)
+ JSONTest(const FilePath& path, const string16 name, int64 max_file_size)
: DiagnosticTest(name), path_(path), max_file_size_(max_file_size) {
}
diff --git a/chrome/browser/dom_operation_notification_details.h b/chrome/browser/dom_operation_notification_details.h
index fc56394..9b2266e 100644
--- a/chrome/browser/dom_operation_notification_details.h
+++ b/chrome/browser/dom_operation_notification_details.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -12,7 +12,7 @@
class DomOperationNotificationDetails {
public:
- DomOperationNotificationDetails(const std::string& json, int automation_id)
+ DomOperationNotificationDetails(const std::string json, int automation_id)
: json_(json), automation_id_(automation_id) { }
~DomOperationNotificationDetails() { }
diff --git a/chrome/browser/extensions/extension_updater.cc b/chrome/browser/extensions/extension_updater.cc
index 868991d..98e4fd6 100644
--- a/chrome/browser/extensions/extension_updater.cc
+++ b/chrome/browser/extensions/extension_updater.cc
@@ -154,7 +154,7 @@ bool ManifestFetchData::AddExtension(std::string id, std::string version,
return true;
}
-bool ManifestFetchData::Includes(const std::string& extension_id) const {
+bool ManifestFetchData::Includes(std::string extension_id) const {
return extension_ids_.find(extension_id) != extension_ids_.end();
}
diff --git a/chrome/browser/extensions/extension_updater.h b/chrome/browser/extensions/extension_updater.h
index 07c90bf..a2f67c6 100644
--- a/chrome/browser/extensions/extension_updater.h
+++ b/chrome/browser/extensions/extension_updater.h
@@ -75,7 +75,7 @@ class ManifestFetchData {
const std::set<std::string>& extension_ids() const { return extension_ids_; }
// Returns true if the given id is included in this manifest fetch.
- bool Includes(const std::string& extension_id) const;
+ bool Includes(std::string extension_id) const;
// Returns true if a ping parameter for |type| was added to full_url for this
// extension id.
diff --git a/chrome/browser/sync/engine/build_and_process_conflict_sets_command.cc b/chrome/browser/sync/engine/build_and_process_conflict_sets_command.cc
index 5c79492..0d14069 100644
--- a/chrome/browser/sync/engine/build_and_process_conflict_sets_command.cc
+++ b/chrome/browser/sync/engine/build_and_process_conflict_sets_command.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -312,8 +312,8 @@ class ServerDeletedPathChecker {
// returns 0 if we should stop investigating the path.
static syncable::Id GetAndExamineParent(syncable::BaseTransaction* trans,
- const syncable::Id& id,
- const syncable::Id& check_id,
+ syncable::Id id,
+ syncable::Id check_id,
const syncable::Entry& log_entry) {
syncable::Entry parent(trans, syncable::GET_BY_ID, id);
CHECK(parent.good()) << "Tree inconsitency, missing id" << id << " "
@@ -334,8 +334,8 @@ class LocallyDeletedPathChecker {
// returns 0 if we should stop investigating the path.
static syncable::Id GetAndExamineParent(syncable::BaseTransaction* trans,
- const syncable::Id& id,
- const syncable::Id& check_id,
+ syncable::Id id,
+ syncable::Id check_id,
const syncable::Entry& log_entry) {
syncable::Entry parent(trans, syncable::GET_BY_ID, id);
if (!parent.good())
diff --git a/chrome/browser/sync/engine/syncer_util.cc b/chrome/browser/sync/engine/syncer_util.cc
index c20e206..c1bed35 100644
--- a/chrome/browser/sync/engine/syncer_util.cc
+++ b/chrome/browser/sync/engine/syncer_util.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -639,6 +639,28 @@ void SyncerUtil::AddPredecessorsThenItem(
std::reverse(commit_ids->begin() + initial_size, commit_ids->end());
}
+// TODO(ncarter): This is redundant to some code in GetCommitIdsCommand. Unify
+// them.
+// static
+void SyncerUtil::AddUncommittedParentsAndTheirPredecessors(
+ syncable::BaseTransaction* trans,
+ syncable::MetahandleSet* inserted_items,
+ std::vector<syncable::Id>* commit_ids,
+ syncable::Id parent_id) {
+ size_t intial_commit_ids_size = commit_ids->size();
+ // Climb the tree adding entries leaf -> root.
+ while (!parent_id.ServerKnows()) {
+ Entry parent(trans, GET_BY_ID, parent_id);
+ CHECK(parent.good()) << "Bad user-only parent in item path.";
+ if (!AddItemThenPredecessors(trans, &parent, IS_UNSYNCED, inserted_items,
+ commit_ids))
+ break; // Parent was already present in |inserted_items|.
+ parent_id = parent.Get(PARENT_ID);
+ }
+ // Reverse what we added to get the correct order.
+ std::reverse(commit_ids->begin() + intial_commit_ids_size, commit_ids->end());
+}
+
// static
void SyncerUtil::MarkDeletedChildrenSynced(
const syncable::ScopedDirLookup &dir,
diff --git a/chrome/browser/sync/engine/syncer_util.h b/chrome/browser/sync/engine/syncer_util.h
index 90de980..b1d5e50 100644
--- a/chrome/browser/sync/engine/syncer_util.h
+++ b/chrome/browser/sync/engine/syncer_util.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -127,6 +127,12 @@ class SyncerUtil {
syncable::MetahandleSet* inserted_items,
std::vector<syncable::Id>* commit_ids);
+ static void AddUncommittedParentsAndTheirPredecessors(
+ syncable::BaseTransaction* trans,
+ syncable::MetahandleSet* inserted_items,
+ std::vector<syncable::Id>* commit_ids,
+ syncable::Id parent_id);
+
static void MarkDeletedChildrenSynced(
const syncable::ScopedDirLookup &dir,
std::set<syncable::Id>* deleted_folders);
diff --git a/chrome/browser/sync/syncable/syncable.cc b/chrome/browser/sync/syncable/syncable.cc
index 395e6cc..e9abb9e 100644
--- a/chrome/browser/sync/syncable/syncable.cc
+++ b/chrome/browser/sync/syncable/syncable.cc
@@ -886,7 +886,7 @@ string Directory::store_birthday() const {
return kernel_->persisted_info.store_birthday;
}
-void Directory::set_store_birthday(const string& store_birthday) {
+void Directory::set_store_birthday(string store_birthday) {
ScopedKernelLock lock(this);
if (kernel_->persisted_info.store_birthday == store_birthday)
return;
diff --git a/chrome/browser/sync/syncable/syncable.h b/chrome/browser/sync/syncable/syncable.h
index 55f76bb..f20e80f 100644
--- a/chrome/browser/sync/syncable/syncable.h
+++ b/chrome/browser/sync/syncable/syncable.h
@@ -810,11 +810,11 @@ class Directory {
const std::string& name() const { return kernel_->name; }
- // (Account) Store birthday is opaque to the client, so we keep it in the
- // format it is in the proto buffer in case we switch to a binary birthday
- // later.
+ // (Account) Store birthday is opaque to the client,
+ // so we keep it in the format it is in the proto buffer
+ // in case we switch to a binary birthday later.
std::string store_birthday() const;
- void set_store_birthday(const std::string& store_birthday);
+ void set_store_birthday(std::string store_birthday);
std::string GetAndClearNotificationState();
void SetNotificationState(const std::string& notification_state);
diff --git a/chrome/browser/themes/browser_theme_pack.cc b/chrome/browser/themes/browser_theme_pack.cc
index 274cae3..93633a9 100644
--- a/chrome/browser/themes/browser_theme_pack.cc
+++ b/chrome/browser/themes/browser_theme_pack.cc
@@ -812,7 +812,7 @@ void BrowserThemePack::BuildDisplayPropertiesFromJSON(
void BrowserThemePack::ParseImageNamesFromJSON(
DictionaryValue* images_value,
- const FilePath& images_path,
+ FilePath images_path,
FilePathMap* file_paths) const {
if (!images_value)
return;
diff --git a/chrome/browser/themes/browser_theme_pack.h b/chrome/browser/themes/browser_theme_pack.h
index ed3d26d..9aba30d 100644
--- a/chrome/browser/themes/browser_theme_pack.h
+++ b/chrome/browser/themes/browser_theme_pack.h
@@ -127,7 +127,7 @@ class BrowserThemePack : public base::RefCountedThreadSafe<
// Parses the image names out of an extension.
void ParseImageNamesFromJSON(DictionaryValue* images_value,
- const FilePath& images_path,
+ FilePath images_path,
FilePathMap* file_paths) const;
// Creates the data for |source_images_| from |file_paths|.
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index e65d9e1..d6e0305 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -1266,7 +1266,8 @@ bool Extension::ParsePEMKeyBytes(const std::string& input,
return base::Base64Decode(working, output);
}
-bool Extension::ProducePEM(const std::string& input, std::string* output) {
+bool Extension::ProducePEM(const std::string& input,
+ std::string* output) {
CHECK(output);
if (input.length() == 0)
return false;
@@ -1274,7 +1275,7 @@ bool Extension::ProducePEM(const std::string& input, std::string* output) {
return base::Base64Encode(input, output);
}
-bool Extension::FormatPEMForFileOutput(const std::string& input,
+bool Extension::FormatPEMForFileOutput(const std::string input,
std::string* output,
bool is_public) {
CHECK(output);
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index 861cad6..6b40f15 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -311,9 +311,8 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
// Expects base64 encoded |input| and formats into |output| including
// the appropriate header & footer.
- static bool FormatPEMForFileOutput(const std::string& input,
- std::string* output,
- bool is_public);
+ static bool FormatPEMForFileOutput(const std::string input,
+ std::string* output, bool is_public);
// Determine whether |new_extension| has increased privileges compared to
// its previously granted permissions, specified by |granted_apis|,
diff --git a/chrome/common/extensions/extension_message_bundle.cc b/chrome/common/extensions/extension_message_bundle.cc
index 26e9c97..f0e60bc 100644
--- a/chrome/common/extensions/extension_message_bundle.cc
+++ b/chrome/common/extensions/extension_message_bundle.cc
@@ -336,7 +336,7 @@ ExtensionToL10nMessagesMap* GetExtensionToL10nMessagesMap() {
return &g_extension_to_messages_map.Get().messages_map;
}
-L10nMessagesMap* GetL10nMessagesMap(const std::string& extension_id) {
+L10nMessagesMap* GetL10nMessagesMap(const std::string extension_id) {
ExtensionToL10nMessagesMap::iterator it =
g_extension_to_messages_map.Get().messages_map.find(extension_id);
if (it != g_extension_to_messages_map.Get().messages_map.end())
diff --git a/chrome/common/extensions/extension_message_bundle.h b/chrome/common/extensions/extension_message_bundle.h
index 8f3078e..89e7fd4 100644
--- a/chrome/common/extensions/extension_message_bundle.h
+++ b/chrome/common/extensions/extension_message_bundle.h
@@ -159,6 +159,6 @@ typedef std::map<std::string, L10nMessagesMap > ExtensionToL10nMessagesMap;
ExtensionToL10nMessagesMap* GetExtensionToL10nMessagesMap();
// Returns message map that matches given extension_id, or NULL.
-L10nMessagesMap* GetL10nMessagesMap(const std::string& extension_id);
+L10nMessagesMap* GetL10nMessagesMap(const std::string extension_id);
#endif // CHROME_COMMON_EXTENSIONS_EXTENSION_MESSAGE_BUNDLE_H_
diff --git a/chrome/common/spellcheck_common.cc b/chrome/common/spellcheck_common.cc
index 26d90ce..21ff923 100644
--- a/chrome/common/spellcheck_common.cc
+++ b/chrome/common/spellcheck_common.cc
@@ -169,4 +169,17 @@ void SpellCheckLanguages(std::vector<std::string>* languages) {
}
}
+
+std::string GetLanguageFromLanguageRegion(std::string input_language) {
+ for (size_t i = 0; i < ARRAYSIZE_UNSAFE(g_supported_spellchecker_languages);
+ ++i) {
+ std::string language(
+ g_supported_spellchecker_languages[i].language_region);
+ if (language == input_language)
+ return std::string(g_supported_spellchecker_languages[i].language);
+ }
+
+ return input_language;
+}
+
} // namespace SpellCheckCommon
diff --git a/chrome/common/spellcheck_common.h b/chrome/common/spellcheck_common.h
index cafffa8..9074e16 100644
--- a/chrome/common/spellcheck_common.h
+++ b/chrome/common/spellcheck_common.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -26,6 +26,12 @@ std::string GetCorrespondingSpellCheckLanguage(const std::string& language);
// Get SpellChecker supported languages.
void SpellCheckLanguages(std::vector<std::string>* languages);
+
+// This function returns ll (language code) from ll-RR where 'RR' (region
+// code) is redundant. However, if the region code matters, it's preserved.
+// That is, it returns 'hi' and 'en-GB' for 'hi-IN' and 'en-GB' respectively.
+std::string GetLanguageFromLanguageRegion(std::string input_language);
+
} // namespace SpellCheckCommon
#endif // CHROME_COMMON_SPELLCHECK_COMMON_H_
diff --git a/chrome/renderer/spellchecker/spellcheck.cc b/chrome/renderer/spellchecker/spellcheck.cc
index 0ed18ce..9c700ae 100644
--- a/chrome/renderer/spellchecker/spellcheck.cc
+++ b/chrome/renderer/spellchecker/spellcheck.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -28,7 +28,7 @@ SpellCheck::~SpellCheck() {
void SpellCheck::Init(base::PlatformFile file,
const std::vector<std::string>& custom_words,
- const std::string& language) {
+ const std::string language) {
initialized_ = true;
hunspell_.reset();
bdict_file_.reset();
diff --git a/chrome/renderer/spellchecker/spellcheck.h b/chrome/renderer/spellchecker/spellcheck.h
index 29980b5..6a5780d 100644
--- a/chrome/renderer/spellchecker/spellcheck.h
+++ b/chrome/renderer/spellchecker/spellcheck.h
@@ -32,7 +32,7 @@ class SpellCheck {
void Init(base::PlatformFile file,
const std::vector<std::string>& custom_words,
- const std::string& language);
+ const std::string language);
// SpellCheck a word.
// Returns true if spelled correctly, false otherwise.