diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-03 00:20:05 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-03 00:20:05 +0000 |
commit | 7131880e814ea51968b4eb589d40c9478b10cb8d (patch) | |
tree | 302327a5c31b3029a3e6a5bcc745350ed46598da | |
parent | 5b7ca42829a3aedcbb5ac4e6d7832649e8daea12 (diff) | |
download | chromium_src-7131880e814ea51968b4eb589d40c9478b10cb8d.zip chromium_src-7131880e814ea51968b4eb589d40c9478b10cb8d.tar.gz chromium_src-7131880e814ea51968b4eb589d40c9478b10cb8d.tar.bz2 |
Update sync/, sql/, and printing/ to use scoped_refptr<T>::get() rather than implicit "operator T*"
Linux fixes
BUG=110610
TBR=darin
Review URL: https://chromiumcodereview.appspot.com/16298002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203651 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | printing/printed_document.cc | 2 | ||||
-rw-r--r-- | sql/statement.cc | 2 | ||||
-rw-r--r-- | sync/engine/model_changing_syncer_command.cc | 2 | ||||
-rw-r--r-- | sync/internal_api/http_bridge.cc | 10 | ||||
-rw-r--r-- | sync/internal_api/http_bridge_unittest.cc | 18 | ||||
-rw-r--r-- | sync/notifier/non_blocking_invalidator.cc | 2 | ||||
-rw-r--r-- | sync/test/engine/syncer_command_test.h | 2 | ||||
-rw-r--r-- | sync/tools/sync_client.cc | 6 |
8 files changed, 21 insertions, 23 deletions
diff --git a/printing/printed_document.cc b/printing/printed_document.cc index 4589c18..17e4c35 100644 --- a/printing/printed_document.cc +++ b/printing/printed_document.cc @@ -85,7 +85,7 @@ void PrintedDocument::SetPage(int page_number, mutable_.first_page = page_number; #endif } - DebugDump(*page); + DebugDump(*page.get()); } bool PrintedDocument::GetPage(int page_number, diff --git a/sql/statement.cc b/sql/statement.cc index fe0accb..5736d7d 100644 --- a/sql/statement.cc +++ b/sql/statement.cc @@ -308,7 +308,7 @@ bool Statement::CheckOk(int err) const { int Statement::CheckError(int err) { // Please don't add DCHECKs here, OnSqliteError() already has them. succeeded_ = (err == SQLITE_OK || err == SQLITE_ROW || err == SQLITE_DONE); - if (!succeeded_ && ref_ && ref_->connection()) + if (!succeeded_ && ref_.get() && ref_->connection()) return ref_->connection()->OnSqliteError(err, this); return err; } diff --git a/sync/engine/model_changing_syncer_command.cc b/sync/engine/model_changing_syncer_command.cc index c2c2750..a793626 100644 --- a/sync/engine/model_changing_syncer_command.cc +++ b/sync/engine/model_changing_syncer_command.cc @@ -20,7 +20,7 @@ SyncerError ModelChangingSyncerCommand::ExecuteImpl( const std::set<ModelSafeGroup>& groups_to_change = GetGroupsToChange(*work_session_); for (size_t i = 0; i < session->context()->workers().size(); ++i) { - ModelSafeWorker* worker = session->context()->workers()[i]; + ModelSafeWorker* worker = session->context()->workers()[i].get(); ModelSafeGroup group = worker->GetModelSafeGroup(); // Skip workers whose group isn't active. if (groups_to_change.count(group) == 0u) { diff --git a/sync/internal_api/http_bridge.cc b/sync/internal_api/http_bridge.cc index c3cb4b5..d429903 100644 --- a/sync/internal_api/http_bridge.cc +++ b/sync/internal_api/http_bridge.cc @@ -29,8 +29,8 @@ HttpBridge::RequestContextGetter::RequestContextGetter( network_task_runner_( baseline_context_getter_->GetNetworkTaskRunner()), user_agent_(user_agent) { - DCHECK(baseline_context_getter_); - DCHECK(network_task_runner_); + DCHECK(baseline_context_getter_.get()); + DCHECK(network_task_runner_.get()); DCHECK(!user_agent_.empty()); } @@ -70,7 +70,7 @@ HttpBridgeFactory::~HttpBridgeFactory() { } HttpPostProviderInterface* HttpBridgeFactory::Create() { - HttpBridge* http = new HttpBridge(request_context_getter_, + HttpBridge* http = new HttpBridge(request_context_getter_.get(), network_time_update_callback_); http->AddRef(); return http; @@ -228,7 +228,7 @@ void HttpBridge::MakeAsynchronousPost() { fetch_state_.url_poster = net::URLFetcher::Create( url_for_request_, net::URLFetcher::POST, this); - fetch_state_.url_poster->SetRequestContext(context_getter_for_request_); + fetch_state_.url_poster->SetRequestContext(context_getter_for_request_.get()); fetch_state_.url_poster->SetUploadData(content_type_, request_content_); fetch_state_.url_poster->SetExtraRequestHeaders(extra_headers_); fetch_state_.url_poster->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES); @@ -323,7 +323,7 @@ void HttpBridge::OnURLFetchComplete(const net::URLFetcher* source) { net::URLRequestContextGetter* HttpBridge::GetRequestContextGetterForTest() const { - return context_getter_for_request_; + return context_getter_for_request_.get(); } void HttpBridge::UpdateNetworkTime() { diff --git a/sync/internal_api/http_bridge_unittest.cc b/sync/internal_api/http_bridge_unittest.cc index 605d9c0..6db061e 100644 --- a/sync/internal_api/http_bridge_unittest.cc +++ b/sync/internal_api/http_bridge_unittest.cc @@ -160,11 +160,11 @@ void SyncHttpBridgeTest::RunSyncThreadBridgeUseTest( scoped_refptr<net::URLRequestContextGetter> ctx_getter( new net::TestURLRequestContextGetter(io_thread_.message_loop_proxy())); { - scoped_refptr<ShuntedHttpBridge> bridge(new ShuntedHttpBridge( - ctx_getter, this, true)); + scoped_refptr<ShuntedHttpBridge> bridge( + new ShuntedHttpBridge(ctx_getter.get(), this, true)); bridge->SetURL("http://www.google.com", 9999); bridge->SetPostPayload("text/plain", 2, " "); - bridge_for_race_test_ = bridge; + bridge_for_race_test_ = bridge.get(); signal_when_created->Signal(); int os_error = 0; @@ -190,8 +190,8 @@ TEST_F(SyncHttpBridgeTest, TestUsesSameHttpNetworkSession) { TEST_F(SyncHttpBridgeTest, TestMakeSynchronousPostShunted) { scoped_refptr<net::URLRequestContextGetter> ctx_getter( new net::TestURLRequestContextGetter(io_thread()->message_loop_proxy())); - scoped_refptr<HttpBridge> http_bridge(new ShuntedHttpBridge( - ctx_getter, this, false)); + scoped_refptr<HttpBridge> http_bridge( + new ShuntedHttpBridge(ctx_getter.get(), this, false)); http_bridge->SetURL("http://www.google.com", 9999); http_bridge->SetPostPayload("text/plain", 2, " "); @@ -312,8 +312,8 @@ TEST_F(SyncHttpBridgeTest, TestResponseHeader) { TEST_F(SyncHttpBridgeTest, Abort) { scoped_refptr<net::URLRequestContextGetter> ctx_getter( new net::TestURLRequestContextGetter(io_thread()->message_loop_proxy())); - scoped_refptr<ShuntedHttpBridge> http_bridge(new ShuntedHttpBridge( - ctx_getter, this, true)); + scoped_refptr<ShuntedHttpBridge> http_bridge( + new ShuntedHttpBridge(ctx_getter.get(), this, true)); http_bridge->SetURL("http://www.google.com", 9999); http_bridge->SetPostPayload("text/plain", 2, " "); @@ -331,8 +331,8 @@ TEST_F(SyncHttpBridgeTest, Abort) { TEST_F(SyncHttpBridgeTest, AbortLate) { scoped_refptr<net::URLRequestContextGetter> ctx_getter( new net::TestURLRequestContextGetter(io_thread()->message_loop_proxy())); - scoped_refptr<ShuntedHttpBridge> http_bridge(new ShuntedHttpBridge( - ctx_getter, this, false)); + scoped_refptr<ShuntedHttpBridge> http_bridge( + new ShuntedHttpBridge(ctx_getter.get(), this, false)); http_bridge->SetURL("http://www.google.com", 9999); http_bridge->SetPostPayload("text/plain", 2, " "); diff --git a/sync/notifier/non_blocking_invalidator.cc b/sync/notifier/non_blocking_invalidator.cc index a67b196..99b5532 100644 --- a/sync/notifier/non_blocking_invalidator.cc +++ b/sync/notifier/non_blocking_invalidator.cc @@ -77,7 +77,7 @@ void NonBlockingInvalidator::Core::Initialize( const std::string& invalidation_bootstrap_data, const WeakHandle<InvalidationStateTracker>& invalidation_state_tracker, const std::string& client_info) { - DCHECK(notifier_options.request_context_getter); + DCHECK(notifier_options.request_context_getter.get()); DCHECK_EQ(notifier::NOTIFICATION_SERVER, notifier_options.notification_method); network_task_runner_ = notifier_options.request_context_getter-> diff --git a/sync/test/engine/syncer_command_test.h b/sync/test/engine/syncer_command_test.h index 9379212..94d1182 100644 --- a/sync/test/engine/syncer_command_test.h +++ b/sync/test/engine/syncer_command_test.h @@ -83,7 +83,7 @@ class SyncerCommandTestBase : public testing::Test, std::vector<ModelSafeWorker*> workers; std::vector<scoped_refptr<ModelSafeWorker> >::iterator it; for (it = workers_.begin(); it != workers_.end(); ++it) - workers.push_back(*it); + workers.push_back(it->get()); return workers; } void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out) { diff --git a/sync/tools/sync_client.cc b/sync/tools/sync_client.cc index 9d3c51d..1cc3640 100644 --- a/sync/tools/sync_client.cc +++ b/sync/tools/sync_client.cc @@ -310,10 +310,8 @@ int SyncClientMain(int argc, char* argv[]) { const char kUserAgent[] = "sync_client"; // TODO(akalin): Replace this with just the context getter once // HttpPostProviderFactory is removed. - scoped_ptr<HttpPostProviderFactory> post_factory( - new HttpBridgeFactory(context_getter, - kUserAgent, - NetworkTimeUpdateCallback())); + scoped_ptr<HttpPostProviderFactory> post_factory(new HttpBridgeFactory( + context_getter.get(), kUserAgent, NetworkTimeUpdateCallback())); // Used only when committing bookmarks, so it's okay to leave this // as NULL. ExtensionsActivityMonitor* extensions_activity_monitor = NULL; |