Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
ee87972
Remove headers from CMake file.
jonsimantov Jun 26, 2023
648ba2d
Find-and-replace change.
jonsimantov Jun 26, 2023
101c476
Format code.
jonsimantov Jun 26, 2023
5bb53a5
Find and replace for std::atomic.
jonsimantov Jun 26, 2023
2ab305f
Format code.
jonsimantov Jun 26, 2023
6f91d88
Update to Dec 2022 release of boringssl.
jonsimantov Jun 26, 2023
058a1c5
Re-add patch file.
jonsimantov Jun 26, 2023
c0e6420
Merge branch 'update-boringssl-xcode' into use_cpp14_memory_classes
jonsimantov Jun 27, 2023
54ae6b5
Switch to std::make_unique.
jonsimantov Jun 27, 2023
a5dae51
Fix make_shared, std::move, and class initialization.
jonsimantov Jun 27, 2023
29e86b9
WIP.
jonsimantov Jun 27, 2023
681fba5
Fix more move syntax.
jonsimantov Jun 27, 2023
bc3d774
Fix more std::move issues.
jonsimantov Jun 27, 2023
8ed952c
Remove debug output
jonsimantov Jun 28, 2023
0ba031b
Merge branch 'update-boringssl-xcode' into use_cpp14_memory_classes
jonsimantov Jun 28, 2023
ea56bb7
Fix Android Firestore test, and Storage assignment.
jonsimantov Jun 28, 2023
df10cf1
Make the callback safer via shared_ptr.
jonsimantov Jun 28, 2023
7da99eb
Merge branch 'main' into use_cpp14_memory_classes
jonsimantov Jun 28, 2023
8af3114
Fix lint errors.
jonsimantov Jun 28, 2023
2dc3263
Merge branch 'main' into use_cpp14_memory_classes
jonsimantov Jun 28, 2023
c49a41d
Format code.
jonsimantov Jun 28, 2023
b2de426
Merge branch 'use_cpp14_memory_classes' of https://github.com/firebas…
jonsimantov Jun 28, 2023
56444e2
More lint fixes.
jonsimantov Jun 28, 2023
c5cedd3
More lint.
jonsimantov Jun 28, 2023
4638b17
Additional lint warning fixes.
jonsimantov Jun 28, 2023
cd9625f
Fix Firestore test.
jonsimantov Jun 28, 2023
caa1c19
Fix more lints.
jonsimantov Jun 28, 2023
8f0ca77
Lint lint lint.
jonsimantov Jun 28, 2023
2e0254a
Merge branch 'main' into use_cpp14_memory_classes
jonsimantov Jun 28, 2023
19ec00f
Change RequestDataPtr to a unique_ptr since STLPort is no longer used.
jonsimantov Jun 28, 2023
66c9d29
Remove Move() and Forward(), replacing with std::move() and std::fowa…
jonsimantov Jun 28, 2023
ec835e1
Merge branch 'use_cpp14_memory_classes' of https://github.com/firebas…
jonsimantov Jun 28, 2023
2740dbf
Format code and lint fixes.
jonsimantov Jun 28, 2023
6aa83b6
Change firebase::Move explicitly to std::move.
jonsimantov Jun 28, 2023
5355b5b
Remove lint warnings for headers.
jonsimantov Jun 28, 2023
352686e
More lint warnings on includes.
jonsimantov Jun 28, 2023
153b6d8
Format code.
jonsimantov Jun 28, 2023
7e52ba5
Return back to shared pointer.
jonsimantov Jun 28, 2023
43d0725
Add note about NewCallback and link to TODO.
jonsimantov Jun 28, 2023
b0db38b
Fix lint error.
jonsimantov Jun 28, 2023
39b6672
Fix a lingering firebase::Move.
jonsimantov Jun 29, 2023
2d1126f
Fix optional_test to mock Move correctly again.
jonsimantov Jun 29, 2023
e0c5f3f
Revert prereqs script, python3 change will be made elsewhere.
jonsimantov Jun 29, 2023
332e417
Lint.
jonsimantov Jun 29, 2023
ebc81d0
Remove references to atomic_test.
jonsimantov Jun 29, 2023
0a5ba19
Fix Move -> std::move once more
jonsimantov Jun 29, 2023
6a7d031
Fix a seg fault race condition on Linux by using a unique_ptr.
jonsimantov Jun 29, 2023
ad52259
Empty commit.
jonsimantov Jun 29, 2023
2359406
Merge branch 'main' into use_cpp14_memory_classes
jonsimantov Jun 29, 2023
3d2b749
Fix test error.
jonsimantov Jun 29, 2023
d2c2298
Fix test compilation error.
jonsimantov Jun 29, 2023
97504c0
Fix additional test build error.
jonsimantov Jun 29, 2023
2c88b27
Vector initializer lists use copy semantics. Switch to push_back sinc…
jonsimantov Jun 29, 2023
8cf9397
Merge branch 'main' into use_cpp14_memory_classes
jonsimantov Jun 30, 2023
85fb83b
Merge branch 'main' into use_cpp14_memory_classes
jonsimantov Jun 30, 2023
de2fee0
Fix Forward --> std::forward from the merged Firestore change.
jonsimantov Jun 30, 2023
94175cf
Merge branch 'main' into use_cpp14_memory_classes
jonsimantov Jul 1, 2023
ccbcbfc
Add callback tests for shared_ptr wrapping a unique_ptr.
jonsimantov Jul 5, 2023
b50cdc2
Merge branch 'main' into use_cpp14_memory_classes
jonsimantov Jul 5, 2023
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Format code.
  • Loading branch information
