Commit ed08b098 authored by dcheng's avatar dcheng Committed by Commit bot

Remove implicit conversions from scoped_refptr to T* in chrome/browser/prerender/

This patch was generated by running the rewrite_scoped_refptr clang tool
on a Linux build.

BUG=110610

Review URL: https://codereview.chromium.org/509573002

Cr-Commit-Position: refs/heads/master@{#292199}
parent 6092f83c
...@@ -748,7 +748,7 @@ void PrerenderContents::DestroyWhenUsingTooManyResources() { ...@@ -748,7 +748,7 @@ void PrerenderContents::DestroyWhenUsingTooManyResources() {
WebContents* PrerenderContents::ReleasePrerenderContents() { WebContents* PrerenderContents::ReleasePrerenderContents() {
prerender_contents_->SetDelegate(NULL); prerender_contents_->SetDelegate(NULL);
content::WebContentsObserver::Observe(NULL); content::WebContentsObserver::Observe(NULL);
if (alias_session_storage_namespace) if (alias_session_storage_namespace.get())
alias_session_storage_namespace->RemoveTransactionLogProcessId(child_id_); alias_session_storage_namespace->RemoveTransactionLogProcessId(child_id_);
return prerender_contents_.release(); return prerender_contents_.release();
} }
......
...@@ -21,7 +21,7 @@ PrerenderCookieStore::PrerenderCookieStore( ...@@ -21,7 +21,7 @@ PrerenderCookieStore::PrerenderCookieStore(
cookie_conflict_cb_(cookie_conflict_cb), cookie_conflict_cb_(cookie_conflict_cb),
cookie_conflict_(false) { cookie_conflict_(false) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(default_cookie_monster_ != NULL); DCHECK(default_cookie_monster_.get() != NULL);
DCHECK(default_cookie_monster_->loaded()); DCHECK(default_cookie_monster_->loaded());
} }
...@@ -119,36 +119,37 @@ net::CookieStore* PrerenderCookieStore::GetCookieStoreForCookieOpAndLog( ...@@ -119,36 +119,37 @@ net::CookieStore* PrerenderCookieStore::GetCookieStoreForCookieOpAndLog(
op.op == COOKIE_OP_GET_ALL_COOKIES_FOR_URL_ASYNC); op.op == COOKIE_OP_GET_ALL_COOKIES_FOR_URL_ASYNC);
if (in_forwarding_mode_) if (in_forwarding_mode_)
return default_cookie_monster_; return default_cookie_monster_.get();
DCHECK(changes_cookie_monster_ != NULL); DCHECK(changes_cookie_monster_.get() != NULL);
cookie_ops_.push_back(op); cookie_ops_.push_back(op);
bool key_copied = ContainsKey(copied_keys_, key); bool key_copied = ContainsKey(copied_keys_, key);
if (key_copied) if (key_copied)
return changes_cookie_monster_; return changes_cookie_monster_.get();
if (is_read_only) { if (is_read_only) {
// Insert this key into the set of read keys, if it doesn't exist yet. // Insert this key into the set of read keys, if it doesn't exist yet.
if (!ContainsKey(read_keys_, key)) if (!ContainsKey(read_keys_, key))
read_keys_.insert(key); read_keys_.insert(key);
return default_cookie_monster_; return default_cookie_monster_.get();
} }
// If this method hasn't returned yet, the key has not been copied yet, // If this method hasn't returned yet, the key has not been copied yet,
// and we must copy it due to the requested write operation. // and we must copy it due to the requested write operation.
bool copy_success = default_cookie_monster_-> bool copy_success =
CopyCookiesForKeyToOtherCookieMonster(key, changes_cookie_monster_); default_cookie_monster_->CopyCookiesForKeyToOtherCookieMonster(
key, changes_cookie_monster_.get());
// The copy must succeed. // The copy must succeed.
DCHECK(copy_success); DCHECK(copy_success);
copied_keys_.insert(key); copied_keys_.insert(key);
return changes_cookie_monster_; return changes_cookie_monster_.get();
} }
void PrerenderCookieStore::ApplyChanges(std::vector<GURL>* cookie_change_urls) { void PrerenderCookieStore::ApplyChanges(std::vector<GURL>* cookie_change_urls) {
...@@ -198,7 +199,7 @@ void PrerenderCookieStore::OnCookieChangedForURL( ...@@ -198,7 +199,7 @@ void PrerenderCookieStore::OnCookieChangedForURL(
// If the cookie was changed in a different cookie monster than the one // If the cookie was changed in a different cookie monster than the one
// being decorated, there is nothing to do). // being decorated, there is nothing to do).
if (cookie_monster != default_cookie_monster_) if (cookie_monster != default_cookie_monster_.get())
return; return;
if (in_forwarding_mode_) if (in_forwarding_mode_)
......
...@@ -101,7 +101,7 @@ class PrerenderCookieStore : public net::CookieStore { ...@@ -101,7 +101,7 @@ class PrerenderCookieStore : public net::CookieStore {
const GURL& url); const GURL& url);
net::CookieMonster* default_cookie_monster() { net::CookieMonster* default_cookie_monster() {
return default_cookie_monster_; return default_cookie_monster_.get();
} }
private: private:
......
...@@ -1333,7 +1333,7 @@ void PrerenderLocalPredictor::ContinuePrerenderCheck( ...@@ -1333,7 +1333,7 @@ void PrerenderLocalPredictor::ContinuePrerenderCheck(
continue; continue;
} }
#if defined(FULL_SAFE_BROWSING) #if defined(FULL_SAFE_BROWSING)
if (!SkipLocalPredictorWhitelist() && sb_db_manager && if (!SkipLocalPredictorWhitelist() && sb_db_manager.get() &&
sb_db_manager->CheckSideEffectFreeWhitelistUrl(url_info->url)) { sb_db_manager->CheckSideEffectFreeWhitelistUrl(url_info->url)) {
// If a page is on the side-effect free whitelist, we will just prerender // If a page is on the side-effect free whitelist, we will just prerender
// it without any additional checks. // it without any additional checks.
......
...@@ -166,7 +166,7 @@ void PrerenderTracker::RemovePrerenderCookieStoreOnIOThread(int process_id, ...@@ -166,7 +166,7 @@ void PrerenderTracker::RemovePrerenderCookieStoreOnIOThread(int process_id,
for (std::vector<GURL>::const_iterator url_it = cookie_change_urls.begin(); for (std::vector<GURL>::const_iterator url_it = cookie_change_urls.begin();
url_it != cookie_change_urls.end(); url_it != cookie_change_urls.end();
++url_it) { ++url_it) {
OnCookieChangedForURL(process_id, cookie_monster, *url_it); OnCookieChangedForURL(process_id, cookie_monster.get(), *url_it);
} }
} }
...@@ -175,7 +175,7 @@ void PrerenderTracker::AddPrerenderCookieStoreOnIOThread( ...@@ -175,7 +175,7 @@ void PrerenderTracker::AddPrerenderCookieStoreOnIOThread(
scoped_refptr<net::URLRequestContextGetter> request_context, scoped_refptr<net::URLRequestContextGetter> request_context,
const base::Closure& cookie_conflict_cb) { const base::Closure& cookie_conflict_cb) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(request_context != NULL); DCHECK(request_context.get() != NULL);
net::CookieMonster* cookie_monster = net::CookieMonster* cookie_monster =
request_context->GetURLRequestContext()->cookie_store()-> request_context->GetURLRequestContext()->cookie_store()->
GetCookieMonster(); GetCookieMonster();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment