diff options
author | brettw <brettw@chromium.org> | 2015-06-02 21:29:25 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-03 04:30:27 +0000 |
commit | bd4d71128239a38fa844c42e4110458109a8b135 (patch) | |
tree | 47ff0ad11b9270fb410d93632fd63a0c78218176 | |
parent | 6f89d8f965bae07a352ee82abe1fb551f65d65e1 (diff) | |
download | chromium_src-bd4d71128239a38fa844c42e4110458109a8b135.zip chromium_src-bd4d71128239a38fa844c42e4110458109a8b135.tar.gz chromium_src-bd4d71128239a38fa844c42e4110458109a8b135.tar.bz2 |
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}
190 files changed, 986 insertions, 841 deletions
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc index c7af67f..30c243e 100644 --- a/android_webview/native/aw_contents.cc +++ b/android_webview/native/aw_contents.cc @@ -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()); } diff --git a/android_webview/native/state_serializer.cc b/android_webview/native/state_serializer.cc index b969883..50dfd34 100644 --- a/android_webview/native/state_serializer.cc +++ b/android_webview/native/state_serializer.cc @@ -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; diff --git a/android_webview/native/state_serializer_unittest.cc b/android_webview/native/state_serializer_unittest.cc index 27b7e51..fd897d4 100644 --- a/android_webview/native/state_serializer_unittest.cc +++ b/android_webview/native/state_serializer_unittest.cc @@ -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); diff --git a/chrome/browser/android/tab_state.cc b/chrome/browser/android/tab_state.cc index 5e01566..f22255a 100644 --- a/chrome/browser/android/tab_state.cc +++ b/chrome/browser/android/tab_state.cc @@ -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; diff --git a/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc b/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc index f4d2092..ae7acdb 100644 --- a/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc +++ b/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc @@ -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; diff --git a/chrome/browser/extensions/api/page_capture/page_capture_api.cc b/chrome/browser/extensions/api/page_capture/page_capture_api.cc index 68c81f6..e0f6b3d 100644 --- a/chrome/browser/extensions/api/page_capture/page_capture_api.cc +++ b/chrome/browser/extensions/api/page_capture/page_capture_api.cc @@ -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; diff --git a/chrome/browser/extensions/extension_action.cc b/chrome/browser/extensions/extension_action.cc index f1c1c54..312633d 100644 --- a/chrome/browser/extensions/extension_action.cc +++ b/chrome/browser/extensions/extension_action.cc @@ -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; diff --git a/chrome/browser/media/webrtc_log_uploader.cc b/chrome/browser/media/webrtc_log_uploader.cc index b7e96e6..c72f817 100644 --- a/chrome/browser/media/webrtc_log_uploader.cc +++ b/chrome/browser/media/webrtc_log_uploader.cc @@ -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); diff --git a/chrome/browser/password_manager/native_backend_kwallet_x.cc b/chrome/browser/password_manager/native_backend_kwallet_x.cc index 85ac9c7..12536ed 100644 --- a/chrome/browser/password_manager/native_backend_kwallet_x.cc +++ b/chrome/browser/password_manager/native_backend_kwallet_x.cc @@ -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) || diff --git a/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc b/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc index 297a765..9c3a37c 100644 --- a/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc +++ b/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc @@ -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); diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc b/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc index 4499b21..fdc054f 100644 --- a/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc +++ b/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc @@ -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()); diff --git a/chrome/browser/safe_browsing/malware_details_unittest.cc b/chrome/browser/safe_browsing/malware_details_unittest.cc index 82110dc..83f4513 100644 --- a/chrome/browser/safe_browsing/malware_details_unittest.cc +++ b/chrome/browser/safe_browsing/malware_details_unittest.cc @@ -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( diff --git a/chrome/browser/ui/app_list/fast_show_pickler.cc b/chrome/browser/ui/app_list/fast_show_pickler.cc index 8221926..a9d0835 100644 --- a/chrome/browser/ui/app_list/fast_show_pickler.cc +++ b/chrome/browser/ui/app_list/fast_show_pickler.cc @@ -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>(); diff --git a/chrome/browser/ui/app_list/test/fast_show_pickler_unittest.cc b/chrome/browser/ui/app_list/test/fast_show_pickler_unittest.cc index 03a4840..678742f 100644 --- a/chrome/browser/ui/app_list/test/fast_show_pickler_unittest.cc +++ b/chrome/browser/ui/app_list/test/fast_show_pickler_unittest.cc @@ -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()); } diff --git a/chrome/browser/ui/views/extensions/browser_action_drag_data.cc b/chrome/browser/ui/views/extensions/browser_action_drag_data.cc index ce98094..82f62c5 100644 --- a/chrome/browser/ui/views/extensions/browser_action_drag_data.cc +++ b/chrome/browser/ui/views/extensions/browser_action_drag_data.cc @@ -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_))) diff --git a/chrome/common/content_settings_pattern_serializer.cc b/chrome/common/content_settings_pattern_serializer.cc index 612a96e..af36d567 100644 --- a/chrome/common/content_settings_pattern_serializer.cc +++ b/chrome/common/content_settings_pattern_serializer.cc @@ -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_) && diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc index dd81496..1573a2c 100644 --- a/chrome/common/render_messages.cc +++ b/chrome/common/render_messages.cc @@ -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); } diff --git a/chrome/common/safe_browsing/ipc_protobuf_message_unittest.cc b/chrome/common/safe_browsing/ipc_protobuf_message_unittest.cc index 0e9f4c9..d2fda1f 100644 --- a/chrome/common/safe_browsing/ipc_protobuf_message_unittest.cc +++ b/chrome/common/safe_browsing/ipc_protobuf_message_unittest.cc @@ -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_) { diff --git a/chromecast/common/media/cma_param_traits.cc b/chromecast/common/media/cma_param_traits.cc index 33accb0..2bb9a26 100644 --- a/chromecast/common/media/cma_param_traits.cc +++ b/chromecast/common/media/cma_param_traits.cc @@ -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; diff --git a/cloud_print/service/win/setup_listener.cc b/cloud_print/service/win/setup_listener.cc index be8cb67..57c3a15 100644 --- a/cloud_print/service/win/setup_listener.cc +++ b/cloud_print/service/win/setup_listener.cc @@ -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; diff --git a/components/autofill/core/common/form_data.cc b/components/autofill/core/common/form_data.cc index 8bfb352..3691b6a 100644 --- a/components/autofill/core/common/form_data.cc +++ b/components/autofill/core/common/form_data.cc @@ -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); } diff --git a/components/autofill/core/common/form_data_unittest.cc b/components/autofill/core/common/form_data_unittest.cc index 01e99c5..e2faaf1 100644 --- a/components/autofill/core/common/form_data_unittest.cc +++ b/components/autofill/core/common/form_data_unittest.cc @@ -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)); diff --git a/components/autofill/core/common/form_field_data.cc b/components/autofill/core/common/form_field_data.cc index e82472e..1ae3446 100644 --- a/components/autofill/core/common/form_field_data.cc +++ b/components/autofill/core/common/form_field_data.cc @@ -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; diff --git a/components/autofill/core/common/form_field_data_unittest.cc b/components/autofill/core/common/form_field_data_unittest.cc index 8d77d2c..dc17277 100644 --- a/components/autofill/core/common/form_field_data_unittest.cc +++ b/components/autofill/core/common/form_field_data_unittest.cc @@ -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)); diff --git a/components/bookmarks/browser/bookmark_node_data.cc b/components/bookmarks/browser/bookmark_node_data.cc index a781516..36b1bdd 100644 --- a/components/bookmarks/browser/bookmark_node_data.cc +++ b/components/bookmarks/browser/bookmark_node_data.cc @@ -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)) { diff --git a/components/bookmarks/browser/bookmark_node_data_views.cc b/components/bookmarks/browser/bookmark_node_data_views.cc index 809113d..efd2733 100644 --- a/components/bookmarks/browser/bookmark_node_data_views.cc +++ b/components/bookmarks/browser/bookmark_node_data_views.cc @@ -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; diff --git a/components/nacl/browser/nacl_browser.cc b/components/nacl/browser/nacl_browser.cc index 12e759c..3e69458 100644 --- a/components/nacl/browser/nacl_browser.cc +++ b/components/nacl/browser/nacl_browser.cc @@ -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 diff --git a/components/nacl/browser/nacl_validation_cache.cc b/components/nacl/browser/nacl_validation_cache.cc index 574d818..e956cb1 100644 --- a/components/nacl/browser/nacl_validation_cache.cc +++ b/components/nacl/browser/nacl_validation_cache.cc @@ -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; diff --git a/components/nacl/browser/nacl_validation_cache_unittest.cc b/components/nacl/browser/nacl_validation_cache_unittest.cc index 945db2f..00378d0 100644 --- a/components/nacl/browser/nacl_validation_cache_unittest.cc +++ b/components/nacl/browser/nacl_validation_cache_unittest.cc @@ -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()); } diff --git a/components/nacl/loader/nacl_helper_linux.cc b/components/nacl/loader/nacl_helper_linux.cc index ac7648f..5b92b5c 100644 --- a/components/nacl/loader/nacl_helper_linux.cc +++ b/components/nacl/loader/nacl_helper_linux.cc @@ -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"; diff --git a/components/nacl/loader/nacl_ipc_adapter.cc b/components/nacl/loader/nacl_ipc_adapter.cc index 8e402e1..a9ea0b8 100644 --- a/components/nacl/loader/nacl_ipc_adapter.cc +++ b/components/nacl/loader/nacl_ipc_adapter.cc @@ -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 diff --git a/components/nacl/zygote/nacl_fork_delegate_linux.cc b/components/nacl/zygote/nacl_fork_delegate_linux.cc index 820ac09..12d265c 100644 --- a/components/nacl/zygote/nacl_fork_delegate_linux.cc +++ b/components/nacl/zygote/nacl_fork_delegate_linux.cc @@ -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 || diff --git a/components/network_hints/common/network_hints_messages.cc b/components/network_hints/common/network_hints_messages.cc index e97e1a2..82eaf6e 100644 --- a/components/network_hints/common/network_hints_messages.cc +++ b/components/network_hints/common/network_hints_messages.cc @@ -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)) { diff --git a/components/password_manager/core/browser/login_database.cc b/components/password_manager/core/browser/login_database.cc index 91c71d0..9039b8c 100644 --- a/components/password_manager/core/browser/login_database.cc +++ b/components/password_manager/core/browser/login_database.cc @@ -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 = diff --git a/components/password_manager/core/browser/login_database_unittest.cc b/components/password_manager/core/browser/login_database_unittest.cc index b47b92d..fd11d08 100644 --- a/components/password_manager/core/browser/login_database_unittest.cc +++ b/components/password_manager/core/browser/login_database_unittest.cc @@ -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)); diff --git a/components/sessions/base_session_service_commands.cc b/components/sessions/base_session_service_commands.cc index 09eab43..e8aaeec 100644 --- a/components/sessions/base_session_service_commands.cc +++ b/components/sessions/base_session_service_commands.cc @@ -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); } diff --git a/components/sessions/serialized_navigation_entry.cc b/components/sessions/serialized_navigation_entry.cc index 929c72f..e630c19 100644 --- a/components/sessions/serialized_navigation_entry.cc +++ b/components/sessions/serialized_navigation_entry.cc @@ -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; diff --git a/components/sessions/serialized_navigation_entry_unittest.cc b/components/sessions/serialized_navigation_entry_unittest.cc index ac6ae54..417601e 100644 --- a/components/sessions/serialized_navigation_entry_unittest.cc +++ b/components/sessions/serialized_navigation_entry_unittest.cc @@ -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. diff --git a/components/sessions/session_command.cc b/components/sessions/session_command.cc index 59fc6fc..a7cd59d 100644 --- a/components/sessions/session_command.cc +++ b/components/sessions/session_command.cc @@ -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 diff --git a/components/sessions/session_service_commands.cc b/components/sessions/session_service_commands.cc index a7f653d..60be71c 100644 --- a/components/sessions/session_service_commands.cc +++ b/components/sessions/session_service_commands.cc @@ -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; diff --git a/components/visitedlink/test/visitedlink_unittest.cc b/components/visitedlink/test/visitedlink_unittest.cc index 81d62ae..1b0454d 100644 --- a/components/visitedlink/test/visitedlink_unittest.cc +++ b/components/visitedlink/test/visitedlink_unittest.cc @@ -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()); diff --git a/content/browser/android/java/gin_java_bridge_dispatcher_host.cc b/content/browser/android/java/gin_java_bridge_dispatcher_host.cc index fc4c55e..69a08b43 100644 --- a/content/browser/android/java/gin_java_bridge_dispatcher_host.cc +++ b/content/browser/android/java/gin_java_bridge_dispatcher_host.cc @@ -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; diff --git a/content/browser/appcache/appcache_response.cc b/content/browser/appcache/appcache_response.cc index 0c0f4bf..66ec22e 100644 --- a/content/browser/appcache/appcache_response.cc +++ b/content/browser/appcache/appcache_response.cc @@ -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 diff --git a/content/browser/appcache/appcache_response_unittest.cc b/content/browser/appcache/appcache_response_unittest.cc index 5f91f92..f5eb417 100644 --- a/content/browser/appcache/appcache_response_unittest.cc +++ b/content/browser/appcache/appcache_response_unittest.cc @@ -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); diff --git a/content/browser/appcache/appcache_service_unittest.cc b/content/browser/appcache/appcache_service_unittest.cc index b3532f5..4159245 100644 --- a/content/browser/appcache/appcache_service_unittest.cc +++ b/content/browser/appcache/appcache_service_unittest.cc @@ -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); diff --git a/content/browser/appcache/appcache_url_request_job_unittest.cc b/content/browser/appcache/appcache_url_request_job_unittest.cc index bd5ff7a..fdd1c9b 100644 --- a/content/browser/appcache/appcache_url_request_job_unittest.cc +++ b/content/browser/appcache/appcache_url_request_job_unittest.cc @@ -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); diff --git a/content/browser/browser_plugin/browser_plugin_message_filter.cc b/content/browser/browser_plugin/browser_plugin_message_filter.cc index c04114d..2e63f03 100644 --- a/content/browser/browser_plugin/browser_plugin_message_filter.cc +++ b/content/browser/browser_plugin/browser_plugin_message_filter.cc @@ -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); diff --git a/content/browser/download/base_file.cc b/content/browser/download/base_file.cc index 62ffe57..f9b8015 100644 --- a/content/browser/download/base_file.cc +++ b/content/browser/download/base_file.cc @@ -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(); diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc index eca4290..73d22c6 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc @@ -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)) diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc index c49cb3c..2648ea6 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.cc +++ b/content/browser/loader/resource_dispatcher_host_impl.cc @@ -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); diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc index 9db7d37..c3b4eca 100644 --- a/content/browser/loader/resource_dispatcher_host_unittest.cc +++ b/content/browser/loader/resource_dispatcher_host_unittest.cc @@ -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)); diff --git a/content/browser/loader/resource_scheduler_filter.cc b/content/browser/loader/resource_scheduler_filter.cc index b9f240d..2777eaa 100644 --- a/content/browser/loader/resource_scheduler_filter.cc +++ b/content/browser/loader/resource_scheduler_filter.cc @@ -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)) { diff --git a/content/browser/renderer_host/clipboard_message_filter.cc b/content/browser/renderer_host/clipboard_message_filter.cc index 88e24d9..e270b7c 100644 --- a/content/browser/renderer_host/clipboard_message_filter.cc +++ b/content/browser/renderer_host/clipboard_message_filter.cc @@ -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()); diff --git a/content/browser/renderer_host/input/input_router_impl_unittest.cc b/content/browser/renderer_host/input/input_router_impl_unittest.cc index 2332cbf..918c260 100644 --- a/content/browser/renderer_host/input/input_router_impl_unittest.cc +++ b/content/browser/renderer_host/input/input_router_impl_unittest.cc @@ -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)) diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc index ad581ac..fc691c7 100644 --- a/content/browser/renderer_host/render_widget_host_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_unittest.cc @@ -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)) diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc index de4cf01..839c35f 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc @@ -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)) diff --git a/content/browser/renderer_host/sandbox_ipc_linux.cc b/content/browser/renderer_host/sandbox_ipc_linux.cc index 0c073bf..966f350 100644 --- a/content/browser/renderer_host/sandbox_ipc_linux.cc +++ b/content/browser/renderer_host/sandbox_ipc_linux.cc @@ -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)); diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc index 705fbb9..258a128 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc @@ -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)) diff --git a/content/browser/web_contents/web_drag_source_mac.mm b/content/browser/web_contents/web_drag_source_mac.mm index 57e12a0..e6e8595 100644 --- a/content/browser/web_contents/web_drag_source_mac.mm +++ b/content/browser/web_contents/web_drag_source_mac.mm @@ -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]; diff --git a/content/browser/zygote_host/zygote_host_impl_linux.cc b/content/browser/zygote_host/zygote_host_impl_linux.cc index 3e8cf7e..3036982 100644 --- a/content/browser/zygote_host/zygote_host_impl_linux.cc +++ b/content/browser/zygote_host/zygote_host_impl_linux.cc @@ -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."; diff --git a/content/child/bluetooth/bluetooth_message_filter.cc b/content/child/bluetooth/bluetooth_message_filter.cc index 554e3c3..45b8da6 100644 --- a/content/child/bluetooth/bluetooth_message_filter.cc +++ b/content/child/bluetooth/bluetooth_message_filter.cc @@ -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 diff --git a/content/child/geofencing/geofencing_message_filter.cc b/content/child/geofencing/geofencing_message_filter.cc index a866b37..b30645c 100644 --- a/content/child/geofencing/geofencing_message_filter.cc +++ b/content/child/geofencing/geofencing_message_filter.cc @@ -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 diff --git a/content/child/indexed_db/indexed_db_message_filter.cc b/content/child/indexed_db/indexed_db_message_filter.cc index 60c1bea..b0d0396 100644 --- a/content/child/indexed_db/indexed_db_message_filter.cc +++ b/content/child/indexed_db/indexed_db_message_filter.cc @@ -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) { diff --git a/content/child/navigator_connect/navigator_connect_dispatcher.cc b/content/child/navigator_connect/navigator_connect_dispatcher.cc index 1a30433..ee5bc3e 100644 --- a/content/child/navigator_connect/navigator_connect_dispatcher.cc +++ b/content/child/navigator_connect/navigator_connect_dispatcher.cc @@ -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 diff --git a/content/child/notifications/notification_dispatcher.cc b/content/child/notifications/notification_dispatcher.cc index e99ddc4..1c6fb54 100644 --- a/content/child/notifications/notification_dispatcher.cc +++ b/content/child/notifications/notification_dispatcher.cc @@ -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_); diff --git a/content/child/npapi/npruntime_util.cc b/content/child/npapi/npruntime_util.cc index da2f42c..f3edb9bd 100644 --- a/content/child/npapi/npruntime_util.cc +++ b/content/child/npapi/npruntime_util.cc @@ -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)) diff --git a/content/child/plugin_param_traits.cc b/content/child/plugin_param_traits.cc index 27b21dd..903936a 100644 --- a/content/child/plugin_param_traits.cc +++ b/content/child/plugin_param_traits.cc @@ -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); } diff --git a/content/child/push_messaging/push_dispatcher.cc b/content/child/push_messaging/push_dispatcher.cc index 4303443..8d49c12 100644 --- a/content/child/push_messaging/push_dispatcher.cc +++ b/content/child/push_messaging/push_dispatcher.cc @@ -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_); diff --git a/content/child/quota_message_filter.cc b/content/child/quota_message_filter.cc index e9290e4..e196ebd 100644 --- a/content/child/quota_message_filter.cc +++ b/content/child/quota_message_filter.cc @@ -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_); diff --git a/content/child/resource_dispatcher.cc b/content/child/resource_dispatcher.cc index 10bf13c7..59e54f4 100644 --- a/content/child/resource_dispatcher.cc +++ b/content/child/resource_dispatcher.cc @@ -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"; diff --git a/content/child/service_worker/service_worker_message_filter.cc b/content/child/service_worker/service_worker_message_filter.cc index 3568ad7..9966e41 100644 --- a/content/child/service_worker/service_worker_message_filter.cc +++ b/content/child/service_worker/service_worker_message_filter.cc @@ -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( diff --git a/content/child/threaded_data_provider.cc b/content/child/threaded_data_provider.cc index 4dbcb38..e5ef835 100644 --- a/content/child/threaded_data_provider.cc +++ b/content/child/threaded_data_provider.cc @@ -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; diff --git a/content/common/android/gin_java_bridge_value.cc b/content/common/android/gin_java_bridge_value.cc index 465383c..b9de5f9 100644 --- a/content/common/android/gin_java_bridge_value.cc +++ b/content/common/android/gin_java_bridge_value.cc @@ -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; diff --git a/content/common/cc_messages.cc b/content/common/cc_messages.cc index bf8413c..fc5aed9 100644 --- a/content/common/cc_messages.cc +++ b/content/common/cc_messages.cc @@ -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; diff --git a/content/common/cc_messages_unittest.cc b/content/common/cc_messages_unittest.cc index 4ebaebb..8ba443d 100644 --- a/content/common/cc_messages_unittest.cc +++ b/content/common/cc_messages_unittest.cc @@ -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)); diff --git a/content/common/child_process_sandbox_support_impl_linux.cc b/content/common/child_process_sandbox_support_impl_linux.cc index 464a2e0..cecd833 100644 --- a/content/common/child_process_sandbox_support_impl_linux.cc +++ b/content/common/child_process_sandbox_support_impl_linux.cc @@ -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); diff --git a/content/common/child_process_sandbox_support_impl_shm_linux.cc b/content/common/child_process_sandbox_support_impl_shm_linux.cc index 4c05742..1553826 100644 --- a/content/common/child_process_sandbox_support_impl_shm_linux.cc +++ b/content/common/child_process_sandbox_support_impl_shm_linux.cc @@ -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); diff --git a/content/common/common_param_traits_unittest.cc b/content/common/common_param_traits_unittest.cc index 0f810db..aefab1c 100644 --- a/content/common/common_param_traits_unittest.cc +++ b/content/common/common_param_traits_unittest.cc @@ -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()); diff --git a/content/common/content_param_traits.cc b/content/common/content_param_traits.cc index 8faf97c..2924d61 100644 --- a/content/common/content_param_traits.cc +++ b/content/common/content_param_traits.cc @@ -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; diff --git a/content/common/cursors/webcursor.cc b/content/common/cursors/webcursor.cc index 85721fd..6bc3f3e 100644 --- a/content/common/cursors/webcursor.cc +++ b/content/common/cursors/webcursor.cc @@ -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()) || diff --git a/content/common/font_config_ipc_linux.cc b/content/common/font_config_ipc_linux.cc index 342202b..7d2ac24 100644 --- a/content/common/font_config_ipc_linux.cc +++ b/content/common/font_config_ipc_linux.cc @@ -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); diff --git a/content/common/gamepad_param_traits.cc b/content/common/gamepad_param_traits.cc index cc60d7c..cbc7e6a 100644 --- a/content/common/gamepad_param_traits.cc +++ b/content/common/gamepad_param_traits.cc @@ -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)) diff --git a/content/common/indexed_db/indexed_db_param_traits.cc b/content/common/indexed_db/indexed_db_param_traits.cc index 4e52946..9ca0cec 100644 --- a/content/common/indexed_db/indexed_db_param_traits.cc +++ b/content/common/indexed_db/indexed_db_param_traits.cc @@ -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)) diff --git a/content/common/input/input_param_traits.cc b/content/common/input/input_param_traits.cc index 1f4b7e4..b0d079f 100644 --- a/content/common/input/input_param_traits.cc +++ b/content/common/input/input_param_traits.cc @@ -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; diff --git a/content/common/input/input_param_traits_unittest.cc b/content/common/input/input_param_traits_unittest.cc index b70b19c..f40152f 100644 --- a/content/common/input/input_param_traits_unittest.cc +++ b/content/common/input/input_param_traits_unittest.cc @@ -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)); } diff --git a/content/common/mac/attributed_string_coder.mm b/content/common/mac/attributed_string_coder.mm index ed377bb..edbb0ae 100644 --- a/content/common/mac/attributed_string_coder.mm +++ b/content/common/mac/attributed_string_coder.mm @@ -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; diff --git a/content/common/media/media_param_traits.cc b/content/common/media/media_param_traits.cc index a9606ce..280d908 100644 --- a/content/common/media/media_param_traits.cc +++ b/content/common/media/media_param_traits.cc @@ -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) || diff --git a/content/common/page_state_serialization.cc b/content/common/page_state_serialization.cc index 77e2abf..b40b457 100644 --- a/content/common/page_state_serialization.cc +++ b/content/common/page_state_serialization.cc @@ -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; }; diff --git a/content/common/page_state_serialization_unittest.cc b/content/common/page_state_serialization_unittest.cc index 9f58c76..abb2a39 100644 --- a/content/common/page_state_serialization_unittest.cc +++ b/content/common/page_state_serialization_unittest.cc @@ -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. diff --git a/content/common/resource_messages.cc b/content/common/resource_messages.cc index 6fcda2ab..2f86ae2 100644 --- a/content/common/resource_messages.cc +++ b/content/common/resource_messages.cc @@ -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)) diff --git a/content/common/ssl_status_serialization.cc b/content/common/ssl_status_serialization.cc index 0e2e4d2..71dba9e 100644 --- a/content/common/ssl_status_serialization.cc +++ b/content/common/ssl_status_serialization.cc @@ -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) || diff --git a/content/public/common/common_param_traits.cc b/content/public/common/common_param_traits.cc index 7ed8236..7347160 100644 --- a/content/public/common/common_param_traits.cc +++ b/content/public/common/common_param_traits.cc @@ -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; diff --git a/content/renderer/browser_plugin/browser_plugin_manager.cc b/content/renderer/browser_plugin/browser_plugin_manager.cc index a95c310..186d6bf6 100644 --- a/content/renderer/browser_plugin/browser_plugin_manager.cc +++ b/content/renderer/browser_plugin/browser_plugin_manager.cc @@ -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); diff --git a/content/renderer/cache_storage/cache_storage_message_filter.cc b/content/renderer/cache_storage/cache_storage_message_filter.cc index e4d4835..5f7fad4 100644 --- a/content/renderer/cache_storage/cache_storage_message_filter.cc +++ b/content/renderer/cache_storage/cache_storage_message_filter.cc @@ -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 diff --git a/content/renderer/scheduler/resource_dispatch_throttler_unittest.cc b/content/renderer/scheduler/resource_dispatch_throttler_unittest.cc index 8b9dc14..296c28a 100644 --- a/content/renderer/scheduler/resource_dispatch_throttler_unittest.cc +++ b/content/renderer/scheduler/resource_dispatch_throttler_unittest.cc @@ -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; diff --git a/content/renderer/service_worker/embedded_worker_context_message_filter.cc b/content/renderer/service_worker/embedded_worker_context_message_filter.cc index 4ecaa17..03120e1 100644 --- a/content/renderer/service_worker/embedded_worker_context_message_filter.cc +++ b/content/renderer/service_worker/embedded_worker_context_message_filter.cc @@ -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 diff --git a/content/zygote/zygote_linux.cc b/content/zygote/zygote_linux.cc index d4bf8c0..59a14c1 100644 --- a/content/zygote/zygote_linux.cc +++ b/content/zygote/zygote_linux.cc @@ -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"; diff --git a/content/zygote/zygote_main_linux.cc b/content/zygote/zygote_main_linux.cc index 5982f05..6562dc3 100644 --- a/content/zygote/zygote_main_linux.cc +++ b/content/zygote/zygote_main_linux.cc @@ -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) || diff --git a/crypto/secure_hash_default.cc b/crypto/secure_hash_default.cc index 262beb7..739b402 100644 --- a/crypto/secure_hash_default.cc +++ b/crypto/secure_hash_default.cc @@ -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; diff --git a/crypto/secure_hash_openssl.cc b/crypto/secure_hash_openssl.cc index ee1993c..1033b8e 100644 --- a/crypto/secure_hash_openssl.cc +++ b/crypto/secure_hash_openssl.cc @@ -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; diff --git a/crypto/secure_hash_unittest.cc b/crypto/secure_hash_unittest.cc index c21c365..facf476 100644 --- a/crypto/secure_hash_unittest.cc +++ b/crypto/secure_hash_unittest.cc @@ -53,7 +53,7 @@ TEST(SecureHashTest, TestSerialization) { crypto::SecureHash::SHA256)); scoped_ptr<crypto::SecureHash> ctx2(crypto::SecureHash::Create( crypto::SecureHash::SHA256)); - Pickle pickle; + base::Pickle pickle; ctx1->Update(input1.data(), input1.size()); ctx1->Update(input2.data(), input2.size()); ctx1->Update(input3.data(), input3.size()); @@ -64,7 +64,7 @@ TEST(SecureHashTest, TestSerialization) { ctx1->Finish(output1, sizeof(output1)); - PickleIterator data_iterator(pickle); + base::PickleIterator data_iterator(pickle); EXPECT_TRUE(ctx2->Deserialize(&data_iterator)); ctx2->Update(input4.data(), input4.size()); ctx2->Update(input5.data(), input5.size()); diff --git a/extensions/browser/sandboxed_unpacker.cc b/extensions/browser/sandboxed_unpacker.cc index 38a7cd9a..8b17160 100644 --- a/extensions/browser/sandboxed_unpacker.cc +++ b/extensions/browser/sandboxed_unpacker.cc @@ -190,7 +190,7 @@ bool ReadImagesFromFile(const base::FilePath& extension_path, return false; IPC::Message pickle(file_str.data(), file_str.size()); - PickleIterator iter(pickle); + base::PickleIterator iter(pickle); return IPC::ReadParam(&pickle, &iter, images); } @@ -206,7 +206,7 @@ bool ReadMessageCatalogsFromFile(const base::FilePath& extension_path, return false; IPC::Message pickle(file_str.data(), file_str.size()); - PickleIterator iter(pickle); + base::PickleIterator iter(pickle); return IPC::ReadParam(&pickle, &iter, catalogs); } diff --git a/extensions/browser/script_executor.cc b/extensions/browser/script_executor.cc index 0502d89..6161f3c 100644 --- a/extensions/browser/script_executor.cc +++ b/extensions/browser/script_executor.cc @@ -73,7 +73,7 @@ class Handler : public content::WebContentsObserver { return false; int message_request_id; - PickleIterator iter(message); + base::PickleIterator iter(message); CHECK(iter.ReadInt(&message_request_id)); if (message_request_id != main_request_id_ && diff --git a/extensions/browser/user_script_loader.cc b/extensions/browser/user_script_loader.cc index 4407093..047080a 100644 --- a/extensions/browser/user_script_loader.cc +++ b/extensions/browser/user_script_loader.cc @@ -275,7 +275,7 @@ void UserScriptLoader::StartLoad() { // static scoped_ptr<base::SharedMemory> UserScriptLoader::Serialize( const UserScriptList& scripts) { - Pickle pickle; + base::Pickle pickle; pickle.WriteSizeT(scripts.size()); for (const UserScript& script : scripts) { // TODO(aa): This can be replaced by sending content script metadata to diff --git a/extensions/common/api/sockets/sockets_manifest_permission_unittest.cc b/extensions/common/api/sockets/sockets_manifest_permission_unittest.cc index 419ddd7..4b2dbcf 100644 --- a/extensions/common/api/sockets/sockets_manifest_permission_unittest.cc +++ b/extensions/common/api/sockets/sockets_manifest_permission_unittest.cc @@ -194,7 +194,7 @@ TEST(SocketsManifestPermissionTest, Empty) { IPC::Message m; ipc_perm->Write(&m); - PickleIterator iter(m); + base::PickleIterator iter(m); EXPECT_TRUE(ipc_perm2->Read(&m, &iter)); AssertEmptyPermission(ipc_perm2.get()); } @@ -399,7 +399,7 @@ TEST(SocketsManifestPermissionTest, IPC) { IPC::Message m; ipc_perm->Write(&m); - PickleIterator iter(m); + base::PickleIterator iter(m); EXPECT_TRUE(ipc_perm2->Read(&m, &iter)); EXPECT_TRUE(permission->Equal(ipc_perm2.get())); } diff --git a/extensions/common/extension_messages.cc b/extensions/common/extension_messages.cc index e7fdb51..42e25f4 100644 --- a/extensions/common/extension_messages.cc +++ b/extensions/common/extension_messages.cc @@ -95,7 +95,9 @@ struct ParamTraits<Manifest::Location> { int val = static_cast<int>(p); WriteParam(m, val); } - static bool Read(const Message* m, PickleIterator* iter, param_type* p) { + static bool Read(const Message* m, + base::PickleIterator* iter, + param_type* p) { int val = 0; if (!ReadParam(m, iter, &val) || val < Manifest::INVALID_LOCATION || @@ -114,7 +116,8 @@ void ParamTraits<URLPattern>::Write(Message* m, const param_type& p) { WriteParam(m, p.GetAsString()); } -bool ParamTraits<URLPattern>::Read(const Message* m, PickleIterator* iter, +bool ParamTraits<URLPattern>::Read(const Message* m, + base::PickleIterator* iter, param_type* p) { int valid_schemes; std::string spec; @@ -141,8 +144,9 @@ void ParamTraits<URLPatternSet>::Write(Message* m, const param_type& p) { WriteParam(m, p.patterns()); } -bool ParamTraits<URLPatternSet>::Read(const Message* m, PickleIterator* iter, - param_type* p) { +bool ParamTraits<URLPatternSet>::Read(const Message* m, + base::PickleIterator* iter, + param_type* p) { std::set<URLPattern> patterns; if (!ReadParam(m, iter, &patterns)) return false; @@ -162,8 +166,9 @@ void ParamTraits<APIPermission::ID>::Write( WriteParam(m, static_cast<int>(p)); } -bool ParamTraits<APIPermission::ID>::Read( - const Message* m, PickleIterator* iter, param_type* p) { +bool ParamTraits<APIPermission::ID>::Read(const Message* m, + base::PickleIterator* iter, + param_type* p) { int api_id = -2; if (!ReadParam(m, iter, &api_id)) return false; @@ -188,8 +193,9 @@ void ParamTraits<APIPermissionSet>::Write( } } -bool ParamTraits<APIPermissionSet>::Read( - const Message* m, PickleIterator* iter, param_type* r) { +bool ParamTraits<APIPermissionSet>::Read(const Message* m, + base::PickleIterator* iter, + param_type* r) { size_t size; if (!ReadParam(m, iter, &size)) return false; @@ -225,8 +231,9 @@ void ParamTraits<ManifestPermissionSet>::Write( } } -bool ParamTraits<ManifestPermissionSet>::Read( - const Message* m, PickleIterator* iter, param_type* r) { +bool ParamTraits<ManifestPermissionSet>::Read(const Message* m, + base::PickleIterator* iter, + param_type* r) { size_t size; if (!ReadParam(m, iter, &size)) return false; @@ -255,8 +262,9 @@ void ParamTraits<HostID>::Write( WriteParam(m, p.id()); } -bool ParamTraits<HostID>::Read( - const Message* m, PickleIterator* iter, param_type* r) { +bool ParamTraits<HostID>::Read(const Message* m, + base::PickleIterator* iter, + param_type* r) { HostID::HostType type; std::string id; if (!ReadParam(m, iter, &type)) @@ -281,9 +289,10 @@ void ParamTraits<ExtensionMsg_PermissionSetStruct>::Write(Message* m, WriteParam(m, p.scriptable_hosts); } -bool ParamTraits<ExtensionMsg_PermissionSetStruct>::Read(const Message* m, - PickleIterator* iter, - param_type* p) { +bool ParamTraits<ExtensionMsg_PermissionSetStruct>::Read( + const Message* m, + base::PickleIterator* iter, + param_type* p) { return ReadParam(m, iter, &p->apis) && ReadParam(m, iter, &p->manifest_permissions) && ReadParam(m, iter, &p->explicit_hosts) && @@ -309,7 +318,7 @@ void ParamTraits<ExtensionMsg_Loaded_Params>::Write(Message* m, } bool ParamTraits<ExtensionMsg_Loaded_Params>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* p) { p->manifest.reset(new base::DictionaryValue()); return ReadParam(m, iter, &p->location) && ReadParam(m, iter, &p->path) && diff --git a/extensions/common/permissions/api_permission.cc b/extensions/common/permissions/api_permission.cc index 77afe9d..7d8f04e 100644 --- a/extensions/common/permissions/api_permission.cc +++ b/extensions/common/permissions/api_permission.cc @@ -84,7 +84,7 @@ class SimpleAPIPermission : public APIPermission { void Write(IPC::Message* m) const override {} - bool Read(const IPC::Message* m, PickleIterator* iter) override { + bool Read(const IPC::Message* m, base::PickleIterator* iter) override { return true; } diff --git a/extensions/common/permissions/api_permission_set_unittest.cc b/extensions/common/permissions/api_permission_set_unittest.cc index 0574250..78a0161 100644 --- a/extensions/common/permissions/api_permission_set_unittest.cc +++ b/extensions/common/permissions/api_permission_set_unittest.cc @@ -280,7 +280,7 @@ TEST(APIPermissionSetTest, IPC) { IPC::Message m; WriteParam(&m, apis); - PickleIterator iter(m); + base::PickleIterator iter(m); CHECK(ReadParam(&m, &iter, &expected_apis)); EXPECT_EQ(apis, expected_apis); } diff --git a/extensions/common/permissions/manifest_permission.cc b/extensions/common/permissions/manifest_permission.cc index 6be6b18..a3ba98e 100644 --- a/extensions/common/permissions/manifest_permission.cc +++ b/extensions/common/permissions/manifest_permission.cc @@ -34,7 +34,8 @@ void ManifestPermission::Write(IPC::Message* m) const { IPC::WriteParam(m, singleton); } -bool ManifestPermission::Read(const IPC::Message* m, PickleIterator* iter) { +bool ManifestPermission::Read(const IPC::Message* m, + base::PickleIterator* iter) { base::ListValue singleton; if (!IPC::ReadParam(m, iter, &singleton)) return false; diff --git a/extensions/common/permissions/settings_override_permission.cc b/extensions/common/permissions/settings_override_permission.cc index 4514a3f..c45678c 100644 --- a/extensions/common/permissions/settings_override_permission.cc +++ b/extensions/common/permissions/settings_override_permission.cc @@ -109,7 +109,7 @@ APIPermission* SettingsOverrideAPIPermission::Intersect( void SettingsOverrideAPIPermission::Write(IPC::Message* m) const {} bool SettingsOverrideAPIPermission::Read(const IPC::Message* m, - PickleIterator* iter) { + base::PickleIterator* iter) { return true; } diff --git a/extensions/common/permissions/socket_permission_unittest.cc b/extensions/common/permissions/socket_permission_unittest.cc index 0b1fae0..1ed207e 100644 --- a/extensions/common/permissions/socket_permission_unittest.cc +++ b/extensions/common/permissions/socket_permission_unittest.cc @@ -275,7 +275,7 @@ TEST(SocketPermissionTest, IPC) { permission_info->CreateAPIPermission()); permission1->Write(&m); - PickleIterator iter(m); + base::PickleIterator iter(m); permission2->Read(&m, &iter); EXPECT_TRUE(permission1->Equal(permission2.get())); @@ -298,7 +298,7 @@ TEST(SocketPermissionTest, IPC) { EXPECT_FALSE(permission1->Equal(permission2.get())); permission1->Write(&m); - PickleIterator iter(m); + base::PickleIterator iter(m); permission2->Read(&m, &iter); EXPECT_TRUE(permission1->Equal(permission2.get())); } diff --git a/extensions/common/user_script.h b/extensions/common/user_script.h index 070679e..93ca14f 100644 --- a/extensions/common/user_script.h +++ b/extensions/common/user_script.h @@ -235,7 +235,8 @@ class UserScript { void Unpickle(const base::Pickle& pickle, base::PickleIterator* iter); private: - // Pickle helper functions used to pickle the individual types of components. + // base::Pickle helper functions used to pickle the individual types of + // components. void PickleGlobs(base::Pickle* pickle, const std::vector<std::string>& globs) const; void PickleHostID(base::Pickle* pickle, const HostID& host_id) const; diff --git a/extensions/common/user_script_unittest.cc b/extensions/common/user_script_unittest.cc index 4a964f7..1dae0a2 100644 --- a/extensions/common/user_script_unittest.cc +++ b/extensions/common/user_script_unittest.cc @@ -196,10 +196,10 @@ TEST(ExtensionUserScriptTest, Pickle) { HostID id(HostID::EXTENSIONS, kExtensionId); script1.set_host_id(id); - Pickle pickle; + base::Pickle pickle; script1.Pickle(&pickle); - PickleIterator iter(pickle); + base::PickleIterator iter(pickle); UserScript script2; script2.Unpickle(pickle, &iter); diff --git a/extensions/renderer/user_script_set.cc b/extensions/renderer/user_script_set.cc index 01e8a5a..6af8627 100644 --- a/extensions/renderer/user_script_set.cc +++ b/extensions/renderer/user_script_set.cc @@ -98,21 +98,22 @@ bool UserScriptSet::UpdateUserScripts(base::SharedMemoryHandle shared_memory, return false; // First get the size of the memory block. - if (!shared_memory_->Map(sizeof(Pickle::Header))) + if (!shared_memory_->Map(sizeof(base::Pickle::Header))) return false; - Pickle::Header* pickle_header = - reinterpret_cast<Pickle::Header*>(shared_memory_->memory()); + base::Pickle::Header* pickle_header = + reinterpret_cast<base::Pickle::Header*>(shared_memory_->memory()); // Now map in the rest of the block. - int pickle_size = sizeof(Pickle::Header) + pickle_header->payload_size; + int pickle_size = sizeof(base::Pickle::Header) + pickle_header->payload_size; shared_memory_->Unmap(); if (!shared_memory_->Map(pickle_size)) return false; // Unpickle scripts. size_t num_scripts = 0; - Pickle pickle(reinterpret_cast<char*>(shared_memory_->memory()), pickle_size); - PickleIterator iter(pickle); + base::Pickle pickle(reinterpret_cast<char*>(shared_memory_->memory()), + pickle_size); + base::PickleIterator iter(pickle); CHECK(iter.ReadSizeT(&num_scripts)); scripts_.clear(); diff --git a/gpu/ipc/gpu_command_buffer_traits.cc b/gpu/ipc/gpu_command_buffer_traits.cc index 1de3b41..8d2148d 100644 --- a/gpu/ipc/gpu_command_buffer_traits.cc +++ b/gpu/ipc/gpu_command_buffer_traits.cc @@ -36,7 +36,7 @@ void ParamTraits<gpu::CommandBuffer::State> ::Write(Message* m, } bool ParamTraits<gpu::CommandBuffer::State> ::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* p) { int32 temp; if (ReadParam(m, iter, &p->get_offset) && @@ -59,9 +59,9 @@ void ParamTraits<gpu::Mailbox>::Write(Message* m, const param_type& p) { m->WriteBytes(p.name, sizeof(p.name)); } -bool ParamTraits<gpu::Mailbox>::Read(const Message* m, - PickleIterator* iter, - param_type* p) { +bool ParamTraits<gpu::Mailbox> ::Read(const Message* m, + base::PickleIterator* iter, + param_type* p) { const char* bytes = NULL; if (!iter->ReadBytes(&bytes, sizeof(p->name))) return false; @@ -81,9 +81,9 @@ void ParamTraits<gpu::MailboxHolder>::Write(Message* m, const param_type& p) { WriteParam(m, p.sync_point); } -bool ParamTraits<gpu::MailboxHolder>::Read(const Message* m, - PickleIterator* iter, - param_type* p) { +bool ParamTraits<gpu::MailboxHolder> ::Read(const Message* m, + base::PickleIterator* iter, + param_type* p) { if (!ReadParam(m, iter, &p->mailbox) || !ReadParam(m, iter, &p->texture_target) || !ReadParam(m, iter, &p->sync_point)) @@ -101,9 +101,9 @@ void ParamTraits<gpu::ValueState>::Write(Message* m, const param_type& p) { sizeof(gpu::ValueState)); } -bool ParamTraits<gpu::ValueState>::Read(const Message* m, - PickleIterator* iter, - param_type* p) { +bool ParamTraits<gpu::ValueState> ::Read(const Message* m, + base::PickleIterator* iter, + param_type* p) { int length; const char* data = NULL; if (!iter->ReadData(&data, &length) || length != sizeof(gpu::ValueState)) diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc index b23f761..20c73e2 100644 --- a/ipc/ipc_channel_posix.cc +++ b/ipc/ipc_channel_posix.cc @@ -901,7 +901,7 @@ void ChannelPosix::QueueCloseFDMessage(int fd, int hops) { void ChannelPosix::HandleInternalMessage(const Message& msg) { // The Hello message contains only the process id. - PickleIterator iter(msg); + base::PickleIterator iter(msg); switch (msg.type()) { default: diff --git a/ipc/ipc_channel_unittest.cc b/ipc/ipc_channel_unittest.cc index b6a0226..142881a 100644 --- a/ipc/ipc_channel_unittest.cc +++ b/ipc/ipc_channel_unittest.cc @@ -34,7 +34,7 @@ TEST_F(IPCChannelTest, BasicMessageTest) { EXPECT_TRUE(m.WriteString(v2)); EXPECT_TRUE(m.WriteString16(v3)); - PickleIterator iter(m); + base::PickleIterator iter(m); int vi; std::string vs; diff --git a/ipc/ipc_channel_win.cc b/ipc/ipc_channel_win.cc index 2704373..edba83a 100644 --- a/ipc/ipc_channel_win.cc +++ b/ipc/ipc_channel_win.cc @@ -161,7 +161,7 @@ bool ChannelWin::WillDispatchInputMessage(Message* msg) { void ChannelWin::HandleInternalMessage(const Message& msg) { DCHECK_EQ(msg.type(), static_cast<unsigned>(Channel::HELLO_MESSAGE_TYPE)); // The hello message contains one parameter containing the PID. - PickleIterator it(msg); + base::PickleIterator it(msg); int32 claimed_pid; bool failed = !it.ReadInt(&claimed_pid); diff --git a/ipc/ipc_fuzzing_tests.cc b/ipc/ipc_fuzzing_tests.cc index 42fa859..c19d842 100644 --- a/ipc/ipc_fuzzing_tests.cc +++ b/ipc/ipc_fuzzing_tests.cc @@ -44,7 +44,7 @@ TEST(IPCMessageIntegrity, ReadBeyondBufferStr) { EXPECT_TRUE(m.WriteInt(v1)); EXPECT_TRUE(m.WriteInt(v2)); - PickleIterator iter(m); + base::PickleIterator iter(m); std::string vs; EXPECT_FALSE(iter.ReadString(&vs)); } @@ -57,7 +57,7 @@ TEST(IPCMessageIntegrity, ReadBeyondBufferStr16) { EXPECT_TRUE(m.WriteInt(v1)); EXPECT_TRUE(m.WriteInt(v2)); - PickleIterator iter(m); + base::PickleIterator iter(m); base::string16 vs; EXPECT_FALSE(iter.ReadString16(&vs)); } @@ -68,7 +68,7 @@ TEST(IPCMessageIntegrity, ReadBytesBadIterator) { EXPECT_TRUE(m.WriteInt(1)); EXPECT_TRUE(m.WriteInt(2)); - PickleIterator iter(m); + base::PickleIterator iter(m); const char* data = NULL; EXPECT_TRUE(iter.ReadBytes(&data, sizeof(int))); } @@ -84,7 +84,7 @@ TEST(IPCMessageIntegrity, ReadVectorNegativeSize) { EXPECT_TRUE(m.WriteInt(3)); std::vector<double> vec; - PickleIterator iter(m); + base::PickleIterator iter(m); EXPECT_FALSE(ReadParam(&m, &iter, &vec)); } @@ -97,7 +97,7 @@ TEST(IPCMessageIntegrity, ReadVectorTooLarge1) { EXPECT_TRUE(m.WriteInt64(2)); std::vector<int64> vec; - PickleIterator iter(m); + base::PickleIterator iter(m); EXPECT_FALSE(ReadParam(&m, &iter, &vec)); } @@ -111,7 +111,7 @@ TEST(IPCMessageIntegrity, ReadVectorTooLarge2) { EXPECT_TRUE(m.WriteInt64(2)); std::vector<int64> vec; - PickleIterator iter(m); + base::PickleIterator iter(m); EXPECT_FALSE(ReadParam(&m, &iter, &vec)); } @@ -213,7 +213,7 @@ class FuzzerClientListener : public SimpleListener { return false; int msg_value1 = 0; int msg_value2 = 0; - PickleIterator iter(*last_msg_); + base::PickleIterator iter(*last_msg_); if (!iter.ReadInt(&msg_value1)) return false; if (!iter.ReadInt(&msg_value2)) diff --git a/ipc/ipc_logging.cc b/ipc/ipc_logging.cc index 3db4e67..da80b14d 100644 --- a/ipc/ipc_logging.cc +++ b/ipc/ipc_logging.cc @@ -110,7 +110,7 @@ void Logging::SetIPCSender(IPC::Sender* sender) { void Logging::OnReceivedLoggingMessage(const Message& message) { std::vector<LogData> data; - PickleIterator iter(message); + base::PickleIterator iter(message); if (!ReadParam(&message, &iter, &data)) return; diff --git a/ipc/ipc_message.cc b/ipc/ipc_message.cc index 2587b0b..7aa268e 100644 --- a/ipc/ipc_message.cc +++ b/ipc/ipc_message.cc @@ -43,8 +43,7 @@ namespace IPC { Message::~Message() { } -Message::Message() - : Pickle(sizeof(Header)) { +Message::Message() : base::Pickle(sizeof(Header)) { header()->routing = header()->type = 0; header()->flags = GetRefNumUpper24(); #if defined(OS_POSIX) @@ -55,7 +54,7 @@ Message::Message() } Message::Message(int32 routing_id, uint32 type, PriorityValue priority) - : Pickle(sizeof(Header)) { + : base::Pickle(sizeof(Header)) { header()->routing = routing_id; header()->type = type; DCHECK((priority & 0xffffff00) == 0); @@ -67,11 +66,12 @@ Message::Message(int32 routing_id, uint32 type, PriorityValue priority) Init(); } -Message::Message(const char* data, int data_len) : Pickle(data, data_len) { +Message::Message(const char* data, int data_len) + : base::Pickle(data, data_len) { Init(); } -Message::Message(const Message& other) : Pickle(other) { +Message::Message(const Message& other) : base::Pickle(other) { Init(); #if defined(OS_POSIX) attachment_set_ = other.attachment_set_; @@ -88,7 +88,7 @@ void Message::Init() { } Message& Message::operator=(const Message& other) { - *static_cast<Pickle*>(this) = other; + *static_cast<base::Pickle*>(this) = other; #if defined(OS_POSIX) attachment_set_ = other.attachment_set_; #endif @@ -138,7 +138,7 @@ bool Message::WriteAttachment(scoped_refptr<MessageAttachment> attachment) { } bool Message::ReadAttachment( - PickleIterator* iter, + base::PickleIterator* iter, scoped_refptr<MessageAttachment>* attachment) const { int descriptor_index; if (!iter->ReadInt(&descriptor_index)) diff --git a/ipc/ipc_message_unittest.cc b/ipc/ipc_message_unittest.cc index 5b3a78d..885ac2e 100644 --- a/ipc/ipc_message_unittest.cc +++ b/ipc/ipc_message_unittest.cc @@ -36,7 +36,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)); @@ -44,7 +44,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)); } @@ -71,7 +71,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)); @@ -79,7 +79,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)); } diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc index 58dc510..f86022c 100644 --- a/ipc/ipc_message_utils.cc +++ b/ipc/ipc_message_utils.cc @@ -54,7 +54,9 @@ void LogBytes(const std::vector<CharType>& data, std::string* out) { #endif } -bool ReadValue(const Message* m, PickleIterator* iter, base::Value** value, +bool ReadValue(const Message* m, + base::PickleIterator* iter, + base::Value** value, int recursion); void WriteValue(Message* m, const base::Value* value, int recursion) { @@ -130,8 +132,10 @@ void WriteValue(Message* m, const base::Value* value, int recursion) { // Helper for ReadValue that reads a DictionaryValue into a pre-allocated // object. -bool ReadDictionaryValue(const Message* m, PickleIterator* iter, - base::DictionaryValue* value, int recursion) { +bool ReadDictionaryValue(const Message* m, + base::PickleIterator* iter, + base::DictionaryValue* value, + int recursion) { int size; if (!ReadParam(m, iter, &size)) return false; @@ -150,8 +154,10 @@ bool ReadDictionaryValue(const Message* m, PickleIterator* iter, // Helper for ReadValue that reads a ReadListValue into a pre-allocated // object. -bool ReadListValue(const Message* m, PickleIterator* iter, - base::ListValue* value, int recursion) { +bool ReadListValue(const Message* m, + base::PickleIterator* iter, + base::ListValue* value, + int recursion) { int size; if (!ReadParam(m, iter, &size)) return false; @@ -166,7 +172,9 @@ bool ReadListValue(const Message* m, PickleIterator* iter, return true; } -bool ReadValue(const Message* m, PickleIterator* iter, base::Value** value, +bool ReadValue(const Message* m, + base::PickleIterator* iter, + base::Value** value, int recursion) { if (recursion > kMaxRecursionDepth) { LOG(WARNING) << "Max recursion depth hit in ReadValue."; @@ -261,8 +269,9 @@ void ParamTraits<unsigned char>::Write(Message* m, const param_type& p) { m->WriteBytes(&p, sizeof(param_type)); } -bool ParamTraits<unsigned char>::Read(const Message* m, PickleIterator* iter, - param_type* r) { +bool ParamTraits<unsigned char>::Read(const Message* m, + base::PickleIterator* iter, + param_type* r) { const char* data; if (!iter->ReadBytes(&data, sizeof(param_type))) return false; @@ -278,7 +287,8 @@ void ParamTraits<unsigned short>::Write(Message* m, const param_type& p) { m->WriteBytes(&p, sizeof(param_type)); } -bool ParamTraits<unsigned short>::Read(const Message* m, PickleIterator* iter, +bool ParamTraits<unsigned short>::Read(const Message* m, + base::PickleIterator* iter, param_type* r) { const char* data; if (!iter->ReadBytes(&data, sizeof(param_type))) @@ -323,7 +333,8 @@ void ParamTraits<double>::Write(Message* m, const param_type& p) { m->WriteBytes(reinterpret_cast<const char*>(&p), sizeof(param_type)); } -bool ParamTraits<double>::Read(const Message* m, PickleIterator* iter, +bool ParamTraits<double>::Read(const Message* m, + base::PickleIterator* iter, param_type* r) { const char *data; if (!iter->ReadBytes(&data, sizeof(*r))) { @@ -355,9 +366,9 @@ void ParamTraits<std::vector<char> >::Write(Message* m, const param_type& p) { } } -bool ParamTraits<std::vector<char> >::Read(const Message* m, - PickleIterator* iter, - param_type* r) { +bool ParamTraits<std::vector<char>>::Read(const Message* m, + base::PickleIterator* iter, + param_type* r) { const char *data; int data_size = 0; if (!iter->ReadData(&data, &data_size) || data_size < 0) @@ -382,9 +393,9 @@ void ParamTraits<std::vector<unsigned char> >::Write(Message* m, } } -bool ParamTraits<std::vector<unsigned char> >::Read(const Message* m, - PickleIterator* iter, - param_type* r) { +bool ParamTraits<std::vector<unsigned char>>::Read(const Message* m, + base::PickleIterator* iter, + param_type* r) { const char *data; int data_size = 0; if (!iter->ReadData(&data, &data_size) || data_size < 0) @@ -409,9 +420,9 @@ void ParamTraits<std::vector<bool> >::Write(Message* m, const param_type& p) { WriteParam(m, static_cast<bool>(p[i])); } -bool ParamTraits<std::vector<bool> >::Read(const Message* m, - PickleIterator* iter, - param_type* r) { +bool ParamTraits<std::vector<bool>>::Read(const Message* m, + base::PickleIterator* iter, + param_type* r) { int size; // ReadLength() checks for < 0 itself. if (!iter->ReadLength(&size)) @@ -439,8 +450,9 @@ void ParamTraits<base::DictionaryValue>::Write(Message* m, WriteValue(m, &p, 0); } -bool ParamTraits<base::DictionaryValue>::Read( - const Message* m, PickleIterator* iter, param_type* r) { +bool ParamTraits<base::DictionaryValue>::Read(const Message* m, + base::PickleIterator* iter, + param_type* r) { int type; if (!ReadParam(m, iter, &type) || type != base::Value::TYPE_DICTIONARY) return false; @@ -474,7 +486,7 @@ void ParamTraits<base::FileDescriptor>::Write(Message* m, const param_type& p) { } bool ParamTraits<base::FileDescriptor>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* r) { *r = base::FileDescriptor(); @@ -509,7 +521,7 @@ void ParamTraits<base::FilePath>::Write(Message* m, const param_type& p) { } bool ParamTraits<base::FilePath>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* r) { return r->ReadFromPickle(iter); } @@ -522,8 +534,9 @@ void ParamTraits<base::ListValue>::Write(Message* m, const param_type& p) { WriteValue(m, &p, 0); } -bool ParamTraits<base::ListValue>::Read( - const Message* m, PickleIterator* iter, param_type* r) { +bool ParamTraits<base::ListValue>::Read(const Message* m, + base::PickleIterator* iter, + param_type* r) { int type; if (!ReadParam(m, iter, &type) || type != base::Value::TYPE_LIST) return false; @@ -544,7 +557,7 @@ void ParamTraits<base::NullableString16>::Write(Message* m, } bool ParamTraits<base::NullableString16>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* r) { base::string16 string; if (!ReadParam(m, iter, &string)) @@ -575,7 +588,7 @@ void ParamTraits<base::File::Info>::Write(Message* m, } bool ParamTraits<base::File::Info>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* p) { double last_modified, last_accessed, creation_time; if (!ReadParam(m, iter, &p->size) || @@ -609,7 +622,8 @@ void ParamTraits<base::Time>::Write(Message* m, const param_type& p) { ParamTraits<int64>::Write(m, p.ToInternalValue()); } -bool ParamTraits<base::Time>::Read(const Message* m, PickleIterator* iter, +bool ParamTraits<base::Time>::Read(const Message* m, + base::PickleIterator* iter, param_type* r) { int64 value; if (!ParamTraits<int64>::Read(m, iter, &value)) @@ -627,7 +641,7 @@ void ParamTraits<base::TimeDelta>::Write(Message* m, const param_type& p) { } bool ParamTraits<base::TimeDelta>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* r) { int64 value; bool ret = ParamTraits<int64>::Read(m, iter, &value); @@ -646,7 +660,7 @@ void ParamTraits<base::TimeTicks>::Write(Message* m, const param_type& p) { } bool ParamTraits<base::TimeTicks>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* r) { int64 value; bool ret = ParamTraits<int64>::Read(m, iter, &value); @@ -665,7 +679,7 @@ void ParamTraits<base::TraceTicks>::Write(Message* m, const param_type& p) { } bool ParamTraits<base::TraceTicks>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* r) { int64 value; bool ret = ParamTraits<int64>::Read(m, iter, &value); @@ -691,7 +705,7 @@ void ParamTraits<IPC::ChannelHandle>::Write(Message* m, const param_type& p) { } bool ParamTraits<IPC::ChannelHandle>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* r) { return ReadParam(m, iter, &r->name) #if defined(OS_POSIX) @@ -723,7 +737,7 @@ void ParamTraits<LogData>::Write(Message* m, const param_type& p) { } bool ParamTraits<LogData>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* r) { return ReadParam(m, iter, &r->channel) && @@ -764,7 +778,8 @@ void ParamTraits<Message>::Write(Message* m, const Message& p) { m->WriteData(p.payload(), static_cast<uint32>(p.payload_size())); } -bool ParamTraits<Message>::Read(const Message* m, PickleIterator* iter, +bool ParamTraits<Message>::Read(const Message* m, + base::PickleIterator* iter, Message* r) { uint32 routing_id, type, flags; if (!iter->ReadUInt32(&routing_id) || @@ -792,7 +807,8 @@ void ParamTraits<HANDLE>::Write(Message* m, const param_type& p) { m->WriteInt(HandleToLong(p)); } -bool ParamTraits<HANDLE>::Read(const Message* m, PickleIterator* iter, +bool ParamTraits<HANDLE>::Read(const Message* m, + base::PickleIterator* iter, param_type* r) { int32 temp; if (!iter->ReadInt(&temp)) @@ -809,7 +825,8 @@ void ParamTraits<LOGFONT>::Write(Message* m, const param_type& p) { m->WriteData(reinterpret_cast<const char*>(&p), sizeof(LOGFONT)); } -bool ParamTraits<LOGFONT>::Read(const Message* m, PickleIterator* iter, +bool ParamTraits<LOGFONT>::Read(const Message* m, + base::PickleIterator* iter, param_type* r) { const char *data; int data_size = 0; @@ -833,7 +850,8 @@ void ParamTraits<MSG>::Write(Message* m, const param_type& p) { m->WriteData(reinterpret_cast<const char*>(&p), sizeof(MSG)); } -bool ParamTraits<MSG>::Read(const Message* m, PickleIterator* iter, +bool ParamTraits<MSG>::Read(const Message* m, + base::PickleIterator* iter, param_type* r) { const char *data; int data_size = 0; diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h index cf0dcbc..9465141 100644 --- a/ipc/ipc_message_utils.h +++ b/ipc/ipc_message_utils.h @@ -96,9 +96,8 @@ static inline void WriteParam(Message* m, const P& p) { } template <class P> -static inline bool WARN_UNUSED_RESULT ReadParam(const Message* m, - base::PickleIterator* iter, - P* p) { +static inline bool WARN_UNUSED_RESULT +ReadParam(const Message* m, base::PickleIterator* iter, P* p) { typedef typename SimilarTypeTraits<P>::Type Type; return ParamTraits<Type>::Read(m, iter, reinterpret_cast<Type* >(p)); } @@ -117,7 +116,8 @@ struct ParamTraits<bool> { static void Write(Message* m, const param_type& p) { m->WriteBool(p); } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { return iter->ReadBool(r); } @@ -128,7 +128,7 @@ template <> struct IPC_EXPORT ParamTraits<unsigned char> { typedef unsigned char param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, PickleIterator* iter, param_type* r); + static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); static void Log(const param_type& p, std::string* l); }; @@ -136,7 +136,9 @@ template <> struct IPC_EXPORT ParamTraits<unsigned short> { typedef unsigned short param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); + static bool Read(const Message* m, + base::PickleIterator* iter, + param_type* r); static void Log(const param_type& p, std::string* l); }; @@ -146,7 +148,8 @@ struct ParamTraits<int> { static void Write(Message* m, const param_type& p) { m->WriteInt(p); } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { return iter->ReadInt(r); } @@ -159,7 +162,8 @@ struct ParamTraits<unsigned int> { static void Write(Message* m, const param_type& p) { m->WriteInt(p); } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { return iter->ReadInt(reinterpret_cast<int*>(r)); } @@ -172,7 +176,8 @@ struct ParamTraits<long> { static void Write(Message* m, const param_type& p) { m->WriteLongUsingDangerousNonPortableLessPersistableForm(p); } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { return iter->ReadLong(r); } @@ -185,7 +190,8 @@ struct ParamTraits<unsigned long> { static void Write(Message* m, const param_type& p) { m->WriteLongUsingDangerousNonPortableLessPersistableForm(p); } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { return iter->ReadLong(reinterpret_cast<long*>(r)); } @@ -198,7 +204,8 @@ struct ParamTraits<long long> { static void Write(Message* m, const param_type& p) { m->WriteInt64(static_cast<int64>(p)); } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { return iter->ReadInt64(reinterpret_cast<int64*>(r)); } @@ -211,7 +218,8 @@ struct ParamTraits<unsigned long long> { static void Write(Message* m, const param_type& p) { m->WriteInt64(p); } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { return iter->ReadInt64(reinterpret_cast<int64*>(r)); } @@ -227,7 +235,8 @@ struct IPC_EXPORT ParamTraits<float> { static void Write(Message* m, const param_type& p) { m->WriteFloat(p); } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { return iter->ReadFloat(r); } @@ -238,7 +247,9 @@ template <> struct IPC_EXPORT ParamTraits<double> { typedef double param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); + static bool Read(const Message* m, + base::PickleIterator* iter, + param_type* r); static void Log(const param_type& p, std::string* l); }; @@ -250,7 +261,8 @@ struct ParamTraits<std::string> { static void Write(Message* m, const param_type& p) { m->WriteString(p); } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { return iter->ReadString(r); } @@ -263,7 +275,8 @@ struct ParamTraits<base::string16> { static void Write(Message* m, const param_type& p) { m->WriteString16(p); } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { return iter->ReadString16(r); } @@ -274,7 +287,9 @@ template <> struct IPC_EXPORT ParamTraits<std::vector<char> > { typedef std::vector<char> param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message*, base::PickleIterator* iter, param_type* r); + static bool Read(const Message*, + base::PickleIterator* iter, + param_type* r); static void Log(const param_type& p, std::string* l); }; @@ -282,7 +297,9 @@ template <> struct IPC_EXPORT ParamTraits<std::vector<unsigned char> > { typedef std::vector<unsigned char> param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); + static bool Read(const Message* m, + base::PickleIterator* iter, + param_type* r); static void Log(const param_type& p, std::string* l); }; @@ -290,7 +307,9 @@ template <> struct IPC_EXPORT ParamTraits<std::vector<bool> > { typedef std::vector<bool> param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); + static bool Read(const Message* m, + base::PickleIterator* iter, + param_type* r); static void Log(const param_type& p, std::string* l); }; @@ -302,7 +321,8 @@ struct ParamTraits<std::vector<P> > { for (size_t i = 0; i < p.size(); i++) WriteParam(m, p[i]); } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { int size; // ReadLength() checks for < 0 itself. @@ -336,7 +356,8 @@ struct ParamTraits<std::set<P> > { for (iter = p.begin(); iter != p.end(); ++iter) WriteParam(m, *iter); } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { int size; if (!iter->ReadLength(&size)) @@ -365,7 +386,8 @@ struct ParamTraits<std::map<K, V, C, A> > { WriteParam(m, iter->second); } } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { int size; if (!ReadParam(m, iter, &size) || size < 0) @@ -392,7 +414,8 @@ struct ParamTraits<std::pair<A, B> > { WriteParam(m, p.first); WriteParam(m, p.second); } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { return ReadParam(m, iter, &r->first) && ReadParam(m, iter, &r->second); } @@ -411,7 +434,9 @@ template <> struct IPC_EXPORT ParamTraits<base::DictionaryValue> { typedef base::DictionaryValue param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); + static bool Read(const Message* m, + base::PickleIterator* iter, + param_type* r); static void Log(const param_type& p, std::string* l); }; @@ -435,7 +460,9 @@ template<> struct IPC_EXPORT ParamTraits<base::FileDescriptor> { typedef base::FileDescriptor param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); + static bool Read(const Message* m, + base::PickleIterator* iter, + param_type* r); static void Log(const param_type& p, std::string* l); }; #endif // defined(OS_POSIX) @@ -444,7 +471,9 @@ template <> struct IPC_EXPORT ParamTraits<base::FilePath> { typedef base::FilePath param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); + static bool Read(const Message* m, + base::PickleIterator* iter, + param_type* r); static void Log(const param_type& p, std::string* l); }; @@ -452,7 +481,9 @@ template <> struct IPC_EXPORT ParamTraits<base::ListValue> { typedef base::ListValue param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); + static bool Read(const Message* m, + base::PickleIterator* iter, + param_type* r); static void Log(const param_type& p, std::string* l); }; @@ -460,7 +491,8 @@ template <> struct IPC_EXPORT ParamTraits<base::NullableString16> { typedef base::NullableString16 param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r); static void Log(const param_type& p, std::string* l); }; @@ -469,7 +501,9 @@ template <> struct IPC_EXPORT ParamTraits<base::File::Info> { typedef base::File::Info param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); + static bool Read(const Message* m, + base::PickleIterator* iter, + param_type* r); static void Log(const param_type& p, std::string* l); }; @@ -489,7 +523,9 @@ template <> struct IPC_EXPORT ParamTraits<base::Time> { typedef base::Time param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); + static bool Read(const Message* m, + base::PickleIterator* iter, + param_type* r); static void Log(const param_type& p, std::string* l); }; @@ -497,7 +533,9 @@ template <> struct IPC_EXPORT ParamTraits<base::TimeDelta> { typedef base::TimeDelta param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); + static bool Read(const Message* m, + base::PickleIterator* iter, + param_type* r); static void Log(const param_type& p, std::string* l); }; @@ -505,7 +543,9 @@ template <> struct IPC_EXPORT ParamTraits<base::TimeTicks> { typedef base::TimeTicks param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); + static bool Read(const Message* m, + base::PickleIterator* iter, + param_type* r); static void Log(const param_type& p, std::string* l); }; @@ -513,7 +553,9 @@ template <> struct IPC_EXPORT ParamTraits<base::TraceTicks> { typedef base::TraceTicks param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); + static bool Read(const Message* m, + base::PickleIterator* iter, + param_type* r); static void Log(const param_type& p, std::string* l); }; @@ -522,7 +564,8 @@ struct ParamTraits<base::Tuple<>> { typedef base::Tuple<> param_type; static void Write(Message* m, const param_type& p) { } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { return true; } @@ -536,7 +579,8 @@ struct ParamTraits<base::Tuple<A>> { static void Write(Message* m, const param_type& p) { WriteParam(m, base::get<0>(p)); } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { return ReadParam(m, iter, &base::get<0>(*r)); } @@ -552,7 +596,8 @@ struct ParamTraits<base::Tuple<A, B>> { WriteParam(m, base::get<0>(p)); WriteParam(m, base::get<1>(p)); } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { return (ReadParam(m, iter, &base::get<0>(*r)) && ReadParam(m, iter, &base::get<1>(*r))); @@ -572,7 +617,8 @@ struct ParamTraits<base::Tuple<A, B, C>> { WriteParam(m, base::get<1>(p)); WriteParam(m, base::get<2>(p)); } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { return (ReadParam(m, iter, &base::get<0>(*r)) && ReadParam(m, iter, &base::get<1>(*r)) && @@ -596,7 +642,8 @@ struct ParamTraits<base::Tuple<A, B, C, D>> { WriteParam(m, base::get<2>(p)); WriteParam(m, base::get<3>(p)); } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { return (ReadParam(m, iter, &base::get<0>(*r)) && ReadParam(m, iter, &base::get<1>(*r)) && @@ -624,7 +671,8 @@ struct ParamTraits<base::Tuple<A, B, C, D, E>> { WriteParam(m, base::get<3>(p)); WriteParam(m, base::get<4>(p)); } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { return (ReadParam(m, iter, &base::get<0>(*r)) && ReadParam(m, iter, &base::get<1>(*r)) && @@ -653,7 +701,8 @@ struct ParamTraits<ScopedVector<P> > { for (size_t i = 0; i < p.size(); i++) WriteParam(m, *p[i]); } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { int size = 0; if (!iter->ReadLength(&size)) @@ -693,7 +742,8 @@ struct ParamTraits<base::SmallMap<NormalMap, kArraySize, EqualKey, MapInit> > { WriteParam(m, iter->second); } } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { int size; if (!iter->ReadLength(&size)) @@ -722,7 +772,8 @@ struct ParamTraits<scoped_ptr<P> > { if (valid) WriteParam(m, *p); } - static bool Read(const Message* m, base::PickleIterator* iter, + static bool Read(const Message* m, + base::PickleIterator* iter, param_type* r) { bool valid = false; if (!ReadParam(m, iter, &valid)) @@ -757,7 +808,9 @@ template<> struct IPC_EXPORT ParamTraits<IPC::ChannelHandle> { typedef ChannelHandle param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); + static bool Read(const Message* m, + base::PickleIterator* iter, + param_type* r); static void Log(const param_type& p, std::string* l); }; @@ -765,14 +818,18 @@ template <> struct IPC_EXPORT ParamTraits<LogData> { typedef LogData param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); + static bool Read(const Message* m, + base::PickleIterator* iter, + param_type* r); static void Log(const param_type& p, std::string* l); }; template <> struct IPC_EXPORT ParamTraits<Message> { static void Write(Message* m, const Message& p); - static bool Read(const Message* m, base::PickleIterator* iter, Message* r); + static bool Read(const Message* m, + base::PickleIterator* iter, + Message* r); static void Log(const Message& p, std::string* l); }; @@ -783,7 +840,9 @@ template <> struct IPC_EXPORT ParamTraits<HANDLE> { typedef HANDLE param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); + static bool Read(const Message* m, + base::PickleIterator* iter, + param_type* r); static void Log(const param_type& p, std::string* l); }; @@ -791,7 +850,9 @@ template <> struct IPC_EXPORT ParamTraits<LOGFONT> { typedef LOGFONT param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); + static bool Read(const Message* m, + base::PickleIterator* iter, + param_type* r); static void Log(const param_type& p, std::string* l); }; @@ -799,7 +860,9 @@ template <> struct IPC_EXPORT ParamTraits<MSG> { typedef MSG param_type; static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); + static bool Read(const Message* m, + base::PickleIterator* iter, + param_type* r); static void Log(const param_type& p, std::string* l); }; #endif // defined(OS_WIN) diff --git a/ipc/ipc_message_utils_unittest.cc b/ipc/ipc_message_utils_unittest.cc index 2156eeb..a73e2e7 100644 --- a/ipc/ipc_message_utils_unittest.cc +++ b/ipc/ipc_message_utils_unittest.cc @@ -29,7 +29,7 @@ TEST(IPCMessageUtilsTest, NestedMessages) { ParamTraits<Message>::Write(&outer_msg, nested_msg); // Read back the nested message. - PickleIterator iter(outer_msg); + base::PickleIterator iter(outer_msg); IPC::Message result_msg; ASSERT_TRUE(ParamTraits<Message>::Read(&outer_msg, &iter, &result_msg)); @@ -40,7 +40,7 @@ TEST(IPCMessageUtilsTest, NestedMessages) { EXPECT_EQ(nested_msg.flags(), result_msg.flags()); // Verify nested message content - PickleIterator nested_iter(nested_msg); + base::PickleIterator nested_iter(nested_msg); int result_content = 0; ASSERT_TRUE(ParamTraits<int>::Read(&nested_msg, &nested_iter, &result_content)); @@ -63,7 +63,7 @@ TEST(IPCMessageUtilsTest, ParameterValidation) { ParamTraits<base::FilePath::StringType>::Write(&message, ok_string); ParamTraits<base::FilePath::StringType>::Write(&message, bad_string); - PickleIterator iter(message); + base::PickleIterator iter(message); base::FilePath ok_path; base::FilePath bad_path; ASSERT_TRUE(ParamTraits<base::FilePath>::Read(&message, &iter, &ok_path)); diff --git a/ipc/ipc_perftest_support.cc b/ipc/ipc_perftest_support.cc index ae8be7f..5ae4076 100644 --- a/ipc/ipc_perftest_support.cc +++ b/ipc/ipc_perftest_support.cc @@ -98,7 +98,7 @@ class ChannelReflectorListener : public Listener { bool OnMessageReceived(const Message& message) override { CHECK(channel_); - PickleIterator iter(message); + base::PickleIterator iter(message); int64 time_internal; EXPECT_TRUE(iter.ReadInt64(&time_internal)); int msgid; @@ -167,7 +167,7 @@ class PerformanceChannelListener : public Listener { bool OnMessageReceived(const Message& message) override { CHECK(sender_); - PickleIterator iter(message); + base::PickleIterator iter(message); int64 time_internal; EXPECT_TRUE(iter.ReadInt64(&time_internal)); int msgid; diff --git a/ipc/ipc_send_fds_test.cc b/ipc/ipc_send_fds_test.cc index 148eeca..2328c30 100644 --- a/ipc/ipc_send_fds_test.cc +++ b/ipc/ipc_send_fds_test.cc @@ -47,7 +47,7 @@ static_assert(kNumFDsToSend == class MyChannelDescriptorListenerBase : public IPC::Listener { public: bool OnMessageReceived(const IPC::Message& message) override { - PickleIterator iter(message); + base::PickleIterator iter(message); base::FileDescriptor descriptor; while (IPC::ParamTraits<base::FileDescriptor>::Read( &message, &iter, &descriptor)) { diff --git a/ipc/ipc_sync_message.cc b/ipc/ipc_sync_message.cc index fd6dc47..6b59e11 100644 --- a/ipc/ipc_sync_message.cc +++ b/ipc/ipc_sync_message.cc @@ -74,10 +74,10 @@ bool SyncMessage::IsMessageReplyTo(const Message& msg, int request_id) { return GetMessageId(msg) == request_id; } -PickleIterator SyncMessage::GetDataIterator(const Message* msg) { - PickleIterator iter(*msg); +base::PickleIterator SyncMessage::GetDataIterator(const Message* msg) { + base::PickleIterator iter(*msg); if (!iter.SkipBytes(kSyncMessageHeaderSize)) - return PickleIterator(); + return base::PickleIterator(); else return iter; } @@ -112,7 +112,7 @@ Message* SyncMessage::GenerateReply(const Message* msg) { bool SyncMessage::ReadSyncHeader(const Message& msg, SyncHeader* header) { DCHECK(msg.is_sync() || msg.is_reply()); - PickleIterator iter(msg); + base::PickleIterator iter(msg); bool result = iter.ReadInt(&header->message_id); if (!result) { NOTREACHED(); diff --git a/ipc/ipc_test_channel_listener.cc b/ipc/ipc_test_channel_listener.cc index e98f6b7..7d1832d 100644 --- a/ipc/ipc_test_channel_listener.cc +++ b/ipc/ipc_test_channel_listener.cc @@ -32,7 +32,7 @@ void TestChannelListener::SendOneMessage(IPC::Sender* sender, bool TestChannelListener::OnMessageReceived(const IPC::Message& message) { - PickleIterator iter(message); + base::PickleIterator iter(message); int ignored; EXPECT_TRUE(iter.ReadInt(&ignored)); diff --git a/ipc/mojo/ipc_channel_mojo_unittest.cc b/ipc/mojo/ipc_channel_mojo_unittest.cc index 53c6ecf..df5b7ba 100644 --- a/ipc/mojo/ipc_channel_mojo_unittest.cc +++ b/ipc/mojo/ipc_channel_mojo_unittest.cc @@ -38,7 +38,7 @@ class ListenerThatExpectsOK : public IPC::Listener { ~ListenerThatExpectsOK() override {} bool OnMessageReceived(const IPC::Message& message) override { - PickleIterator iter(message); + base::PickleIterator iter(message); std::string should_be_ok; EXPECT_TRUE(iter.ReadString(&should_be_ok)); EXPECT_EQ(should_be_ok, "OK"); @@ -325,7 +325,7 @@ class HandleSendingHelper { } static void ReadReceivedPipe(const IPC::Message& message, - PickleIterator* iter) { + base::PickleIterator* iter) { mojo::ScopedMessagePipeHandle pipe; EXPECT_TRUE( IPC::MojoMessageHelper::ReadMessagePipeFrom(&message, iter, &pipe)); @@ -372,7 +372,7 @@ class HandleSendingHelper { } static void ReadReceivedFile(const IPC::Message& message, - PickleIterator* iter) { + base::PickleIterator* iter) { base::ScopedFD fd; scoped_refptr<IPC::MessageAttachment> attachment; EXPECT_TRUE(message.ReadAttachment(iter, &attachment)); @@ -391,7 +391,7 @@ class ListenerThatExpectsMessagePipe : public IPC::Listener { ~ListenerThatExpectsMessagePipe() override {} bool OnMessageReceived(const IPC::Message& message) override { - PickleIterator iter(message); + base::PickleIterator iter(message); HandleSendingHelper::ReadReceivedPipe(message, &iter); base::MessageLoop::current()->Quit(); ListenerThatExpectsOK::SendOK(sender_); @@ -461,7 +461,7 @@ class ListenerThatExpectsMessagePipeUsingParamTrait : public IPC::Listener { ~ListenerThatExpectsMessagePipeUsingParamTrait() override {} bool OnMessageReceived(const IPC::Message& message) override { - PickleIterator iter(message); + base::PickleIterator iter(message); mojo::MessagePipeHandle handle; EXPECT_TRUE(IPC::ParamTraits<mojo::MessagePipeHandle>::Read(&message, &iter, &handle)); @@ -622,7 +622,7 @@ class ListenerThatExpectsFile : public IPC::Listener { ~ListenerThatExpectsFile() override {} bool OnMessageReceived(const IPC::Message& message) override { - PickleIterator iter(message); + base::PickleIterator iter(message); HandleSendingHelper::ReadReceivedFile(message, &iter); base::MessageLoop::current()->Quit(); ListenerThatExpectsOK::SendOK(sender_); @@ -681,7 +681,7 @@ class ListenerThatExpectsFileAndPipe : public IPC::Listener { ~ListenerThatExpectsFileAndPipe() override {} bool OnMessageReceived(const IPC::Message& message) override { - PickleIterator iter(message); + base::PickleIterator iter(message); HandleSendingHelper::ReadReceivedFile(message, &iter); HandleSendingHelper::ReadReceivedPipe(message, &iter); base::MessageLoop::current()->Quit(); diff --git a/ipc/mojo/ipc_mojo_bootstrap.cc b/ipc/mojo/ipc_mojo_bootstrap.cc index d307246..cd9b24a 100644 --- a/ipc/mojo/ipc_mojo_bootstrap.cc +++ b/ipc/mojo/ipc_mojo_bootstrap.cc @@ -141,7 +141,7 @@ bool MojoClientBootstrap::OnMessageReceived(const Message& message) { } PlatformFileForTransit pipe; - PickleIterator iter(message); + base::PickleIterator iter(message); if (!ParamTraits<PlatformFileForTransit>::Read(&message, &iter, &pipe)) { LOG(WARNING) << "Failed to read a file handle from bootstrap channel."; message.set_dispatch_error(); diff --git a/ipc/mojo/ipc_mojo_message_helper.cc b/ipc/mojo/ipc_mojo_message_helper.cc index 38b870d..6f33f80 100644 --- a/ipc/mojo/ipc_mojo_message_helper.cc +++ b/ipc/mojo/ipc_mojo_message_helper.cc @@ -20,7 +20,7 @@ bool MojoMessageHelper::WriteMessagePipeTo( // static bool MojoMessageHelper::ReadMessagePipeFrom( const Message* message, - PickleIterator* iter, + base::PickleIterator* iter, mojo::ScopedMessagePipeHandle* handle) { scoped_refptr<MessageAttachment> attachment; if (!message->ReadAttachment(iter, &attachment)) { diff --git a/ipc/mojo/ipc_mojo_param_traits.cc b/ipc/mojo/ipc_mojo_param_traits.cc index 80c3ca7..1bb5256 100644 --- a/ipc/mojo/ipc_mojo_param_traits.cc +++ b/ipc/mojo/ipc_mojo_param_traits.cc @@ -17,7 +17,7 @@ void ParamTraits<mojo::MessagePipeHandle>::Write(Message* m, } bool ParamTraits<mojo::MessagePipeHandle>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* r) { bool is_valid; if (!ReadParam(m, iter, &is_valid)) diff --git a/media/base/test_helpers.cc b/media/base/test_helpers.cc index bde12b4..bbfbd64 100644 --- a/media/base/test_helpers.cc +++ b/media/base/test_helpers.cc @@ -217,7 +217,7 @@ static const char kFakeVideoBufferHeader[] = "FakeVideoBufferForTest"; scoped_refptr<DecoderBuffer> CreateFakeVideoBufferForTest( const VideoDecoderConfig& config, base::TimeDelta timestamp, base::TimeDelta duration) { - Pickle pickle; + base::Pickle pickle; pickle.WriteString(kFakeVideoBufferHeader); pickle.WriteInt(config.coded_size().width()); pickle.WriteInt(config.coded_size().height()); @@ -237,8 +237,8 @@ bool VerifyFakeVideoBufferForTest( const scoped_refptr<DecoderBuffer>& buffer, const VideoDecoderConfig& config) { // Check if the input |buffer| matches the |config|. - PickleIterator pickle(Pickle(reinterpret_cast<const char*>(buffer->data()), - buffer->data_size())); + base::PickleIterator pickle(base::Pickle( + reinterpret_cast<const char*>(buffer->data()), buffer->data_size())); std::string header; int width = 0; int height = 0; diff --git a/net/base/io_buffer.cc b/net/base/io_buffer.cc index d722b44..3ab762a 100644 --- a/net/base/io_buffer.cc +++ b/net/base/io_buffer.cc @@ -167,13 +167,16 @@ GrowableIOBuffer::~GrowableIOBuffer() { data_ = NULL; } -PickledIOBuffer::PickledIOBuffer() : IOBuffer() {} +PickledIOBuffer::PickledIOBuffer() : IOBuffer() { +} void PickledIOBuffer::Done() { data_ = const_cast<char*>(static_cast<const char*>(pickle_.data())); } -PickledIOBuffer::~PickledIOBuffer() { data_ = NULL; } +PickledIOBuffer::~PickledIOBuffer() { + data_ = NULL; +} WrappedIOBuffer::WrappedIOBuffer(const char* data) : IOBuffer(const_cast<char*>(data)) { diff --git a/net/cert/signed_certificate_timestamp.cc b/net/cert/signed_certificate_timestamp.cc index 9c0f57d..bbd36df 100644 --- a/net/cert/signed_certificate_timestamp.cc +++ b/net/cert/signed_certificate_timestamp.cc @@ -32,7 +32,7 @@ SignedCertificateTimestamp::SignedCertificateTimestamp() {} SignedCertificateTimestamp::~SignedCertificateTimestamp() {} -void SignedCertificateTimestamp::Persist(Pickle* pickle) { +void SignedCertificateTimestamp::Persist(base::Pickle* pickle) { CHECK(pickle->WriteInt(version)); CHECK(pickle->WriteString(log_id)); CHECK(pickle->WriteInt64(timestamp.ToInternalValue())); @@ -46,7 +46,7 @@ void SignedCertificateTimestamp::Persist(Pickle* pickle) { // static scoped_refptr<SignedCertificateTimestamp> -SignedCertificateTimestamp::CreateFromPickle(PickleIterator* iter) { +SignedCertificateTimestamp::CreateFromPickle(base::PickleIterator* iter) { int version; int64 timestamp; int hash_algorithm; diff --git a/net/cert/signed_certificate_timestamp_unittest.cc b/net/cert/signed_certificate_timestamp_unittest.cc index 79f4621..90b4ab7 100644 --- a/net/cert/signed_certificate_timestamp_unittest.cc +++ b/net/cert/signed_certificate_timestamp_unittest.cc @@ -31,10 +31,10 @@ class SignedCertificateTimestampTest : public ::testing::Test { }; TEST_F(SignedCertificateTimestampTest, PicklesAndUnpickles) { - Pickle pickle; + base::Pickle pickle; sample_sct_->Persist(&pickle); - PickleIterator iter(pickle); + base::PickleIterator iter(pickle); scoped_refptr<SignedCertificateTimestamp> unpickled_sct( SignedCertificateTimestamp::CreateFromPickle(&iter)); diff --git a/net/cert/x509_certificate.cc b/net/cert/x509_certificate.cc index 2b0a10a..7d1b47f 100644 --- a/net/cert/x509_certificate.cc +++ b/net/cert/x509_certificate.cc @@ -312,8 +312,9 @@ X509Certificate* X509Certificate::CreateFromBytes(const char* data, } // static -X509Certificate* X509Certificate::CreateFromPickle(PickleIterator* pickle_iter, - PickleType type) { +X509Certificate* X509Certificate::CreateFromPickle( + base::PickleIterator* pickle_iter, + PickleType type) { if (type == PICKLETYPE_CERTIFICATE_CHAIN_V3) { int chain_length = 0; if (!pickle_iter->ReadLength(&chain_length)) @@ -359,7 +360,7 @@ X509Certificate* X509Certificate::CreateFromPickle(PickleIterator* pickle_iter, // bits of zeroes. Now we always write 32 bits, so after a while, these old // cached pickles will all get replaced. // TODO(mdm): remove this compatibility code in April 2013 or so. - PickleIterator saved_iter = *pickle_iter; + base::PickleIterator saved_iter = *pickle_iter; uint32 zero_check = 0; if (!pickle_iter->ReadUInt32(&zero_check)) { // This may not be an error. If there are no intermediates, and we're @@ -473,7 +474,7 @@ CertificateList X509Certificate::CreateCertificateListFromBytes( return results; } -void X509Certificate::Persist(Pickle* pickle) { +void X509Certificate::Persist(base::Pickle* pickle) { DCHECK(cert_handle_); // This would be an absolutely insane number of intermediates. if (intermediate_ca_certs_.size() > static_cast<size_t>(INT_MAX) - 1) { diff --git a/net/cert/x509_certificate.h b/net/cert/x509_certificate.h index ef7861c..3cd1ad7 100644 --- a/net/cert/x509_certificate.h +++ b/net/cert/x509_certificate.h @@ -110,7 +110,7 @@ class NET_EXPORT X509Certificate // PickleType is intended for deserializing certificates that were pickled // by previous releases as part of a net::HttpResponseInfo. - // When serializing certificates to a new Pickle, + // When serializing certificates to a new base::Pickle, // PICKLETYPE_CERTIFICATE_CHAIN_V3 is always used. enum PickleType { // When reading a certificate from a Pickle, the Pickle only contains a diff --git a/net/cert/x509_certificate_ios.cc b/net/cert/x509_certificate_ios.cc index bc76d08..9c3b333 100644 --- a/net/cert/x509_certificate_ios.cc +++ b/net/cert/x509_certificate_ios.cc @@ -225,14 +225,14 @@ SHA1HashValue X509Certificate::CalculateCAFingerprint( } // static -X509Certificate::OSCertHandle -X509Certificate::ReadOSCertHandleFromPickle(PickleIterator* pickle_iter) { +X509Certificate::OSCertHandle X509Certificate::ReadOSCertHandleFromPickle( + base::PickleIterator* pickle_iter) { return x509_util::ReadOSCertHandleFromPickle(pickle_iter); } // static bool X509Certificate::WriteOSCertHandleToPickle(OSCertHandle cert_handle, - Pickle* pickle) { + base::Pickle* pickle) { ScopedCFTypeRef<CFDataRef> cert_data(SecCertificateCopyData(cert_handle)); if (!cert_data) return false; diff --git a/net/cert/x509_certificate_mac.cc b/net/cert/x509_certificate_mac.cc index c02f33b..5f1d58f 100644 --- a/net/cert/x509_certificate_mac.cc +++ b/net/cert/x509_certificate_mac.cc @@ -464,8 +464,8 @@ CFMutableArrayRef X509Certificate::CreateOSCertChainForCert() const { } // static -X509Certificate::OSCertHandle -X509Certificate::ReadOSCertHandleFromPickle(PickleIterator* pickle_iter) { +X509Certificate::OSCertHandle X509Certificate::ReadOSCertHandleFromPickle( + base::PickleIterator* pickle_iter) { const char* data; int length; if (!pickle_iter->ReadData(&data, &length)) @@ -476,7 +476,7 @@ X509Certificate::ReadOSCertHandleFromPickle(PickleIterator* pickle_iter) { // static bool X509Certificate::WriteOSCertHandleToPickle(OSCertHandle cert_handle, - Pickle* pickle) { + base::Pickle* pickle) { CSSM_DATA cert_data; OSStatus status = SecCertificateGetData(cert_handle, &cert_data); if (status) diff --git a/net/cert/x509_certificate_nss.cc b/net/cert/x509_certificate_nss.cc index 45dd0a2..f8646cb 100644 --- a/net/cert/x509_certificate_nss.cc +++ b/net/cert/x509_certificate_nss.cc @@ -261,14 +261,14 @@ SHA1HashValue X509Certificate::CalculateCAFingerprint( } // static -X509Certificate::OSCertHandle -X509Certificate::ReadOSCertHandleFromPickle(PickleIterator* pickle_iter) { +X509Certificate::OSCertHandle X509Certificate::ReadOSCertHandleFromPickle( + base::PickleIterator* pickle_iter) { return x509_util::ReadOSCertHandleFromPickle(pickle_iter); } // static bool X509Certificate::WriteOSCertHandleToPickle(OSCertHandle cert_handle, - Pickle* pickle) { + base::Pickle* pickle) { return pickle->WriteData( reinterpret_cast<const char*>(cert_handle->derCert.data), cert_handle->derCert.len); diff --git a/net/cert/x509_certificate_openssl.cc b/net/cert/x509_certificate_openssl.cc index 5d043d1..1153832 100644 --- a/net/cert/x509_certificate_openssl.cc +++ b/net/cert/x509_certificate_openssl.cc @@ -343,8 +343,8 @@ bool X509Certificate::IsSameOSCert(X509Certificate::OSCertHandle a, } // static -X509Certificate::OSCertHandle -X509Certificate::ReadOSCertHandleFromPickle(PickleIterator* pickle_iter) { +X509Certificate::OSCertHandle X509Certificate::ReadOSCertHandleFromPickle( + base::PickleIterator* pickle_iter) { const char* data; int length; if (!pickle_iter->ReadData(&data, &length)) @@ -355,7 +355,7 @@ X509Certificate::ReadOSCertHandleFromPickle(PickleIterator* pickle_iter) { // static bool X509Certificate::WriteOSCertHandleToPickle(OSCertHandle cert_handle, - Pickle* pickle) { + base::Pickle* pickle) { base::StringPiece der; if (!x509_util::GetDER(cert_handle, &der)) return false; diff --git a/net/cert/x509_certificate_unittest.cc b/net/cert/x509_certificate_unittest.cc index 4fdb9a7..3bf6671 100644 --- a/net/cert/x509_certificate_unittest.cc +++ b/net/cert/x509_certificate_unittest.cc @@ -613,10 +613,10 @@ TEST(X509CertificateTest, Pickle) { X509Certificate::FreeOSCertHandle(google_cert_handle); X509Certificate::FreeOSCertHandle(thawte_cert_handle); - Pickle pickle; + base::Pickle pickle; cert->Persist(&pickle); - PickleIterator iter(pickle); + base::PickleIterator iter(pickle); scoped_refptr<X509Certificate> cert_from_pickle = X509Certificate::CreateFromPickle( &iter, X509Certificate::PICKLETYPE_CERTIFICATE_CHAIN_V3); diff --git a/net/cert/x509_certificate_win.cc b/net/cert/x509_certificate_win.cc index c965f69..3e20c5f 100644 --- a/net/cert/x509_certificate_win.cc +++ b/net/cert/x509_certificate_win.cc @@ -372,8 +372,8 @@ SHA1HashValue X509Certificate::CalculateCAFingerprint( } // static -X509Certificate::OSCertHandle -X509Certificate::ReadOSCertHandleFromPickle(PickleIterator* pickle_iter) { +X509Certificate::OSCertHandle X509Certificate::ReadOSCertHandleFromPickle( + base::PickleIterator* pickle_iter) { const char* data; int length; if (!pickle_iter->ReadData(&data, &length)) @@ -411,7 +411,7 @@ X509Certificate::ReadOSCertHandleFromPickle(PickleIterator* pickle_iter) { // static bool X509Certificate::WriteOSCertHandleToPickle(OSCertHandle cert_handle, - Pickle* pickle) { + base::Pickle* pickle) { return pickle->WriteData( reinterpret_cast<char*>(cert_handle->pbCertEncoded), cert_handle->cbCertEncoded); diff --git a/net/cert/x509_util_nss_certs.cc b/net/cert/x509_util_nss_certs.cc index b308355..78112b44 100644 --- a/net/cert/x509_util_nss_certs.cc +++ b/net/cert/x509_util_nss_certs.cc @@ -239,7 +239,7 @@ X509Certificate::OSCertHandles CreateOSCertHandlesFromBytes( } X509Certificate::OSCertHandle ReadOSCertHandleFromPickle( - PickleIterator* pickle_iter) { + base::PickleIterator* pickle_iter) { const char* data; int length; if (!pickle_iter->ReadData(&data, &length)) diff --git a/net/disk_cache/simple/simple_index.cc b/net/disk_cache/simple/simple_index.cc index 6eb60bd..fd01abd 100644 --- a/net/disk_cache/simple/simple_index.cc +++ b/net/disk_cache/simple/simple_index.cc @@ -119,14 +119,14 @@ void EntryMetadata::SetEntrySize(uint64 entry_size) { entry_size_ = base::checked_cast<int32>(entry_size); } -void EntryMetadata::Serialize(Pickle* pickle) const { +void EntryMetadata::Serialize(base::Pickle* pickle) const { DCHECK(pickle); int64 internal_last_used_time = GetLastUsedTime().ToInternalValue(); pickle->WriteInt64(internal_last_used_time); pickle->WriteUInt64(entry_size_); } -bool EntryMetadata::Deserialize(PickleIterator* it) { +bool EntryMetadata::Deserialize(base::PickleIterator* it) { DCHECK(it); int64 tmp_last_used_time; uint64 tmp_entry_size; diff --git a/net/disk_cache/simple/simple_index_file.cc b/net/disk_cache/simple/simple_index_file.cc index 95b2bae..c013084 100644 --- a/net/disk_cache/simple/simple_index_file.cc +++ b/net/disk_cache/simple/simple_index_file.cc @@ -33,7 +33,7 @@ const int kEntryFilesSuffixLength = 2; const uint64 kMaxEntiresInIndex = 100000000; -uint32 CalculatePickleCRC(const Pickle& pickle) { +uint32 CalculatePickleCRC(const base::Pickle& pickle) { return crc32(crc32(0, Z_NULL, 0), reinterpret_cast<const Bytef*>(pickle.payload()), pickle.payload_size()); @@ -68,7 +68,7 @@ void UmaRecordIndexInitMethod(IndexInitMethod method, method, INITIALIZE_METHOD_MAX); } -bool WritePickleFile(Pickle* pickle, const base::FilePath& file_name) { +bool WritePickleFile(base::Pickle* pickle, const base::FilePath& file_name) { File file( file_name, File::FLAG_CREATE | File::FLAG_WRITE | File::FLAG_SHARE_DELETE); @@ -166,7 +166,7 @@ SimpleIndexFile::IndexMetadata::IndexMetadata( number_of_entries_(number_of_entries), cache_size_(cache_size) {} -void SimpleIndexFile::IndexMetadata::Serialize(Pickle* pickle) const { +void SimpleIndexFile::IndexMetadata::Serialize(base::Pickle* pickle) const { DCHECK(pickle); pickle->WriteUInt64(magic_number_); pickle->WriteUInt32(version_); @@ -176,7 +176,7 @@ void SimpleIndexFile::IndexMetadata::Serialize(Pickle* pickle) const { // static bool SimpleIndexFile::SerializeFinalData(base::Time cache_modified, - Pickle* pickle) { + base::Pickle* pickle) { if (!pickle->WriteInt64(cache_modified.ToInternalValue())) return false; SimpleIndexFile::PickleHeader* header_p = pickle->headerT<PickleHeader>(); @@ -184,7 +184,7 @@ bool SimpleIndexFile::SerializeFinalData(base::Time cache_modified, return true; } -bool SimpleIndexFile::IndexMetadata::Deserialize(PickleIterator* it) { +bool SimpleIndexFile::IndexMetadata::Deserialize(base::PickleIterator* it) { DCHECK(it); return it->ReadUInt64(&magic_number_) && it->ReadUInt32(&version_) && @@ -196,7 +196,7 @@ void SimpleIndexFile::SyncWriteToDisk(net::CacheType cache_type, const base::FilePath& cache_directory, const base::FilePath& index_filename, const base::FilePath& temp_index_filename, - scoped_ptr<Pickle> pickle, + scoped_ptr<base::Pickle> pickle, const base::TimeTicks& start_time, bool app_on_background) { DCHECK_EQ(index_filename.DirName().value(), @@ -281,7 +281,7 @@ void SimpleIndexFile::WriteToDisk(const SimpleIndex::EntrySet& entry_set, bool app_on_background, const base::Closure& callback) { IndexMetadata index_metadata(entry_set.size(), cache_size); - scoped_ptr<Pickle> pickle = Serialize(index_metadata, entry_set); + scoped_ptr<base::Pickle> pickle = Serialize(index_metadata, entry_set); base::Closure task = base::Bind(&SimpleIndexFile::SyncWriteToDisk, cache_type_, cache_directory_, index_file_, temp_index_file_, @@ -369,10 +369,11 @@ void SimpleIndexFile::SyncLoadFromDisk(const base::FilePath& index_filename, } // static -scoped_ptr<Pickle> SimpleIndexFile::Serialize( +scoped_ptr<base::Pickle> SimpleIndexFile::Serialize( const SimpleIndexFile::IndexMetadata& index_metadata, const SimpleIndex::EntrySet& entries) { - scoped_ptr<Pickle> pickle(new Pickle(sizeof(SimpleIndexFile::PickleHeader))); + scoped_ptr<base::Pickle> pickle( + new base::Pickle(sizeof(SimpleIndexFile::PickleHeader))); index_metadata.Serialize(pickle.get()); for (SimpleIndex::EntrySet::const_iterator it = entries.begin(); @@ -392,13 +393,13 @@ void SimpleIndexFile::Deserialize(const char* data, int data_len, out_result->Reset(); SimpleIndex::EntrySet* entries = &out_result->entries; - Pickle pickle(data, data_len); + base::Pickle pickle(data, data_len); if (!pickle.data()) { LOG(WARNING) << "Corrupt Simple Index File."; return; } - PickleIterator pickle_it(pickle); + base::PickleIterator pickle_it(pickle); SimpleIndexFile::PickleHeader* header_p = pickle.headerT<SimpleIndexFile::PickleHeader>(); const uint32 crc_read = header_p->crc; diff --git a/net/disk_cache/simple/simple_index_file.h b/net/disk_cache/simple/simple_index_file.h index 17aee44..d044301 100644 --- a/net/disk_cache/simple/simple_index_file.h +++ b/net/disk_cache/simple/simple_index_file.h @@ -115,7 +115,8 @@ class NET_EXPORT_PRIVATE SimpleIndexFile { base::Time* out_last_cache_seen_by_index, SimpleIndexLoadResult* out_result); - // Returns a scoped_ptr for a newly allocated Pickle containing the serialized + // Returns a scoped_ptr for a newly allocated base::Pickle containing the + // serialized // data to be written to a file. Note: the pickle is not in a consistent state // immediately after calling this menthod, one needs to call // SerializeFinalData to make it ready to write to a file. diff --git a/net/disk_cache/simple/simple_index_file_unittest.cc b/net/disk_cache/simple/simple_index_file_unittest.cc index 4cedab2..0732fbc 100644 --- a/net/disk_cache/simple/simple_index_file_unittest.cc +++ b/net/disk_cache/simple/simple_index_file_unittest.cc @@ -50,9 +50,9 @@ TEST(IndexMetadataTest, Basics) { TEST(IndexMetadataTest, Serialize) { SimpleIndexFile::IndexMetadata index_metadata(123, 456); - Pickle pickle; + base::Pickle pickle; index_metadata.Serialize(&pickle); - PickleIterator it(pickle); + base::PickleIterator it(pickle); SimpleIndexFile::IndexMetadata new_index_metadata; new_index_metadata.Deserialize(&it); @@ -114,8 +114,8 @@ TEST_F(SimpleIndexFileTest, Serialize) { SimpleIndex::InsertInEntrySet(hash, metadata_entries[i], &entries); } - scoped_ptr<Pickle> pickle = WrappedSimpleIndexFile::Serialize( - index_metadata, entries); + scoped_ptr<base::Pickle> pickle = + WrappedSimpleIndexFile::Serialize(index_metadata, entries); EXPECT_TRUE(pickle.get() != NULL); base::Time now = base::Time::Now(); EXPECT_TRUE(WrappedSimpleIndexFile::SerializeFinalData(now, pickle.get())); diff --git a/net/disk_cache/simple/simple_index_unittest.cc b/net/disk_cache/simple/simple_index_unittest.cc index a74cb10..3741070 100644 --- a/net/disk_cache/simple/simple_index_unittest.cc +++ b/net/disk_cache/simple/simple_index_unittest.cc @@ -188,10 +188,10 @@ TEST_F(EntryMetadataTest, Basics) { TEST_F(EntryMetadataTest, Serialize) { EntryMetadata entry_metadata = NewEntryMetadataWithValues(); - Pickle pickle; + base::Pickle pickle; entry_metadata.Serialize(&pickle); - PickleIterator it(pickle); + base::PickleIterator it(pickle); EntryMetadata new_entry_metadata; new_entry_metadata.Deserialize(&it); CheckEntryMetadataValues(new_entry_metadata); diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index b5a79a3..c3bdd30 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -569,7 +569,7 @@ disk_cache::Backend* HttpCache::GetCurrentBackend() const { bool HttpCache::ParseResponseInfo(const char* data, int len, HttpResponseInfo* response_info, bool* response_truncated) { - Pickle pickle(data, len); + base::Pickle pickle(data, len); return response_info->InitFromPickle(pickle, response_truncated); } diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc index 50802e8..62a3d6a 100644 --- a/net/http/http_cache_unittest.cc +++ b/net/http/http_cache_unittest.cc @@ -5467,7 +5467,7 @@ TEST(HttpCache, PersistHttpResponseInfo) { response1.headers = new HttpResponseHeaders("HTTP/1.1 200 OK"); // Pickle. - Pickle pickle; + base::Pickle pickle; response1.Persist(&pickle, false, false); // Unpickle. diff --git a/net/http/http_response_headers.cc b/net/http/http_response_headers.cc index 8c5a9ea..d56f8f0 100644 --- a/net/http/http_response_headers.cc +++ b/net/http/http_response_headers.cc @@ -156,14 +156,15 @@ HttpResponseHeaders::HttpResponseHeaders(const std::string& raw_input) HttpUtil::GetStatusCodesForHistogram()); } -HttpResponseHeaders::HttpResponseHeaders(PickleIterator* iter) +HttpResponseHeaders::HttpResponseHeaders(base::PickleIterator* iter) : response_code_(-1) { std::string raw_input; if (iter->ReadString(&raw_input)) Parse(raw_input); } -void HttpResponseHeaders::Persist(Pickle* pickle, PersistOptions options) { +void HttpResponseHeaders::Persist(base::Pickle* pickle, + PersistOptions options) { if (options == PERSIST_RAW) { pickle->WriteString(raw_headers_); return; // Done. diff --git a/net/http/http_response_headers_unittest.cc b/net/http/http_response_headers_unittest.cc index c3aff96e..0184885 100644 --- a/net/http/http_response_headers_unittest.cc +++ b/net/http/http_response_headers_unittest.cc @@ -315,10 +315,10 @@ TEST_P(PersistenceTest, Persist) { HeadersToRaw(&headers); scoped_refptr<HttpResponseHeaders> parsed1(new HttpResponseHeaders(headers)); - Pickle pickle; + base::Pickle pickle; parsed1->Persist(&pickle, test.options); - PickleIterator iter(pickle); + base::PickleIterator iter(pickle); scoped_refptr<HttpResponseHeaders> parsed2(new HttpResponseHeaders(&iter)); std::string h2; diff --git a/net/http/http_response_info.cc b/net/http/http_response_info.cc index ba118ac..d569d05 100644 --- a/net/http/http_response_info.cc +++ b/net/http/http_response_info.cc @@ -159,9 +159,9 @@ HttpResponseInfo& HttpResponseInfo::operator=(const HttpResponseInfo& rhs) { return *this; } -bool HttpResponseInfo::InitFromPickle(const Pickle& pickle, +bool HttpResponseInfo::InitFromPickle(const base::Pickle& pickle, bool* response_truncated) { - PickleIterator iter(pickle); + base::PickleIterator iter(pickle); // Read flags and verify version int flags; @@ -287,7 +287,7 @@ bool HttpResponseInfo::InitFromPickle(const Pickle& pickle, return true; } -void HttpResponseInfo::Persist(Pickle* pickle, +void HttpResponseInfo::Persist(base::Pickle* pickle, bool skip_transient_headers, bool response_truncated) const { int flags = RESPONSE_INFO_VERSION; diff --git a/net/http/http_response_info_unittest.cc b/net/http/http_response_info_unittest.cc index b0f9155..ef7d411 100644 --- a/net/http/http_response_info_unittest.cc +++ b/net/http/http_response_info_unittest.cc @@ -20,7 +20,7 @@ class HttpResponseInfoTest : public testing::Test { void PickleAndRestore(const HttpResponseInfo& response_info, HttpResponseInfo* restored_response_info) const { - Pickle pickle; + base::Pickle pickle; response_info.Persist(&pickle, false, false); bool truncated = false; restored_response_info->InitFromPickle(pickle, &truncated); diff --git a/net/http/http_vary_data.cc b/net/http/http_vary_data.cc index f2f853c..9938d29 100644 --- a/net/http/http_vary_data.cc +++ b/net/http/http_vary_data.cc @@ -64,7 +64,7 @@ bool HttpVaryData::Init(const HttpRequestInfo& request_info, return is_valid_ = true; } -bool HttpVaryData::InitFromPickle(PickleIterator* iter) { +bool HttpVaryData::InitFromPickle(base::PickleIterator* iter) { is_valid_ = false; const char* data; if (iter->ReadBytes(&data, sizeof(request_digest_))) { @@ -74,7 +74,7 @@ bool HttpVaryData::InitFromPickle(PickleIterator* iter) { return false; } -void HttpVaryData::Persist(Pickle* pickle) const { +void HttpVaryData::Persist(base::Pickle* pickle) const { DCHECK(is_valid()); pickle->WriteBytes(&request_digest_, sizeof(request_digest_)); } diff --git a/net/http/mock_http_cache.cc b/net/http/mock_http_cache.cc index dd8abd7..19ab420 100644 --- a/net/http/mock_http_cache.cc +++ b/net/http/mock_http_cache.cc @@ -564,7 +564,7 @@ bool MockHttpCache::WriteResponseInfo(disk_cache::Entry* disk_entry, const HttpResponseInfo* response_info, bool skip_transient_headers, bool response_truncated) { - Pickle pickle; + base::Pickle pickle; response_info->Persist( &pickle, skip_transient_headers, response_truncated); diff --git a/net/quic/crypto/quic_server_info.cc b/net/quic/crypto/quic_server_info.cc index c86d1f6..4011151 100644 --- a/net/quic/crypto/quic_server_info.cc +++ b/net/quic/crypto/quic_server_info.cc @@ -63,8 +63,8 @@ bool QuicServerInfo::ParseInner(const string& data) { return false; } - Pickle p(data.data(), data.size()); - PickleIterator iter(p); + base::Pickle p(data.data(), data.size()); + base::PickleIterator iter(p); int version = -1; if (!iter.ReadInt(&version)) { @@ -116,7 +116,7 @@ string QuicServerInfo::Serialize() { } string QuicServerInfo::SerializeInner() const { - Pickle p(sizeof(Pickle::Header)); + base::Pickle p(sizeof(base::Pickle::Header)); if (!p.WriteInt(kQuicCryptoConfigVersion) || !p.WriteString(state_.server_config) || diff --git a/net/url_request/view_cache_helper_unittest.cc b/net/url_request/view_cache_helper_unittest.cc index 213a6f1..284482a 100644 --- a/net/url_request/view_cache_helper_unittest.cc +++ b/net/url_request/view_cache_helper_unittest.cc @@ -41,7 +41,7 @@ void WriteHeaders(disk_cache::Entry* entry, int flags, if (data.empty()) return; - Pickle pickle; + base::Pickle pickle; pickle.WriteInt(flags | 1); // Version 1. pickle.WriteInt64(0); pickle.WriteInt64(0); diff --git a/ppapi/nacl_irt/ppapi_dispatcher.cc b/ppapi/nacl_irt/ppapi_dispatcher.cc index bd3f490..1e7ad10 100644 --- a/ppapi/nacl_irt/ppapi_dispatcher.cc +++ b/ppapi/nacl_irt/ppapi_dispatcher.cc @@ -202,7 +202,7 @@ void PpapiDispatcher::OnMsgInitializeNaClDispatcher( void PpapiDispatcher::OnPluginDispatcherMessageReceived( const IPC::Message& msg) { // The first parameter should be a plugin dispatcher ID. - PickleIterator iter(msg); + base::PickleIterator iter(msg); uint32 id = 0; if (!iter.ReadUInt32(&id)) { NOTREACHED(); diff --git a/ppapi/proxy/ppapi_param_traits.cc b/ppapi/proxy/ppapi_param_traits.cc index c3e5af1..3895b31 100644 --- a/ppapi/proxy/ppapi_param_traits.cc +++ b/ppapi/proxy/ppapi_param_traits.cc @@ -36,9 +36,9 @@ namespace { // // The solution is to make a new object for each deserialized item, and then // add it to the vector one at a time. -template<typename T> +template <typename T> bool ReadVectorWithoutCopy(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, std::vector<T>* output) { // This part is just a copy of the the default ParamTraits vector Read(). int size; @@ -81,7 +81,7 @@ void ParamTraits<PP_Bool>::Write(Message* m, const param_type& p) { // static bool ParamTraits<PP_Bool>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* r) { // We specifically want to be strict here about what types of input we accept, // which ParamTraits<bool> does for us. We don't want to deserialize "2" into @@ -109,7 +109,7 @@ void ParamTraits<PP_KeyInformation>::Write(Message* m, const param_type& p) { // static bool ParamTraits<PP_KeyInformation>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* p) { uint32_t size; if (!ReadParam(m, iter, &size)) @@ -154,7 +154,7 @@ void ParamTraits<PP_NetAddress_Private>::Write(Message* m, // static bool ParamTraits<PP_NetAddress_Private>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* p) { uint16 size; if (!ReadParam(m, iter, &size)) @@ -189,7 +189,7 @@ void ParamTraits<ppapi::HostResource>::Write(Message* m, // static bool ParamTraits<ppapi::HostResource>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* r) { PP_Instance instance; PP_Resource resource; @@ -215,7 +215,7 @@ void ParamTraits<ppapi::proxy::SerializedVar>::Write(Message* m, // static bool ParamTraits<ppapi::proxy::SerializedVar>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* r) { return r->ReadFromMessage(m, iter); } @@ -234,9 +234,9 @@ void ParamTraits< std::vector<ppapi::proxy::SerializedVar> >::Write( } // static -bool ParamTraits< std::vector<ppapi::proxy::SerializedVar> >::Read( +bool ParamTraits<std::vector<ppapi::proxy::SerializedVar>>::Read( const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* r) { return ReadVectorWithoutCopy(m, iter, r); } @@ -256,7 +256,7 @@ void ParamTraits<ppapi::PpapiPermissions>::Write(Message* m, // static bool ParamTraits<ppapi::PpapiPermissions>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* r) { uint32_t bits; if (!ParamTraits<uint32_t>::Read(m, iter, &bits)) @@ -291,9 +291,10 @@ void ParamTraits<ppapi::proxy::SerializedHandle>::Write(Message* m, } // static -bool ParamTraits<ppapi::proxy::SerializedHandle>::Read(const Message* m, - PickleIterator* iter, - param_type* r) { +bool ParamTraits<ppapi::proxy::SerializedHandle>::Read( + const Message* m, + base::PickleIterator* iter, + param_type* r) { ppapi::proxy::SerializedHandle::Header header; if (!ppapi::proxy::SerializedHandle::ReadHeader(iter, &header)) return false; @@ -351,7 +352,7 @@ void ParamTraits<ppapi::proxy::PPBURLLoader_UpdateProgress_Params>::Write( // static bool ParamTraits<ppapi::proxy::PPBURLLoader_UpdateProgress_Params>::Read( const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* r) { return ParamTraits<PP_Instance>::Read(m, iter, &r->instance) && @@ -397,7 +398,7 @@ void ParamTraits<ppapi::proxy::PPBFlash_DrawGlyphs_Params>::Write( // static bool ParamTraits<ppapi::proxy::PPBFlash_DrawGlyphs_Params>::Read( const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* r) { return ParamTraits<PP_Instance>::Read(m, iter, &r->instance) && @@ -438,9 +439,10 @@ void ParamTraits<ppapi::proxy::SerializedDirEntry>::Write(Message* m, } // static -bool ParamTraits<ppapi::proxy::SerializedDirEntry>::Read(const Message* m, - PickleIterator* iter, - param_type* r) { +bool ParamTraits<ppapi::proxy::SerializedDirEntry>::Read( + const Message* m, + base::PickleIterator* iter, + param_type* r) { return ParamTraits<std::string>::Read(m, iter, &r->name) && ParamTraits<bool>::Read(m, iter, &r->is_dir); } @@ -469,7 +471,7 @@ void ParamTraits<ppapi::proxy::SerializedFontDescription>::Write( // static bool ParamTraits<ppapi::proxy::SerializedFontDescription>::Read( const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* r) { return ParamTraits<std::string>::Read(m, iter, &r->face) && @@ -506,7 +508,7 @@ void ParamTraits<ppapi::proxy::SerializedTrueTypeFontDesc>::Write( // static bool ParamTraits<ppapi::proxy::SerializedTrueTypeFontDesc>::Read( const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* r) { return ParamTraits<std::string>::Read(m, iter, &r->family) && @@ -536,7 +538,7 @@ void ParamTraits<ppapi::PepperFilePath>::Write(Message* m, // static bool ParamTraits<ppapi::PepperFilePath>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* p) { unsigned domain; base::FilePath path; @@ -570,9 +572,10 @@ void ParamTraits<ppapi::proxy::SerializedFlashMenu>::Write( } // static -bool ParamTraits<ppapi::proxy::SerializedFlashMenu>::Read(const Message* m, - PickleIterator* iter, - param_type* r) { +bool ParamTraits<ppapi::proxy::SerializedFlashMenu>::Read( + const Message* m, + base::PickleIterator* iter, + param_type* r) { return r->ReadFromMessage(m, iter); } @@ -592,9 +595,10 @@ void ParamTraits<ppapi::PPB_X509Certificate_Fields>::Write( } // static -bool ParamTraits<ppapi::PPB_X509Certificate_Fields>::Read(const Message* m, - PickleIterator* iter, - param_type* r) { +bool ParamTraits<ppapi::PPB_X509Certificate_Fields>::Read( + const Message* m, + base::PickleIterator* iter, + param_type* r) { return ParamTraits<base::ListValue>::Read(m, iter, &(r->values_)); } @@ -640,7 +644,7 @@ void ParamTraits<ppapi::SocketOptionData>::Write(Message* m, // static bool ParamTraits<ppapi::SocketOptionData>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* r) { *r = ppapi::SocketOptionData(); int32_t type = 0; @@ -692,7 +696,7 @@ void ParamTraits<ppapi::CompositorLayerData::Transform>::Write( // static bool ParamTraits<ppapi::CompositorLayerData::Transform>::Read( const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, param_type* r) { for (size_t i = 0; i < arraysize(r->matrix);i++) { if (!ParamTraits<float>::Read(m, iter, &r->matrix[i])) diff --git a/ppapi/proxy/raw_var_data.cc b/ppapi/proxy/raw_var_data.cc index ac925c9..12483f7 100644 --- a/ppapi/proxy/raw_var_data.cc +++ b/ppapi/proxy/raw_var_data.cc @@ -185,7 +185,7 @@ void RawVarDataGraph::Write(IPC::Message* m, // static scoped_ptr<RawVarDataGraph> RawVarDataGraph::Read(const IPC::Message* m, - PickleIterator* iter) { + base::PickleIterator* iter) { scoped_ptr<RawVarDataGraph> result(new RawVarDataGraph); uint32_t size = 0; if (!iter->ReadUInt32(&size)) @@ -312,7 +312,7 @@ void BasicRawVarData::Write( bool BasicRawVarData::Read(PP_VarType type, const IPC::Message* m, - PickleIterator* iter) { + base::PickleIterator* iter) { PP_Var result; result.type = type; switch (type) { @@ -384,7 +384,7 @@ void StringRawVarData::Write(IPC::Message* m, bool StringRawVarData::Read(PP_VarType type, const IPC::Message* m, - PickleIterator* iter) { + base::PickleIterator* iter) { if (!iter->ReadString(&data_)) return false; return true; @@ -501,7 +501,7 @@ void ArrayBufferRawVarData::Write( bool ArrayBufferRawVarData::Read(PP_VarType type, const IPC::Message* m, - PickleIterator* iter) { + base::PickleIterator* iter) { int shmem_type; if (!iter->ReadInt(&shmem_type)) return false; @@ -582,7 +582,7 @@ void ArrayRawVarData::Write(IPC::Message* m, bool ArrayRawVarData::Read(PP_VarType type, const IPC::Message* m, - PickleIterator* iter) { + base::PickleIterator* iter) { uint32_t size; if (!iter->ReadUInt32(&size)) return false; @@ -648,7 +648,7 @@ void DictionaryRawVarData::Write( bool DictionaryRawVarData::Read(PP_VarType type, const IPC::Message* m, - PickleIterator* iter) { + base::PickleIterator* iter) { uint32_t size; if (!iter->ReadUInt32(&size)) return false; @@ -725,7 +725,7 @@ void ResourceRawVarData::Write(IPC::Message* m, bool ResourceRawVarData::Read(PP_VarType type, const IPC::Message* m, - PickleIterator* iter) { + base::PickleIterator* iter) { int value; if (!iter->ReadInt(&value)) return false; diff --git a/ppapi/proxy/raw_var_data_unittest.cc b/ppapi/proxy/raw_var_data_unittest.cc index f555990..ac353b9 100644 --- a/ppapi/proxy/raw_var_data_unittest.cc +++ b/ppapi/proxy/raw_var_data_unittest.cc @@ -57,7 +57,7 @@ bool WriteAndRead(const PP_Var& var, PP_Var* result) { return false; IPC::Message m; expected_data->Write(&m, base::Bind(&DefaultHandleWriter)); - PickleIterator iter(m); + base::PickleIterator iter(m); scoped_ptr<RawVarDataGraph> actual_data(RawVarDataGraph::Read(&m, &iter)); *result = actual_data->CreatePPVar(dummy_instance); return true; diff --git a/ppapi/proxy/resource_message_params.cc b/ppapi/proxy/resource_message_params.cc index e4858da..dc15594 100644 --- a/ppapi/proxy/resource_message_params.cc +++ b/ppapi/proxy/resource_message_params.cc @@ -46,7 +46,7 @@ void ResourceMessageParams::Serialize(IPC::Message* msg) const { } bool ResourceMessageParams::Deserialize(const IPC::Message* msg, - PickleIterator* iter) { + base::PickleIterator* iter) { return ReadHeader(msg, iter) && ReadHandles(msg, iter); } @@ -61,7 +61,7 @@ void ResourceMessageParams::WriteHandles(IPC::Message* msg) const { } bool ResourceMessageParams::ReadHeader(const IPC::Message* msg, - PickleIterator* iter) { + base::PickleIterator* iter) { DCHECK(handles_->data().empty()); handles_->set_should_close(true); return IPC::ParamTraits<PP_Resource>::Read(msg, iter, &pp_resource_) && @@ -69,7 +69,7 @@ bool ResourceMessageParams::ReadHeader(const IPC::Message* msg, } bool ResourceMessageParams::ReadHandles(const IPC::Message* msg, - PickleIterator* iter) { + base::PickleIterator* iter) { return IPC::ParamTraits<std::vector<SerializedHandle> >::Read( msg, iter, &handles_->data()); } @@ -159,7 +159,7 @@ void ResourceMessageCallParams::Serialize(IPC::Message* msg) const { } bool ResourceMessageCallParams::Deserialize(const IPC::Message* msg, - PickleIterator* iter) { + base::PickleIterator* iter) { if (!ResourceMessageParams::Deserialize(msg, iter)) return false; return IPC::ParamTraits<bool>::Read(msg, iter, &has_callback_); @@ -189,7 +189,7 @@ void ResourceMessageReplyParams::Serialize(IPC::Message* msg) const { } bool ResourceMessageReplyParams::Deserialize(const IPC::Message* msg, - PickleIterator* iter) { + base::PickleIterator* iter) { return (ReadHeader(msg, iter) && IPC::ParamTraits<int32_t>::Read(msg, iter, &result_) && ReadHandles(msg, iter)); diff --git a/ppapi/proxy/serialized_flash_menu.cc b/ppapi/proxy/serialized_flash_menu.cc index 9f39916..cda9545 100644 --- a/ppapi/proxy/serialized_flash_menu.cc +++ b/ppapi/proxy/serialized_flash_menu.cc @@ -20,7 +20,9 @@ const uint32_t kMaxMenuEntries = 1000; bool CheckMenu(int depth, const PP_Flash_Menu* menu); void FreeMenu(const PP_Flash_Menu* menu); void WriteMenu(IPC::Message* m, const PP_Flash_Menu* menu); -PP_Flash_Menu* ReadMenu(int depth, const IPC::Message* m, PickleIterator* iter); +PP_Flash_Menu* ReadMenu(int depth, + const IPC::Message* m, + base::PickleIterator* iter); bool CheckMenuItem(int depth, const PP_Flash_MenuItem* item) { if (item->type == PP_FLASH_MENUITEM_TYPE_SUBMENU) @@ -78,7 +80,7 @@ void FreeMenu(const PP_Flash_Menu* menu) { bool ReadMenuItem(int depth, const IPC::Message* m, - PickleIterator* iter, + base::PickleIterator* iter, PP_Flash_MenuItem* menu_item) { uint32_t type; if (!iter->ReadUInt32(&type)) @@ -108,7 +110,7 @@ bool ReadMenuItem(int depth, PP_Flash_Menu* ReadMenu(int depth, const IPC::Message* m, - PickleIterator* iter) { + base::PickleIterator* iter) { if (depth > kMaxMenuDepth) return NULL; ++depth; @@ -167,7 +169,7 @@ void SerializedFlashMenu::WriteToMessage(IPC::Message* m) const { } bool SerializedFlashMenu::ReadFromMessage(const IPC::Message* m, - PickleIterator* iter) { + base::PickleIterator* iter) { DCHECK(!pp_menu_); pp_menu_ = ReadMenu(0, m, iter); if (!pp_menu_) diff --git a/ppapi/proxy/serialized_handle.cc b/ppapi/proxy/serialized_handle.cc index 7d06c76..ee0f359 100644 --- a/ppapi/proxy/serialized_handle.cc +++ b/ppapi/proxy/serialized_handle.cc @@ -90,7 +90,7 @@ void SerializedHandle::Close() { } // static -bool SerializedHandle::WriteHeader(const Header& hdr, Pickle* pickle) { +bool SerializedHandle::WriteHeader(const Header& hdr, base::Pickle* pickle) { if (!pickle->WriteInt(hdr.type)) return false; if (hdr.type == SHARED_MEMORY) { @@ -105,7 +105,7 @@ bool SerializedHandle::WriteHeader(const Header& hdr, Pickle* pickle) { } // static -bool SerializedHandle::ReadHeader(PickleIterator* iter, Header* hdr) { +bool SerializedHandle::ReadHeader(base::PickleIterator* iter, Header* hdr) { *hdr = Header(INVALID, 0, 0, 0); int type = 0; if (!iter->ReadInt(&type)) diff --git a/ppapi/proxy/serialized_var.cc b/ppapi/proxy/serialized_var.cc index eb7ba4e..4d3ecff 100644 --- a/ppapi/proxy/serialized_var.cc +++ b/ppapi/proxy/serialized_var.cc @@ -135,7 +135,7 @@ void SerializedVar::Inner::WriteDataToMessage( } bool SerializedVar::Inner::ReadFromMessage(const IPC::Message* m, - PickleIterator* iter) { + base::PickleIterator* iter) { #ifndef NDEBUG // We should only deserialize something once or will end up with leaked // references. diff --git a/ppapi/proxy/url_loader_resource.cc b/ppapi/proxy/url_loader_resource.cc index 0697e90..4ac345a 100644 --- a/ppapi/proxy/url_loader_resource.cc +++ b/ppapi/proxy/url_loader_resource.cc @@ -265,7 +265,7 @@ void URLLoaderResource::OnPluginMsgReceivedResponse( void URLLoaderResource::OnPluginMsgSendData( const ResourceMessageReplyParams& params, const IPC::Message& message) { - PickleIterator iter(message); + base::PickleIterator iter(message); const char* data; int data_length; if (!iter.ReadData(&data, &data_length)) { diff --git a/remoting/host/chromoting_param_traits.cc b/remoting/host/chromoting_param_traits.cc index 9434cce..6a46d9c 100644 --- a/remoting/host/chromoting_param_traits.cc +++ b/remoting/host/chromoting_param_traits.cc @@ -18,7 +18,7 @@ void ParamTraits<webrtc::DesktopVector>::Write(Message* m, // static bool ParamTraits<webrtc::DesktopVector>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, webrtc::DesktopVector* r) { int x, y; if (!iter->ReadInt(&x) || !iter->ReadInt(&y)) @@ -43,7 +43,7 @@ void ParamTraits<webrtc::DesktopSize>::Write(Message* m, // static bool ParamTraits<webrtc::DesktopSize>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, webrtc::DesktopSize* r) { int width, height; if (!iter->ReadInt(&width) || !iter->ReadInt(&height)) @@ -70,7 +70,7 @@ void ParamTraits<webrtc::DesktopRect>::Write(Message* m, // static bool ParamTraits<webrtc::DesktopRect>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, webrtc::DesktopRect* r) { int left, right, top, bottom; if (!iter->ReadInt(&left) || !iter->ReadInt(&top) || @@ -110,10 +110,9 @@ void ParamTraits<webrtc::MouseCursor>::Write( } // static -bool ParamTraits<webrtc::MouseCursor>::Read( - const Message* m, - PickleIterator* iter, - webrtc::MouseCursor* r) { +bool ParamTraits<webrtc::MouseCursor>::Read(const Message* m, + base::PickleIterator* iter, + webrtc::MouseCursor* r) { webrtc::DesktopSize size; if (!ParamTraits<webrtc::DesktopSize>::Read(m, iter, &size) || size.width() <= 0 || size.width() > (SHRT_MAX / 2) || @@ -163,7 +162,7 @@ void ParamTraits<remoting::ScreenResolution>::Write( // static bool ParamTraits<remoting::ScreenResolution>::Read( const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, remoting::ScreenResolution* r) { webrtc::DesktopSize size; webrtc::DesktopVector dpi; diff --git a/sandbox/linux/syscall_broker/broker_client.cc b/sandbox/linux/syscall_broker/broker_client.cc index 5af2fb8..760cf59 100644 --- a/sandbox/linux/syscall_broker/broker_client.cc +++ b/sandbox/linux/syscall_broker/broker_client.cc @@ -65,7 +65,7 @@ int BrokerClient::PathAndFlagsSyscall(IPCCommand syscall_type, } } - Pickle write_pickle; + base::Pickle write_pickle; write_pickle.WriteInt(syscall_type); write_pickle.WriteString(pathname); write_pickle.WriteInt(flags); @@ -87,8 +87,8 @@ int BrokerClient::PathAndFlagsSyscall(IPCCommand syscall_type, return -ENOMEM; } - Pickle read_pickle(reinterpret_cast<char*>(reply_buf), msg_len); - PickleIterator iter(read_pickle); + base::Pickle read_pickle(reinterpret_cast<char*>(reply_buf), msg_len); + base::PickleIterator iter(read_pickle); int return_value = -1; // Now deserialize the return value and eventually return the file // descriptor. diff --git a/sandbox/linux/syscall_broker/broker_host.cc b/sandbox/linux/syscall_broker/broker_host.cc index 13f9123..e5957ed 100644 --- a/sandbox/linux/syscall_broker/broker_host.cc +++ b/sandbox/linux/syscall_broker/broker_host.cc @@ -59,7 +59,7 @@ int sys_open(const char* pathname, int flags) { void OpenFileForIPC(const BrokerPolicy& policy, const std::string& requested_filename, int flags, - Pickle* write_pickle, + base::Pickle* write_pickle, std::vector<int>* opened_files) { DCHECK(write_pickle); DCHECK(opened_files); @@ -91,7 +91,7 @@ void OpenFileForIPC(const BrokerPolicy& policy, void AccessFileForIPC(const BrokerPolicy& policy, const std::string& requested_filename, int mode, - Pickle* write_pickle) { + base::Pickle* write_pickle) { DCHECK(write_pickle); const char* file_to_access = NULL; const bool safe_to_access_file = policy.GetFileNameIfAllowedToAccess( @@ -116,14 +116,14 @@ void AccessFileForIPC(const BrokerPolicy& policy, bool HandleRemoteCommand(const BrokerPolicy& policy, IPCCommand command_type, int reply_ipc, - PickleIterator iter) { + base::PickleIterator iter) { // Currently all commands have two arguments: filename and flags. std::string requested_filename; int flags = 0; if (!iter.ReadString(&requested_filename) || !iter.ReadInt(&flags)) return false; - Pickle write_pickle; + base::Pickle write_pickle; std::vector<int> opened_files; switch (command_type) { @@ -194,8 +194,8 @@ BrokerHost::RequestStatus BrokerHost::HandleRequest() const { base::ScopedFD temporary_ipc(fds[0]->Pass()); - Pickle pickle(buf, msg_len); - PickleIterator iter(pickle); + base::Pickle pickle(buf, msg_len); + base::PickleIterator iter(pickle); int command_type; if (iter.ReadInt(&command_type)) { bool command_handled = false; diff --git a/skia/ext/skia_utils_base.cc b/skia/ext/skia_utils_base.cc index 56ca993..6643b49 100644 --- a/skia/ext/skia_utils_base.cc +++ b/skia/ext/skia_utils_base.cc @@ -6,7 +6,7 @@ namespace skia { -bool ReadSkString(PickleIterator* iter, SkString* str) { +bool ReadSkString(base::PickleIterator* iter, SkString* str) { int reply_length; const char* reply_text; @@ -18,7 +18,7 @@ bool ReadSkString(PickleIterator* iter, SkString* str) { return true; } -bool ReadSkFontIdentity(PickleIterator* iter, +bool ReadSkFontIdentity(base::PickleIterator* iter, SkFontConfigInterface::FontIdentity* identity) { uint32_t reply_id; uint32_t reply_ttcIndex; @@ -38,11 +38,11 @@ bool ReadSkFontIdentity(PickleIterator* iter, return true; } -bool WriteSkString(Pickle* pickle, const SkString& str) { +bool WriteSkString(base::Pickle* pickle, const SkString& str) { return pickle->WriteData(str.c_str(), str.size()); } -bool WriteSkFontIdentity(Pickle* pickle, +bool WriteSkFontIdentity(base::Pickle* pickle, const SkFontConfigInterface::FontIdentity& identity) { return pickle->WriteUInt32(identity.fID) && pickle->WriteUInt32(identity.fTTCIndex) && diff --git a/storage/browser/fileapi/file_system_usage_cache.cc b/storage/browser/fileapi/file_system_usage_cache.cc index 8c65177..f1d3ece 100644 --- a/storage/browser/fileapi/file_system_usage_cache.cc +++ b/storage/browser/fileapi/file_system_usage_cache.cc @@ -38,8 +38,7 @@ const int FileSystemUsageCache::kUsageFileHeaderSize = 4; // Pickle::{Read,Write}Bool treat bool as int const int FileSystemUsageCache::kUsageFileSize = - sizeof(Pickle::Header) + - FileSystemUsageCache::kUsageFileHeaderSize + + sizeof(base::Pickle::Header) + FileSystemUsageCache::kUsageFileHeaderSize + sizeof(int) + sizeof(int32) + sizeof(int64); // NOLINT bool FileSystemUsageCache::GetUsage(const base::FilePath& usage_file_path, @@ -176,8 +175,8 @@ bool FileSystemUsageCache::Read(const base::FilePath& usage_file_path, if (usage_file_path.empty() || !ReadBytes(usage_file_path, buffer, kUsageFileSize)) return false; - Pickle read_pickle(buffer, kUsageFileSize); - PickleIterator iter(read_pickle); + base::Pickle read_pickle(buffer, kUsageFileSize); + base::PickleIterator iter(read_pickle); uint32 dirty = 0; int64 usage = 0; @@ -204,7 +203,7 @@ bool FileSystemUsageCache::Write(const base::FilePath& usage_file_path, int64 usage) { TRACE_EVENT0("FileSystem", "UsageCache::Write"); DCHECK(CalledOnValidThread()); - Pickle write_pickle; + base::Pickle write_pickle; write_pickle.WriteBytes(kUsageFileHeader, kUsageFileHeaderSize); write_pickle.WriteBool(is_valid); write_pickle.WriteUInt32(dirty); diff --git a/storage/browser/fileapi/sandbox_directory_database.cc b/storage/browser/fileapi/sandbox_directory_database.cc index 976a3fa..4543863 100644 --- a/storage/browser/fileapi/sandbox_directory_database.cc +++ b/storage/browser/fileapi/sandbox_directory_database.cc @@ -25,7 +25,7 @@ namespace { bool PickleFromFileInfo(const storage::SandboxDirectoryDatabase::FileInfo& info, - Pickle* pickle) { + base::Pickle* pickle) { DCHECK(pickle); std::string data_path; // Round off here to match the behavior of the filesystem on real files. @@ -46,9 +46,9 @@ bool PickleFromFileInfo(const storage::SandboxDirectoryDatabase::FileInfo& info, return false; } -bool FileInfoFromPickle(const Pickle& pickle, +bool FileInfoFromPickle(const base::Pickle& pickle, storage::SandboxDirectoryDatabase::FileInfo* info) { - PickleIterator iter(pickle); + base::PickleIterator iter(pickle); std::string data_path; std::string name; int64 internal_time; @@ -62,7 +62,7 @@ bool FileInfoFromPickle(const Pickle& pickle, info->modification_time = base::Time::FromInternalValue(internal_time); return true; } - LOG(ERROR) << "Pickle could not be digested!"; + LOG(ERROR) << "base::Pickle could not be digested!"; return false; } @@ -224,7 +224,8 @@ bool DatabaseCheckHelper::ScanDatabase() { // value: "<pickled FileInfo>" FileInfo file_info; if (!FileInfoFromPickle( - Pickle(itr->value().data(), itr->value().size()), &file_info)) + base::Pickle(itr->value().data(), itr->value().size()), + &file_info)) return false; FileId file_id = -1; @@ -498,7 +499,7 @@ bool SandboxDirectoryDatabase::GetFileInfo(FileId file_id, FileInfo* info) { db_->Get(leveldb::ReadOptions(), file_key, &file_data_string); if (status.ok()) { bool success = FileInfoFromPickle( - Pickle(file_data_string.data(), file_data_string.length()), info); + base::Pickle(file_data_string.data(), file_data_string.length()), info); if (!success) return false; if (!VerifyDataPath(info->data_path)) { @@ -621,7 +622,7 @@ bool SandboxDirectoryDatabase::UpdateModificationTime( if (!GetFileInfo(file_id, &info)) return false; info.modification_time = modification_time; - Pickle pickle; + base::Pickle pickle; if (!PickleFromFileInfo(info, &pickle)) return false; leveldb::Status status = db_->Put( @@ -653,7 +654,7 @@ bool SandboxDirectoryDatabase::OverwritingMoveFile( dest_file_info.data_path = src_file_info.data_path; if (!RemoveFileInfoHelper(src_file_id, &batch)) return false; - Pickle pickle; + base::Pickle pickle; if (!PickleFromFileInfo(dest_file_info, &pickle)) return false; batch.Put( @@ -899,7 +900,7 @@ bool SandboxDirectoryDatabase::AddFileInfoHelper( std::string child_key = GetChildLookupKey(info.parent_id, info.name); batch->Put(child_key, id_string); } - Pickle pickle; + base::Pickle pickle; if (!PickleFromFileInfo(info, &pickle)) return false; batch->Put( diff --git a/storage/browser/fileapi/sandbox_prioritized_origin_database.cc b/storage/browser/fileapi/sandbox_prioritized_origin_database.cc index 9a64edf..3a677a8 100644 --- a/storage/browser/fileapi/sandbox_prioritized_origin_database.cc +++ b/storage/browser/fileapi/sandbox_prioritized_origin_database.cc @@ -30,7 +30,7 @@ bool WritePrimaryOriginFile(const base::FilePath& path, return false; if (!file.created()) file.SetLength(0); - Pickle pickle; + base::Pickle pickle; pickle.WriteString(origin); file.Write(0, static_cast<const char*>(pickle.data()), pickle.size()); file.Flush(); @@ -42,8 +42,8 @@ bool ReadPrimaryOriginFile(const base::FilePath& path, std::string buffer; if (!base::ReadFileToString(path, &buffer)) return false; - Pickle pickle(buffer.data(), buffer.size()); - PickleIterator iter(pickle); + base::Pickle pickle(buffer.data(), buffer.size()); + base::PickleIterator iter(pickle); return iter.ReadString(origin) && !origin->empty(); } diff --git a/third_party/mojo/src/mojo/edk/system/message_pipe_perftest.cc b/third_party/mojo/src/mojo/edk/system/message_pipe_perftest.cc index 2387782..3b22480 100644 --- a/third_party/mojo/src/mojo/edk/system/message_pipe_perftest.cc +++ b/third_party/mojo/src/mojo/edk/system/message_pipe_perftest.cc @@ -40,7 +40,7 @@ class MultiprocessMessagePipePerfTest void SetUpMeasurement(int message_count, size_t message_size) { message_count_ = message_count; message_size_ = message_size; - payload_ = Pickle(); + payload_ = base::Pickle(); payload_.WriteString(std::string(message_size, '*')); read_buffer_.resize(message_size * 2); } @@ -86,7 +86,7 @@ class MultiprocessMessagePipePerfTest private: int message_count_; size_t message_size_; - Pickle payload_; + base::Pickle payload_; std::string read_buffer_; scoped_ptr<base::PerfTimeLogger> perf_logger_; }; diff --git a/tools/android/forwarder2/host_forwarder_main.cc b/tools/android/forwarder2/host_forwarder_main.cc index f5d8e2f..9aed23a 100644 --- a/tools/android/forwarder2/host_forwarder_main.cc +++ b/tools/android/forwarder2/host_forwarder_main.cc @@ -332,8 +332,8 @@ class ServerDelegate : public Daemon::ServerDelegate { has_failed_ = true; return; } - const Pickle command_pickle(buf, bytes_read); - PickleIterator pickle_it(command_pickle); + const base::Pickle command_pickle(buf, bytes_read); + base::PickleIterator pickle_it(command_pickle); std::string device_serial; CHECK(pickle_it.ReadString(&device_serial)); int device_port; @@ -358,10 +358,8 @@ class ServerDelegate : public Daemon::ServerDelegate { class ClientDelegate : public Daemon::ClientDelegate { public: - ClientDelegate(const Pickle& command_pickle) - : command_pickle_(command_pickle), - has_failed_(false) { - } + ClientDelegate(const base::Pickle& command_pickle) + : command_pickle_(command_pickle), has_failed_(false) {} bool has_failed() const { return has_failed_; } @@ -387,7 +385,7 @@ class ClientDelegate : public Daemon::ClientDelegate { } private: - const Pickle command_pickle_; + const base::Pickle command_pickle_; bool has_failed_; }; @@ -419,7 +417,7 @@ int RunHostForwarder(int argc, char** argv) { std::string adb_path = "adb"; bool kill_server = false; - Pickle pickle; + base::Pickle pickle; pickle.WriteString( cmd_line.HasSwitch("serial-id") ? cmd_line.GetSwitchValueASCII("serial-id") : std::string()); diff --git a/ui/base/clipboard/custom_data_helper.cc b/ui/base/clipboard/custom_data_helper.cc index b715446..a50a0a0 100644 --- a/ui/base/clipboard/custom_data_helper.cc +++ b/ui/base/clipboard/custom_data_helper.cc @@ -16,17 +16,17 @@ namespace ui { namespace { -class SkippablePickle : public Pickle { +class SkippablePickle : public base::Pickle { public: SkippablePickle(const void* data, size_t data_len); - bool SkipString16(PickleIterator* iter); + bool SkipString16(base::PickleIterator* iter); }; SkippablePickle::SkippablePickle(const void* data, size_t data_len) - : Pickle(reinterpret_cast<const char*>(data), data_len) { + : base::Pickle(reinterpret_cast<const char*>(data), data_len) { } -bool SkippablePickle::SkipString16(PickleIterator* iter) { +bool SkippablePickle::SkipString16(base::PickleIterator* iter) { DCHECK(iter); int len; @@ -41,7 +41,7 @@ void ReadCustomDataTypes(const void* data, size_t data_length, std::vector<base::string16>* types) { SkippablePickle pickle(data, data_length); - PickleIterator iter(pickle); + base::PickleIterator iter(pickle); size_t size = 0; if (!iter.ReadSizeT(&size)) @@ -66,7 +66,7 @@ void ReadCustomDataForType(const void* data, const base::string16& type, base::string16* result) { SkippablePickle pickle(data, data_length); - PickleIterator iter(pickle); + base::PickleIterator iter(pickle); size_t size = 0; if (!iter.ReadSizeT(&size)) @@ -88,8 +88,8 @@ void ReadCustomDataForType(const void* data, void ReadCustomDataIntoMap(const void* data, size_t data_length, std::map<base::string16, base::string16>* result) { - Pickle pickle(reinterpret_cast<const char*>(data), data_length); - PickleIterator iter(pickle); + base::Pickle pickle(reinterpret_cast<const char*>(data), data_length); + base::PickleIterator iter(pickle); size_t size = 0; if (!iter.ReadSizeT(&size)) @@ -114,7 +114,7 @@ void ReadCustomDataIntoMap(const void* data, void WriteCustomDataToPickle( const std::map<base::string16, base::string16>& data, - Pickle* pickle) { + base::Pickle* pickle) { pickle->WriteSizeT(data.size()); for (std::map<base::string16, base::string16>::const_iterator it = data.begin(); diff --git a/ui/base/clipboard/custom_data_helper_unittest.cc b/ui/base/clipboard/custom_data_helper_unittest.cc index a765852..1ed53c6 100644 --- a/ui/base/clipboard/custom_data_helper_unittest.cc +++ b/ui/base/clipboard/custom_data_helper_unittest.cc @@ -16,12 +16,12 @@ namespace ui { namespace { -void PrepareEmptyTestData(Pickle* pickle) { +void PrepareEmptyTestData(base::Pickle* pickle) { std::map<base::string16, base::string16> data; WriteCustomDataToPickle(data, pickle); } -void PrepareTestData(Pickle* pickle) { +void PrepareTestData(base::Pickle* pickle) { std::map<base::string16, base::string16> data; data.insert(std::make_pair(ASCIIToUTF16("abc"), base::string16())); data.insert(std::make_pair(ASCIIToUTF16("de"), ASCIIToUTF16("1"))); @@ -30,7 +30,7 @@ void PrepareTestData(Pickle* pickle) { } TEST(CustomDataHelperTest, EmptyReadTypes) { - Pickle pickle; + base::Pickle pickle; PrepareEmptyTestData(&pickle); std::vector<base::string16> types; @@ -39,7 +39,7 @@ TEST(CustomDataHelperTest, EmptyReadTypes) { } TEST(CustomDataHelperTest, EmptyReadSingleType) { - Pickle pickle; + base::Pickle pickle; PrepareEmptyTestData(&pickle); base::string16 result; @@ -51,7 +51,7 @@ TEST(CustomDataHelperTest, EmptyReadSingleType) { } TEST(CustomDataHelperTest, EmptyReadMap) { - Pickle pickle; + base::Pickle pickle; PrepareEmptyTestData(&pickle); std::map<base::string16, base::string16> result; @@ -60,7 +60,7 @@ TEST(CustomDataHelperTest, EmptyReadMap) { } TEST(CustomDataHelperTest, ReadTypes) { - Pickle pickle; + base::Pickle pickle; PrepareTestData(&pickle); std::vector<base::string16> types; @@ -74,7 +74,7 @@ TEST(CustomDataHelperTest, ReadTypes) { } TEST(CustomDataHelperTest, ReadSingleType) { - Pickle pickle; + base::Pickle pickle; PrepareTestData(&pickle); base::string16 result; @@ -98,7 +98,7 @@ TEST(CustomDataHelperTest, ReadSingleType) { } TEST(CustomDataHelperTest, ReadMap) { - Pickle pickle; + base::Pickle pickle; PrepareTestData(&pickle); std::map<base::string16, base::string16> result; @@ -119,7 +119,7 @@ TEST(CustomDataHelperTest, BadReadTypes) { expected.push_back(ASCIIToUTF16("de")); expected.push_back(ASCIIToUTF16("f")); - Pickle malformed; + base::Pickle malformed; malformed.WriteSizeT(1000); malformed.WriteString16(ASCIIToUTF16("hello")); malformed.WriteString16(ASCIIToUTF16("world")); @@ -127,7 +127,7 @@ TEST(CustomDataHelperTest, BadReadTypes) { ReadCustomDataTypes(malformed.data(), malformed.size(), &actual); EXPECT_EQ(expected, actual); - Pickle malformed2; + base::Pickle malformed2; malformed2.WriteSizeT(1); malformed2.WriteString16(ASCIIToUTF16("hello")); std::vector<base::string16> actual2(expected); @@ -139,7 +139,7 @@ TEST(CustomDataHelperTest, BadPickle) { base::string16 result_data; std::map<base::string16, base::string16> result_map; - Pickle malformed; + base::Pickle malformed; malformed.WriteSizeT(1000); malformed.WriteString16(ASCIIToUTF16("hello")); malformed.WriteString16(ASCIIToUTF16("world")); @@ -152,7 +152,7 @@ TEST(CustomDataHelperTest, BadPickle) { EXPECT_EQ(0u, result_data.size()); EXPECT_EQ(0u, result_map.size()); - Pickle malformed2; + base::Pickle malformed2; malformed2.WriteSizeT(1); malformed2.WriteString16(ASCIIToUTF16("hello")); diff --git a/ui/base/clipboard/scoped_clipboard_writer.cc b/ui/base/clipboard/scoped_clipboard_writer.cc index 5044f62..6850cd4 100644 --- a/ui/base/clipboard/scoped_clipboard_writer.cc +++ b/ui/base/clipboard/scoped_clipboard_writer.cc @@ -103,7 +103,8 @@ void ScopedClipboardWriter::WriteImage(const SkBitmap& bitmap) { } void ScopedClipboardWriter::WritePickledData( - const Pickle& pickle, const Clipboard::FormatType& format) { + const base::Pickle& pickle, + const Clipboard::FormatType& format) { std::string format_string = format.Serialize(); Clipboard::ObjectMapParam format_parameter(format_string.begin(), format_string.end()); diff --git a/ui/base/dragdrop/os_exchange_data.cc b/ui/base/dragdrop/os_exchange_data.cc index c236a46..69d13ed 100644 --- a/ui/base/dragdrop/os_exchange_data.cc +++ b/ui/base/dragdrop/os_exchange_data.cc @@ -53,7 +53,7 @@ void OSExchangeData::SetFilenames( } void OSExchangeData::SetPickledData(const CustomFormat& format, - const Pickle& data) { + const base::Pickle& data) { provider_->SetPickledData(format, data); } @@ -77,7 +77,7 @@ bool OSExchangeData::GetFilenames( } bool OSExchangeData::GetPickledData(const CustomFormat& format, - Pickle* data) const { + base::Pickle* data) const { return provider_->GetPickledData(format, data); } diff --git a/ui/base/dragdrop/os_exchange_data_provider_aura.cc b/ui/base/dragdrop/os_exchange_data_provider_aura.cc index 0d4fb90..d633ccc 100644 --- a/ui/base/dragdrop/os_exchange_data_provider_aura.cc +++ b/ui/base/dragdrop/os_exchange_data_provider_aura.cc @@ -74,7 +74,7 @@ void OSExchangeDataProviderAura::SetFilenames( void OSExchangeDataProviderAura::SetPickledData( const OSExchangeData::CustomFormat& format, - const Pickle& data) { + const base::Pickle& data) { pickle_data_[format] = data; formats_ |= OSExchangeData::PICKLED_DATA; } @@ -122,7 +122,7 @@ bool OSExchangeDataProviderAura::GetFilenames( bool OSExchangeDataProviderAura::GetPickledData( const OSExchangeData::CustomFormat& format, - Pickle* data) const { + base::Pickle* data) const { PickleData::const_iterator i = pickle_data_.find(format); if (i == pickle_data_.end()) return false; diff --git a/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc b/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc index 714069f..c9285a0 100644 --- a/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc +++ b/ui/base/dragdrop/os_exchange_data_provider_aurax11.cc @@ -206,7 +206,7 @@ void OSExchangeDataProviderAuraX11::SetFilenames( void OSExchangeDataProviderAuraX11::SetPickledData( const OSExchangeData::CustomFormat& format, - const Pickle& pickle) { + const base::Pickle& pickle) { const unsigned char* data = reinterpret_cast<const unsigned char*>(pickle.data()); @@ -324,7 +324,7 @@ bool OSExchangeDataProviderAuraX11::GetFilenames( bool OSExchangeDataProviderAuraX11::GetPickledData( const OSExchangeData::CustomFormat& format, - Pickle* pickle) const { + base::Pickle* pickle) const { std::vector< ::Atom> requested_types; requested_types.push_back(atom_cache_.GetAtom(format.ToString().c_str())); @@ -332,8 +332,8 @@ bool OSExchangeDataProviderAuraX11::GetPickledData( if (data.IsValid()) { // Note that the pickle object on the right hand side of the assignment // only refers to the bytes in |data|. The assignment copies the data. - *pickle = Pickle(reinterpret_cast<const char*>(data.GetData()), - static_cast<int>(data.GetSize())); + *pickle = base::Pickle(reinterpret_cast<const char*>(data.GetData()), + static_cast<int>(data.GetSize())); return true; } diff --git a/ui/base/dragdrop/os_exchange_data_provider_mac.mm b/ui/base/dragdrop/os_exchange_data_provider_mac.mm index 94e4bed..dcc93a08 100644 --- a/ui/base/dragdrop/os_exchange_data_provider_mac.mm +++ b/ui/base/dragdrop/os_exchange_data_provider_mac.mm @@ -63,7 +63,7 @@ void OSExchangeDataProviderMac::SetFilenames( void OSExchangeDataProviderMac::SetPickledData( const OSExchangeData::CustomFormat& format, - const Pickle& data) { + const base::Pickle& data) { NSData* ns_data = [NSData dataWithBytes:data.data() length:data.size()]; [pasteboard_ setData:ns_data forType:format.ToNSString()]; } @@ -126,13 +126,14 @@ bool OSExchangeDataProviderMac::GetFilenames( bool OSExchangeDataProviderMac::GetPickledData( const OSExchangeData::CustomFormat& format, - Pickle* data) const { + base::Pickle* data) const { DCHECK(data); NSData* ns_data = [pasteboard_ dataForType:format.ToNSString()]; if (!ns_data) return false; - *data = Pickle(static_cast<const char*>([ns_data bytes]), [ns_data length]); + *data = + base::Pickle(static_cast<const char*>([ns_data bytes]), [ns_data length]); return true; } diff --git a/ui/base/dragdrop/os_exchange_data_provider_win.cc b/ui/base/dragdrop/os_exchange_data_provider_win.cc index ac57ffc..0257d22 100644 --- a/ui/base/dragdrop/os_exchange_data_provider_win.cc +++ b/ui/base/dragdrop/os_exchange_data_provider_win.cc @@ -364,7 +364,7 @@ void OSExchangeDataProviderWin::SetFilenames( void OSExchangeDataProviderWin::SetPickledData( const OSExchangeData::CustomFormat& format, - const Pickle& data) { + const base::Pickle& data) { STGMEDIUM* storage = GetStorageForBytes(data.data(), data.size()); data_->contents_.push_back( new DataObjectImpl::StoredDataInfo(format.ToFormatEtc(), storage)); @@ -449,7 +449,7 @@ bool OSExchangeDataProviderWin::GetFilenames( bool OSExchangeDataProviderWin::GetPickledData( const OSExchangeData::CustomFormat& format, - Pickle* data) const { + base::Pickle* data) const { DCHECK(data); bool success = false; STGMEDIUM medium; @@ -458,7 +458,7 @@ bool OSExchangeDataProviderWin::GetPickledData( if (medium.tymed & TYMED_HGLOBAL) { base::win::ScopedHGlobal<char*> c_data(medium.hGlobal); DCHECK_GT(c_data.Size(), 0u); - *data = Pickle(c_data.get(), static_cast<int>(c_data.Size())); + *data = base::Pickle(c_data.get(), static_cast<int>(c_data.Size())); success = true; } ReleaseStgMedium(&medium); diff --git a/ui/base/dragdrop/os_exchange_data_unittest.cc b/ui/base/dragdrop/os_exchange_data_unittest.cc index 9e2130c..e3fc6b5 100644 --- a/ui/base/dragdrop/os_exchange_data_unittest.cc +++ b/ui/base/dragdrop/os_exchange_data_unittest.cc @@ -147,7 +147,7 @@ TEST_F(OSExchangeDataTest, TestPickledData) { const OSExchangeData::CustomFormat kTestFormat = ui::Clipboard::GetFormatType("application/vnd.chromium.test"); - Pickle saved_pickle; + base::Pickle saved_pickle; saved_pickle.WriteInt(1); saved_pickle.WriteInt(2); OSExchangeData data; @@ -156,9 +156,9 @@ TEST_F(OSExchangeDataTest, TestPickledData) { OSExchangeData copy(data.provider().Clone()); EXPECT_TRUE(copy.HasCustomFormat(kTestFormat)); - Pickle restored_pickle; + base::Pickle restored_pickle; EXPECT_TRUE(copy.GetPickledData(kTestFormat, &restored_pickle)); - PickleIterator iterator(restored_pickle); + base::PickleIterator iterator(restored_pickle); int value; EXPECT_TRUE(iterator.ReadInt(&value)); EXPECT_EQ(1, value); diff --git a/ui/gfx/ipc/gfx_param_traits.cc b/ui/gfx/ipc/gfx_param_traits.cc index db4c92e..2aaccd2 100644 --- a/ui/gfx/ipc/gfx_param_traits.cc +++ b/ui/gfx/ipc/gfx_param_traits.cc @@ -57,7 +57,8 @@ void ParamTraits<gfx::Point>::Write(Message* m, const gfx::Point& p) { m->WriteInt(p.y()); } -bool ParamTraits<gfx::Point>::Read(const Message* m, PickleIterator* iter, +bool ParamTraits<gfx::Point>::Read(const Message* m, + base::PickleIterator* iter, gfx::Point* r) { int x, y; if (!iter->ReadInt(&x) || @@ -78,8 +79,8 @@ void ParamTraits<gfx::PointF>::Write(Message* m, const gfx::PointF& v) { } bool ParamTraits<gfx::PointF>::Read(const Message* m, - PickleIterator* iter, - gfx::PointF* r) { + base::PickleIterator* iter, + gfx::PointF* r) { float x, y; if (!ParamTraits<float>::Read(m, iter, &x) || !ParamTraits<float>::Read(m, iter, &y)) @@ -101,7 +102,7 @@ void ParamTraits<gfx::Size>::Write(Message* m, const gfx::Size& p) { } bool ParamTraits<gfx::Size>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, gfx::Size* r) { const char* char_values; if (!iter->ReadBytes(&char_values, sizeof(int) * 2)) @@ -124,7 +125,7 @@ void ParamTraits<gfx::SizeF>::Write(Message* m, const gfx::SizeF& p) { } bool ParamTraits<gfx::SizeF>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, gfx::SizeF* r) { const char* char_values; if (!iter->ReadBytes(&char_values, sizeof(float) * 2)) @@ -145,7 +146,7 @@ void ParamTraits<gfx::Vector2d>::Write(Message* m, const gfx::Vector2d& p) { } bool ParamTraits<gfx::Vector2d>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, gfx::Vector2d* r) { const char* char_values; if (!iter->ReadBytes(&char_values, sizeof(int) * 2)) @@ -166,8 +167,8 @@ void ParamTraits<gfx::Vector2dF>::Write(Message* m, const gfx::Vector2dF& p) { } bool ParamTraits<gfx::Vector2dF>::Read(const Message* m, - PickleIterator* iter, - gfx::Vector2dF* r) { + base::PickleIterator* iter, + gfx::Vector2dF* r) { const char* char_values; if (!iter->ReadBytes(&char_values, sizeof(float) * 2)) return false; @@ -187,7 +188,7 @@ void ParamTraits<gfx::Rect>::Write(Message* m, const gfx::Rect& p) { } bool ParamTraits<gfx::Rect>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, gfx::Rect* r) { const char* char_values; if (!iter->ReadBytes(&char_values, sizeof(int) * 4)) @@ -210,7 +211,7 @@ void ParamTraits<gfx::RectF>::Write(Message* m, const gfx::RectF& p) { } bool ParamTraits<gfx::RectF>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, gfx::RectF* r) { const char* char_values; if (!iter->ReadBytes(&char_values, sizeof(float) * 4)) @@ -238,7 +239,7 @@ void ParamTraits<SkBitmap>::Write(Message* m, const SkBitmap& p) { } bool ParamTraits<SkBitmap>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, SkBitmap* r) { const char* fixed_data; int fixed_data_size = 0; @@ -272,7 +273,7 @@ void ParamTraits<gfx::Range>::Write(Message* m, const gfx::Range& r) { } bool ParamTraits<gfx::Range>::Read(const Message* m, - PickleIterator* iter, + base::PickleIterator* iter, gfx::Range* r) { size_t start, end; if (!iter->ReadSizeT(&start) || !iter->ReadSizeT(&end)) diff --git a/ui/views/controls/textfield/textfield_unittest.cc b/ui/views/controls/textfield/textfield_unittest.cc index 2950045f..a02456e 100644 --- a/ui/views/controls/textfield/textfield_unittest.cc +++ b/ui/views/controls/textfield/textfield_unittest.cc @@ -1017,7 +1017,7 @@ TEST_F(TextfieldTest, DragAndDrop_AcceptDrop) { ui::OSExchangeData bad_data; bad_data.SetFilename(base::FilePath(FILE_PATH_LITERAL("x"))); ui::OSExchangeData::CustomFormat fmt = ui::Clipboard::GetBitmapFormatType(); - bad_data.SetPickledData(fmt, Pickle()); + bad_data.SetPickledData(fmt, base::Pickle()); bad_data.SetFileContents(base::FilePath(L"x"), "x"); bad_data.SetHtml(base::string16(ASCIIToUTF16("x")), GURL("x.org")); ui::OSExchangeData::DownloadFileInfo download(base::FilePath(), NULL); |