jonsimantov committed Jun 26, 2023
commit 101c4760f6d61d9c4f322cf1c99eb1eb40d30372
2 changes: 1 addition & 1 deletion app/src/app_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
#include <string.h>

#include <map>
#include <memory>"
#include <string>
#include <utility> // Used to detect STL variant.
#include <vector>

#include <memory>"
#include "app/src/assert.h"
#include "app/src/callback.h"
#include "app/src/cleanup_notifier.h"
Expand Down
2 changes: 1 addition & 1 deletion app/src/callback.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#include "app/src/callback.h"

#include <list>

#include <memory>"

#include "app/src/include/firebase/internal/mutex.h"
#include "app/src/log.h"
#include "app/src/semaphore.h"
Expand Down
8 changes: 5 additions & 3 deletions app/src/heartbeat/heartbeat_controller_desktop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
#include <iomanip>
#include <map>
#include <memory>
#include <memory>"
#include <sstream>
#include <string>
#include <thread>
#include <vector>

#include <memory>"
#include "app/rest/zlibwrapper.h"
#include "app/src/app_common.h"
#include "app/src/base64.h"
Expand Down Expand Up @@ -112,7 +112,8 @@ std::string HeartbeatController::GetAndResetStoredHeartbeats() {
last_read_all_heartbeats_time_ = now;

std::shared_ptr<std::string> output_str = MakeShared<std::string>("");
std::shared_ptr<Semaphore> scheduled_work_semaphore = MakeShared<Semaphore>(0);
std::shared_ptr<Semaphore> scheduled_work_semaphore =
MakeShared<Semaphore>(0);

std::function<void(void)> get_and_reset_function =
[&, output_str, scheduled_work_semaphore]() {
Expand Down Expand Up @@ -163,7 +164,8 @@ std::string HeartbeatController::GetAndResetTodaysStoredHeartbeats() {
}
last_read_todays_heartbeat_time_ = now;
std::shared_ptr<std::string> output_str = MakeShared<std::string>("");
std::shared_ptr<Semaphore> scheduled_work_semaphore = MakeShared<Semaphore>(0);
std::shared_ptr<Semaphore> scheduled_work_semaphore =
MakeShared<Semaphore>(0);

std::function<void(void)> get_and_reset_function =
[&, output_str, scheduled_work_semaphore]() {
Expand Down
1 change: 1 addition & 0 deletions app/src/safe_reference.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#define FIREBASE_APP_SRC_SAFE_REFERENCE_H_

#include <memory>"

#include "app/src/include/firebase/internal/mutex.h"

namespace firebase {
Expand Down
14 changes: 7 additions & 7 deletions app/src/scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#ifndef FIREBASE_APP_SRC_SCHEDULER_H_
#define FIREBASE_APP_SRC_SCHEDULER_H_

#include <memory>"
#include <queue>

#include <memory>"
#include "app/src/callback.h"
#include "app/src/include/firebase/internal/mutex.h"
#include "app/src/semaphore.h"
Expand Down Expand Up @@ -57,8 +57,8 @@ struct RequestStatusBlock {

// The handle used to check the status of a scheduled task or to cancel it.
// This handle is safe to be copied or be moved. However, it is NOT safe to
// modify or reference the same handle from different threads since std::shared_ptr
// is not thread-safe.
// modify or reference the same handle from different threads since
// std::shared_ptr is not thread-safe.
class RequestHandle {
public:
RequestHandle() : status_() {}
Expand Down Expand Up @@ -149,10 +149,10 @@ class Scheduler {
std::shared_ptr<RequestStatusBlock> status;
};

// std::shared_ptr of request data. Ideally this should be std::unique_ptr and there
// should only have one copy of it in request_queue_ . However, STLPort queue
// uses copy instead of move() while reordering heap element, and std::unique_ptr is
// not copyable. Therefore, use std::shared_ptr here.
// std::shared_ptr of request data. Ideally this should be std::unique_ptr
// and there should only have one copy of it in request_queue_ . However,
// STLPort queue uses copy instead of move() while reordering heap element,
// and std::unique_ptr is not copyable. Therefore, use std::shared_ptr here.
typedef std::shared_ptr<RequestData> RequestDataPtr;

// Comparer struct for priority_queue. If the operator return true, lhs will
Expand Down
1 change: 1 addition & 0 deletions app/src/secure/user_secure_manager_fake.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "app/src/secure/user_secure_manager_fake.h"

#include <memory>"

#include "app/src/include/firebase/internal/platform.h"
#include "app/src/secure/user_secure_fake_internal.h"

Expand Down
2 changes: 1 addition & 1 deletion app/tests/callback_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

#include "app/src/callback.h"

#include <memory>"
#include <string>
#include <utility>

#include <memory>"
#include "app/src/include/firebase/internal/mutex.h"
#include "app/src/thread.h"
#include "app/src/time.h"
Expand Down
2 changes: 1 addition & 1 deletion app/tests/future_manager_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#include <stdlib.h>

#include <ctime>
#include <memory>"
#include <vector>

#include <memory>"
#include "app/src/include/firebase/future.h"
#include "app/src/semaphore.h"
#include "app/src/thread.h"
Expand Down
5 changes: 3 additions & 2 deletions app/tests/secure/user_secure_internal_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,9 @@ TEST_F(UserSecureInternalTest, SetLargeDataThenDeleteIt) {

TEST_F(UserSecureInternalTest, TestMultipleDomains) {
// Set up an alternate UserSecureInternal with a different domain.
std::unique_ptr<USER_SECURE_TYPE> alt_user_secure = MakeUnique<USER_SECURE_TYPE>(
"alternate_test", USER_SECURE_TEST_NAMESPACE);
std::unique_ptr<USER_SECURE_TYPE> alt_user_secure =
MakeUnique<USER_SECURE_TYPE>("alternate_test",
USER_SECURE_TEST_NAMESPACE);
alt_user_secure->DeleteAllData();

user_secure_->SaveUserData(kAppName1, kUserData1);
Expand Down
2 changes: 1 addition & 1 deletion app_check/src/ios/debug_provider_ios.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
#define FIREBASE_APP_CHECK_SRC_IOS_DEBUG_PROVIDER_IOS_H_

#include <map>
#include <memory>"
#include <string>

#include <memory>"
#include "app/src/util_ios.h"
#include "firebase/app_check.h"

Expand Down
2 changes: 1 addition & 1 deletion app_check/src/ios/device_check_provider_ios.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#define FIREBASE_APP_CHECK_SRC_IOS_DEVICE_CHECK_PROVIDER_IOS_H_

#include <map>

#include <memory>"

#include "app/src/util_ios.h"
#include "firebase/app_check.h"

Expand Down
2 changes: 1 addition & 1 deletion auth/src/desktop/auth_desktop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
#include "auth/src/desktop/auth_desktop.h"

#include <memory>
#include <memory>"
#include <string>
#include <utility>

#include <memory>"
#include "app/rest/transport_curl.h"
#include "app/src/app_common.h"
#include "app/src/app_identifier.h"
Expand Down
6 changes: 4 additions & 2 deletions auth/src/desktop/user_desktop.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ class UserDataPersist : public firebase::auth::AuthStateListener {

// Overloaded constructor to set the internal instance.
explicit UserDataPersist(
std::unique_ptr<firebase::app::secure::UserSecureManager> user_secure_manager);
std::unique_ptr<firebase::app::secure::UserSecureManager>
user_secure_manager);

void OnAuthStateChanged(Auth* auth) override;

Expand All @@ -112,7 +113,8 @@ class UserDataPersist : public firebase::auth::AuthStateListener {
Future<void> DeleteUserData(AuthData* auth_data);

private:
std::unique_ptr<firebase::app::secure::UserSecureManager> user_secure_manager_;
std::unique_ptr<firebase::app::secure::UserSecureManager>
user_secure_manager_;
};

} // namespace auth
Expand Down
2 changes: 1 addition & 1 deletion auth/tests/desktop/auth_desktop_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

#include <cstddef>
#include <memory>
#include <memory>"
#include <string>
#include <utility>

#include <memory>"
#include "app/rest/transport_builder.h"
#include "app/rest/transport_curl.h"
#include "app/rest/transport_mock.h"
Expand Down
2 changes: 1 addition & 1 deletion database/src/desktop/connection/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
#ifndef FIREBASE_DATABASE_SRC_DESKTOP_CONNECTION_CONNECTION_H_
#define FIREBASE_DATABASE_SRC_DESKTOP_CONNECTION_CONNECTION_H_

#include <memory>"
#include <sstream>

#include "app/memory/atomic.h"
#include <memory>"
#include "app/src/include/firebase/variant.h"
#include "app/src/logger.h"
#include "app/src/safe_reference.h"
Expand Down
3 changes: 1 addition & 2 deletions database/src/desktop/connection/persistent_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@

#include <cassert>
#include <map>
#include <memory>"
#include <queue>
#include <set>
#include <string>
#include <vector>

#include "app/memory/atomic.h"
#include <memory>"
#include <memory>"
#include "app/src/include/firebase/app.h"
#include "app/src/include/firebase/future.h"
#include "app/src/include/firebase/variant.h"
Expand Down
2 changes: 1 addition & 1 deletion database/src/desktop/connection/util_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#ifndef FIREBASE_DATABASE_SRC_DESKTOP_CONNECTION_UTIL_CONNECTION_H_
#define FIREBASE_DATABASE_SRC_DESKTOP_CONNECTION_UTIL_CONNECTION_H_

#include <memory>"
#include <string>

#include <memory>"
#include "app/src/logger.h"
#include "app/src/scheduler.h"
#include "database/src/desktop/connection/host_info.h"
Expand Down
2 changes: 1 addition & 1 deletion database/src/desktop/connection/web_socket_client_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
#ifndef FIREBASE_DATABASE_SRC_DESKTOP_CONNECTION_WEB_SOCKET_CLIENT_IMPL_H_
#define FIREBASE_DATABASE_SRC_DESKTOP_CONNECTION_WEB_SOCKET_CLIENT_IMPL_H_

#include <memory>"
#include <queue>
#include <string>

#include "app/memory/atomic.h"
#include <memory>"
#include "app/src/include/firebase/internal/mutex.h"
#include "app/src/logger.h"
#include "app/src/safe_reference.h"
Expand Down
3 changes: 2 additions & 1 deletion database/src/desktop/core/repo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ Repo::~Repo() {
callback, this);
}

void Repo::AddEventCallback(std::unique_ptr<EventRegistration> event_registration) {
void Repo::AddEventCallback(
std::unique_ptr<EventRegistration> event_registration) {
std::vector<Event> events;
if (StringStartsWith(event_registration->query_spec().path.str(), kDotInfo)) {
events = info_sync_tree_->AddEventRegistration(Move(event_registration));
Expand Down
2 changes: 1 addition & 1 deletion database/src/desktop/core/repo.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#ifndef FIREBASE_DATABASE_SRC_DESKTOP_CORE_REPO_H_
#define FIREBASE_DATABASE_SRC_DESKTOP_CORE_REPO_H_

#include <memory>"
#include <vector>

#include <memory>"
#include "app/src/include/firebase/variant.h"
#include "app/src/path.h"
#include "app/src/reference_counted_future_impl.h"
Expand Down
2 changes: 1 addition & 1 deletion database/src/desktop/core/sync_tree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

#include "database/src/desktop/core/sync_tree.h"

#include <memory>"
#include <vector>

#include <memory>"
#include "app/src/assert.h"
#include "app/src/callback.h"
#include "app/src/include/firebase/variant.h"
Expand Down
2 changes: 1 addition & 1 deletion database/src/desktop/core/sync_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#ifndef FIREBASE_DATABASE_SRC_DESKTOP_CORE_SYNC_TREE_H_
#define FIREBASE_DATABASE_SRC_DESKTOP_CORE_SYNC_TREE_H_

#include <memory>"
#include <vector>

#include <memory>"
#include "app/src/include/firebase/variant.h"
#include "app/src/optional.h"
#include "app/src/path.h"
Expand Down
2 changes: 1 addition & 1 deletion database/src/desktop/database_desktop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
#include "database/src/desktop/database_desktop.h"

#include <memory>
#include <memory>"
#include <queue>
#include <stack>

#include <memory>"
#include "app/src/app_common.h"
#include "app/src/assert.h"
#include "app/src/function_registry.h"
Expand Down
2 changes: 1 addition & 1 deletion database/src/desktop/database_desktop.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

#include <list>
#include <memory>
#include <memory>"
#include <string>

#include <memory>"
#include "app/src/cleanup_notifier.h"
#include "app/src/future_manager.h"
#include "app/src/include/firebase/app.h"
Expand Down
2 changes: 1 addition & 1 deletion database/src/desktop/mutable_data_desktop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#include <stdlib.h>

#include <cassert>
#include <memory>"
#include <sstream>

#include <memory>"
#include "app/src/log.h"
#include "database/src/common/database_reference.h"
#include "database/src/desktop/database_desktop.h"
Expand Down
2 changes: 1 addition & 1 deletion database/src/desktop/mutable_data_desktop.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#ifndef FIREBASE_DATABASE_SRC_DESKTOP_MUTABLE_DATA_DESKTOP_H_
#define FIREBASE_DATABASE_SRC_DESKTOP_MUTABLE_DATA_DESKTOP_H_

#include <memory>"
#include <string>

#include <memory>"
#include "app/src/include/firebase/variant.h"
#include "app/src/path.h"
#include "database/src/include/firebase/database/mutable_data.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#define FIREBASE_DATABASE_SRC_DESKTOP_PERSISTENCE_IN_MEMORY_PERSISTENCE_STORAGE_ENGINE_H_

#include <memory>"

#include "app/src/include/firebase/variant.h"
#include "app/src/logger.h"
#include "app/src/path.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#define FIREBASE_DATABASE_SRC_DESKTOP_PERSISTENCE_LEVEL_DB_PERSISTENCE_STORAGE_ENGINE_H_

#include <memory>"

#include "app/src/include/firebase/variant.h"
#include "app/src/logger.h"
#include "app/src/path.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
#define FIREBASE_DATABASE_SRC_DESKTOP_PERSISTENCE_NOOP_PERSISTENCE_MANAGER_H_

#include <functional>
#include <memory>"
#include <set>
#include <string>
#include <vector>

#include <memory>"
#include "app/src/include/firebase/internal/mutex.h"
#include "app/src/path.h"
#include "database/src/common/query_spec.h"
Expand Down
2 changes: 1 addition & 1 deletion database/src/desktop/persistence/persistence_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
#define FIREBASE_DATABASE_SRC_DESKTOP_PERSISTENCE_PERSISTENCE_MANAGER_H_

#include <functional>
#include <memory>"
#include <set>
#include <string>
#include <vector>

#include <memory>"
#include "app/src/include/firebase/internal/mutex.h"
#include "app/src/path.h"
#include "database/src/common/query_spec.h"
Expand Down
Loading