Change most uses of Pickle to base::Pickle
There should be no behavior change. TBR=jschuh (IPC messages) Review URL: https://codereview.chromium.org/1154283003 Cr-Commit-Position: refs/heads/master@{#332552}
This commit is contained in:
android_webview/native
chrome
browser
android
extensions
media
password_manager
renderer_host
safe_browsing
ui
app_list
views
extensions
common
chromecast/common/media
cloud_print/service/win
components
autofill
bookmarks
nacl
browser
loader
zygote
network_hints
password_manager
core
sessions
base_session_service_commands.ccserialized_navigation_entry.ccserialized_navigation_entry_unittest.ccsession_command.ccsession_service_commands.cc
visitedlink
content
browser
android
appcache
appcache_response.ccappcache_response_unittest.ccappcache_service_unittest.ccappcache_url_request_job_unittest.cc
browser_plugin
download
frame_host
loader
renderer_host
clipboard_message_filter.cc
input
render_widget_host_unittest.ccrender_widget_host_view_aura_unittest.ccsandbox_ipc_linux.ccweb_contents
zygote_host
child
bluetooth
geofencing
indexed_db
navigator_connect
notifications
npapi
plugin_param_traits.ccpush_messaging
quota_message_filter.ccresource_dispatcher.ccservice_worker
threaded_data_provider.cccommon
android
cc_messages.cccc_messages_unittest.ccchild_process_sandbox_support_impl_linux.ccchild_process_sandbox_support_impl_shm_linux.cccommon_param_traits_unittest.cccontent_param_traits.cccursors
font_config_ipc_linux.ccgamepad_param_traits.ccindexed_db
input
mac
media
page_state_serialization.ccpage_state_serialization_unittest.ccresource_messages.ccssl_status_serialization.ccpublic
common
renderer
browser_plugin
cache_storage
scheduler
service_worker
zygote
crypto
extensions
browser
common
api
extension_messages.ccpermissions
api_permission.ccapi_permission_set_unittest.ccmanifest_permission.ccsettings_override_permission.ccsocket_permission_unittest.cc
user_script.huser_script_unittest.ccrenderer
gpu/ipc
ipc
ipc_channel_posix.ccipc_channel_unittest.ccipc_channel_win.ccipc_fuzzing_tests.ccipc_logging.ccipc_message.ccipc_message_unittest.ccipc_message_utils.ccipc_message_utils.hipc_message_utils_unittest.ccipc_perftest_support.ccipc_send_fds_test.ccipc_sync_message.ccipc_test_channel_listener.cc
mojo
media/base
net
base
cert
signed_certificate_timestamp.ccsigned_certificate_timestamp_unittest.ccx509_certificate.ccx509_certificate.hx509_certificate_ios.ccx509_certificate_mac.ccx509_certificate_nss.ccx509_certificate_openssl.ccx509_certificate_unittest.ccx509_certificate_win.ccx509_util_nss_certs.cc
disk_cache
simple
http
http_cache.cchttp_cache_unittest.cchttp_response_headers.cchttp_response_headers_unittest.cchttp_response_info.cchttp_response_info_unittest.cchttp_vary_data.ccmock_http_cache.cc
quic
crypto
url_request
ppapi
nacl_irt
proxy
remoting/host
sandbox/linux/syscall_broker
skia/ext
storage/browser/fileapi
third_party/mojo/src/mojo/edk/system
tools/android/forwarder2
ui
base
clipboard
dragdrop
gfx
views
controls
textfield
@ -846,7 +846,7 @@ AwContents::GetOpaqueState(JNIEnv* env, jobject obj) {
|
||||
if (!web_contents_->GetController().GetEntryCount())
|
||||
return ScopedJavaLocalRef<jbyteArray>();
|
||||
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
if (!WriteToPickle(*web_contents_, &pickle)) {
|
||||
return ScopedJavaLocalRef<jbyteArray>();
|
||||
} else {
|
||||
@ -863,9 +863,9 @@ jboolean AwContents::RestoreFromOpaqueState(
|
||||
std::vector<uint8> state_vector;
|
||||
base::android::JavaByteArrayToByteVector(env, state, &state_vector);
|
||||
|
||||
Pickle pickle(reinterpret_cast<const char*>(state_vector.data()),
|
||||
state_vector.size());
|
||||
PickleIterator iterator(pickle);
|
||||
base::Pickle pickle(reinterpret_cast<const char*>(state_vector.data()),
|
||||
state_vector.size());
|
||||
base::PickleIterator iterator(pickle);
|
||||
|
||||
return RestoreFromPickle(&iterator, web_contents_.get());
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ const uint32 AW_STATE_VERSION = 20130814;
|
||||
} // namespace
|
||||
|
||||
bool WriteToPickle(const content::WebContents& web_contents,
|
||||
Pickle* pickle) {
|
||||
base::Pickle* pickle) {
|
||||
DCHECK(pickle);
|
||||
|
||||
if (!internal::WriteHeaderToPickle(pickle))
|
||||
@ -71,7 +71,7 @@ bool WriteToPickle(const content::WebContents& web_contents,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RestoreFromPickle(PickleIterator* iterator,
|
||||
bool RestoreFromPickle(base::PickleIterator* iterator,
|
||||
content::WebContents* web_contents) {
|
||||
DCHECK(iterator);
|
||||
DCHECK(web_contents);
|
||||
@ -136,11 +136,11 @@ bool RestoreFromPickle(PickleIterator* iterator,
|
||||
|
||||
namespace internal {
|
||||
|
||||
bool WriteHeaderToPickle(Pickle* pickle) {
|
||||
bool WriteHeaderToPickle(base::Pickle* pickle) {
|
||||
return pickle->WriteUInt32(AW_STATE_VERSION);
|
||||
}
|
||||
|
||||
bool RestoreHeaderFromPickle(PickleIterator* iterator) {
|
||||
bool RestoreHeaderFromPickle(base::PickleIterator* iterator) {
|
||||
uint32 state_version = -1;
|
||||
if (!iterator->ReadUInt32(&state_version))
|
||||
return false;
|
||||
@ -152,7 +152,7 @@ bool RestoreHeaderFromPickle(PickleIterator* iterator) {
|
||||
}
|
||||
|
||||
bool WriteNavigationEntryToPickle(const content::NavigationEntry& entry,
|
||||
Pickle* pickle) {
|
||||
base::Pickle* pickle) {
|
||||
if (!pickle->WriteString(entry.GetURL().spec()))
|
||||
return false;
|
||||
|
||||
@ -194,7 +194,7 @@ bool WriteNavigationEntryToPickle(const content::NavigationEntry& entry,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RestoreNavigationEntryFromPickle(PickleIterator* iterator,
|
||||
bool RestoreNavigationEntryFromPickle(base::PickleIterator* iterator,
|
||||
content::NavigationEntry* entry) {
|
||||
{
|
||||
string url;
|
||||
|
@ -22,11 +22,11 @@ using std::string;
|
||||
namespace android_webview {
|
||||
|
||||
TEST(AndroidWebViewStateSerializerTest, TestHeaderSerialization) {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
bool result = internal::WriteHeaderToPickle(&pickle);
|
||||
EXPECT_TRUE(result);
|
||||
|
||||
PickleIterator iterator(pickle);
|
||||
base::PickleIterator iterator(pickle);
|
||||
result = internal::RestoreHeaderFromPickle(&iterator);
|
||||
EXPECT_TRUE(result);
|
||||
}
|
||||
@ -68,12 +68,12 @@ TEST(AndroidWebViewStateSerializerTest, TestNavigationEntrySerialization) {
|
||||
entry->SetTimestamp(timestamp);
|
||||
entry->SetHttpStatusCode(http_status_code);
|
||||
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
bool result = internal::WriteNavigationEntryToPickle(*entry, &pickle);
|
||||
EXPECT_TRUE(result);
|
||||
|
||||
scoped_ptr<content::NavigationEntry> copy(content::NavigationEntry::Create());
|
||||
PickleIterator iterator(pickle);
|
||||
base::PickleIterator iterator(pickle);
|
||||
result = internal::RestoreNavigationEntryFromPickle(&iterator, copy.get());
|
||||
EXPECT_TRUE(result);
|
||||
|
||||
|
@ -33,8 +33,10 @@ using content::WebContents;
|
||||
|
||||
namespace {
|
||||
|
||||
bool WriteStateHeaderToPickle(bool off_the_record, int entry_count,
|
||||
int current_entry_index, Pickle* pickle) {
|
||||
bool WriteStateHeaderToPickle(bool off_the_record,
|
||||
int entry_count,
|
||||
int current_entry_index,
|
||||
base::Pickle* pickle) {
|
||||
return pickle->WriteBool(off_the_record) &&
|
||||
pickle->WriteInt(entry_count) &&
|
||||
pickle->WriteInt(current_entry_index);
|
||||
@ -66,10 +68,9 @@ bool WriteStateHeaderToPickle(bool off_the_record, int entry_count,
|
||||
void UpgradeNavigationFromV0ToV2(
|
||||
std::vector<sessions::SerializedNavigationEntry>* navigations,
|
||||
int entry_count,
|
||||
PickleIterator* iterator) {
|
||||
|
||||
base::PickleIterator* iterator) {
|
||||
for (int i = 0; i < entry_count; ++i) {
|
||||
Pickle v2_pickle;
|
||||
base::Pickle v2_pickle;
|
||||
std::string virtual_url_spec;
|
||||
std::string str_referrer;
|
||||
base::string16 title;
|
||||
@ -104,7 +105,7 @@ void UpgradeNavigationFromV0ToV2(
|
||||
// search_terms
|
||||
v2_pickle.WriteString16(base::string16());
|
||||
|
||||
PickleIterator tab_navigation_pickle_iterator(v2_pickle);
|
||||
base::PickleIterator tab_navigation_pickle_iterator(v2_pickle);
|
||||
sessions::SerializedNavigationEntry nav;
|
||||
if (nav.ReadFromPickle(&tab_navigation_pickle_iterator)) {
|
||||
navigations->push_back(nav);
|
||||
@ -152,9 +153,9 @@ void UpgradeNavigationFromV0ToV2(
|
||||
void UpgradeNavigationFromV1ToV2(
|
||||
std::vector<sessions::SerializedNavigationEntry>* navigations,
|
||||
int entry_count,
|
||||
PickleIterator* iterator) {
|
||||
base::PickleIterator* iterator) {
|
||||
for (int i = 0; i < entry_count; ++i) {
|
||||
Pickle v2_pickle;
|
||||
base::Pickle v2_pickle;
|
||||
|
||||
int index;
|
||||
std::string virtual_url_spec;
|
||||
@ -203,7 +204,7 @@ void UpgradeNavigationFromV1ToV2(
|
||||
// Force output of search_terms
|
||||
v2_pickle.WriteString16(base::string16());
|
||||
|
||||
PickleIterator tab_navigation_pickle_iterator(v2_pickle);
|
||||
base::PickleIterator tab_navigation_pickle_iterator(v2_pickle);
|
||||
sessions::SerializedNavigationEntry nav;
|
||||
if (nav.ReadFromPickle(&tab_navigation_pickle_iterator)) {
|
||||
navigations->push_back(nav);
|
||||
@ -224,8 +225,8 @@ bool ExtractNavigationEntries(
|
||||
int* current_entry_index,
|
||||
std::vector<sessions::SerializedNavigationEntry>* navigations) {
|
||||
int entry_count;
|
||||
Pickle pickle(static_cast<char*>(data), size);
|
||||
PickleIterator iter(pickle);
|
||||
base::Pickle pickle(static_cast<char*>(data), size);
|
||||
base::PickleIterator iter(pickle);
|
||||
if (!iter.ReadBool(is_off_the_record) || !iter.ReadInt(&entry_count) ||
|
||||
!iter.ReadInt(current_entry_index)) {
|
||||
LOG(ERROR) << "Failed to restore state from byte array (length=" << size
|
||||
@ -258,9 +259,10 @@ bool ExtractNavigationEntries(
|
||||
<< ").";
|
||||
return false; // It's dangerous to keep deserializing now, give up.
|
||||
}
|
||||
Pickle tab_navigation_pickle(tab_navigation_data,
|
||||
tab_navigation_data_length);
|
||||
PickleIterator tab_navigation_pickle_iterator(tab_navigation_pickle);
|
||||
base::Pickle tab_navigation_pickle(tab_navigation_data,
|
||||
tab_navigation_data_length);
|
||||
base::PickleIterator tab_navigation_pickle_iterator(
|
||||
tab_navigation_pickle);
|
||||
sessions::SerializedNavigationEntry nav;
|
||||
if (!nav.ReadFromPickle(&tab_navigation_pickle_iterator))
|
||||
return false; // If we failed to read a navigation, give up on others.
|
||||
@ -321,7 +323,7 @@ ScopedJavaLocalRef<jobject> WebContentsState::WriteNavigationsAsByteBuffer(
|
||||
bool is_off_the_record,
|
||||
const std::vector<content::NavigationEntry*>& navigations,
|
||||
int current_entry) {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
if (!WriteStateHeaderToPickle(is_off_the_record, navigations.size(),
|
||||
current_entry, &pickle)) {
|
||||
LOG(ERROR) << "Failed to serialize tab state (entry count=" <<
|
||||
@ -333,7 +335,7 @@ ScopedJavaLocalRef<jobject> WebContentsState::WriteNavigationsAsByteBuffer(
|
||||
for (size_t i = 0; i < navigations.size(); ++i) {
|
||||
// Write each SerializedNavigationEntry as a separate pickle to avoid
|
||||
// optional reads of one tab bleeding into the next tab's data.
|
||||
Pickle tab_navigation_pickle;
|
||||
base::Pickle tab_navigation_pickle;
|
||||
// Max size taken from BaseSessionService::CreateUpdateTabNavigationCommand.
|
||||
static const size_t max_state_size =
|
||||
std::numeric_limits<sessions::SessionCommand::size_type>::max() - 1024;
|
||||
|
@ -82,7 +82,7 @@ class QuerySelectorHandler : public content::WebContentsObserver {
|
||||
|
||||
// There may be several requests in flight; check this response matches.
|
||||
int message_request_id = 0;
|
||||
PickleIterator iter(message);
|
||||
base::PickleIterator iter(message);
|
||||
if (!iter.ReadInt(&message_request_id))
|
||||
return false;
|
||||
|
||||
|
@ -73,7 +73,7 @@ bool PageCaptureSaveAsMHTMLFunction::OnMessageReceived(
|
||||
return false;
|
||||
|
||||
int message_request_id;
|
||||
PickleIterator iter(message);
|
||||
base::PickleIterator iter(message);
|
||||
if (!iter.ReadInt(&message_request_id)) {
|
||||
NOTREACHED() << "malformed extension message";
|
||||
return true;
|
||||
|
@ -157,7 +157,7 @@ bool ExtensionAction::ParseIconFromCanvasDictionary(
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
PickleIterator iter(pickle);
|
||||
base::PickleIterator iter(pickle);
|
||||
SkBitmap bitmap;
|
||||
if (!IPC::ReadParam(&pickle, &iter, &bitmap))
|
||||
return false;
|
||||
|
@ -246,8 +246,8 @@ void WebRtcLogUploader::UploadStoredLog(
|
||||
.AddExtension(FILE_PATH_LITERAL(".meta"));
|
||||
if (base::ReadFileToString(meta_path, &meta_data_contents) &&
|
||||
!meta_data_contents.empty()) {
|
||||
Pickle pickle(&meta_data_contents[0], meta_data_contents.size());
|
||||
PickleIterator it(pickle);
|
||||
base::Pickle pickle(&meta_data_contents[0], meta_data_contents.size());
|
||||
base::PickleIterator it(pickle);
|
||||
std::string key, value;
|
||||
while (it.ReadString(&key) && it.ReadString(&value))
|
||||
(*meta_data.get())[key] = value;
|
||||
@ -296,7 +296,7 @@ void WebRtcLogUploader::LoggingStoppedDoStore(
|
||||
}
|
||||
|
||||
if (meta_data.get() && !meta_data->empty()) {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
for (const auto& it : *meta_data.get()) {
|
||||
pickle.WriteString(it.first);
|
||||
pickle.WriteString(it.second);
|
||||
|
@ -67,8 +67,8 @@ bool CompareForms(const autofill::PasswordForm& a,
|
||||
bool CheckSerializedValue(const uint8_t* byte_array,
|
||||
size_t length,
|
||||
const std::string& realm) {
|
||||
const Pickle::Header* header =
|
||||
reinterpret_cast<const Pickle::Header*>(byte_array);
|
||||
const base::Pickle::Header* header =
|
||||
reinterpret_cast<const base::Pickle::Header*>(byte_array);
|
||||
if (length < sizeof(*header) ||
|
||||
header->payload_size > length - sizeof(*header)) {
|
||||
LOG(WARNING) << "Invalid KWallet entry detected (realm: " << realm << ")";
|
||||
@ -79,7 +79,7 @@ bool CheckSerializedValue(const uint8_t* byte_array,
|
||||
|
||||
// Convenience function to read a GURL from a Pickle. Assumes the URL has
|
||||
// been written as a UTF-8 string. Returns true on success.
|
||||
bool ReadGURL(PickleIterator* iter, bool warn_only, GURL* url) {
|
||||
bool ReadGURL(base::PickleIterator* iter, bool warn_only, GURL* url) {
|
||||
std::string url_string;
|
||||
if (!iter->ReadString(&url_string)) {
|
||||
if (!warn_only)
|
||||
@ -113,12 +113,12 @@ void LogDeserializationWarning(int version,
|
||||
// as either size when reading old pickles that fail to deserialize using the
|
||||
// native size. Returns true on success.
|
||||
bool DeserializeValueSize(const std::string& signon_realm,
|
||||
const PickleIterator& init_iter,
|
||||
const base::PickleIterator& init_iter,
|
||||
int version,
|
||||
bool size_32,
|
||||
bool warn_only,
|
||||
ScopedVector<autofill::PasswordForm>* forms) {
|
||||
PickleIterator iter = init_iter;
|
||||
base::PickleIterator iter = init_iter;
|
||||
|
||||
size_t count = 0;
|
||||
if (size_32) {
|
||||
@ -235,7 +235,7 @@ bool DeserializeValueSize(const std::string& signon_realm,
|
||||
|
||||
// Serializes a list of PasswordForms to be stored in the wallet.
|
||||
void SerializeValue(const std::vector<autofill::PasswordForm*>& forms,
|
||||
Pickle* pickle) {
|
||||
base::Pickle* pickle) {
|
||||
pickle->WriteInt(kPickleVersion);
|
||||
pickle->WriteSizeT(forms.size());
|
||||
for (autofill::PasswordForm* form : forms) {
|
||||
@ -637,7 +637,7 @@ bool NativeBackendKWallet::GetLoginsList(
|
||||
}
|
||||
|
||||
// Can't we all just agree on whether bytes are signed or not? Please?
|
||||
Pickle pickle(reinterpret_cast<const char*>(bytes), length);
|
||||
base::Pickle pickle(reinterpret_cast<const char*>(bytes), length);
|
||||
*forms = DeserializeValue(signon_realm, pickle);
|
||||
}
|
||||
|
||||
@ -719,7 +719,7 @@ bool NativeBackendKWallet::GetAllLogins(
|
||||
continue;
|
||||
|
||||
// Can't we all just agree on whether bytes are signed or not? Please?
|
||||
Pickle pickle(reinterpret_cast<const char*>(bytes), length);
|
||||
base::Pickle pickle(reinterpret_cast<const char*>(bytes), length);
|
||||
AppendSecondToFirst(forms, DeserializeValue(signon_realm, pickle));
|
||||
}
|
||||
return true;
|
||||
@ -756,7 +756,7 @@ bool NativeBackendKWallet::SetLoginsList(
|
||||
return ret == 0;
|
||||
}
|
||||
|
||||
Pickle value;
|
||||
base::Pickle value;
|
||||
SerializeValue(forms, &value);
|
||||
|
||||
dbus::MethodCall method_call(kKWalletInterface, "writeEntry");
|
||||
@ -856,7 +856,7 @@ bool NativeBackendKWallet::RemoveLoginsBetween(
|
||||
continue;
|
||||
|
||||
// Can't we all just agree on whether bytes are signed or not? Please?
|
||||
Pickle pickle(reinterpret_cast<const char*>(bytes), length);
|
||||
base::Pickle pickle(reinterpret_cast<const char*>(bytes), length);
|
||||
ScopedVector<autofill::PasswordForm> all_forms =
|
||||
DeserializeValue(signon_realm, pickle);
|
||||
|
||||
@ -888,8 +888,8 @@ bool NativeBackendKWallet::RemoveLoginsBetween(
|
||||
// static
|
||||
ScopedVector<autofill::PasswordForm> NativeBackendKWallet::DeserializeValue(
|
||||
const std::string& signon_realm,
|
||||
const Pickle& pickle) {
|
||||
PickleIterator iter(pickle);
|
||||
const base::Pickle& pickle) {
|
||||
base::PickleIterator iter(pickle);
|
||||
|
||||
int version = -1;
|
||||
if (!iter.ReadInt(&version) ||
|
||||
|
@ -605,7 +605,8 @@ void NativeBackendKWalletTest::CheckPasswordForms(
|
||||
EXPECT_EQ(sorted_expected[i].first, entries[i]);
|
||||
TestKWallet::Blob value;
|
||||
EXPECT_TRUE(wallet_.readEntry(folder, entries[i], &value));
|
||||
Pickle pickle(reinterpret_cast<const char*>(value.data()), value.size());
|
||||
base::Pickle pickle(reinterpret_cast<const char*>(value.data()),
|
||||
value.size());
|
||||
ScopedVector<autofill::PasswordForm> forms =
|
||||
NativeBackendKWalletStub::DeserializeValue(entries[i], pickle);
|
||||
const std::vector<const PasswordForm*>& expect = sorted_expected[i].second;
|
||||
@ -930,14 +931,14 @@ TEST_F(NativeBackendKWalletTest, RemoveLoginsSyncedBetween) {
|
||||
|
||||
class NativeBackendKWalletPickleTest : public NativeBackendKWalletTestBase {
|
||||
protected:
|
||||
void CreateVersion6Pickle(const PasswordForm& form, Pickle* pickle);
|
||||
void CreateVersion5Pickle(const PasswordForm& form, Pickle* pickle);
|
||||
void CreateVersion3Pickle(const PasswordForm& form, Pickle* pickle);
|
||||
void CreateVersion2Pickle(const PasswordForm& form, Pickle* pickle);
|
||||
void CreateVersion1Pickle(const PasswordForm& form, Pickle* pickle);
|
||||
void CreateVersion6Pickle(const PasswordForm& form, base::Pickle* pickle);
|
||||
void CreateVersion5Pickle(const PasswordForm& form, base::Pickle* pickle);
|
||||
void CreateVersion3Pickle(const PasswordForm& form, base::Pickle* pickle);
|
||||
void CreateVersion2Pickle(const PasswordForm& form, base::Pickle* pickle);
|
||||
void CreateVersion1Pickle(const PasswordForm& form, base::Pickle* pickle);
|
||||
void CreateVersion0Pickle(bool size_32,
|
||||
const PasswordForm& form,
|
||||
Pickle* pickle);
|
||||
base::Pickle* pickle);
|
||||
void CheckVersion6Pickle();
|
||||
void CheckVersion5Pickle();
|
||||
void CheckVersion3Pickle();
|
||||
@ -953,12 +954,12 @@ class NativeBackendKWalletPickleTest : public NativeBackendKWalletTestBase {
|
||||
void CreatePickle(bool size_32,
|
||||
bool date_created_internal,
|
||||
const PasswordForm& form,
|
||||
Pickle* pickle);
|
||||
base::Pickle* pickle);
|
||||
};
|
||||
|
||||
void NativeBackendKWalletPickleTest::CreateVersion6Pickle(
|
||||
const PasswordForm& form,
|
||||
Pickle* pickle) {
|
||||
base::Pickle* pickle) {
|
||||
pickle->WriteInt(6);
|
||||
CreatePickle(false, true, form, pickle);
|
||||
pickle->WriteInt(form.type);
|
||||
@ -974,7 +975,7 @@ void NativeBackendKWalletPickleTest::CreateVersion6Pickle(
|
||||
|
||||
void NativeBackendKWalletPickleTest::CreateVersion5Pickle(
|
||||
const PasswordForm& form,
|
||||
Pickle* pickle) {
|
||||
base::Pickle* pickle) {
|
||||
pickle->WriteInt(5);
|
||||
CreatePickle(false, true, form, pickle);
|
||||
pickle->WriteInt(form.type);
|
||||
@ -988,7 +989,8 @@ void NativeBackendKWalletPickleTest::CreateVersion5Pickle(
|
||||
}
|
||||
|
||||
void NativeBackendKWalletPickleTest::CreateVersion3Pickle(
|
||||
const PasswordForm& form, Pickle* pickle) {
|
||||
const PasswordForm& form,
|
||||
base::Pickle* pickle) {
|
||||
pickle->WriteInt(3);
|
||||
CreatePickle(false, false, form, pickle);
|
||||
pickle->WriteInt(form.type);
|
||||
@ -998,7 +1000,8 @@ void NativeBackendKWalletPickleTest::CreateVersion3Pickle(
|
||||
}
|
||||
|
||||
void NativeBackendKWalletPickleTest::CreateVersion2Pickle(
|
||||
const PasswordForm& form, Pickle* pickle) {
|
||||
const PasswordForm& form,
|
||||
base::Pickle* pickle) {
|
||||
pickle->WriteInt(2);
|
||||
CreatePickle(false, false, form, pickle);
|
||||
pickle->WriteInt(form.type);
|
||||
@ -1007,13 +1010,16 @@ void NativeBackendKWalletPickleTest::CreateVersion2Pickle(
|
||||
}
|
||||
|
||||
void NativeBackendKWalletPickleTest::CreateVersion1Pickle(
|
||||
const PasswordForm& form, Pickle* pickle) {
|
||||
const PasswordForm& form,
|
||||
base::Pickle* pickle) {
|
||||
pickle->WriteInt(1);
|
||||
CreatePickle(false, false, form, pickle);
|
||||
}
|
||||
|
||||
void NativeBackendKWalletPickleTest::CreateVersion0Pickle(
|
||||
bool size_32, const PasswordForm& form, Pickle* pickle) {
|
||||
bool size_32,
|
||||
const PasswordForm& form,
|
||||
base::Pickle* pickle) {
|
||||
pickle->WriteInt(0);
|
||||
CreatePickle(size_32, false, form, pickle);
|
||||
}
|
||||
@ -1021,7 +1027,7 @@ void NativeBackendKWalletPickleTest::CreateVersion0Pickle(
|
||||
void NativeBackendKWalletPickleTest::CreatePickle(bool size_32,
|
||||
bool date_created_internal,
|
||||
const PasswordForm& form,
|
||||
Pickle* pickle) {
|
||||
base::Pickle* pickle) {
|
||||
if (size_32)
|
||||
pickle->WriteUInt32(1); // Size of form list. 32 bits.
|
||||
else
|
||||
@ -1044,7 +1050,7 @@ void NativeBackendKWalletPickleTest::CreatePickle(bool size_32,
|
||||
}
|
||||
|
||||
void NativeBackendKWalletPickleTest::CheckVersion6Pickle() {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
PasswordForm form = form_google_;
|
||||
form.generation_upload_status = PasswordForm::NEGATIVE_SIGNAL_SENT;
|
||||
CreateVersion6Pickle(form, &pickle);
|
||||
@ -1059,7 +1065,7 @@ void NativeBackendKWalletPickleTest::CheckVersion6Pickle() {
|
||||
}
|
||||
|
||||
void NativeBackendKWalletPickleTest::CheckVersion5Pickle() {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
PasswordForm form = form_google_;
|
||||
CreateVersion5Pickle(form, &pickle);
|
||||
|
||||
@ -1072,7 +1078,7 @@ void NativeBackendKWalletPickleTest::CheckVersion5Pickle() {
|
||||
}
|
||||
|
||||
void NativeBackendKWalletPickleTest::CheckVersion3Pickle() {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
PasswordForm form = form_google_;
|
||||
// Remove the fields which were not present in version #3.
|
||||
form.display_name.clear();
|
||||
@ -1090,7 +1096,7 @@ void NativeBackendKWalletPickleTest::CheckVersion3Pickle() {
|
||||
}
|
||||
|
||||
void NativeBackendKWalletPickleTest::CheckVersion2Pickle() {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
PasswordForm form = old_form_google_;
|
||||
form.times_used = form_google_.times_used;
|
||||
form.type = form_google_.type;
|
||||
@ -1107,7 +1113,7 @@ void NativeBackendKWalletPickleTest::CheckVersion2Pickle() {
|
||||
|
||||
// Make sure that we can still read version 1 pickles.
|
||||
void NativeBackendKWalletPickleTest::CheckVersion1Pickle() {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
PasswordForm form = form_google_;
|
||||
CreateVersion1Pickle(form, &pickle);
|
||||
|
||||
@ -1123,7 +1129,7 @@ void NativeBackendKWalletPickleTest::CheckVersion1Pickle() {
|
||||
|
||||
void NativeBackendKWalletPickleTest::CheckVersion0Pickle(
|
||||
bool size_32, PasswordForm::Scheme scheme) {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
PasswordForm form = old_form_google_;
|
||||
form.scheme = scheme;
|
||||
CreateVersion0Pickle(size_32, form, &pickle);
|
||||
|
@ -46,7 +46,8 @@ ui::ClipboardType ConvertClipboardType(uint32_t type) {
|
||||
// assume all data that is placed on the clipboard is UTF16 and pepper allows
|
||||
// arbitrary data so this change would require some reworking of the chrome
|
||||
// clipboard interface for custom data.
|
||||
bool JumpToFormatInPickle(const base::string16& format, PickleIterator* iter) {
|
||||
bool JumpToFormatInPickle(const base::string16& format,
|
||||
base::PickleIterator* iter) {
|
||||
size_t size = 0;
|
||||
if (!iter->ReadSizeT(&size))
|
||||
return false;
|
||||
@ -66,22 +67,22 @@ bool JumpToFormatInPickle(const base::string16& format, PickleIterator* iter) {
|
||||
}
|
||||
|
||||
bool IsFormatAvailableInPickle(const base::string16& format,
|
||||
const Pickle& pickle) {
|
||||
PickleIterator iter(pickle);
|
||||
const base::Pickle& pickle) {
|
||||
base::PickleIterator iter(pickle);
|
||||
return JumpToFormatInPickle(format, &iter);
|
||||
}
|
||||
|
||||
std::string ReadDataFromPickle(const base::string16& format,
|
||||
const Pickle& pickle) {
|
||||
const base::Pickle& pickle) {
|
||||
std::string result;
|
||||
PickleIterator iter(pickle);
|
||||
base::PickleIterator iter(pickle);
|
||||
if (!JumpToFormatInPickle(format, &iter) || !iter.ReadString(&result))
|
||||
return std::string();
|
||||
return result;
|
||||
}
|
||||
|
||||
bool WriteDataToPickle(const std::map<base::string16, std::string>& data,
|
||||
Pickle* pickle) {
|
||||
base::Pickle* pickle) {
|
||||
pickle->WriteSizeT(data.size());
|
||||
for (std::map<base::string16, std::string>::const_iterator it = data.begin();
|
||||
it != data.end();
|
||||
@ -187,7 +188,7 @@ int32_t PepperFlashClipboardMessageFilter::OnMsgIsFormatAvailable(
|
||||
std::string clipboard_data;
|
||||
clipboard->ReadData(ui::Clipboard::GetPepperCustomDataFormatType(),
|
||||
&clipboard_data);
|
||||
Pickle pickle(clipboard_data.data(), clipboard_data.size());
|
||||
base::Pickle pickle(clipboard_data.data(), clipboard_data.size());
|
||||
available =
|
||||
IsFormatAvailableInPickle(base::UTF8ToUTF16(format_name), pickle);
|
||||
}
|
||||
@ -265,7 +266,7 @@ int32_t PepperFlashClipboardMessageFilter::OnMsgReadData(
|
||||
std::string clipboard_data;
|
||||
clipboard->ReadData(ui::Clipboard::GetPepperCustomDataFormatType(),
|
||||
&clipboard_data);
|
||||
Pickle pickle(clipboard_data.data(), clipboard_data.size());
|
||||
base::Pickle pickle(clipboard_data.data(), clipboard_data.size());
|
||||
if (IsFormatAvailableInPickle(format_name, pickle)) {
|
||||
result = PP_OK;
|
||||
clipboard_string = ReadDataFromPickle(format_name, pickle);
|
||||
@ -340,7 +341,7 @@ int32_t PepperFlashClipboardMessageFilter::OnMsgWriteData(
|
||||
}
|
||||
|
||||
if (custom_data_map.size() > 0) {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
if (WriteDataToPickle(custom_data_map, &pickle)) {
|
||||
scw.WritePickledData(pickle,
|
||||
ui::Clipboard::GetPepperCustomDataFormatType());
|
||||
|
@ -72,7 +72,7 @@ void WriteHeaders(disk_cache::Entry* entry, const std::string& headers) {
|
||||
responseinfo.socket_address = net::HostPortPair("1.2.3.4", 80);
|
||||
responseinfo.headers = new net::HttpResponseHeaders(raw_headers);
|
||||
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
responseinfo.Persist(&pickle, false, false);
|
||||
|
||||
scoped_refptr<net::WrappedIOBuffer> buf(new net::WrappedIOBuffer(
|
||||
|
@ -75,7 +75,7 @@ bool ColorTypeToFormat(SkColorType colorType, ImageFormat* out) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PickleImage(Pickle* pickle, const gfx::ImageSkia& image) {
|
||||
bool PickleImage(base::Pickle* pickle, const gfx::ImageSkia& image) {
|
||||
std::vector<gfx::ImageSkiaRep> reps(image.image_reps());
|
||||
pickle->WriteInt(static_cast<int>(reps.size()));
|
||||
for (std::vector<gfx::ImageSkiaRep>::const_iterator it = reps.begin();
|
||||
@ -96,7 +96,7 @@ bool PickleImage(Pickle* pickle, const gfx::ImageSkia& image) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool UnpickleImage(PickleIterator* it, gfx::ImageSkia* out) {
|
||||
bool UnpickleImage(base::PickleIterator* it, gfx::ImageSkia* out) {
|
||||
int rep_count = 0;
|
||||
if (!it->ReadInt(&rep_count))
|
||||
return false;
|
||||
@ -147,7 +147,7 @@ bool UnpickleImage(PickleIterator* it, gfx::ImageSkia* out) {
|
||||
} // namespace
|
||||
|
||||
scoped_ptr<AppListItem> FastShowPickler::UnpickleAppListItem(
|
||||
PickleIterator* it) {
|
||||
base::PickleIterator* it) {
|
||||
std::string id;
|
||||
if (!it->ReadString(&id))
|
||||
return scoped_ptr<AppListItem>();
|
||||
@ -169,7 +169,8 @@ scoped_ptr<AppListItem> FastShowPickler::UnpickleAppListItem(
|
||||
return result.Pass();
|
||||
}
|
||||
|
||||
bool FastShowPickler::PickleAppListItem(Pickle* pickle, AppListItem* item) {
|
||||
bool FastShowPickler::PickleAppListItem(base::Pickle* pickle,
|
||||
AppListItem* item) {
|
||||
if (!pickle->WriteString(item->id()))
|
||||
return false;
|
||||
if (!pickle->WriteString(item->name()))
|
||||
@ -194,17 +195,17 @@ void FastShowPickler::CopyOverItem(AppListItem* src_item,
|
||||
// whenever this format is changed so new clients can invalidate old versions.
|
||||
const int FastShowPickler::kVersion = 3;
|
||||
|
||||
scoped_ptr<Pickle> FastShowPickler::PickleAppListModelForFastShow(
|
||||
scoped_ptr<base::Pickle> FastShowPickler::PickleAppListModelForFastShow(
|
||||
AppListModel* model) {
|
||||
scoped_ptr<Pickle> result(new Pickle);
|
||||
scoped_ptr<base::Pickle> result(new Pickle);
|
||||
if (!result->WriteInt(kVersion))
|
||||
return scoped_ptr<Pickle>();
|
||||
return scoped_ptr<base::Pickle>();
|
||||
if (!result->WriteInt((int)model->top_level_item_list()->item_count()))
|
||||
return scoped_ptr<Pickle>();
|
||||
return scoped_ptr<base::Pickle>();
|
||||
for (size_t i = 0; i < model->top_level_item_list()->item_count(); ++i) {
|
||||
if (!PickleAppListItem(result.get(),
|
||||
model->top_level_item_list()->item_at(i))) {
|
||||
return scoped_ptr<Pickle>();
|
||||
return scoped_ptr<base::Pickle>();
|
||||
}
|
||||
}
|
||||
return result.Pass();
|
||||
@ -220,9 +221,9 @@ void FastShowPickler::CopyOver(AppListModel* src, AppListModel* dest) {
|
||||
}
|
||||
}
|
||||
|
||||
scoped_ptr<AppListModel>
|
||||
FastShowPickler::UnpickleAppListModelForFastShow(Pickle* pickle) {
|
||||
PickleIterator it(*pickle);
|
||||
scoped_ptr<AppListModel> FastShowPickler::UnpickleAppListModelForFastShow(
|
||||
base::Pickle* pickle) {
|
||||
base::PickleIterator it(*pickle);
|
||||
int read_version = 0;
|
||||
if (!it.ReadInt(&read_version))
|
||||
return scoped_ptr<AppListModel>();
|
||||
|
@ -45,7 +45,7 @@ class AppListModelPicklerUnitTest : public testing::Test {
|
||||
}
|
||||
|
||||
scoped_ptr<AppListModel> CopyViaPickle(AppListModel* model) {
|
||||
scoped_ptr<Pickle> pickle(
|
||||
scoped_ptr<base::Pickle> pickle(
|
||||
FastShowPickler::PickleAppListModelForFastShow(model));
|
||||
return FastShowPickler::UnpickleAppListModelForFastShow(pickle.get());
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ bool BrowserActionDragData::IsFromProfile(const Profile* profile) const {
|
||||
void BrowserActionDragData::Write(
|
||||
Profile* profile, ui::OSExchangeData* data) const {
|
||||
DCHECK(data);
|
||||
Pickle data_pickle;
|
||||
base::Pickle data_pickle;
|
||||
WriteToPickle(profile, &data_pickle);
|
||||
data->SetPickledData(GetBrowserActionCustomFormat(), data_pickle);
|
||||
}
|
||||
@ -59,7 +59,7 @@ bool BrowserActionDragData::Read(const ui::OSExchangeData& data) {
|
||||
if (!data.HasCustomFormat(GetBrowserActionCustomFormat()))
|
||||
return false;
|
||||
|
||||
Pickle drag_data_pickle;
|
||||
base::Pickle drag_data_pickle;
|
||||
if (!data.GetPickledData(GetBrowserActionCustomFormat(), &drag_data_pickle))
|
||||
return false;
|
||||
|
||||
@ -81,15 +81,15 @@ BrowserActionDragData::GetBrowserActionCustomFormat() {
|
||||
}
|
||||
#endif
|
||||
|
||||
void BrowserActionDragData::WriteToPickle(
|
||||
Profile* profile, base::Pickle* pickle) const {
|
||||
void BrowserActionDragData::WriteToPickle(Profile* profile,
|
||||
base::Pickle* pickle) const {
|
||||
pickle->WriteBytes(&profile, sizeof(profile));
|
||||
pickle->WriteString(id_);
|
||||
pickle->WriteUInt64(index_);
|
||||
}
|
||||
|
||||
bool BrowserActionDragData::ReadFromPickle(Pickle* pickle) {
|
||||
PickleIterator data_iterator(*pickle);
|
||||
bool BrowserActionDragData::ReadFromPickle(base::Pickle* pickle) {
|
||||
base::PickleIterator data_iterator(*pickle);
|
||||
|
||||
const char* tmp;
|
||||
if (!data_iterator.ReadBytes(&tmp, sizeof(profile_)))
|
||||
|
@ -18,7 +18,7 @@ void ContentSettingsPatternSerializer::WriteToMessage(
|
||||
// static
|
||||
bool ContentSettingsPatternSerializer::ReadFromMessage(
|
||||
const IPC::Message* m,
|
||||
PickleIterator* iter,
|
||||
base::PickleIterator* iter,
|
||||
ContentSettingsPattern* pattern) {
|
||||
DCHECK(pattern);
|
||||
return IPC::ReadParam(m, iter, &pattern->is_valid_) &&
|
||||
|
@ -14,7 +14,9 @@ void ParamTraits<ContentSettingsPattern>::Write(
|
||||
}
|
||||
|
||||
bool ParamTraits<ContentSettingsPattern>::Read(
|
||||
const Message* m, PickleIterator* iter, ContentSettingsPattern* pattern) {
|
||||
const Message* m,
|
||||
base::PickleIterator* iter,
|
||||
ContentSettingsPattern* pattern) {
|
||||
return ContentSettingsPatternSerializer::ReadFromMessage(m, iter, pattern);
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ TEST_P(IPCProtobufMessageTest, FundamentalField) {
|
||||
IPC::WriteParam(&msg, input);
|
||||
|
||||
TestMessage output;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
ASSERT_TRUE(IPC::ReadParam(&msg, &iter, &output));
|
||||
|
||||
if (field_is_present_) {
|
||||
@ -67,7 +67,7 @@ TEST_P(IPCProtobufMessageTest, StringField) {
|
||||
IPC::WriteParam(&msg, input);
|
||||
|
||||
TestMessage output;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
ASSERT_TRUE(IPC::ReadParam(&msg, &iter, &output));
|
||||
|
||||
if (field_is_present_) {
|
||||
@ -89,7 +89,7 @@ TEST_P(IPCProtobufMessageTest, BytesField) {
|
||||
IPC::WriteParam(&msg, input);
|
||||
|
||||
TestMessage output;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
ASSERT_TRUE(IPC::ReadParam(&msg, &iter, &output));
|
||||
|
||||
if (field_is_present_) {
|
||||
@ -111,7 +111,7 @@ TEST_P(IPCProtobufMessageTest, OptionalSubmessage) {
|
||||
IPC::WriteParam(&msg, input);
|
||||
|
||||
TestMessage output;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
ASSERT_TRUE(IPC::ReadParam(&msg, &iter, &output));
|
||||
|
||||
if (field_is_present_) {
|
||||
@ -137,7 +137,7 @@ TEST_P(IPCProtobufMessageTest, RepeatedSubmessage) {
|
||||
IPC::WriteParam(&msg, input);
|
||||
|
||||
TestMessage output;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
ASSERT_TRUE(IPC::ReadParam(&msg, &iter, &output));
|
||||
|
||||
if (field_is_present_) {
|
||||
|
@ -45,7 +45,8 @@ void ParamTraits<media::AudioDecoderConfig>::Write(
|
||||
}
|
||||
|
||||
bool ParamTraits<media::AudioDecoderConfig>::Read(
|
||||
const Message* m, PickleIterator* iter,
|
||||
const Message* m,
|
||||
base::PickleIterator* iter,
|
||||
media::AudioDecoderConfig* r) {
|
||||
media::AudioCodec codec;
|
||||
media::SampleFormat sample_format;
|
||||
@ -96,7 +97,8 @@ void ParamTraits<media::VideoDecoderConfig>::Write(
|
||||
}
|
||||
|
||||
bool ParamTraits<media::VideoDecoderConfig>::Read(
|
||||
const Message* m, PickleIterator* iter,
|
||||
const Message* m,
|
||||
base::PickleIterator* iter,
|
||||
media::VideoDecoderConfig* r) {
|
||||
media::VideoCodec codec;
|
||||
media::VideoCodecProfile profile;
|
||||
|
@ -46,7 +46,7 @@ SetupListener::~SetupListener() {
|
||||
}
|
||||
|
||||
bool SetupListener::OnMessageReceived(const IPC::Message& msg) {
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
std::string json_string;
|
||||
if (!iter.ReadString(&json_string))
|
||||
return false;
|
||||
|
@ -16,7 +16,7 @@ namespace {
|
||||
|
||||
const int kPickleVersion = 3;
|
||||
|
||||
bool ReadGURL(PickleIterator* iter, GURL* url) {
|
||||
bool ReadGURL(base::PickleIterator* iter, GURL* url) {
|
||||
std::string spec;
|
||||
if (!iter->ReadString(&spec))
|
||||
return false;
|
||||
@ -26,14 +26,14 @@ bool ReadGURL(PickleIterator* iter, GURL* url) {
|
||||
}
|
||||
|
||||
void SerializeFormFieldDataVector(const std::vector<FormFieldData>& fields,
|
||||
Pickle* pickle) {
|
||||
base::Pickle* pickle) {
|
||||
pickle->WriteInt(static_cast<int>(fields.size()));
|
||||
for (size_t i = 0; i < fields.size(); ++i) {
|
||||
SerializeFormFieldData(fields[i], pickle);
|
||||
}
|
||||
}
|
||||
|
||||
bool DeserializeFormFieldDataVector(PickleIterator* iter,
|
||||
bool DeserializeFormFieldDataVector(base::PickleIterator* iter,
|
||||
std::vector<FormFieldData>* fields) {
|
||||
int size;
|
||||
if (!iter->ReadInt(&size))
|
||||
@ -115,7 +115,7 @@ std::ostream& operator<<(std::ostream& os, const FormData& form) {
|
||||
return os;
|
||||
}
|
||||
|
||||
void SerializeFormData(const FormData& form_data, Pickle* pickle) {
|
||||
void SerializeFormData(const FormData& form_data, base::Pickle* pickle) {
|
||||
pickle->WriteInt(kPickleVersion);
|
||||
pickle->WriteString16(form_data.name);
|
||||
pickle->WriteString(form_data.origin.spec());
|
||||
@ -127,14 +127,14 @@ void SerializeFormData(const FormData& form_data, Pickle* pickle) {
|
||||
|
||||
void SerializeFormDataToBase64String(const FormData& form_data,
|
||||
std::string* output) {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
SerializeFormData(form_data, &pickle);
|
||||
Base64Encode(
|
||||
base::StringPiece(static_cast<const char*>(pickle.data()), pickle.size()),
|
||||
output);
|
||||
}
|
||||
|
||||
bool DeserializeFormData(PickleIterator* iter, FormData* form_data) {
|
||||
bool DeserializeFormData(base::PickleIterator* iter, FormData* form_data) {
|
||||
int version;
|
||||
FormData temp_form_data;
|
||||
if (!iter->ReadInt(&version)) {
|
||||
@ -187,8 +187,8 @@ bool DeserializeFormDataFromBase64String(const base::StringPiece& input,
|
||||
return false;
|
||||
std::string pickle_data;
|
||||
Base64Decode(input, &pickle_data);
|
||||
Pickle pickle(pickle_data.data(), static_cast<int>(pickle_data.size()));
|
||||
PickleIterator iter(pickle);
|
||||
base::Pickle pickle(pickle_data.data(), static_cast<int>(pickle_data.size()));
|
||||
base::PickleIterator iter(pickle);
|
||||
return DeserializeFormData(&iter, form_data);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,8 @@ namespace {
|
||||
// This function serializes the form data into the pickle in version one format.
|
||||
// It should always be possible to deserialize it using DeserializeFormData(),
|
||||
// even when version changes. See kPickleVersion in form_data.cc.
|
||||
void SerializeInVersion1Format(const FormData& form_data, Pickle* pickle) {
|
||||
void SerializeInVersion1Format(const FormData& form_data,
|
||||
base::Pickle* pickle) {
|
||||
DCHECK_EQ(true, form_data.is_form_tag);
|
||||
pickle->WriteInt(1);
|
||||
pickle->WriteString16(form_data.name);
|
||||
@ -31,7 +32,8 @@ void SerializeInVersion1Format(const FormData& form_data, Pickle* pickle) {
|
||||
}
|
||||
}
|
||||
|
||||
void SerializeInVersion2Format(const FormData& form_data, Pickle* pickle) {
|
||||
void SerializeInVersion2Format(const FormData& form_data,
|
||||
base::Pickle* pickle) {
|
||||
DCHECK_EQ(true, form_data.is_form_tag);
|
||||
pickle->WriteInt(2);
|
||||
pickle->WriteString16(form_data.name);
|
||||
@ -46,7 +48,7 @@ void SerializeInVersion2Format(const FormData& form_data, Pickle* pickle) {
|
||||
|
||||
// This function serializes the form data into the pickle in incorrect format
|
||||
// (no version number).
|
||||
void SerializeIncorrectFormat(const FormData& form_data, Pickle* pickle) {
|
||||
void SerializeIncorrectFormat(const FormData& form_data, base::Pickle* pickle) {
|
||||
pickle->WriteString16(form_data.name);
|
||||
pickle->WriteString(form_data.origin.spec());
|
||||
pickle->WriteString(form_data.action.spec());
|
||||
@ -97,10 +99,10 @@ TEST(FormDataTest, SerializeAndDeserialize) {
|
||||
FillInDummyFormData(&data);
|
||||
data.is_form_tag = false;
|
||||
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
SerializeFormData(data, &pickle);
|
||||
|
||||
PickleIterator iter(pickle);
|
||||
base::PickleIterator iter(pickle);
|
||||
FormData actual;
|
||||
EXPECT_TRUE(DeserializeFormData(&iter, &actual));
|
||||
|
||||
@ -111,10 +113,10 @@ TEST(FormDataTest, Serialize_v1_Deserialize_vCurrent) {
|
||||
FormData data;
|
||||
FillInDummyFormData(&data);
|
||||
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
SerializeInVersion1Format(data, &pickle);
|
||||
|
||||
PickleIterator iter(pickle);
|
||||
base::PickleIterator iter(pickle);
|
||||
FormData actual;
|
||||
EXPECT_TRUE(DeserializeFormData(&iter, &actual));
|
||||
|
||||
@ -125,10 +127,10 @@ TEST(FormDataTest, Serialize_v2_Deserialize_vCurrent) {
|
||||
FormData data;
|
||||
FillInDummyFormData(&data);
|
||||
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
SerializeInVersion2Format(data, &pickle);
|
||||
|
||||
PickleIterator iter(pickle);
|
||||
base::PickleIterator iter(pickle);
|
||||
FormData actual;
|
||||
EXPECT_TRUE(DeserializeFormData(&iter, &actual));
|
||||
|
||||
@ -139,10 +141,10 @@ TEST(FormDataTest, SerializeIncorrectFormatAndDeserialize) {
|
||||
FormData data;
|
||||
FillInDummyFormData(&data);
|
||||
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
SerializeIncorrectFormat(data, &pickle);
|
||||
|
||||
PickleIterator iter(pickle);
|
||||
base::PickleIterator iter(pickle);
|
||||
FormData actual;
|
||||
EXPECT_FALSE(DeserializeFormData(&iter, &actual));
|
||||
|
||||
|
@ -17,14 +17,14 @@ namespace {
|
||||
const int kPickleVersion = 2;
|
||||
|
||||
void AddVectorToPickle(std::vector<base::string16> strings,
|
||||
Pickle* pickle) {
|
||||
base::Pickle* pickle) {
|
||||
pickle->WriteInt(static_cast<int>(strings.size()));
|
||||
for (size_t i = 0; i < strings.size(); ++i) {
|
||||
pickle->WriteString16(strings[i]);
|
||||
}
|
||||
}
|
||||
|
||||
bool ReadStringVector(PickleIterator* iter,
|
||||
bool ReadStringVector(base::PickleIterator* iter,
|
||||
std::vector<base::string16>* strings) {
|
||||
int size;
|
||||
if (!iter->ReadInt(&size))
|
||||
@ -41,7 +41,7 @@ bool ReadStringVector(PickleIterator* iter,
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool ReadAsInt(PickleIterator* iter, T* target_value) {
|
||||
bool ReadAsInt(base::PickleIterator* iter, T* target_value) {
|
||||
int pickle_data;
|
||||
if (!iter->ReadInt(&pickle_data))
|
||||
return false;
|
||||
@ -50,7 +50,7 @@ bool ReadAsInt(PickleIterator* iter, T* target_value) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DeserializeCommonSection1(PickleIterator* iter,
|
||||
bool DeserializeCommonSection1(base::PickleIterator* iter,
|
||||
FormFieldData* field_data) {
|
||||
return iter->ReadString16(&field_data->label) &&
|
||||
iter->ReadString16(&field_data->name) &&
|
||||
@ -65,14 +65,14 @@ bool DeserializeCommonSection1(PickleIterator* iter,
|
||||
iter->ReadBool(&field_data->should_autocomplete);
|
||||
}
|
||||
|
||||
bool DeserializeCommonSection2(PickleIterator* iter,
|
||||
bool DeserializeCommonSection2(base::PickleIterator* iter,
|
||||
FormFieldData* field_data) {
|
||||
return ReadAsInt(iter, &field_data->text_direction) &&
|
||||
ReadStringVector(iter, &field_data->option_values) &&
|
||||
ReadStringVector(iter, &field_data->option_contents);
|
||||
}
|
||||
|
||||
bool DeserializeVersion2Specific(PickleIterator* iter,
|
||||
bool DeserializeVersion2Specific(base::PickleIterator* iter,
|
||||
FormFieldData* field_data) {
|
||||
return ReadAsInt(iter, &field_data->role);
|
||||
}
|
||||
@ -143,7 +143,7 @@ bool FormFieldData::operator<(const FormFieldData& field) const {
|
||||
}
|
||||
|
||||
void SerializeFormFieldData(const FormFieldData& field_data,
|
||||
Pickle* pickle) {
|
||||
base::Pickle* pickle) {
|
||||
pickle->WriteInt(kPickleVersion);
|
||||
pickle->WriteString16(field_data.label);
|
||||
pickle->WriteString16(field_data.name);
|
||||
@ -162,7 +162,7 @@ void SerializeFormFieldData(const FormFieldData& field_data,
|
||||
AddVectorToPickle(field_data.option_contents, pickle);
|
||||
}
|
||||
|
||||
bool DeserializeFormFieldData(PickleIterator* iter,
|
||||
bool DeserializeFormFieldData(base::PickleIterator* iter,
|
||||
FormFieldData* field_data) {
|
||||
int version;
|
||||
FormFieldData temp_form_field_data;
|
||||
|
@ -32,7 +32,7 @@ void FillCommonFields(FormFieldData* data) {
|
||||
data->option_contents.push_back(base::ASCIIToUTF16("Second"));
|
||||
}
|
||||
|
||||
void WriteCommonSection1(const FormFieldData& data, Pickle* pickle) {
|
||||
void WriteCommonSection1(const FormFieldData& data, base::Pickle* pickle) {
|
||||
pickle->WriteString16(data.label);
|
||||
pickle->WriteString16(data.name);
|
||||
pickle->WriteString16(data.value);
|
||||
@ -46,7 +46,7 @@ void WriteCommonSection1(const FormFieldData& data, Pickle* pickle) {
|
||||
pickle->WriteBool(data.should_autocomplete);
|
||||
}
|
||||
|
||||
void WriteCommonSection2(const FormFieldData& data, Pickle* pickle) {
|
||||
void WriteCommonSection2(const FormFieldData& data, base::Pickle* pickle) {
|
||||
pickle->WriteInt(data.text_direction);
|
||||
pickle->WriteInt(static_cast<int>(data.option_values.size()));
|
||||
for (auto s : data.option_values)
|
||||
@ -63,10 +63,10 @@ TEST(FormFieldDataTest, SerializeAndDeserialize) {
|
||||
FillCommonFields(&data);
|
||||
data.role = FormFieldData::ROLE_ATTRIBUTE_PRESENTATION;
|
||||
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
SerializeFormFieldData(data, &pickle);
|
||||
|
||||
PickleIterator iter(pickle);
|
||||
base::PickleIterator iter(pickle);
|
||||
FormFieldData actual;
|
||||
EXPECT_TRUE(DeserializeFormFieldData(&iter, &actual));
|
||||
|
||||
@ -77,12 +77,12 @@ TEST(FormFieldDataTest, DeserializeVersion1) {
|
||||
FormFieldData data;
|
||||
FillCommonFields(&data);
|
||||
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
pickle.WriteInt(1);
|
||||
WriteCommonSection1(data, &pickle);
|
||||
WriteCommonSection2(data, &pickle);
|
||||
|
||||
PickleIterator iter(pickle);
|
||||
base::PickleIterator iter(pickle);
|
||||
FormFieldData actual;
|
||||
EXPECT_TRUE(DeserializeFormFieldData(&iter, &actual));
|
||||
|
||||
@ -92,12 +92,12 @@ TEST(FormFieldDataTest, DeserializeVersion1) {
|
||||
// Verify that if the data isn't valid, the FormFieldData isn't populated
|
||||
// during deserialization.
|
||||
TEST(FormFieldDataTest, DeserializeBadData) {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
pickle.WriteInt(255);
|
||||
pickle.WriteString16(base::ASCIIToUTF16("random"));
|
||||
pickle.WriteString16(base::ASCIIToUTF16("data"));
|
||||
|
||||
PickleIterator iter(pickle);
|
||||
base::PickleIterator iter(pickle);
|
||||
FormFieldData actual;
|
||||
EXPECT_FALSE(DeserializeFormFieldData(&iter, &actual));
|
||||
|
||||
|
@ -37,7 +37,7 @@ BookmarkNodeData::Element::Element(const BookmarkNode* node)
|
||||
BookmarkNodeData::Element::~Element() {
|
||||
}
|
||||
|
||||
void BookmarkNodeData::Element::WriteToPickle(Pickle* pickle) const {
|
||||
void BookmarkNodeData::Element::WriteToPickle(base::Pickle* pickle) const {
|
||||
pickle->WriteBool(is_url);
|
||||
pickle->WriteString(url.spec());
|
||||
pickle->WriteString16(title);
|
||||
@ -57,7 +57,7 @@ void BookmarkNodeData::Element::WriteToPickle(Pickle* pickle) const {
|
||||
}
|
||||
}
|
||||
|
||||
bool BookmarkNodeData::Element::ReadFromPickle(PickleIterator* iterator) {
|
||||
bool BookmarkNodeData::Element::ReadFromPickle(base::PickleIterator* iterator) {
|
||||
std::string url_spec;
|
||||
if (!iterator->ReadBool(&is_url) ||
|
||||
!iterator->ReadString(&url_spec) ||
|
||||
@ -194,7 +194,7 @@ void BookmarkNodeData::WriteToClipboard(ui::ClipboardType clipboard_type) {
|
||||
scw.WriteText(text);
|
||||
}
|
||||
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
WriteToPickle(base::FilePath(), &pickle);
|
||||
scw.WritePickledData(pickle,
|
||||
ui::Clipboard::GetFormatType(kClipboardFormatString));
|
||||
@ -208,7 +208,7 @@ bool BookmarkNodeData::ReadFromClipboard(ui::ClipboardType type) {
|
||||
&data);
|
||||
|
||||
if (!data.empty()) {
|
||||
Pickle pickle(data.data(), static_cast<int>(data.size()));
|
||||
base::Pickle pickle(data.data(), static_cast<int>(data.size()));
|
||||
if (ReadFromPickle(&pickle))
|
||||
return true;
|
||||
}
|
||||
@ -232,7 +232,7 @@ bool BookmarkNodeData::ReadFromClipboard(ui::ClipboardType type) {
|
||||
#endif
|
||||
|
||||
void BookmarkNodeData::WriteToPickle(const base::FilePath& profile_path,
|
||||
Pickle* pickle) const {
|
||||
base::Pickle* pickle) const {
|
||||
profile_path.WriteToPickle(pickle);
|
||||
pickle->WriteSizeT(size());
|
||||
|
||||
@ -240,8 +240,8 @@ void BookmarkNodeData::WriteToPickle(const base::FilePath& profile_path,
|
||||
elements[i].WriteToPickle(pickle);
|
||||
}
|
||||
|
||||
bool BookmarkNodeData::ReadFromPickle(Pickle* pickle) {
|
||||
PickleIterator data_iterator(*pickle);
|
||||
bool BookmarkNodeData::ReadFromPickle(base::Pickle* pickle) {
|
||||
base::PickleIterator data_iterator(*pickle);
|
||||
size_t element_count;
|
||||
if (profile_path_.ReadFromPickle(&data_iterator) &&
|
||||
data_iterator.ReadSizeT(&element_count)) {
|
||||
|
@ -37,7 +37,7 @@ void BookmarkNodeData::Write(const base::FilePath& profile_path,
|
||||
}
|
||||
}
|
||||
|
||||
Pickle data_pickle;
|
||||
base::Pickle data_pickle;
|
||||
WriteToPickle(profile_path, &data_pickle);
|
||||
|
||||
data->SetPickledData(GetBookmarkCustomFormat(), data_pickle);
|
||||
@ -49,7 +49,7 @@ bool BookmarkNodeData::Read(const ui::OSExchangeData& data) {
|
||||
profile_path_.clear();
|
||||
|
||||
if (data.HasCustomFormat(GetBookmarkCustomFormat())) {
|
||||
Pickle drag_data_pickle;
|
||||
base::Pickle drag_data_pickle;
|
||||
if (data.GetPickledData(GetBookmarkCustomFormat(), &drag_data_pickle)) {
|
||||
if (!ReadFromPickle(&drag_data_pickle))
|
||||
return false;
|
||||
|
@ -86,7 +86,7 @@ void ReadCache(const base::FilePath& filename, std::string* data) {
|
||||
}
|
||||
}
|
||||
|
||||
void WriteCache(const base::FilePath& filename, const Pickle* pickle) {
|
||||
void WriteCache(const base::FilePath& filename, const base::Pickle* pickle) {
|
||||
base::WriteFile(filename, static_cast<const char*>(pickle->data()),
|
||||
pickle->size());
|
||||
}
|
||||
@ -359,7 +359,7 @@ void NaClBrowser::OnValidationCacheLoaded(const std::string *data) {
|
||||
// No file found.
|
||||
validation_cache_.Reset();
|
||||
} else {
|
||||
Pickle pickle(data->data(), data->size());
|
||||
base::Pickle pickle(data->data(), data->size());
|
||||
validation_cache_.Deserialize(&pickle);
|
||||
}
|
||||
validation_cache_state_ = NaClResourceReady;
|
||||
@ -529,7 +529,7 @@ void NaClBrowser::PersistValidationCache() {
|
||||
// validation_cache_file_path_ may be empty if something went wrong during
|
||||
// initialization.
|
||||
if (validation_cache_is_modified_ && !validation_cache_file_path_.empty()) {
|
||||
Pickle* pickle = new Pickle();
|
||||
base::Pickle* pickle = new base::Pickle();
|
||||
validation_cache_.Serialize(pickle);
|
||||
|
||||
// Pass the serialized data to another thread to write to disk. File IO is
|
||||
|
@ -52,7 +52,7 @@ void NaClValidationCache::SetKnownToValidate(const std::string& signature) {
|
||||
}
|
||||
}
|
||||
|
||||
void NaClValidationCache::Serialize(Pickle* pickle) const {
|
||||
void NaClValidationCache::Serialize(base::Pickle* pickle) const {
|
||||
// Mark the beginning of the data stream.
|
||||
pickle->WriteString(kValidationCacheBeginMagic);
|
||||
pickle->WriteString(validation_cache_key_);
|
||||
@ -76,7 +76,7 @@ void NaClValidationCache::Reset() {
|
||||
validation_cache_.Clear();
|
||||
}
|
||||
|
||||
bool NaClValidationCache::Deserialize(const Pickle* pickle) {
|
||||
bool NaClValidationCache::Deserialize(const base::Pickle* pickle) {
|
||||
bool success = DeserializeImpl(pickle);
|
||||
if (!success) {
|
||||
Reset();
|
||||
@ -84,8 +84,8 @@ bool NaClValidationCache::Deserialize(const Pickle* pickle) {
|
||||
return success;
|
||||
}
|
||||
|
||||
bool NaClValidationCache::DeserializeImpl(const Pickle* pickle) {
|
||||
PickleIterator iter(*pickle);
|
||||
bool NaClValidationCache::DeserializeImpl(const base::Pickle* pickle) {
|
||||
base::PickleIterator iter(*pickle);
|
||||
std::string buffer;
|
||||
int count;
|
||||
|
||||
|
@ -144,7 +144,7 @@ TEST_F(NaClValidationCacheTest, SerializeDeserialize) {
|
||||
cache1.SetKnownToValidate(sig1);
|
||||
cache1.SetKnownToValidate(sig2);
|
||||
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
cache1.Serialize(&pickle);
|
||||
ASSERT_TRUE(cache2.Deserialize(&pickle));
|
||||
ASSERT_EQ(2, (int) cache2.size());
|
||||
@ -157,9 +157,10 @@ TEST_F(NaClValidationCacheTest, SerializeDeserializeTruncated) {
|
||||
cache1.SetKnownToValidate(sig1);
|
||||
cache1.SetKnownToValidate(sig2);
|
||||
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
cache1.Serialize(&pickle);
|
||||
Pickle truncated(static_cast<const char*>(pickle.data()), pickle.size()-20);
|
||||
base::Pickle truncated(static_cast<const char*>(pickle.data()),
|
||||
pickle.size() - 20);
|
||||
ASSERT_FALSE(cache2.Deserialize(&truncated));
|
||||
ASSERT_EQ(0, (int) cache2.size());
|
||||
}
|
||||
@ -170,7 +171,7 @@ TEST_F(NaClValidationCacheTest, DeserializeBadKey) {
|
||||
cache1.SetKnownToValidate(sig1);
|
||||
cache1.SetKnownToValidate(sig2);
|
||||
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
cache1.Serialize(&pickle);
|
||||
ASSERT_FALSE(cache2.Deserialize(&pickle));
|
||||
ASSERT_EQ(0, (int) cache2.size());
|
||||
@ -178,14 +179,14 @@ TEST_F(NaClValidationCacheTest, DeserializeBadKey) {
|
||||
|
||||
TEST_F(NaClValidationCacheTest, DeserializeNothing) {
|
||||
cache1.SetKnownToValidate(sig1);
|
||||
Pickle pickle("", 0);
|
||||
base::Pickle pickle("", 0);
|
||||
ASSERT_FALSE(cache1.Deserialize(&pickle));
|
||||
ASSERT_EQ(0, (int) cache1.size());
|
||||
}
|
||||
|
||||
TEST_F(NaClValidationCacheTest, DeserializeJunk) {
|
||||
cache1.SetKnownToValidate(sig1);
|
||||
Pickle pickle(key1, strlen(key1));
|
||||
base::Pickle pickle(key1, strlen(key1));
|
||||
ASSERT_FALSE(cache1.Deserialize(&pickle));
|
||||
ASSERT_EQ(0, (int) cache1.size());
|
||||
}
|
||||
|
@ -169,8 +169,8 @@ void ChildNaClLoaderInit(ScopedVector<base::ScopedFD> child_fds,
|
||||
bool HandleForkRequest(ScopedVector<base::ScopedFD> child_fds,
|
||||
const NaClLoaderSystemInfo& system_info,
|
||||
nacl::NaClSandbox* nacl_sandbox,
|
||||
PickleIterator* input_iter,
|
||||
Pickle* output_pickle) {
|
||||
base::PickleIterator* input_iter,
|
||||
base::Pickle* output_pickle) {
|
||||
bool uses_nonsfi_mode;
|
||||
if (!input_iter->ReadBool(&uses_nonsfi_mode)) {
|
||||
LOG(ERROR) << "Could not read uses_nonsfi_mode status";
|
||||
@ -215,8 +215,8 @@ bool HandleForkRequest(ScopedVector<base::ScopedFD> child_fds,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool HandleGetTerminationStatusRequest(PickleIterator* input_iter,
|
||||
Pickle* output_pickle) {
|
||||
bool HandleGetTerminationStatusRequest(base::PickleIterator* input_iter,
|
||||
base::Pickle* output_pickle) {
|
||||
pid_t child_to_wait;
|
||||
if (!input_iter->ReadInt(&child_to_wait)) {
|
||||
LOG(ERROR) << "Could not read pid to wait for";
|
||||
@ -253,8 +253,8 @@ bool HonorRequestAndReply(int reply_fd,
|
||||
ScopedVector<base::ScopedFD> attached_fds,
|
||||
const NaClLoaderSystemInfo& system_info,
|
||||
nacl::NaClSandbox* nacl_sandbox,
|
||||
PickleIterator* input_iter) {
|
||||
Pickle write_pickle;
|
||||
base::PickleIterator* input_iter) {
|
||||
base::Pickle write_pickle;
|
||||
bool have_to_reply = false;
|
||||
// Commands must write anything to send back to |write_pickle|.
|
||||
switch (command_type) {
|
||||
@ -309,8 +309,8 @@ bool HandleZygoteRequest(int zygote_ipc_fd,
|
||||
return false;
|
||||
}
|
||||
|
||||
Pickle read_pickle(buf, msglen);
|
||||
PickleIterator read_iter(read_pickle);
|
||||
base::Pickle read_pickle(buf, msglen);
|
||||
base::PickleIterator read_iter(read_pickle);
|
||||
int command_type;
|
||||
if (!read_iter.ReadInt(&command_type)) {
|
||||
LOG(ERROR) << "Unable to read command from Zygote";
|
||||
|
@ -485,7 +485,7 @@ bool NaClIPCAdapter::OnMessageReceived(const IPC::Message& msg) {
|
||||
// Handle PpapiHostMsg_OpenResource outside the lock as it requires sending
|
||||
// IPC to handle properly.
|
||||
if (type == PpapiHostMsg_OpenResource::ID) {
|
||||
PickleIterator iter = IPC::SyncMessage::GetDataIterator(&msg);
|
||||
base::PickleIterator iter = IPC::SyncMessage::GetDataIterator(&msg);
|
||||
ppapi::proxy::SerializedHandle sh;
|
||||
uint64_t token_lo;
|
||||
uint64_t token_hi;
|
||||
@ -639,7 +639,7 @@ void NaClIPCAdapter::SaveOpenResourceMessage(
|
||||
// The file token didn't resolve successfully, so we give the
|
||||
// original FD to the client without making a validated NaClDesc.
|
||||
// However, we must rewrite the message to clear the file tokens.
|
||||
PickleIterator iter = IPC::SyncMessage::GetDataIterator(&orig_msg);
|
||||
base::PickleIterator iter = IPC::SyncMessage::GetDataIterator(&orig_msg);
|
||||
ppapi::proxy::SerializedHandle sh;
|
||||
|
||||
// We know that this can be read safely; see the original read in
|
||||
|
@ -98,7 +98,7 @@ bool NonZeroSegmentBaseIsSlow() {
|
||||
// requests.
|
||||
bool SendIPCRequestAndReadReply(int ipc_channel,
|
||||
const std::vector<int>& attached_fds,
|
||||
const Pickle& request_pickle,
|
||||
const base::Pickle& request_pickle,
|
||||
char* reply_data_buffer,
|
||||
size_t reply_data_buffer_size,
|
||||
ssize_t* reply_size) {
|
||||
@ -367,7 +367,7 @@ pid_t NaClForkDelegate::Fork(const std::string& process_type,
|
||||
}
|
||||
|
||||
// First, send a remote fork request.
|
||||
Pickle write_pickle;
|
||||
base::Pickle write_pickle;
|
||||
write_pickle.WriteInt(nacl::kNaClForkRequest);
|
||||
// TODO(hamaji): When we split the helper binary for non-SFI mode
|
||||
// from nacl_helper, stop sending this information.
|
||||
@ -385,8 +385,8 @@ pid_t NaClForkDelegate::Fork(const std::string& process_type,
|
||||
}
|
||||
|
||||
// Now see if the other end managed to fork.
|
||||
Pickle reply_pickle(reply_buf, reply_size);
|
||||
PickleIterator iter(reply_pickle);
|
||||
base::Pickle reply_pickle(reply_buf, reply_size);
|
||||
base::PickleIterator iter(reply_pickle);
|
||||
pid_t nacl_child;
|
||||
if (!iter.ReadInt(&nacl_child)) {
|
||||
LOG(ERROR) << "NaClForkDelegate::Fork: pickle failed";
|
||||
@ -403,7 +403,7 @@ bool NaClForkDelegate::GetTerminationStatus(pid_t pid, bool known_dead,
|
||||
DCHECK(status);
|
||||
DCHECK(exit_code);
|
||||
|
||||
Pickle write_pickle;
|
||||
base::Pickle write_pickle;
|
||||
write_pickle.WriteInt(nacl::kNaClGetTerminationStatusRequest);
|
||||
write_pickle.WriteInt(pid);
|
||||
write_pickle.WriteBool(known_dead);
|
||||
@ -419,8 +419,8 @@ bool NaClForkDelegate::GetTerminationStatus(pid_t pid, bool known_dead,
|
||||
return false;
|
||||
}
|
||||
|
||||
Pickle reply_pickle(reply_buf, reply_size);
|
||||
PickleIterator iter(reply_pickle);
|
||||
base::Pickle reply_pickle(reply_buf, reply_size);
|
||||
base::PickleIterator iter(reply_pickle);
|
||||
int termination_status;
|
||||
if (!iter.ReadInt(&termination_status) ||
|
||||
termination_status < 0 ||
|
||||
|
@ -16,7 +16,7 @@ void ParamTraits<network_hints::LookupRequest>::Write(
|
||||
|
||||
bool ParamTraits<network_hints::LookupRequest>::Read(
|
||||
const Message* m,
|
||||
PickleIterator* iter,
|
||||
base::PickleIterator* iter,
|
||||
network_hints::LookupRequest* request) {
|
||||
// Verify the hostname limits after deserialization success.
|
||||
if (IPC::ReadParam(m, iter, &request->hostname_list)) {
|
||||
|
@ -32,19 +32,19 @@ namespace password_manager {
|
||||
const int kCurrentVersionNumber = 13;
|
||||
static const int kCompatibleVersionNumber = 1;
|
||||
|
||||
Pickle SerializeVector(const std::vector<base::string16>& vec) {
|
||||
Pickle p;
|
||||
base::Pickle SerializeVector(const std::vector<base::string16>& vec) {
|
||||
base::Pickle p;
|
||||
for (size_t i = 0; i < vec.size(); ++i) {
|
||||
p.WriteString16(vec[i]);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
std::vector<base::string16> DeserializeVector(const Pickle& p) {
|
||||
std::vector<base::string16> DeserializeVector(const base::Pickle& p) {
|
||||
std::vector<base::string16> ret;
|
||||
base::string16 str;
|
||||
|
||||
PickleIterator iterator(p);
|
||||
base::PickleIterator iterator(p);
|
||||
while (iterator.ReadString16(&str)) {
|
||||
ret.push_back(str);
|
||||
}
|
||||
@ -98,12 +98,13 @@ void BindAddStatement(const PasswordForm& form,
|
||||
s->BindInt(COLUMN_BLACKLISTED_BY_USER, form.blacklisted_by_user);
|
||||
s->BindInt(COLUMN_SCHEME, form.scheme);
|
||||
s->BindInt(COLUMN_PASSWORD_TYPE, form.type);
|
||||
Pickle usernames_pickle = SerializeVector(form.other_possible_usernames);
|
||||
base::Pickle usernames_pickle =
|
||||
SerializeVector(form.other_possible_usernames);
|
||||
s->BindBlob(COLUMN_POSSIBLE_USERNAMES,
|
||||
usernames_pickle.data(),
|
||||
usernames_pickle.size());
|
||||
s->BindInt(COLUMN_TIMES_USED, form.times_used);
|
||||
Pickle form_data_pickle;
|
||||
base::Pickle form_data_pickle;
|
||||
autofill::SerializeFormData(form.form_data, &form_data_pickle);
|
||||
s->BindBlob(COLUMN_FORM_DATA,
|
||||
form_data_pickle.data(),
|
||||
@ -612,7 +613,7 @@ PasswordStoreChangeList LoginDatabase::UpdateLogin(const PasswordForm& form) {
|
||||
static_cast<int>(encrypted_password.length()));
|
||||
s.BindInt(2, form.ssl_valid);
|
||||
s.BindInt(3, form.preferred);
|
||||
Pickle pickle = SerializeVector(form.other_possible_usernames);
|
||||
base::Pickle pickle = SerializeVector(form.other_possible_usernames);
|
||||
s.BindBlob(4, pickle.data(), pickle.size());
|
||||
s.BindInt(5, form.times_used);
|
||||
s.BindString16(6, form.submit_element);
|
||||
@ -729,17 +730,17 @@ LoginDatabase::EncryptionResult LoginDatabase::InitPasswordFormFromStatement(
|
||||
DCHECK(type_int >= 0 && type_int <= PasswordForm::TYPE_GENERATED);
|
||||
form->type = static_cast<PasswordForm::Type>(type_int);
|
||||
if (s.ColumnByteLength(COLUMN_POSSIBLE_USERNAMES)) {
|
||||
Pickle pickle(
|
||||
base::Pickle pickle(
|
||||
static_cast<const char*>(s.ColumnBlob(COLUMN_POSSIBLE_USERNAMES)),
|
||||
s.ColumnByteLength(COLUMN_POSSIBLE_USERNAMES));
|
||||
form->other_possible_usernames = DeserializeVector(pickle);
|
||||
}
|
||||
form->times_used = s.ColumnInt(COLUMN_TIMES_USED);
|
||||
if (s.ColumnByteLength(COLUMN_FORM_DATA)) {
|
||||
Pickle form_data_pickle(
|
||||
base::Pickle form_data_pickle(
|
||||
static_cast<const char*>(s.ColumnBlob(COLUMN_FORM_DATA)),
|
||||
s.ColumnByteLength(COLUMN_FORM_DATA));
|
||||
PickleIterator form_data_iter(form_data_pickle);
|
||||
base::PickleIterator form_data_iter(form_data_pickle);
|
||||
bool success =
|
||||
autofill::DeserializeFormData(&form_data_iter, &form->form_data);
|
||||
metrics_util::FormDeserializationStatus status =
|
||||
|
@ -72,8 +72,8 @@ void GenerateExamplePasswordForm(PasswordForm* form) {
|
||||
} // namespace
|
||||
|
||||
// Serialization routines for vectors implemented in login_database.cc.
|
||||
Pickle SerializeVector(const std::vector<base::string16>& vec);
|
||||
std::vector<base::string16> DeserializeVector(const Pickle& pickle);
|
||||
base::Pickle SerializeVector(const std::vector<base::string16>& vec);
|
||||
std::vector<base::string16> DeserializeVector(const base::Pickle& pickle);
|
||||
|
||||
class LoginDatabaseTest : public testing::Test {
|
||||
protected:
|
||||
@ -765,7 +765,7 @@ TEST_F(LoginDatabaseTest, BlacklistedLogins) {
|
||||
TEST_F(LoginDatabaseTest, VectorSerialization) {
|
||||
// Empty vector.
|
||||
std::vector<base::string16> vec;
|
||||
Pickle temp = SerializeVector(vec);
|
||||
base::Pickle temp = SerializeVector(vec);
|
||||
std::vector<base::string16> output = DeserializeVector(temp);
|
||||
EXPECT_THAT(output, Eq(vec));
|
||||
|
||||
|
@ -14,7 +14,9 @@ namespace {
|
||||
// Helper used by CreateUpdateTabNavigationCommand(). It writes |str| to
|
||||
// |pickle|, if and only if |str| fits within (|max_bytes| - |*bytes_written|).
|
||||
// |bytes_written| is incremented to reflect the data written.
|
||||
void WriteStringToPickle(Pickle& pickle, int* bytes_written, int max_bytes,
|
||||
void WriteStringToPickle(base::Pickle& pickle,
|
||||
int* bytes_written,
|
||||
int max_bytes,
|
||||
const std::string& str) {
|
||||
int num_bytes = str.size() * sizeof(char);
|
||||
if (*bytes_written + num_bytes < max_bytes) {
|
||||
@ -32,7 +34,7 @@ scoped_ptr<SessionCommand> CreateUpdateTabNavigationCommand(
|
||||
SessionID::id_type tab_id,
|
||||
const sessions::SerializedNavigationEntry& navigation) {
|
||||
// Use pickle to handle marshalling.
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
pickle.WriteInt(tab_id);
|
||||
// We only allow navigations up to 63k (which should be completely
|
||||
// reasonable).
|
||||
@ -47,7 +49,7 @@ scoped_ptr<SessionCommand> CreateSetTabExtensionAppIDCommand(
|
||||
SessionID::id_type tab_id,
|
||||
const std::string& extension_id) {
|
||||
// Use pickle to handle marshalling.
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
pickle.WriteInt(tab_id);
|
||||
|
||||
// Enforce a max for ids. They should never be anywhere near this size.
|
||||
@ -66,7 +68,7 @@ scoped_ptr<SessionCommand> CreateSetTabUserAgentOverrideCommand(
|
||||
SessionID::id_type tab_id,
|
||||
const std::string& user_agent_override) {
|
||||
// Use pickle to handle marshalling.
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
pickle.WriteInt(tab_id);
|
||||
|
||||
// Enforce a max for the user agent length. They should never be anywhere
|
||||
@ -87,7 +89,7 @@ scoped_ptr<SessionCommand> CreateSetWindowAppNameCommand(
|
||||
SessionID::id_type window_id,
|
||||
const std::string& app_name) {
|
||||
// Use pickle to handle marshalling.
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
pickle.WriteInt(window_id);
|
||||
|
||||
// Enforce a max for ids. They should never be anywhere near this size.
|
||||
@ -105,43 +107,43 @@ bool RestoreUpdateTabNavigationCommand(
|
||||
const SessionCommand& command,
|
||||
sessions::SerializedNavigationEntry* navigation,
|
||||
SessionID::id_type* tab_id) {
|
||||
scoped_ptr<Pickle> pickle(command.PayloadAsPickle());
|
||||
scoped_ptr<base::Pickle> pickle(command.PayloadAsPickle());
|
||||
if (!pickle.get())
|
||||
return false;
|
||||
PickleIterator iterator(*pickle);
|
||||
base::PickleIterator iterator(*pickle);
|
||||
return iterator.ReadInt(tab_id) && navigation->ReadFromPickle(&iterator);
|
||||
}
|
||||
|
||||
bool RestoreSetTabExtensionAppIDCommand(const SessionCommand& command,
|
||||
SessionID::id_type* tab_id,
|
||||
std::string* extension_app_id) {
|
||||
scoped_ptr<Pickle> pickle(command.PayloadAsPickle());
|
||||
scoped_ptr<base::Pickle> pickle(command.PayloadAsPickle());
|
||||
if (!pickle.get())
|
||||
return false;
|
||||
|
||||
PickleIterator iterator(*pickle);
|
||||
base::PickleIterator iterator(*pickle);
|
||||
return iterator.ReadInt(tab_id) && iterator.ReadString(extension_app_id);
|
||||
}
|
||||
|
||||
bool RestoreSetTabUserAgentOverrideCommand(const SessionCommand& command,
|
||||
SessionID::id_type* tab_id,
|
||||
std::string* user_agent_override) {
|
||||
scoped_ptr<Pickle> pickle(command.PayloadAsPickle());
|
||||
scoped_ptr<base::Pickle> pickle(command.PayloadAsPickle());
|
||||
if (!pickle.get())
|
||||
return false;
|
||||
|
||||
PickleIterator iterator(*pickle);
|
||||
base::PickleIterator iterator(*pickle);
|
||||
return iterator.ReadInt(tab_id) && iterator.ReadString(user_agent_override);
|
||||
}
|
||||
|
||||
bool RestoreSetWindowAppNameCommand(const SessionCommand& command,
|
||||
SessionID::id_type* window_id,
|
||||
std::string* app_name) {
|
||||
scoped_ptr<Pickle> pickle(command.PayloadAsPickle());
|
||||
scoped_ptr<base::Pickle> pickle(command.PayloadAsPickle());
|
||||
if (!pickle.get())
|
||||
return false;
|
||||
|
||||
PickleIterator iterator(*pickle);
|
||||
base::PickleIterator iterator(*pickle);
|
||||
return iterator.ReadInt(window_id) && iterator.ReadString(app_name);
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ namespace {
|
||||
//
|
||||
// TODO(akalin): Unify this with the same function in
|
||||
// base_session_service.cc.
|
||||
void WriteStringToPickle(Pickle* pickle,
|
||||
void WriteStringToPickle(base::Pickle* pickle,
|
||||
int* bytes_written,
|
||||
int max_bytes,
|
||||
const std::string& str) {
|
||||
@ -160,7 +160,7 @@ void WriteStringToPickle(Pickle* pickle,
|
||||
// base::string16 version of WriteStringToPickle.
|
||||
//
|
||||
// TODO(akalin): Unify this, too.
|
||||
void WriteString16ToPickle(Pickle* pickle,
|
||||
void WriteString16ToPickle(base::Pickle* pickle,
|
||||
int* bytes_written,
|
||||
int max_bytes,
|
||||
const base::string16& str) {
|
||||
@ -206,7 +206,7 @@ enum TypeMask {
|
||||
// referrer_policy_
|
||||
|
||||
void SerializedNavigationEntry::WriteToPickle(int max_size,
|
||||
Pickle* pickle) const {
|
||||
base::Pickle* pickle) const {
|
||||
pickle->WriteInt(index_);
|
||||
|
||||
int bytes_written = 0;
|
||||
@ -250,7 +250,7 @@ void SerializedNavigationEntry::WriteToPickle(int max_size,
|
||||
pickle->WriteInt(referrer_policy_);
|
||||
}
|
||||
|
||||
bool SerializedNavigationEntry::ReadFromPickle(PickleIterator* iterator) {
|
||||
bool SerializedNavigationEntry::ReadFromPickle(base::PickleIterator* iterator) {
|
||||
*this = SerializedNavigationEntry();
|
||||
std::string virtual_url_spec;
|
||||
int transition_type_int = 0;
|
||||
|
@ -107,11 +107,11 @@ TEST(SerializedNavigationEntryTest, Pickle) {
|
||||
const SerializedNavigationEntry old_navigation =
|
||||
SerializedNavigationEntryTestHelper::CreateNavigationForTest();
|
||||
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
old_navigation.WriteToPickle(30000, &pickle);
|
||||
|
||||
SerializedNavigationEntry new_navigation;
|
||||
PickleIterator pickle_iterator(pickle);
|
||||
base::PickleIterator pickle_iterator(pickle);
|
||||
EXPECT_TRUE(new_navigation.ReadFromPickle(&pickle_iterator));
|
||||
|
||||
// Fields that are written to the pickle.
|
||||
|
@ -14,7 +14,7 @@ SessionCommand::SessionCommand(id_type id, size_type size)
|
||||
contents_(size, 0) {
|
||||
}
|
||||
|
||||
SessionCommand::SessionCommand(id_type id, const Pickle& pickle)
|
||||
SessionCommand::SessionCommand(id_type id, const base::Pickle& pickle)
|
||||
: id_(id),
|
||||
contents_(pickle.size(), 0) {
|
||||
DCHECK(pickle.size() < std::numeric_limits<size_type>::max());
|
||||
@ -28,8 +28,8 @@ bool SessionCommand::GetPayload(void* dest, size_t count) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
Pickle* SessionCommand::PayloadAsPickle() const {
|
||||
return new Pickle(contents(), static_cast<int>(size()));
|
||||
base::Pickle* SessionCommand::PayloadAsPickle() const {
|
||||
return new base::Pickle(contents(), static_cast<int>(size()));
|
||||
}
|
||||
|
||||
} // namespace sessions
|
||||
|
@ -541,10 +541,10 @@ bool CreateTabsAndWindows(const ScopedVector<SessionCommand>& data,
|
||||
}
|
||||
|
||||
case kCommandSessionStorageAssociated: {
|
||||
scoped_ptr<Pickle> command_pickle(command->PayloadAsPickle());
|
||||
scoped_ptr<base::Pickle> command_pickle(command->PayloadAsPickle());
|
||||
SessionID::id_type command_tab_id;
|
||||
std::string session_storage_persistent_id;
|
||||
PickleIterator iter(*command_pickle.get());
|
||||
base::PickleIterator iter(*command_pickle.get());
|
||||
if (!iter.ReadInt(&command_tab_id) ||
|
||||
!iter.ReadString(&session_storage_persistent_id))
|
||||
return true;
|
||||
@ -705,7 +705,7 @@ scoped_ptr<SessionCommand> CreatePinnedStateCommand(
|
||||
scoped_ptr<SessionCommand> CreateSessionStorageAssociatedCommand(
|
||||
const SessionID& tab_id,
|
||||
const std::string& session_storage_persistent_id) {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
pickle.WriteInt(tab_id.id());
|
||||
pickle.WriteString(session_storage_persistent_id);
|
||||
return scoped_ptr<SessionCommand>(
|
||||
@ -806,8 +806,8 @@ bool ReplacePendingCommand(BaseSessionService* base_session_service,
|
||||
SessionCommand* existing_command = *i;
|
||||
if ((*command)->id() == kCommandUpdateTabNavigation &&
|
||||
existing_command->id() == kCommandUpdateTabNavigation) {
|
||||
scoped_ptr<Pickle> command_pickle((*command)->PayloadAsPickle());
|
||||
PickleIterator iterator(*command_pickle);
|
||||
scoped_ptr<base::Pickle> command_pickle((*command)->PayloadAsPickle());
|
||||
base::PickleIterator iterator(*command_pickle);
|
||||
SessionID::id_type command_tab_id;
|
||||
int command_nav_index;
|
||||
if (!iterator.ReadInt(&command_tab_id) ||
|
||||
@ -820,8 +820,9 @@ bool ReplacePendingCommand(BaseSessionService* base_session_service,
|
||||
// Creating a pickle like this means the Pickle references the data from
|
||||
// the command. Make sure we delete the pickle before the command, else
|
||||
// the pickle references deleted memory.
|
||||
scoped_ptr<Pickle> existing_pickle(existing_command->PayloadAsPickle());
|
||||
iterator = PickleIterator(*existing_pickle);
|
||||
scoped_ptr<base::Pickle> existing_pickle(
|
||||
existing_command->PayloadAsPickle());
|
||||
iterator = base::PickleIterator(*existing_pickle);
|
||||
if (!iterator.ReadInt(&existing_tab_id) ||
|
||||
!iterator.ReadInt(&existing_nav_index)) {
|
||||
return false;
|
||||
|
@ -551,7 +551,7 @@ class VisitRelayingRenderProcessHost : public MockRenderProcessHost {
|
||||
GetBrowserContext());
|
||||
|
||||
if (msg->type() == ChromeViewMsg_VisitedLink_Add::ID) {
|
||||
PickleIterator iter(*msg);
|
||||
base::PickleIterator iter(*msg);
|
||||
std::vector<uint64> fingerprints;
|
||||
CHECK(IPC::ReadParam(msg, &iter, &fingerprints));
|
||||
counting_context->CountAddEvent(fingerprints.size());
|
||||
|
@ -325,7 +325,7 @@ base::TaskRunner* GinJavaBridgeDispatcherHost::OverrideTaskRunnerForMessage(
|
||||
case GinJavaBridgeHostMsg_HasMethod::ID:
|
||||
case GinJavaBridgeHostMsg_InvokeMethod::ID: {
|
||||
DCHECK(message.is_sync());
|
||||
PickleIterator message_reader =
|
||||
base::PickleIterator message_reader =
|
||||
IPC::SyncMessage::GetDataIterator(&message);
|
||||
if (!IPC::ReadParam(&message, &message_reader, &object_id))
|
||||
return NULL;
|
||||
@ -333,7 +333,7 @@ base::TaskRunner* GinJavaBridgeDispatcherHost::OverrideTaskRunnerForMessage(
|
||||
}
|
||||
case GinJavaBridgeHostMsg_ObjectWrapperDeleted::ID: {
|
||||
DCHECK(!message.is_sync());
|
||||
PickleIterator message_reader(message);
|
||||
base::PickleIterator message_reader(message);
|
||||
if (!IPC::ReadParam(&message, &message_reader, &object_id))
|
||||
return NULL;
|
||||
break;
|
||||
|
@ -29,16 +29,16 @@ enum { kResponseInfoIndex, kResponseContentIndex, kResponseMetadataIndex };
|
||||
// pickle is transfered to the WrappedPickleIOBuffer object.
|
||||
class WrappedPickleIOBuffer : public net::WrappedIOBuffer {
|
||||
public:
|
||||
explicit WrappedPickleIOBuffer(const Pickle* pickle) :
|
||||
net::WrappedIOBuffer(reinterpret_cast<const char*>(pickle->data())),
|
||||
pickle_(pickle) {
|
||||
explicit WrappedPickleIOBuffer(const base::Pickle* pickle)
|
||||
: net::WrappedIOBuffer(reinterpret_cast<const char*>(pickle->data())),
|
||||
pickle_(pickle) {
|
||||
DCHECK(pickle->data());
|
||||
}
|
||||
|
||||
private:
|
||||
~WrappedPickleIOBuffer() override {}
|
||||
|
||||
scoped_ptr<const Pickle> pickle_;
|
||||
scoped_ptr<const base::Pickle> pickle_;
|
||||
};
|
||||
|
||||
} // anon namespace
|
||||
@ -254,7 +254,7 @@ void AppCacheResponseReader::OnIOComplete(int result) {
|
||||
reading_metadata_size_ = 0;
|
||||
} else if (info_buffer_.get()) {
|
||||
// Deserialize the http info structure, ensuring we got headers.
|
||||
Pickle pickle(buffer_->data(), result);
|
||||
base::Pickle pickle(buffer_->data(), result);
|
||||
scoped_ptr<net::HttpResponseInfo> info(new net::HttpResponseInfo);
|
||||
bool response_truncated = false;
|
||||
if (!info->InitFromPickle(pickle, &response_truncated) ||
|
||||
@ -336,7 +336,7 @@ void AppCacheResponseWriter::ContinueWriteInfo() {
|
||||
|
||||
const bool kSkipTransientHeaders = true;
|
||||
const bool kTruncated = false;
|
||||
Pickle* pickle = new Pickle;
|
||||
base::Pickle* pickle = new base::Pickle;
|
||||
info_buffer_->http_info->Persist(pickle, kSkipTransientHeaders, kTruncated);
|
||||
write_amount_ = static_cast<int>(pickle->size());
|
||||
buffer_ = new WrappedPickleIOBuffer(pickle); // takes ownership of pickle
|
||||
|
@ -265,21 +265,22 @@ class AppCacheResponseTest : public testing::Test {
|
||||
}
|
||||
|
||||
int GetHttpResponseInfoSize(const net::HttpResponseInfo* info) {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
return PickleHttpResonseInfo(&pickle, info);
|
||||
}
|
||||
|
||||
bool CompareHttpResponseInfos(const net::HttpResponseInfo* info1,
|
||||
const net::HttpResponseInfo* info2) {
|
||||
Pickle pickle1;
|
||||
Pickle pickle2;
|
||||
base::Pickle pickle1;
|
||||
base::Pickle pickle2;
|
||||
PickleHttpResonseInfo(&pickle1, info1);
|
||||
PickleHttpResonseInfo(&pickle2, info2);
|
||||
return (pickle1.size() == pickle2.size()) &&
|
||||
(0 == memcmp(pickle1.data(), pickle2.data(), pickle1.size()));
|
||||
}
|
||||
|
||||
int PickleHttpResonseInfo(Pickle* pickle, const net::HttpResponseInfo* info) {
|
||||
int PickleHttpResonseInfo(base::Pickle* pickle,
|
||||
const net::HttpResponseInfo* info) {
|
||||
const bool kSkipTransientHeaders = true;
|
||||
const bool kTruncated = false;
|
||||
info->Persist(pickle, kSkipTransientHeaders, kTruncated);
|
||||
|
@ -157,11 +157,12 @@ class AppCacheServiceImplTest : public testing::Test {
|
||||
}
|
||||
|
||||
int GetResponseInfoSize(const net::HttpResponseInfo* info) {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
return PickleResponseInfo(&pickle, info);
|
||||
}
|
||||
|
||||
int PickleResponseInfo(Pickle* pickle, const net::HttpResponseInfo* info) {
|
||||
int PickleResponseInfo(base::Pickle* pickle,
|
||||
const net::HttpResponseInfo* info) {
|
||||
const bool kSkipTransientHeaders = true;
|
||||
const bool kTruncated = false;
|
||||
info->Persist(pickle, kSkipTransientHeaders, kTruncated);
|
||||
|
@ -387,21 +387,22 @@ class AppCacheURLRequestJobTest : public testing::Test {
|
||||
}
|
||||
|
||||
int GetHttpResponseInfoSize(const net::HttpResponseInfo* info) {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
return PickleHttpResonseInfo(&pickle, info);
|
||||
}
|
||||
|
||||
bool CompareHttpResponseInfos(const net::HttpResponseInfo* info1,
|
||||
const net::HttpResponseInfo* info2) {
|
||||
Pickle pickle1;
|
||||
Pickle pickle2;
|
||||
base::Pickle pickle1;
|
||||
base::Pickle pickle2;
|
||||
PickleHttpResonseInfo(&pickle1, info1);
|
||||
PickleHttpResonseInfo(&pickle2, info2);
|
||||
return (pickle1.size() == pickle2.size()) &&
|
||||
(0 == memcmp(pickle1.data(), pickle2.data(), pickle1.size()));
|
||||
}
|
||||
|
||||
int PickleHttpResonseInfo(Pickle* pickle, const net::HttpResponseInfo* info) {
|
||||
int PickleHttpResonseInfo(base::Pickle* pickle,
|
||||
const net::HttpResponseInfo* info) {
|
||||
const bool kSkipTransientHeaders = true;
|
||||
const bool kTruncated = false;
|
||||
info->Persist(pickle, kSkipTransientHeaders, kTruncated);
|
||||
|
@ -60,7 +60,7 @@ void BrowserPluginMessageFilter::ForwardMessageToGuest(
|
||||
|
||||
int browser_plugin_instance_id = browser_plugin::kInstanceIDNone;
|
||||
// All allowed messages must have instance_id as their first parameter.
|
||||
PickleIterator iter(message);
|
||||
base::PickleIterator iter(message);
|
||||
bool success = iter.ReadInt(&browser_plugin_instance_id);
|
||||
DCHECK(success);
|
||||
|
||||
|
@ -47,8 +47,9 @@ BaseFile::BaseFile(const base::FilePath& full_path,
|
||||
secure_hash_.reset(crypto::SecureHash::Create(crypto::SecureHash::SHA256));
|
||||
if ((bytes_so_far_ > 0) && // Not starting at the beginning.
|
||||
(!IsEmptyHash(hash_state_bytes))) {
|
||||
Pickle hash_state(hash_state_bytes.c_str(), hash_state_bytes.size());
|
||||
PickleIterator data_iterator(hash_state);
|
||||
base::Pickle hash_state(hash_state_bytes.c_str(),
|
||||
hash_state_bytes.size());
|
||||
base::PickleIterator data_iterator(hash_state);
|
||||
secure_hash_->Deserialize(&data_iterator);
|
||||
}
|
||||
}
|
||||
@ -225,7 +226,7 @@ std::string BaseFile::GetHashState() {
|
||||
if (!calculate_hash_)
|
||||
return std::string();
|
||||
|
||||
Pickle hash_state;
|
||||
base::Pickle hash_state;
|
||||
if (!secure_hash_->Serialize(&hash_state))
|
||||
return std::string();
|
||||
|
||||
|
@ -797,7 +797,7 @@ void RenderFrameHostImpl::OnDidFailLoadWithError(
|
||||
void RenderFrameHostImpl::OnDidCommitProvisionalLoad(const IPC::Message& msg) {
|
||||
// Read the parameters out of the IPC message directly to avoid making another
|
||||
// copy when we filter the URLs.
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
FrameHostMsg_DidCommitProvisionalLoad_Params validated_params;
|
||||
if (!IPC::ParamTraits<FrameHostMsg_DidCommitProvisionalLoad_Params>::
|
||||
Read(&msg, &iter, &validated_params))
|
||||
|
@ -982,7 +982,7 @@ bool ResourceDispatcherHostImpl::OnMessageReceived(
|
||||
IPC_END_MESSAGE_MAP()
|
||||
|
||||
if (!handled && IPC_MESSAGE_ID_CLASS(message.type()) == ResourceMsgStart) {
|
||||
PickleIterator iter(message);
|
||||
base::PickleIterator iter(message);
|
||||
int request_id = -1;
|
||||
bool ok = iter.ReadInt(&request_id);
|
||||
DCHECK(ok);
|
||||
|
@ -69,7 +69,7 @@ void GetResponseHead(const std::vector<IPC::Message>& messages,
|
||||
// The first messages should be received response.
|
||||
ASSERT_EQ(ResourceMsg_ReceivedResponse::ID, messages[0].type());
|
||||
|
||||
PickleIterator iter(messages[0]);
|
||||
base::PickleIterator iter(messages[0]);
|
||||
int request_id;
|
||||
ASSERT_TRUE(IPC::ReadParam(&messages[0], &iter, &request_id));
|
||||
ASSERT_TRUE(IPC::ReadParam(&messages[0], &iter, response_head));
|
||||
@ -92,7 +92,7 @@ void GenerateIPCMessage(
|
||||
// ref-counted core that closes them if not extracted.
|
||||
void ReleaseHandlesInMessage(const IPC::Message& message) {
|
||||
if (message.type() == ResourceMsg_SetDataBuffer::ID) {
|
||||
PickleIterator iter(message);
|
||||
base::PickleIterator iter(message);
|
||||
int request_id;
|
||||
CHECK(iter.ReadInt(&request_id));
|
||||
base::SharedMemoryHandle shm_handle;
|
||||
@ -117,7 +117,7 @@ static int RequestIDForMessage(const IPC::Message& msg) {
|
||||
case ResourceMsg_DataReceived::ID:
|
||||
case ResourceMsg_DataDownloaded::ID:
|
||||
case ResourceMsg_RequestComplete::ID: {
|
||||
bool result = PickleIterator(msg).ReadInt(&request_id);
|
||||
bool result = base::PickleIterator(msg).ReadInt(&request_id);
|
||||
DCHECK(result);
|
||||
break;
|
||||
}
|
||||
@ -917,7 +917,7 @@ class ResourceDispatcherHostTest : public testing::Test,
|
||||
EXPECT_EQ(ResourceMsg_DataReceived::ID, msg.type());
|
||||
|
||||
int request_id = -1;
|
||||
bool result = PickleIterator(msg).ReadInt(&request_id);
|
||||
bool result = base::PickleIterator(msg).ReadInt(&request_id);
|
||||
DCHECK(result);
|
||||
scoped_ptr<IPC::Message> ack(
|
||||
new ResourceHostMsg_DataReceived_ACK(request_id));
|
||||
@ -1007,7 +1007,7 @@ void CheckRequestCompleteErrorCode(const IPC::Message& message,
|
||||
|
||||
ASSERT_EQ(ResourceMsg_RequestComplete::ID, message.type());
|
||||
|
||||
PickleIterator iter(message);
|
||||
base::PickleIterator iter(message);
|
||||
ASSERT_TRUE(IPC::ReadParam(&message, &iter, &request_id));
|
||||
ASSERT_TRUE(IPC::ReadParam(&message, &iter, &error_code));
|
||||
ASSERT_EQ(expected_error_code, error_code);
|
||||
@ -1016,7 +1016,7 @@ void CheckRequestCompleteErrorCode(const IPC::Message& message,
|
||||
testing::AssertionResult ExtractDataOffsetAndLength(const IPC::Message& message,
|
||||
int* data_offset,
|
||||
int* data_length) {
|
||||
PickleIterator iter(message);
|
||||
base::PickleIterator iter(message);
|
||||
int request_id;
|
||||
if (!IPC::ReadParam(&message, &iter, &request_id))
|
||||
return testing::AssertionFailure() << "Could not read request_id";
|
||||
@ -1047,7 +1047,7 @@ void CheckSuccessfulRequestWithErrorCode(
|
||||
|
||||
ASSERT_EQ(ResourceMsg_SetDataBuffer::ID, messages[1].type());
|
||||
|
||||
PickleIterator iter(messages[1]);
|
||||
base::PickleIterator iter(messages[1]);
|
||||
int request_id;
|
||||
ASSERT_TRUE(IPC::ReadParam(&messages[1], &iter, &request_id));
|
||||
base::SharedMemoryHandle shm_handle;
|
||||
@ -3013,7 +3013,7 @@ TEST_F(ResourceDispatcherHostTest, DownloadToFile) {
|
||||
size_t total_len = 0;
|
||||
for (size_t i = 1; i < messages.size() - 1; i++) {
|
||||
ASSERT_EQ(ResourceMsg_DataDownloaded::ID, messages[i].type());
|
||||
PickleIterator iter(messages[i]);
|
||||
base::PickleIterator iter(messages[i]);
|
||||
int request_id, data_len;
|
||||
ASSERT_TRUE(IPC::ReadParam(&messages[i], &iter, &request_id));
|
||||
ASSERT_TRUE(IPC::ReadParam(&messages[i], &iter, &data_len));
|
||||
|
@ -37,7 +37,7 @@ bool ResourceSchedulerFilter::OnMessageReceived(const IPC::Message& message) {
|
||||
|
||||
switch (message.type()) {
|
||||
case FrameHostMsg_DidCommitProvisionalLoad::ID: {
|
||||
PickleIterator iter(message);
|
||||
base::PickleIterator iter(message);
|
||||
FrameHostMsg_DidCommitProvisionalLoad_Params params;
|
||||
if (!IPC::ParamTraits<FrameHostMsg_DidCommitProvisionalLoad_Params>::Read(
|
||||
&message, &iter, ¶ms)) {
|
||||
|
@ -230,7 +230,7 @@ void ClipboardMessageFilter::OnWriteSmartPasteMarker(
|
||||
void ClipboardMessageFilter::OnWriteCustomData(
|
||||
ui::ClipboardType clipboard_type,
|
||||
const std::map<base::string16, base::string16>& data) {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
ui::WriteCustomDataToPickle(data, &pickle);
|
||||
clipboard_writer_->WritePickledData(
|
||||
pickle, ui::Clipboard::GetWebCustomDataFormatType());
|
||||
|
@ -46,7 +46,7 @@ namespace content {
|
||||
namespace {
|
||||
|
||||
const WebInputEvent* GetInputEventFromMessage(const IPC::Message& message) {
|
||||
PickleIterator iter(message);
|
||||
base::PickleIterator iter(message);
|
||||
const char* data;
|
||||
int data_length;
|
||||
if (!iter.ReadData(&data, &data_length))
|
||||
|
@ -571,7 +571,7 @@ class RenderWidgetHostTest : public testing::Test {
|
||||
}
|
||||
|
||||
const WebInputEvent* GetInputEventFromMessage(const IPC::Message& message) {
|
||||
PickleIterator iter(message);
|
||||
base::PickleIterator iter(message);
|
||||
const char* data;
|
||||
int data_length;
|
||||
if (!iter.ReadData(&data, &data_length))
|
||||
|
@ -363,7 +363,7 @@ class MockWindowObserver : public aura::WindowObserver {
|
||||
};
|
||||
|
||||
const WebInputEvent* GetInputEventFromMessage(const IPC::Message& message) {
|
||||
PickleIterator iter(message);
|
||||
base::PickleIterator iter(message);
|
||||
const char* data;
|
||||
int data_length;
|
||||
if (!iter.ReadData(&data, &data_length))
|
||||
|
@ -141,8 +141,8 @@ void SandboxIPCHandler::HandleRequestFromRenderer(int fd) {
|
||||
if (fds.empty())
|
||||
return;
|
||||
|
||||
Pickle pickle(buf, len);
|
||||
PickleIterator iter(pickle);
|
||||
base::Pickle pickle(buf, len);
|
||||
base::PickleIterator iter(pickle);
|
||||
|
||||
int kind;
|
||||
if (!iter.ReadInt(&kind))
|
||||
@ -177,7 +177,7 @@ int SandboxIPCHandler::FindOrAddPath(const SkString& path) {
|
||||
|
||||
void SandboxIPCHandler::HandleFontMatchRequest(
|
||||
int fd,
|
||||
PickleIterator iter,
|
||||
base::PickleIterator iter,
|
||||
const std::vector<base::ScopedFD*>& fds) {
|
||||
uint32_t requested_style;
|
||||
std::string family;
|
||||
@ -196,7 +196,7 @@ void SandboxIPCHandler::HandleFontMatchRequest(
|
||||
&result_family,
|
||||
&result_style);
|
||||
|
||||
Pickle reply;
|
||||
base::Pickle reply;
|
||||
if (!r) {
|
||||
reply.WriteBool(false);
|
||||
} else {
|
||||
@ -215,7 +215,7 @@ void SandboxIPCHandler::HandleFontMatchRequest(
|
||||
|
||||
void SandboxIPCHandler::HandleFontOpenRequest(
|
||||
int fd,
|
||||
PickleIterator iter,
|
||||
base::PickleIterator iter,
|
||||
const std::vector<base::ScopedFD*>& fds) {
|
||||
uint32_t index;
|
||||
if (!iter.ReadUInt32(&index))
|
||||
@ -224,7 +224,7 @@ void SandboxIPCHandler::HandleFontOpenRequest(
|
||||
return;
|
||||
const int result_fd = open(paths_[index]->c_str(), O_RDONLY);
|
||||
|
||||
Pickle reply;
|
||||
base::Pickle reply;
|
||||
if (result_fd == -1) {
|
||||
reply.WriteBool(false);
|
||||
} else {
|
||||
@ -243,7 +243,7 @@ void SandboxIPCHandler::HandleFontOpenRequest(
|
||||
|
||||
void SandboxIPCHandler::HandleGetFallbackFontForChar(
|
||||
int fd,
|
||||
PickleIterator iter,
|
||||
base::PickleIterator iter,
|
||||
const std::vector<base::ScopedFD*>& fds) {
|
||||
// The other side of this call is
|
||||
// content/common/child_process_sandbox_support_impl_linux.cc
|
||||
@ -263,7 +263,7 @@ void SandboxIPCHandler::HandleGetFallbackFontForChar(
|
||||
int pathIndex = FindOrAddPath(SkString(fallbackFont.filename.data()));
|
||||
fallbackFont.fontconfigInterfaceId = pathIndex;
|
||||
|
||||
Pickle reply;
|
||||
base::Pickle reply;
|
||||
if (fallbackFont.name.data()) {
|
||||
reply.WriteString(fallbackFont.name.data());
|
||||
} else {
|
||||
@ -283,7 +283,7 @@ void SandboxIPCHandler::HandleGetFallbackFontForChar(
|
||||
|
||||
void SandboxIPCHandler::HandleGetStyleForStrike(
|
||||
int fd,
|
||||
PickleIterator iter,
|
||||
base::PickleIterator iter,
|
||||
const std::vector<base::ScopedFD*>& fds) {
|
||||
std::string family;
|
||||
bool bold, italic;
|
||||
@ -307,7 +307,7 @@ void SandboxIPCHandler::HandleGetStyleForStrike(
|
||||
|
||||
// These are passed as ints since they're interpreted as tri-state chars in
|
||||
// Blink.
|
||||
Pickle reply;
|
||||
base::Pickle reply;
|
||||
reply.WriteInt(params.use_bitmaps);
|
||||
reply.WriteInt(params.autohinter);
|
||||
reply.WriteInt(params.hinting != gfx::FontRenderParams::HINTING_NONE);
|
||||
@ -321,7 +321,7 @@ void SandboxIPCHandler::HandleGetStyleForStrike(
|
||||
|
||||
void SandboxIPCHandler::HandleLocaltime(
|
||||
int fd,
|
||||
PickleIterator iter,
|
||||
base::PickleIterator iter,
|
||||
const std::vector<base::ScopedFD*>& fds) {
|
||||
// The other side of this call is in zygote_main_linux.cc
|
||||
|
||||
@ -343,7 +343,7 @@ void SandboxIPCHandler::HandleLocaltime(
|
||||
time_zone_string = expanded_time->tm_zone;
|
||||
}
|
||||
|
||||
Pickle reply;
|
||||
base::Pickle reply;
|
||||
reply.WriteString(result_string);
|
||||
reply.WriteString(time_zone_string);
|
||||
SendRendererReply(fds, reply, -1);
|
||||
@ -351,7 +351,7 @@ void SandboxIPCHandler::HandleLocaltime(
|
||||
|
||||
void SandboxIPCHandler::HandleMakeSharedMemorySegment(
|
||||
int fd,
|
||||
PickleIterator iter,
|
||||
base::PickleIterator iter,
|
||||
const std::vector<base::ScopedFD*>& fds) {
|
||||
base::SharedMemoryCreateOptions options;
|
||||
uint32_t size;
|
||||
@ -364,13 +364,13 @@ void SandboxIPCHandler::HandleMakeSharedMemorySegment(
|
||||
base::SharedMemory shm;
|
||||
if (shm.Create(options))
|
||||
shm_fd = shm.handle().fd;
|
||||
Pickle reply;
|
||||
base::Pickle reply;
|
||||
SendRendererReply(fds, reply, shm_fd);
|
||||
}
|
||||
|
||||
void SandboxIPCHandler::HandleMatchWithFallback(
|
||||
int fd,
|
||||
PickleIterator iter,
|
||||
base::PickleIterator iter,
|
||||
const std::vector<base::ScopedFD*>& fds) {
|
||||
std::string face;
|
||||
bool is_bold, is_italic;
|
||||
@ -387,7 +387,7 @@ void SandboxIPCHandler::HandleMatchWithFallback(
|
||||
int font_fd = MatchFontFaceWithFallback(
|
||||
face, is_bold, is_italic, charset, fallback_family);
|
||||
|
||||
Pickle reply;
|
||||
base::Pickle reply;
|
||||
SendRendererReply(fds, reply, font_fd);
|
||||
|
||||
if (font_fd >= 0) {
|
||||
@ -398,7 +398,7 @@ void SandboxIPCHandler::HandleMatchWithFallback(
|
||||
|
||||
void SandboxIPCHandler::SendRendererReply(
|
||||
const std::vector<base::ScopedFD*>& fds,
|
||||
const Pickle& reply,
|
||||
const base::Pickle& reply,
|
||||
int reply_fd) {
|
||||
struct msghdr msg;
|
||||
memset(&msg, 0, sizeof(msg));
|
||||
|
@ -229,7 +229,7 @@ const ui::OSExchangeData::CustomFormat& GetFileSystemFileCustomFormat() {
|
||||
// Writes file system files to the pickle.
|
||||
void WriteFileSystemFilesToPickle(
|
||||
const std::vector<DropData::FileSystemFileInfo>& file_system_files,
|
||||
Pickle* pickle) {
|
||||
base::Pickle* pickle) {
|
||||
pickle->WriteSizeT(file_system_files.size());
|
||||
for (size_t i = 0; i < file_system_files.size(); ++i) {
|
||||
pickle->WriteString(file_system_files[i].url.spec());
|
||||
@ -239,9 +239,9 @@ void WriteFileSystemFilesToPickle(
|
||||
|
||||
// Reads file system files from the pickle.
|
||||
bool ReadFileSystemFilesFromPickle(
|
||||
const Pickle& pickle,
|
||||
const base::Pickle& pickle,
|
||||
std::vector<DropData::FileSystemFileInfo>* file_system_files) {
|
||||
PickleIterator iter(pickle);
|
||||
base::PickleIterator iter(pickle);
|
||||
|
||||
size_t num_files = 0;
|
||||
if (!iter.ReadSizeT(&num_files))
|
||||
@ -295,12 +295,12 @@ void PrepareDragData(const DropData& drop_data,
|
||||
if (!drop_data.filenames.empty())
|
||||
provider->SetFilenames(drop_data.filenames);
|
||||
if (!drop_data.file_system_files.empty()) {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
WriteFileSystemFilesToPickle(drop_data.file_system_files, &pickle);
|
||||
provider->SetPickledData(GetFileSystemFileCustomFormat(), pickle);
|
||||
}
|
||||
if (!drop_data.custom_data.empty()) {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
ui::WriteCustomDataToPickle(drop_data.custom_data, &pickle);
|
||||
provider->SetPickledData(ui::Clipboard::GetWebCustomDataFormatType(),
|
||||
pickle);
|
||||
@ -335,7 +335,7 @@ void PrepareDropData(DropData* drop_data, const ui::OSExchangeData& data) {
|
||||
|
||||
data.GetFilenames(&drop_data->filenames);
|
||||
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
std::vector<DropData::FileSystemFileInfo> file_system_files;
|
||||
if (data.GetPickledData(GetFileSystemFileCustomFormat(), &pickle) &&
|
||||
ReadFileSystemFilesFromPickle(pickle, &file_system_files))
|
||||
|
@ -200,7 +200,7 @@ void PromiseWriterHelper(const DropData& drop_data,
|
||||
|
||||
// Custom MIME data.
|
||||
} else if ([type isEqualToString:ui::kWebCustomDataPboardType]) {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
ui::WriteCustomDataToPickle(dropData_->custom_data, &pickle);
|
||||
[pboard setData:[NSData dataWithBytes:pickle.data() length:pickle.size()]
|
||||
forType:ui::kWebCustomDataPboardType];
|
||||
|
@ -221,7 +221,7 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) {
|
||||
close(fds[1]);
|
||||
control_fd_ = fds[0];
|
||||
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
pickle.WriteInt(kZygoteCommandGetSandboxStatus);
|
||||
if (!SendMessage(pickle, NULL))
|
||||
LOG(FATAL) << "Cannot communicate with zygote";
|
||||
@ -275,7 +275,7 @@ void ZygoteHostImpl::ZygoteChildDied(pid_t process) {
|
||||
}
|
||||
}
|
||||
|
||||
bool ZygoteHostImpl::SendMessage(const Pickle& data,
|
||||
bool ZygoteHostImpl::SendMessage(const base::Pickle& data,
|
||||
const std::vector<int>* fds) {
|
||||
DCHECK_NE(-1, control_fd_);
|
||||
CHECK(data.size() <= kZygoteMaxMessageLength)
|
||||
@ -314,7 +314,7 @@ pid_t ZygoteHostImpl::ForkRequest(const std::vector<std::string>& argv,
|
||||
scoped_ptr<FileDescriptorInfo> mapping,
|
||||
const std::string& process_type) {
|
||||
DCHECK(init_);
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
|
||||
int raw_socks[2];
|
||||
PCHECK(0 == socketpair(AF_UNIX, SOCK_SEQPACKET, 0, raw_socks));
|
||||
@ -378,7 +378,7 @@ pid_t ZygoteHostImpl::ForkRequest(const std::vector<std::string>& argv,
|
||||
my_sock.reset();
|
||||
|
||||
// Always send PID back to zygote.
|
||||
Pickle pid_pickle;
|
||||
base::Pickle pid_pickle;
|
||||
pid_pickle.WriteInt(kZygoteCommandForkRealPID);
|
||||
pid_pickle.WriteInt(real_pid);
|
||||
if (!SendMessage(pid_pickle, NULL))
|
||||
@ -390,8 +390,8 @@ pid_t ZygoteHostImpl::ForkRequest(const std::vector<std::string>& argv,
|
||||
char buf[kMaxReplyLength];
|
||||
const ssize_t len = ReadReply(buf, sizeof(buf));
|
||||
|
||||
Pickle reply_pickle(buf, len);
|
||||
PickleIterator iter(reply_pickle);
|
||||
base::Pickle reply_pickle(buf, len);
|
||||
base::PickleIterator iter(reply_pickle);
|
||||
if (len <= 0 || !iter.ReadInt(&pid))
|
||||
return base::kNullProcessHandle;
|
||||
|
||||
@ -513,7 +513,7 @@ void ZygoteHostImpl::AdjustRendererOOMScore(base::ProcessHandle pid,
|
||||
|
||||
void ZygoteHostImpl::EnsureProcessTerminated(pid_t process) {
|
||||
DCHECK(init_);
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
|
||||
pickle.WriteInt(kZygoteCommandReap);
|
||||
pickle.WriteInt(process);
|
||||
@ -527,7 +527,7 @@ base::TerminationStatus ZygoteHostImpl::GetTerminationStatus(
|
||||
bool known_dead,
|
||||
int* exit_code) {
|
||||
DCHECK(init_);
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
pickle.WriteInt(kZygoteCommandGetTerminationStatus);
|
||||
pickle.WriteBool(known_dead);
|
||||
pickle.WriteInt(handle);
|
||||
@ -552,9 +552,9 @@ base::TerminationStatus ZygoteHostImpl::GetTerminationStatus(
|
||||
} else if (len == 0) {
|
||||
LOG(WARNING) << "Socket closed prematurely.";
|
||||
} else {
|
||||
Pickle read_pickle(buf, len);
|
||||
base::Pickle read_pickle(buf, len);
|
||||
int tmp_status, tmp_exit_code;
|
||||
PickleIterator iter(read_pickle);
|
||||
base::PickleIterator iter(read_pickle);
|
||||
if (!iter.ReadInt(&tmp_status) || !iter.ReadInt(&tmp_exit_code)) {
|
||||
LOG(WARNING)
|
||||
<< "Error parsing GetTerminationStatus response from zygote.";
|
||||
|
@ -31,7 +31,7 @@ void BluetoothMessageFilter::OnFilteredMessageReceived(
|
||||
bool BluetoothMessageFilter::GetWorkerThreadIdForMessage(
|
||||
const IPC::Message& msg,
|
||||
int* ipc_thread_id) {
|
||||
return PickleIterator(msg).ReadInt(ipc_thread_id);
|
||||
return base::PickleIterator(msg).ReadInt(ipc_thread_id);
|
||||
}
|
||||
|
||||
} // namespace content
|
||||
|
@ -30,7 +30,7 @@ void GeofencingMessageFilter::OnFilteredMessageReceived(
|
||||
bool GeofencingMessageFilter::GetWorkerThreadIdForMessage(
|
||||
const IPC::Message& msg,
|
||||
int* ipc_thread_id) {
|
||||
return PickleIterator(msg).ReadInt(ipc_thread_id);
|
||||
return base::PickleIterator(msg).ReadInt(ipc_thread_id);
|
||||
}
|
||||
|
||||
} // namespace content
|
||||
|
@ -32,7 +32,7 @@ void IndexedDBMessageFilter::OnFilteredMessageReceived(
|
||||
bool IndexedDBMessageFilter::GetWorkerThreadIdForMessage(
|
||||
const IPC::Message& msg,
|
||||
int* ipc_thread_id) {
|
||||
return PickleIterator(msg).ReadInt(ipc_thread_id);
|
||||
return base::PickleIterator(msg).ReadInt(ipc_thread_id);
|
||||
}
|
||||
|
||||
void IndexedDBMessageFilter::OnStaleMessageReceived(const IPC::Message& msg) {
|
||||
|
@ -30,7 +30,7 @@ void NavigatorConnectDispatcher::OnFilteredMessageReceived(
|
||||
bool NavigatorConnectDispatcher::GetWorkerThreadIdForMessage(
|
||||
const IPC::Message& msg,
|
||||
int* ipc_thread_id) {
|
||||
return PickleIterator(msg).ReadInt(ipc_thread_id);
|
||||
return base::PickleIterator(msg).ReadInt(ipc_thread_id);
|
||||
}
|
||||
|
||||
} // namespace content
|
||||
|
@ -41,7 +41,7 @@ bool NotificationDispatcher::GetWorkerThreadIdForMessage(
|
||||
const IPC::Message& msg,
|
||||
int* ipc_thread_id) {
|
||||
int notification_id = -1;
|
||||
const bool success = PickleIterator(msg).ReadInt(¬ification_id);
|
||||
const bool success = base::PickleIterator(msg).ReadInt(¬ification_id);
|
||||
DCHECK(success);
|
||||
|
||||
base::AutoLock lock(notification_id_map_lock_);
|
||||
|
@ -11,7 +11,7 @@ using blink::WebBindings;
|
||||
|
||||
namespace content {
|
||||
|
||||
bool SerializeNPIdentifier(NPIdentifier identifier, Pickle* pickle) {
|
||||
bool SerializeNPIdentifier(NPIdentifier identifier, base::Pickle* pickle) {
|
||||
const NPUTF8* string;
|
||||
int32_t number;
|
||||
bool is_string;
|
||||
@ -26,7 +26,7 @@ bool SerializeNPIdentifier(NPIdentifier identifier, Pickle* pickle) {
|
||||
return pickle->WriteInt(number);
|
||||
}
|
||||
|
||||
bool DeserializeNPIdentifier(PickleIterator* pickle_iter,
|
||||
bool DeserializeNPIdentifier(base::PickleIterator* pickle_iter,
|
||||
NPIdentifier* identifier) {
|
||||
bool is_string;
|
||||
if (!pickle_iter->ReadBool(&is_string))
|
||||
|
@ -62,7 +62,7 @@ void ParamTraits<NPVariant_Param>::Write(Message* m, const param_type& p) {
|
||||
}
|
||||
|
||||
bool ParamTraits<NPVariant_Param>::Read(const Message* m,
|
||||
PickleIterator* iter,
|
||||
base::PickleIterator* iter,
|
||||
param_type* r) {
|
||||
int type;
|
||||
if (!ReadParam(m, iter, &type))
|
||||
@ -117,7 +117,7 @@ void ParamTraits<NPIdentifier_Param>::Write(Message* m, const param_type& p) {
|
||||
}
|
||||
|
||||
bool ParamTraits<NPIdentifier_Param>::Read(const Message* m,
|
||||
PickleIterator* iter,
|
||||
base::PickleIterator* iter,
|
||||
param_type* r) {
|
||||
return content::DeserializeNPIdentifier(iter, &r->identifier);
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ bool PushDispatcher::GetWorkerThreadIdForMessage(const IPC::Message& msg,
|
||||
int* ipc_thread_id) {
|
||||
int request_id = -1;
|
||||
|
||||
const bool success = PickleIterator(msg).ReadInt(&request_id);
|
||||
const bool success = base::PickleIterator(msg).ReadInt(&request_id);
|
||||
DCHECK(success);
|
||||
|
||||
base::AutoLock lock(request_id_map_lock_);
|
||||
|
@ -44,7 +44,7 @@ void QuotaMessageFilter::OnFilteredMessageReceived(const IPC::Message& msg) {
|
||||
bool QuotaMessageFilter::GetWorkerThreadIdForMessage(const IPC::Message& msg,
|
||||
int* ipc_thread_id) {
|
||||
int request_id = -1;
|
||||
const bool success = PickleIterator(msg).ReadInt(&request_id);
|
||||
const bool success = base::PickleIterator(msg).ReadInt(&request_id);
|
||||
DCHECK(success);
|
||||
|
||||
base::AutoLock lock(request_id_map_lock_);
|
||||
|
@ -84,7 +84,7 @@ bool ResourceDispatcher::OnMessageReceived(const IPC::Message& message) {
|
||||
|
||||
int request_id;
|
||||
|
||||
PickleIterator iter(message);
|
||||
base::PickleIterator iter(message);
|
||||
if (!iter.ReadInt(&request_id)) {
|
||||
NOTREACHED() << "malformed resource message";
|
||||
return true;
|
||||
@ -699,7 +699,7 @@ bool ResourceDispatcher::IsResourceDispatcherMessage(
|
||||
// static
|
||||
void ResourceDispatcher::ReleaseResourcesInDataMessage(
|
||||
const IPC::Message& message) {
|
||||
PickleIterator iter(message);
|
||||
base::PickleIterator iter(message);
|
||||
int request_id;
|
||||
if (!iter.ReadInt(&request_id)) {
|
||||
NOTREACHED() << "malformed resource message";
|
||||
|
@ -56,7 +56,7 @@ void ServiceWorkerMessageFilter::OnFilteredMessageReceived(
|
||||
bool ServiceWorkerMessageFilter::GetWorkerThreadIdForMessage(
|
||||
const IPC::Message& msg,
|
||||
int* ipc_thread_id) {
|
||||
return PickleIterator(msg).ReadInt(ipc_thread_id);
|
||||
return base::PickleIterator(msg).ReadInt(ipc_thread_id);
|
||||
}
|
||||
|
||||
void ServiceWorkerMessageFilter::OnStaleMessageReceived(
|
||||
|
@ -88,7 +88,7 @@ bool DataProviderMessageFilter::OnMessageReceived(
|
||||
|
||||
int request_id;
|
||||
|
||||
PickleIterator iter(message);
|
||||
base::PickleIterator iter(message);
|
||||
if (!iter.ReadInt(&request_id)) {
|
||||
NOTREACHED() << "malformed resource message";
|
||||
return true;
|
||||
|
@ -17,7 +17,7 @@ namespace {
|
||||
const uint32 kHeaderMagic = 0xBEEFCAFE;
|
||||
|
||||
#pragma pack(push, 4)
|
||||
struct Header : public Pickle::Header {
|
||||
struct Header : public base::Pickle::Header {
|
||||
uint32 magic;
|
||||
int32 type;
|
||||
};
|
||||
@ -61,7 +61,7 @@ bool GinJavaBridgeValue::ContainsGinJavaBridgeValue(const base::Value* value) {
|
||||
reinterpret_cast<const base::BinaryValue*>(value);
|
||||
if (binary_value->GetSize() < sizeof(Header))
|
||||
return false;
|
||||
Pickle pickle(binary_value->GetBuffer(), binary_value->GetSize());
|
||||
base::Pickle pickle(binary_value->GetBuffer(), binary_value->GetSize());
|
||||
// Broken binary value: payload or header size is wrong
|
||||
if (!pickle.data() || pickle.size() - pickle.payload_size() != sizeof(Header))
|
||||
return false;
|
||||
@ -92,7 +92,7 @@ bool GinJavaBridgeValue::IsType(Type type) const {
|
||||
|
||||
bool GinJavaBridgeValue::GetAsNonFinite(float* out_value) const {
|
||||
if (GetType() == TYPE_NONFINITE) {
|
||||
PickleIterator iter(pickle_);
|
||||
base::PickleIterator iter(pickle_);
|
||||
return iter.ReadFloat(out_value);
|
||||
} else {
|
||||
return false;
|
||||
@ -101,7 +101,7 @@ bool GinJavaBridgeValue::GetAsNonFinite(float* out_value) const {
|
||||
|
||||
bool GinJavaBridgeValue::GetAsObjectID(int32* out_object_id) const {
|
||||
if (GetType() == TYPE_OBJECT_ID) {
|
||||
PickleIterator iter(pickle_);
|
||||
base::PickleIterator iter(pickle_);
|
||||
return iter.ReadInt(out_object_id);
|
||||
} else {
|
||||
return false;
|
||||
|
@ -54,8 +54,9 @@ void ParamTraits<cc::FilterOperation>::Write(
|
||||
}
|
||||
}
|
||||
|
||||
bool ParamTraits<cc::FilterOperation>::Read(
|
||||
const Message* m, PickleIterator* iter, param_type* r) {
|
||||
bool ParamTraits<cc::FilterOperation>::Read(const Message* m,
|
||||
base::PickleIterator* iter,
|
||||
param_type* r) {
|
||||
cc::FilterOperation::FilterType type;
|
||||
float amount;
|
||||
gfx::Point drop_shadow_offset;
|
||||
@ -188,8 +189,9 @@ void ParamTraits<cc::FilterOperations>::Write(
|
||||
}
|
||||
}
|
||||
|
||||
bool ParamTraits<cc::FilterOperations>::Read(
|
||||
const Message* m, PickleIterator* iter, param_type* r) {
|
||||
bool ParamTraits<cc::FilterOperations>::Read(const Message* m,
|
||||
base::PickleIterator* iter,
|
||||
param_type* r) {
|
||||
size_t count;
|
||||
if (!ReadParam(m, iter, &count))
|
||||
return false;
|
||||
@ -226,8 +228,9 @@ void ParamTraits<skia::RefPtr<SkImageFilter> >::Write(
|
||||
}
|
||||
}
|
||||
|
||||
bool ParamTraits<skia::RefPtr<SkImageFilter> >::Read(
|
||||
const Message* m, PickleIterator* iter, param_type* r) {
|
||||
bool ParamTraits<skia::RefPtr<SkImageFilter>>::Read(const Message* m,
|
||||
base::PickleIterator* iter,
|
||||
param_type* r) {
|
||||
const char* data = 0;
|
||||
int length = 0;
|
||||
if (!iter->ReadData(&data, &length))
|
||||
@ -261,8 +264,9 @@ void ParamTraits<gfx::Transform>::Write(
|
||||
m->WriteBytes(&column_major_data, sizeof(SkMScalar) * 16);
|
||||
}
|
||||
|
||||
bool ParamTraits<gfx::Transform>::Read(
|
||||
const Message* m, PickleIterator* iter, param_type* r) {
|
||||
bool ParamTraits<gfx::Transform>::Read(const Message* m,
|
||||
base::PickleIterator* iter,
|
||||
param_type* r) {
|
||||
const char* column_major_data;
|
||||
if (!iter->ReadBytes(&column_major_data, sizeof(SkMScalar) * 16))
|
||||
return false;
|
||||
@ -387,7 +391,7 @@ static size_t ReserveSizeForRenderPassWrite(const cc::RenderPass& p) {
|
||||
|
||||
template <typename QuadType>
|
||||
static cc::DrawQuad* ReadDrawQuad(const Message* m,
|
||||
PickleIterator* iter,
|
||||
base::PickleIterator* iter,
|
||||
cc::RenderPass* render_pass) {
|
||||
QuadType* quad = render_pass->CreateAndAppendDrawQuad<QuadType>();
|
||||
if (!ReadParam(m, iter, quad))
|
||||
@ -395,8 +399,9 @@ static cc::DrawQuad* ReadDrawQuad(const Message* m,
|
||||
return quad;
|
||||
}
|
||||
|
||||
bool ParamTraits<cc::RenderPass>::Read(
|
||||
const Message* m, PickleIterator* iter, param_type* p) {
|
||||
bool ParamTraits<cc::RenderPass>::Read(const Message* m,
|
||||
base::PickleIterator* iter,
|
||||
param_type* p) {
|
||||
cc::RenderPassId id(-1, -1);
|
||||
gfx::Rect output_rect;
|
||||
gfx::Rect damage_rect;
|
||||
@ -420,7 +425,7 @@ bool ParamTraits<cc::RenderPass>::Read(
|
||||
|
||||
for (size_t i = 0; i < quad_list_size; ++i) {
|
||||
cc::DrawQuad::Material material;
|
||||
PickleIterator temp_iter = *iter;
|
||||
base::PickleIterator temp_iter = *iter;
|
||||
if (!ReadParam(m, &temp_iter, &material))
|
||||
return false;
|
||||
|
||||
@ -590,7 +595,7 @@ void ParamTraits<cc::CompositorFrame>::Write(Message* m,
|
||||
}
|
||||
|
||||
bool ParamTraits<cc::CompositorFrame>::Read(const Message* m,
|
||||
PickleIterator* iter,
|
||||
base::PickleIterator* iter,
|
||||
param_type* p) {
|
||||
if (!ReadParam(m, iter, &p->metadata))
|
||||
return false;
|
||||
@ -650,7 +655,7 @@ void ParamTraits<cc::CompositorFrameAck>::Write(Message* m,
|
||||
}
|
||||
|
||||
bool ParamTraits<cc::CompositorFrameAck>::Read(const Message* m,
|
||||
PickleIterator* iter,
|
||||
base::PickleIterator* iter,
|
||||
param_type* p) {
|
||||
if (!ReadParam(m, iter, &p->resources))
|
||||
return false;
|
||||
@ -712,7 +717,7 @@ void ParamTraits<cc::DelegatedFrameData>::Write(Message* m,
|
||||
}
|
||||
|
||||
bool ParamTraits<cc::DelegatedFrameData>::Read(const Message* m,
|
||||
PickleIterator* iter,
|
||||
base::PickleIterator* iter,
|
||||
param_type* p) {
|
||||
if (!ReadParam(m, iter, &p->device_scale_factor))
|
||||
return false;
|
||||
@ -782,7 +787,7 @@ void ParamTraits<cc::SoftwareFrameData>::Write(Message* m,
|
||||
}
|
||||
|
||||
bool ParamTraits<cc::SoftwareFrameData>::Read(const Message* m,
|
||||
PickleIterator* iter,
|
||||
base::PickleIterator* iter,
|
||||
param_type* p) {
|
||||
if (!ReadParam(m, iter, &p->id))
|
||||
return false;
|
||||
|
@ -495,7 +495,7 @@ TEST_F(CCMessagesTest, AllQuads) {
|
||||
IPC::ParamTraits<DelegatedFrameData>::Write(&msg, frame_in);
|
||||
|
||||
DelegatedFrameData frame_out;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
EXPECT_TRUE(IPC::ParamTraits<DelegatedFrameData>::Read(&msg,
|
||||
&iter, &frame_out));
|
||||
|
||||
@ -617,7 +617,7 @@ TEST_F(CCMessagesTest, UnusedSharedQuadStates) {
|
||||
IPC::ParamTraits<DelegatedFrameData>::Write(&msg, frame_in);
|
||||
|
||||
DelegatedFrameData frame_out;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
EXPECT_TRUE(
|
||||
IPC::ParamTraits<DelegatedFrameData>::Read(&msg, &iter, &frame_out));
|
||||
|
||||
@ -685,7 +685,7 @@ TEST_F(CCMessagesTest, Resources) {
|
||||
IPC::ParamTraits<DelegatedFrameData>::Write(&msg, frame_in);
|
||||
|
||||
DelegatedFrameData frame_out;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
EXPECT_TRUE(IPC::ParamTraits<DelegatedFrameData>::Read(&msg,
|
||||
&iter, &frame_out));
|
||||
|
||||
@ -707,7 +707,7 @@ TEST_F(CCMessagesTest, SoftwareFrameData) {
|
||||
|
||||
// Read the frame.
|
||||
cc::SoftwareFrameData frame_out;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
EXPECT_TRUE(
|
||||
IPC::ParamTraits<SoftwareFrameData>::Read(&msg, &iter, &frame_out));
|
||||
EXPECT_EQ(frame_in.id, frame_out.id);
|
||||
@ -731,7 +731,7 @@ TEST_F(CCMessagesTest, SoftwareFrameDataMaxInt) {
|
||||
IPC::WriteParam(&msg, frame_in.damage_rect);
|
||||
IPC::WriteParam(&msg, frame_in.bitmap_id);
|
||||
SoftwareFrameData frame_out;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
EXPECT_TRUE(
|
||||
IPC::ParamTraits<SoftwareFrameData>::Read(&msg, &iter, &frame_out));
|
||||
}
|
||||
@ -752,7 +752,7 @@ TEST_F(CCMessagesTest, SoftwareFrameDataMaxInt) {
|
||||
IPC::WriteParam(&msg, frame_in.damage_rect);
|
||||
IPC::WriteParam(&msg, frame_in.bitmap_id);
|
||||
SoftwareFrameData frame_out;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
EXPECT_EQ(
|
||||
expect_read,
|
||||
IPC::ParamTraits<SoftwareFrameData>::Read(&msg, &iter, &frame_out));
|
||||
|
@ -27,7 +27,7 @@ void GetFallbackFontForCharacter(int32_t character,
|
||||
blink::WebFallbackFont* fallbackFont) {
|
||||
TRACE_EVENT0("sandbox_ipc", "GetFontFamilyForCharacter");
|
||||
|
||||
Pickle request;
|
||||
base::Pickle request;
|
||||
request.WriteInt(LinuxSandbox::METHOD_GET_FALLBACK_FONT_FOR_CHAR);
|
||||
request.WriteInt(character);
|
||||
request.WriteString(preferred_locale);
|
||||
@ -43,8 +43,8 @@ void GetFallbackFontForCharacter(int32_t character,
|
||||
bool isBold = false;
|
||||
bool isItalic = false;
|
||||
if (n != -1) {
|
||||
Pickle reply(reinterpret_cast<char*>(buf), n);
|
||||
PickleIterator pickle_iter(reply);
|
||||
base::Pickle reply(reinterpret_cast<char*>(buf), n);
|
||||
base::PickleIterator pickle_iter(reply);
|
||||
if (pickle_iter.ReadString(&family_name) &&
|
||||
pickle_iter.ReadString(&filename) &&
|
||||
pickle_iter.ReadInt(&fontconfigInterfaceId) &&
|
||||
@ -77,7 +77,7 @@ void GetRenderStyleForStrike(const char* family,
|
||||
if (pixel_size > std::numeric_limits<uint16>::max())
|
||||
return;
|
||||
|
||||
Pickle request;
|
||||
base::Pickle request;
|
||||
request.WriteInt(LinuxSandbox::METHOD_GET_STYLE_FOR_STRIKE);
|
||||
request.WriteString(family);
|
||||
request.WriteBool(bold);
|
||||
@ -90,8 +90,8 @@ void GetRenderStyleForStrike(const char* family,
|
||||
if (n == -1)
|
||||
return;
|
||||
|
||||
Pickle reply(reinterpret_cast<char*>(buf), n);
|
||||
PickleIterator pickle_iter(reply);
|
||||
base::Pickle reply(reinterpret_cast<char*>(buf), n);
|
||||
base::PickleIterator pickle_iter(reply);
|
||||
int use_bitmaps, use_autohint, use_hinting, hint_style, use_antialias;
|
||||
int use_subpixel_rendering, use_subpixel_positioning;
|
||||
if (pickle_iter.ReadInt(&use_bitmaps) &&
|
||||
@ -118,7 +118,7 @@ int MatchFontWithFallback(const std::string& face,
|
||||
PP_BrowserFont_Trusted_Family fallback_family) {
|
||||
TRACE_EVENT0("sandbox_ipc", "MatchFontWithFallback");
|
||||
|
||||
Pickle request;
|
||||
base::Pickle request;
|
||||
request.WriteInt(LinuxSandbox::METHOD_MATCH_WITH_FALLBACK);
|
||||
request.WriteString(face);
|
||||
request.WriteBool(bold);
|
||||
|
@ -11,7 +11,7 @@
|
||||
namespace content {
|
||||
|
||||
int MakeSharedMemorySegmentViaIPC(size_t length, bool executable) {
|
||||
Pickle request;
|
||||
base::Pickle request;
|
||||
request.WriteInt(LinuxSandbox::METHOD_MAKE_SHARED_MEMORY_SEGMENT);
|
||||
request.WriteUInt32(length);
|
||||
request.WriteBool(executable);
|
||||
|
@ -33,7 +33,7 @@ TEST(IPCMessageTest, Serialize) {
|
||||
IPC::ParamTraits<GURL>::Write(&msg, input);
|
||||
|
||||
GURL output;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
EXPECT_TRUE(IPC::ParamTraits<GURL>::Read(&msg, &iter, &output));
|
||||
|
||||
// We want to test each component individually to make sure its range was
|
||||
@ -59,7 +59,7 @@ TEST(IPCMessageTest, Serialize) {
|
||||
IPC::ParamTraits<GURL>::Write(&msg, input);
|
||||
|
||||
GURL output;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
EXPECT_TRUE(IPC::ParamTraits<GURL>::Read(&msg, &iter, &output));
|
||||
EXPECT_TRUE(output.is_empty());
|
||||
}
|
||||
@ -69,7 +69,7 @@ TEST(IPCMessageTest, Serialize) {
|
||||
IPC::Message msg;
|
||||
msg.WriteString("#inva://idurl/");
|
||||
GURL output;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
EXPECT_FALSE(IPC::ParamTraits<GURL>::Read(&msg, &iter, &output));
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ TEST(IPCMessageTest, Serialize) {
|
||||
IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL);
|
||||
msg.WriteInt(99);
|
||||
GURL output;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
EXPECT_FALSE(IPC::ParamTraits<GURL>::Read(&msg, &iter, &output));
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ TEST(IPCMessageTest, Pair) {
|
||||
IPC::ParamTraits<TestPair>::Write(&msg, input);
|
||||
|
||||
TestPair output;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
EXPECT_TRUE(IPC::ParamTraits<TestPair>::Read(&msg, &iter, &output));
|
||||
EXPECT_EQ(output.first, "foo");
|
||||
EXPECT_EQ(output.second, "bar");
|
||||
@ -107,7 +107,7 @@ TEST(IPCMessageTest, Bitmap) {
|
||||
IPC::ParamTraits<SkBitmap>::Write(&msg, bitmap);
|
||||
|
||||
SkBitmap output;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
EXPECT_TRUE(IPC::ParamTraits<SkBitmap>::Read(&msg, &iter, &output));
|
||||
|
||||
EXPECT_EQ(bitmap.colorType(), output.colorType());
|
||||
@ -123,7 +123,7 @@ TEST(IPCMessageTest, Bitmap) {
|
||||
// Copy the first message block over to |bad_msg|.
|
||||
const char* fixed_data;
|
||||
int fixed_data_size;
|
||||
iter = PickleIterator(msg);
|
||||
iter = base::PickleIterator(msg);
|
||||
EXPECT_TRUE(iter.ReadData(&fixed_data, &fixed_data_size));
|
||||
bad_msg.WriteData(fixed_data, fixed_data_size);
|
||||
// Add some bogus pixel data.
|
||||
@ -133,7 +133,7 @@ TEST(IPCMessageTest, Bitmap) {
|
||||
bad_msg.WriteData(bogus_pixels.get(), bogus_pixels_size);
|
||||
// Make sure we don't read out the bitmap!
|
||||
SkBitmap bad_output;
|
||||
iter = PickleIterator(bad_msg);
|
||||
iter = base::PickleIterator(bad_msg);
|
||||
EXPECT_FALSE(IPC::ParamTraits<SkBitmap>::Read(&bad_msg, &iter, &bad_output));
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ TEST(IPCMessageTest, ListValue) {
|
||||
IPC::WriteParam(&msg, input);
|
||||
|
||||
base::ListValue output;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
EXPECT_TRUE(IPC::ReadParam(&msg, &iter, &output));
|
||||
|
||||
EXPECT_TRUE(input.Equals(&output));
|
||||
@ -155,7 +155,7 @@ TEST(IPCMessageTest, ListValue) {
|
||||
// Also test the corrupt case.
|
||||
IPC::Message bad_msg(1, 2, IPC::Message::PRIORITY_NORMAL);
|
||||
bad_msg.WriteInt(99);
|
||||
iter = PickleIterator(bad_msg);
|
||||
iter = base::PickleIterator(bad_msg);
|
||||
EXPECT_FALSE(IPC::ReadParam(&bad_msg, &iter, &output));
|
||||
}
|
||||
|
||||
@ -181,7 +181,7 @@ TEST(IPCMessageTest, DictionaryValue) {
|
||||
IPC::WriteParam(&msg, input);
|
||||
|
||||
base::DictionaryValue output;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
EXPECT_TRUE(IPC::ReadParam(&msg, &iter, &output));
|
||||
|
||||
EXPECT_TRUE(input.Equals(&output));
|
||||
@ -189,7 +189,7 @@ TEST(IPCMessageTest, DictionaryValue) {
|
||||
// Also test the corrupt case.
|
||||
IPC::Message bad_msg(1, 2, IPC::Message::PRIORITY_NORMAL);
|
||||
bad_msg.WriteInt(99);
|
||||
iter = PickleIterator(bad_msg);
|
||||
iter = base::PickleIterator(bad_msg);
|
||||
EXPECT_FALSE(IPC::ReadParam(&bad_msg, &iter, &output));
|
||||
}
|
||||
|
||||
@ -201,7 +201,7 @@ TEST(IPCMessageTest, HostPortPair) {
|
||||
IPC::ParamTraits<net::HostPortPair>::Write(&msg, input);
|
||||
|
||||
net::HostPortPair output;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
EXPECT_TRUE(IPC::ParamTraits<net::HostPortPair>::Read(&msg, &iter, &output));
|
||||
EXPECT_EQ(input.host(), output.host());
|
||||
EXPECT_EQ(input.port(), output.port());
|
||||
|
@ -15,7 +15,7 @@ void ParamTraits<WebInputEventPointer>::Write(Message* m, const param_type& p) {
|
||||
}
|
||||
|
||||
bool ParamTraits<WebInputEventPointer>::Read(const Message* m,
|
||||
PickleIterator* iter,
|
||||
base::PickleIterator* iter,
|
||||
param_type* r) {
|
||||
const char* data;
|
||||
int data_length;
|
||||
|
@ -80,7 +80,7 @@ void WebCursor::GetCursorInfo(CursorInfo* cursor_info) const {
|
||||
#endif
|
||||
}
|
||||
|
||||
bool WebCursor::Deserialize(PickleIterator* iter) {
|
||||
bool WebCursor::Deserialize(base::PickleIterator* iter) {
|
||||
int type, hotspot_x, hotspot_y, size_x, size_y, data_len;
|
||||
float scale;
|
||||
const char* data;
|
||||
@ -132,7 +132,7 @@ bool WebCursor::Deserialize(PickleIterator* iter) {
|
||||
return DeserializePlatformData(iter);
|
||||
}
|
||||
|
||||
bool WebCursor::Serialize(Pickle* pickle) const {
|
||||
bool WebCursor::Serialize(base::Pickle* pickle) const {
|
||||
if (!pickle->WriteInt(type_) ||
|
||||
!pickle->WriteInt(hotspot_.x()) ||
|
||||
!pickle->WriteInt(hotspot_.y()) ||
|
||||
|
@ -90,7 +90,7 @@ bool FontConfigIPC::matchFamilyName(const char familyName[],
|
||||
if (familyNameLen > kMaxFontFamilyLength)
|
||||
return false;
|
||||
|
||||
Pickle request;
|
||||
base::Pickle request;
|
||||
request.WriteInt(METHOD_MATCH);
|
||||
request.WriteData(familyName, familyNameLen);
|
||||
request.WriteUInt32(requestedStyle);
|
||||
@ -101,8 +101,8 @@ bool FontConfigIPC::matchFamilyName(const char familyName[],
|
||||
if (r == -1)
|
||||
return false;
|
||||
|
||||
Pickle reply(reinterpret_cast<char*>(reply_buf), r);
|
||||
PickleIterator iter(reply);
|
||||
base::Pickle reply(reinterpret_cast<char*>(reply_buf), r);
|
||||
base::PickleIterator iter(reply);
|
||||
bool result;
|
||||
if (!iter.ReadBool(&result))
|
||||
return false;
|
||||
@ -138,7 +138,7 @@ SkStreamAsset* FontConfigIPC::openStream(const FontIdentity& identity) {
|
||||
return mapped_font_files_it->second->CreateMemoryStream();
|
||||
}
|
||||
|
||||
Pickle request;
|
||||
base::Pickle request;
|
||||
request.WriteInt(METHOD_OPEN);
|
||||
request.WriteUInt32(identity.fID);
|
||||
|
||||
@ -149,9 +149,9 @@ SkStreamAsset* FontConfigIPC::openStream(const FontIdentity& identity) {
|
||||
if (r == -1)
|
||||
return NULL;
|
||||
|
||||
Pickle reply(reinterpret_cast<char*>(reply_buf), r);
|
||||
base::Pickle reply(reinterpret_cast<char*>(reply_buf), r);
|
||||
bool result;
|
||||
PickleIterator iter(reply);
|
||||
base::PickleIterator iter(reply);
|
||||
if (!iter.ReadBool(&result) || !result) {
|
||||
if (result_fd)
|
||||
CloseFD(result_fd);
|
||||
|
@ -36,10 +36,9 @@ void ParamTraits<WebGamepad>::Write(
|
||||
m->WriteData(reinterpret_cast<const char*>(&p), sizeof(WebGamepad));
|
||||
}
|
||||
|
||||
bool ParamTraits<WebGamepad>::Read(
|
||||
const Message* m,
|
||||
PickleIterator* iter,
|
||||
WebGamepad* p) {
|
||||
bool ParamTraits<WebGamepad>::Read(const Message* m,
|
||||
base::PickleIterator* iter,
|
||||
WebGamepad* p) {
|
||||
int length;
|
||||
const char* data;
|
||||
if (!iter->ReadData(&data, &length) || length != sizeof(WebGamepad))
|
||||
|
@ -59,7 +59,7 @@ void ParamTraits<IndexedDBKey>::Write(Message* m, const param_type& p) {
|
||||
}
|
||||
|
||||
bool ParamTraits<IndexedDBKey>::Read(const Message* m,
|
||||
PickleIterator* iter,
|
||||
base::PickleIterator* iter,
|
||||
param_type* r) {
|
||||
int type;
|
||||
if (!ReadParam(m, iter, &type))
|
||||
@ -171,7 +171,7 @@ void ParamTraits<IndexedDBKeyPath>::Write(Message* m, const param_type& p) {
|
||||
}
|
||||
|
||||
bool ParamTraits<IndexedDBKeyPath>::Read(const Message* m,
|
||||
PickleIterator* iter,
|
||||
base::PickleIterator* iter,
|
||||
param_type* r) {
|
||||
int type;
|
||||
if (!ReadParam(m, iter, &type))
|
||||
@ -238,7 +238,7 @@ void ParamTraits<IndexedDBKeyRange>::Write(Message* m, const param_type& p) {
|
||||
}
|
||||
|
||||
bool ParamTraits<IndexedDBKeyRange>::Read(const Message* m,
|
||||
PickleIterator* iter,
|
||||
base::PickleIterator* iter,
|
||||
param_type* r) {
|
||||
IndexedDBKey lower;
|
||||
if (!ReadParam(m, iter, &lower))
|
||||
|
@ -13,11 +13,10 @@
|
||||
|
||||
namespace IPC {
|
||||
namespace {
|
||||
template<typename GestureType>
|
||||
template <typename GestureType>
|
||||
scoped_ptr<content::SyntheticGestureParams> ReadGestureParams(
|
||||
const Message* m,
|
||||
PickleIterator* iter)
|
||||
{
|
||||
base::PickleIterator* iter) {
|
||||
scoped_ptr<GestureType> gesture_params(new GestureType);
|
||||
if (!ReadParam(m, iter, gesture_params.get()))
|
||||
return scoped_ptr<content::SyntheticGestureParams>();
|
||||
@ -35,7 +34,7 @@ void ParamTraits<content::ScopedWebInputEvent>::Write(Message* m,
|
||||
}
|
||||
|
||||
bool ParamTraits<content::ScopedWebInputEvent>::Read(const Message* m,
|
||||
PickleIterator* iter,
|
||||
base::PickleIterator* iter,
|
||||
param_type* p) {
|
||||
bool valid_web_event = false;
|
||||
WebInputEventPointer web_event_pointer = NULL;
|
||||
@ -78,9 +77,10 @@ void ParamTraits<content::SyntheticGesturePacket>::Write(Message* m,
|
||||
}
|
||||
}
|
||||
|
||||
bool ParamTraits<content::SyntheticGesturePacket>::Read(const Message* m,
|
||||
PickleIterator* iter,
|
||||
param_type* p) {
|
||||
bool ParamTraits<content::SyntheticGesturePacket>::Read(
|
||||
const Message* m,
|
||||
base::PickleIterator* iter,
|
||||
param_type* p) {
|
||||
content::SyntheticGestureParams::GestureType gesture_type;
|
||||
if (!ReadParam(m, iter, &gesture_type))
|
||||
return false;
|
||||
|
@ -108,7 +108,7 @@ class InputParamTraitsTest : public testing::Test {
|
||||
IPC::ParamTraits<InputEvents>::Write(&msg, events_in);
|
||||
|
||||
InputEvents events_out;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
EXPECT_TRUE(IPC::ParamTraits<InputEvents>::Read(&msg, &iter, &events_out));
|
||||
|
||||
Compare(&events_in, &events_out);
|
||||
@ -127,7 +127,7 @@ class InputParamTraitsTest : public testing::Test {
|
||||
IPC::ParamTraits<SyntheticGesturePacket>::Write(&msg, packet_in);
|
||||
|
||||
SyntheticGesturePacket packet_out;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
EXPECT_TRUE(IPC::ParamTraits<SyntheticGesturePacket>::Read(&msg, &iter,
|
||||
&packet_out));
|
||||
|
||||
@ -151,7 +151,7 @@ TEST_F(InputParamTraitsTest, UninitializedEvents) {
|
||||
IPC::WriteParam(&msg, event);
|
||||
|
||||
InputEvent event_out;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
EXPECT_FALSE(IPC::ReadParam(&msg, &iter, &event_out));
|
||||
}
|
||||
|
||||
@ -197,7 +197,7 @@ TEST_F(InputParamTraitsTest, InvalidSyntheticGestureParams) {
|
||||
WriteParam(&msg, -3);
|
||||
|
||||
SyntheticGesturePacket packet_out;
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
ASSERT_FALSE(
|
||||
IPC::ParamTraits<SyntheticGesturePacket>::Read(&msg, &iter, &packet_out));
|
||||
}
|
||||
|
@ -128,7 +128,9 @@ void ParamTraits<AttributedStringCoder::EncodedString>::Write(
|
||||
}
|
||||
|
||||
bool ParamTraits<AttributedStringCoder::EncodedString>::Read(
|
||||
const Message* m, PickleIterator* iter, param_type* p) {
|
||||
const Message* m,
|
||||
base::PickleIterator* iter,
|
||||
param_type* p) {
|
||||
bool success = true;
|
||||
|
||||
base::string16 result;
|
||||
@ -151,7 +153,9 @@ void ParamTraits<AttributedStringCoder::FontAttribute>::Write(
|
||||
}
|
||||
|
||||
bool ParamTraits<AttributedStringCoder::FontAttribute>::Read(
|
||||
const Message* m, PickleIterator* iter, param_type* p) {
|
||||
const Message* m,
|
||||
base::PickleIterator* iter,
|
||||
param_type* p) {
|
||||
bool success = true;
|
||||
|
||||
FontDescriptor font;
|
||||
|
@ -28,7 +28,7 @@ void ParamTraits<AudioParameters>::Write(Message* m,
|
||||
}
|
||||
|
||||
bool ParamTraits<AudioParameters>::Read(const Message* m,
|
||||
PickleIterator* iter,
|
||||
base::PickleIterator* iter,
|
||||
AudioParameters* r) {
|
||||
int format, channel_layout, sample_rate, bits_per_sample,
|
||||
frames_per_buffer, channels, effects;
|
||||
@ -66,7 +66,7 @@ void ParamTraits<VideoCaptureFormat>::Write(Message* m,
|
||||
}
|
||||
|
||||
bool ParamTraits<VideoCaptureFormat>::Read(const Message* m,
|
||||
PickleIterator* iter,
|
||||
base::PickleIterator* iter,
|
||||
VideoCaptureFormat* r) {
|
||||
int frame_size_width, frame_size_height, pixel_format;
|
||||
if (!iter->ReadInt(&frame_size_width) ||
|
||||
|
@ -167,15 +167,15 @@ struct SerializeObject {
|
||||
: pickle(data, len),
|
||||
version(0),
|
||||
parse_error(false) {
|
||||
iter = PickleIterator(pickle);
|
||||
iter = base::PickleIterator(pickle);
|
||||
}
|
||||
|
||||
std::string GetAsString() {
|
||||
return std::string(static_cast<const char*>(pickle.data()), pickle.size());
|
||||
}
|
||||
|
||||
Pickle pickle;
|
||||
PickleIterator iter;
|
||||
base::Pickle pickle;
|
||||
base::PickleIterator iter;
|
||||
int version;
|
||||
bool parse_error;
|
||||
};
|
||||
|
@ -322,7 +322,7 @@ TEST_F(PageStateSerializationTest, BasicFrameSetPOST) {
|
||||
}
|
||||
|
||||
TEST_F(PageStateSerializationTest, BadMessagesTest1) {
|
||||
Pickle p;
|
||||
base::Pickle p;
|
||||
// Version 14
|
||||
p.WriteInt(14);
|
||||
// Empty strings.
|
||||
@ -339,7 +339,7 @@ TEST_F(PageStateSerializationTest, BadMessagesTest1) {
|
||||
|
||||
TEST_F(PageStateSerializationTest, BadMessagesTest2) {
|
||||
double d = 0;
|
||||
Pickle p;
|
||||
base::Pickle p;
|
||||
// Version 14
|
||||
p.WriteInt(14);
|
||||
// Empty strings.
|
||||
|
@ -18,8 +18,10 @@ void ParamTraits<scoped_refptr<net::HttpResponseHeaders> >::Write(
|
||||
}
|
||||
}
|
||||
|
||||
bool ParamTraits<scoped_refptr<net::HttpResponseHeaders> >::Read(
|
||||
const Message* m, PickleIterator* iter, param_type* r) {
|
||||
bool ParamTraits<scoped_refptr<net::HttpResponseHeaders>>::Read(
|
||||
const Message* m,
|
||||
base::PickleIterator* iter,
|
||||
param_type* r) {
|
||||
bool has_object;
|
||||
if (!ReadParam(m, iter, &has_object))
|
||||
return false;
|
||||
@ -65,7 +67,7 @@ void ParamTraits<storage::DataElement>::Write(Message* m, const param_type& p) {
|
||||
}
|
||||
|
||||
bool ParamTraits<storage::DataElement>::Read(const Message* m,
|
||||
PickleIterator* iter,
|
||||
base::PickleIterator* iter,
|
||||
param_type* r) {
|
||||
int type;
|
||||
if (!ReadParam(m, iter, &type))
|
||||
@ -146,8 +148,10 @@ void ParamTraits<scoped_refptr<content::ResourceDevToolsInfo> >::Write(
|
||||
}
|
||||
}
|
||||
|
||||
bool ParamTraits<scoped_refptr<content::ResourceDevToolsInfo> >::Read(
|
||||
const Message* m, PickleIterator* iter, param_type* r) {
|
||||
bool ParamTraits<scoped_refptr<content::ResourceDevToolsInfo>>::Read(
|
||||
const Message* m,
|
||||
base::PickleIterator* iter,
|
||||
param_type* r) {
|
||||
bool has_object;
|
||||
if (!ReadParam(m, iter, &has_object))
|
||||
return false;
|
||||
@ -196,8 +200,9 @@ void ParamTraits<net::LoadTimingInfo>::Write(
|
||||
WriteParam(m, p.receive_headers_end);
|
||||
}
|
||||
|
||||
bool ParamTraits<net::LoadTimingInfo>::Read(
|
||||
const Message* m, PickleIterator* iter, param_type* r) {
|
||||
bool ParamTraits<net::LoadTimingInfo>::Read(const Message* m,
|
||||
base::PickleIterator* iter,
|
||||
param_type* r) {
|
||||
bool has_no_times;
|
||||
if (!ReadParam(m, iter, &r->socket_log_id) ||
|
||||
!ReadParam(m, iter, &r->socket_reused) ||
|
||||
@ -268,9 +273,9 @@ void ParamTraits<scoped_refptr<content::ResourceRequestBody> >::Write(
|
||||
}
|
||||
}
|
||||
|
||||
bool ParamTraits<scoped_refptr<content::ResourceRequestBody> >::Read(
|
||||
bool ParamTraits<scoped_refptr<content::ResourceRequestBody>>::Read(
|
||||
const Message* m,
|
||||
PickleIterator* iter,
|
||||
base::PickleIterator* iter,
|
||||
param_type* r) {
|
||||
bool has_object;
|
||||
if (!ReadParam(m, iter, &has_object))
|
||||
|
@ -16,7 +16,7 @@ std::string SerializeSecurityInfo(
|
||||
int ssl_connection_status,
|
||||
const SignedCertificateTimestampIDStatusList&
|
||||
signed_certificate_timestamp_ids) {
|
||||
Pickle pickle;
|
||||
base::Pickle pickle;
|
||||
pickle.WriteInt(cert_id);
|
||||
pickle.WriteUInt32(cert_status);
|
||||
pickle.WriteInt(security_bits);
|
||||
@ -51,8 +51,8 @@ bool DeserializeSecurityInfo(
|
||||
return false;
|
||||
}
|
||||
|
||||
Pickle pickle(state.data(), static_cast<int>(state.size()));
|
||||
PickleIterator iter(pickle);
|
||||
base::Pickle pickle(state.data(), static_cast<int>(state.size()));
|
||||
base::PickleIterator iter(pickle);
|
||||
int num_scts_to_read;
|
||||
if (!iter.ReadInt(cert_id) ||
|
||||
!iter.ReadUInt32(cert_status) ||
|
||||
|
@ -36,7 +36,9 @@ void ParamTraits<GURL>::Write(Message* m, const GURL& p) {
|
||||
// TODO(brettw) bug 684583: Add encoding for query params.
|
||||
}
|
||||
|
||||
bool ParamTraits<GURL>::Read(const Message* m, PickleIterator* iter, GURL* p) {
|
||||
bool ParamTraits<GURL>::Read(const Message* m,
|
||||
base::PickleIterator* iter,
|
||||
GURL* p) {
|
||||
std::string s;
|
||||
if (!iter->ReadString(&s) || s.length() > content::GetMaxURLChars()) {
|
||||
*p = GURL();
|
||||
@ -60,7 +62,7 @@ void ParamTraits<url::Origin>::Write(Message* m,
|
||||
}
|
||||
|
||||
bool ParamTraits<url::Origin>::Read(const Message* m,
|
||||
PickleIterator* iter,
|
||||
base::PickleIterator* iter,
|
||||
url::Origin* p) {
|
||||
std::string s;
|
||||
if (!iter->ReadString(&s)) {
|
||||
@ -81,7 +83,7 @@ void ParamTraits<net::HostPortPair>::Write(Message* m, const param_type& p) {
|
||||
}
|
||||
|
||||
bool ParamTraits<net::HostPortPair>::Read(const Message* m,
|
||||
PickleIterator* iter,
|
||||
base::PickleIterator* iter,
|
||||
param_type* r) {
|
||||
std::string host;
|
||||
uint16 port;
|
||||
@ -102,7 +104,8 @@ void ParamTraits<net::IPEndPoint>::Write(Message* m, const param_type& p) {
|
||||
WriteParam(m, p.port());
|
||||
}
|
||||
|
||||
bool ParamTraits<net::IPEndPoint>::Read(const Message* m, PickleIterator* iter,
|
||||
bool ParamTraits<net::IPEndPoint>::Read(const Message* m,
|
||||
base::PickleIterator* iter,
|
||||
param_type* p) {
|
||||
net::IPAddressNumber address;
|
||||
uint16 port;
|
||||
@ -126,8 +129,9 @@ void ParamTraits<content::PageState>::Write(
|
||||
WriteParam(m, p.ToEncodedData());
|
||||
}
|
||||
|
||||
bool ParamTraits<content::PageState>::Read(
|
||||
const Message* m, PickleIterator* iter, param_type* r) {
|
||||
bool ParamTraits<content::PageState>::Read(const Message* m,
|
||||
base::PickleIterator* iter,
|
||||
param_type* r) {
|
||||
std::string data;
|
||||
if (!ReadParam(m, iter, &data))
|
||||
return false;
|
||||
|
@ -92,7 +92,7 @@ bool BrowserPluginManager::OnControlMessageReceived(
|
||||
int browser_plugin_instance_id = browser_plugin::kInstanceIDNone;
|
||||
// All allowed messages must have |browser_plugin_instance_id| as their
|
||||
// first parameter.
|
||||
PickleIterator iter(message);
|
||||
base::PickleIterator iter(message);
|
||||
bool success = iter.ReadInt(&browser_plugin_instance_id);
|
||||
DCHECK(success);
|
||||
BrowserPlugin* plugin = GetBrowserPlugin(browser_plugin_instance_id);
|
||||
|
@ -32,7 +32,7 @@ void CacheStorageMessageFilter::OnFilteredMessageReceived(
|
||||
bool CacheStorageMessageFilter::GetWorkerThreadIdForMessage(
|
||||
const IPC::Message& msg,
|
||||
int* ipc_thread_id) {
|
||||
return PickleIterator(msg).ReadInt(ipc_thread_id);
|
||||
return base::PickleIterator(msg).ReadInt(ipc_thread_id);
|
||||
}
|
||||
|
||||
} // namespace content
|
||||
|
@ -22,7 +22,7 @@ int GetRequestId(const IPC::Message& msg) {
|
||||
int request_id = -1;
|
||||
switch (msg.type()) {
|
||||
case ResourceHostMsg_RequestResource::ID: {
|
||||
PickleIterator iter(msg);
|
||||
base::PickleIterator iter(msg);
|
||||
int routing_id = -1;
|
||||
if (!iter.ReadInt(&routing_id) || !iter.ReadInt(&request_id))
|
||||
NOTREACHED() << "Invalid id for resource request message.";
|
||||
@ -31,7 +31,7 @@ int GetRequestId(const IPC::Message& msg) {
|
||||
case ResourceHostMsg_DidChangePriority::ID:
|
||||
case ResourceHostMsg_ReleaseDownloadedFile::ID:
|
||||
case ResourceHostMsg_CancelRequest::ID:
|
||||
if (!PickleIterator(msg).ReadInt(&request_id))
|
||||
if (!base::PickleIterator(msg).ReadInt(&request_id))
|
||||
NOTREACHED() << "Invalid id for resource message.";
|
||||
break;
|
||||
|
||||
@ -172,7 +172,7 @@ class ResourceDispatchThrottlerTest : public testing::Test, public IPC::Sender {
|
||||
|
||||
int routing_id = -1;
|
||||
int request_id = -1;
|
||||
PickleIterator iter(*msg);
|
||||
base::PickleIterator iter(*msg);
|
||||
CHECK(IPC::ReadParam(msg, &iter, &routing_id));
|
||||
CHECK(IPC::ReadParam(msg, &iter, &request_id));
|
||||
return request_id;
|
||||
|
@ -35,7 +35,7 @@ void EmbeddedWorkerContextMessageFilter::OnFilteredMessageReceived(
|
||||
bool EmbeddedWorkerContextMessageFilter::GetWorkerThreadIdForMessage(
|
||||
const IPC::Message& msg,
|
||||
int* ipc_thread_id) {
|
||||
return PickleIterator(msg).ReadInt(ipc_thread_id);
|
||||
return base::PickleIterator(msg).ReadInt(ipc_thread_id);
|
||||
}
|
||||
|
||||
} // namespace content
|
||||
|
@ -195,8 +195,8 @@ bool Zygote::HandleRequestFromBrowser(int fd) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Pickle pickle(buf, len);
|
||||
PickleIterator iter(pickle);
|
||||
base::Pickle pickle(buf, len);
|
||||
base::PickleIterator iter(pickle);
|
||||
|
||||
int kind;
|
||||
if (iter.ReadInt(&kind)) {
|
||||
@ -236,8 +236,7 @@ bool Zygote::HandleRequestFromBrowser(int fd) {
|
||||
}
|
||||
|
||||
// TODO(jln): remove callers to this broken API. See crbug.com/274855.
|
||||
void Zygote::HandleReapRequest(int fd,
|
||||
PickleIterator iter) {
|
||||
void Zygote::HandleReapRequest(int fd, base::PickleIterator iter) {
|
||||
base::ProcessId child;
|
||||
|
||||
if (!iter.ReadInt(&child)) {
|
||||
@ -324,8 +323,7 @@ bool Zygote::GetTerminationStatus(base::ProcessHandle real_pid,
|
||||
return true;
|
||||
}
|
||||
|
||||
void Zygote::HandleGetTerminationStatus(int fd,
|
||||
PickleIterator iter) {
|
||||
void Zygote::HandleGetTerminationStatus(int fd, base::PickleIterator iter) {
|
||||
bool known_dead;
|
||||
base::ProcessHandle child_requested;
|
||||
|
||||
@ -348,7 +346,7 @@ void Zygote::HandleGetTerminationStatus(int fd,
|
||||
exit_code = RESULT_CODE_NORMAL_EXIT;
|
||||
}
|
||||
|
||||
Pickle write_pickle;
|
||||
base::Pickle write_pickle;
|
||||
write_pickle.WriteInt(static_cast<int>(status));
|
||||
write_pickle.WriteInt(exit_code);
|
||||
ssize_t written =
|
||||
@ -461,8 +459,8 @@ int Zygote::ForkWithRealPid(const std::string& process_type,
|
||||
CHECK_GT(len, 0);
|
||||
CHECK(recv_fds.empty());
|
||||
|
||||
Pickle pickle(buf, len);
|
||||
PickleIterator iter(pickle);
|
||||
base::Pickle pickle(buf, len);
|
||||
base::PickleIterator iter(pickle);
|
||||
|
||||
int kind;
|
||||
CHECK(iter.ReadInt(&kind));
|
||||
@ -503,7 +501,7 @@ int Zygote::ForkWithRealPid(const std::string& process_type,
|
||||
return real_pid;
|
||||
}
|
||||
|
||||
base::ProcessId Zygote::ReadArgsAndFork(PickleIterator iter,
|
||||
base::ProcessId Zygote::ReadArgsAndFork(base::PickleIterator iter,
|
||||
ScopedVector<base::ScopedFD> fds,
|
||||
std::string* uma_name,
|
||||
int* uma_sample,
|
||||
@ -589,7 +587,7 @@ base::ProcessId Zygote::ReadArgsAndFork(PickleIterator iter,
|
||||
}
|
||||
|
||||
bool Zygote::HandleForkRequest(int fd,
|
||||
PickleIterator iter,
|
||||
base::PickleIterator iter,
|
||||
ScopedVector<base::ScopedFD> fds) {
|
||||
std::string uma_name;
|
||||
int uma_sample;
|
||||
@ -605,7 +603,7 @@ bool Zygote::HandleForkRequest(int fd,
|
||||
&uma_name, &uma_sample, &uma_boundary_value);
|
||||
}
|
||||
// Must always send reply, as ZygoteHost blocks while waiting for it.
|
||||
Pickle reply_pickle;
|
||||
base::Pickle reply_pickle;
|
||||
reply_pickle.WriteInt(child_pid);
|
||||
reply_pickle.WriteString(uma_name);
|
||||
if (!uma_name.empty()) {
|
||||
@ -618,8 +616,7 @@ bool Zygote::HandleForkRequest(int fd,
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Zygote::HandleGetSandboxStatus(int fd,
|
||||
PickleIterator iter) {
|
||||
bool Zygote::HandleGetSandboxStatus(int fd, base::PickleIterator iter) {
|
||||
if (HANDLE_EINTR(write(fd, &sandbox_flags_, sizeof(sandbox_flags_))) !=
|
||||
sizeof(sandbox_flags_)) {
|
||||
PLOG(ERROR) << "write";
|
||||
|
@ -93,7 +93,7 @@ void RunTwoClosures(const base::Closure* first, const base::Closure* second) {
|
||||
static void ProxyLocaltimeCallToBrowser(time_t input, struct tm* output,
|
||||
char* timezone_out,
|
||||
size_t timezone_out_len) {
|
||||
Pickle request;
|
||||
base::Pickle request;
|
||||
request.WriteInt(LinuxSandbox::METHOD_LOCALTIME);
|
||||
request.WriteString(
|
||||
std::string(reinterpret_cast<char*>(&input), sizeof(input)));
|
||||
@ -106,8 +106,8 @@ static void ProxyLocaltimeCallToBrowser(time_t input, struct tm* output,
|
||||
return;
|
||||
}
|
||||
|
||||
Pickle reply(reinterpret_cast<char*>(reply_buf), r);
|
||||
PickleIterator iter(reply);
|
||||
base::Pickle reply(reinterpret_cast<char*>(reply_buf), r);
|
||||
base::PickleIterator iter(reply);
|
||||
std::string result, timezone;
|
||||
if (!iter.ReadString(&result) ||
|
||||
!iter.ReadString(&timezone) ||
|
||||
|
@ -35,14 +35,14 @@ class SecureHashSHA256NSS : public SecureHash {
|
||||
static_cast<unsigned int>(len));
|
||||
}
|
||||
|
||||
bool Serialize(Pickle* pickle) override;
|
||||
bool Deserialize(PickleIterator* data_iterator) override;
|
||||
bool Serialize(base::Pickle* pickle) override;
|
||||
bool Deserialize(base::PickleIterator* data_iterator) override;
|
||||
|
||||
private:
|
||||
SHA256Context ctx_;
|
||||
};
|
||||
|
||||
bool SecureHashSHA256NSS::Serialize(Pickle* pickle) {
|
||||
bool SecureHashSHA256NSS::Serialize(base::Pickle* pickle) {
|
||||
if (!pickle)
|
||||
return false;
|
||||
|
||||
@ -55,7 +55,7 @@ bool SecureHashSHA256NSS::Serialize(Pickle* pickle) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SecureHashSHA256NSS::Deserialize(PickleIterator* data_iterator) {
|
||||
bool SecureHashSHA256NSS::Deserialize(base::PickleIterator* data_iterator) {
|
||||
int version;
|
||||
if (!data_iterator->ReadInt(&version))
|
||||
return false;
|
||||
|
@ -40,14 +40,14 @@ class SecureHashSHA256OpenSSL : public SecureHash {
|
||||
SHA256_Final(result.safe_buffer(), &ctx_);
|
||||
}
|
||||
|
||||
bool Serialize(Pickle* pickle) override;
|
||||
bool Deserialize(PickleIterator* data_iterator) override;
|
||||
bool Serialize(base::Pickle* pickle) override;
|
||||
bool Deserialize(base::PickleIterator* data_iterator) override;
|
||||
|
||||
private:
|
||||
SHA256_CTX ctx_;
|
||||
};
|
||||
|
||||
bool SecureHashSHA256OpenSSL::Serialize(Pickle* pickle) {
|
||||
bool SecureHashSHA256OpenSSL::Serialize(base::Pickle* pickle) {
|
||||
if (!pickle)
|
||||
return false;
|
||||
|
||||
@ -60,7 +60,7 @@ bool SecureHashSHA256OpenSSL::Serialize(Pickle* pickle) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SecureHashSHA256OpenSSL::Deserialize(PickleIterator* data_iterator) {
|
||||
bool SecureHashSHA256OpenSSL::Deserialize(base::PickleIterator* data_iterator) {
|
||||
if (!data_iterator)
|
||||
return false;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user