Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: webkit/tools/test_shell/simple_resource_loader_bridge.cc

Issue 4192012: Convert implicit scoped_refptr constructor calls to explicit ones, part 1 (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: fix presubmit Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/support/webkit_support.cc ('k') | webkit/tools/test_shell/test_webview_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This file contains an implementation of the ResourceLoaderBridge class. 5 // This file contains an implementation of the ResourceLoaderBridge class.
6 // The class is implemented using URLRequest, meaning it is a "simple" version 6 // The class is implemented using URLRequest, meaning it is a "simple" version
7 // that directly issues requests. The more complicated one used in the 7 // that directly issues requests. The more complicated one used in the
8 // browser uses IPC. 8 // browser uses IPC.
9 // 9 //
10 // Because URLRequest only provides an asynchronous resource loading API, this 10 // Because URLRequest only provides an asynchronous resource loading API, this
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 void SimpleResourceLoaderBridge::SetCookie(const GURL& url, 848 void SimpleResourceLoaderBridge::SetCookie(const GURL& url,
849 const GURL& first_party_for_cookies, 849 const GURL& first_party_for_cookies,
850 const std::string& cookie) { 850 const std::string& cookie) {
851 // Proxy to IO thread to synchronize w/ network loading. 851 // Proxy to IO thread to synchronize w/ network loading.
852 852
853 if (!EnsureIOThread()) { 853 if (!EnsureIOThread()) {
854 NOTREACHED(); 854 NOTREACHED();
855 return; 855 return;
856 } 856 }
857 857
858 scoped_refptr<CookieSetter> cookie_setter = new CookieSetter(); 858 scoped_refptr<CookieSetter> cookie_setter(new CookieSetter());
859 g_io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( 859 g_io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
860 cookie_setter.get(), &CookieSetter::Set, url, cookie)); 860 cookie_setter.get(), &CookieSetter::Set, url, cookie));
861 } 861 }
862 862
863 // static 863 // static
864 std::string SimpleResourceLoaderBridge::GetCookies( 864 std::string SimpleResourceLoaderBridge::GetCookies(
865 const GURL& url, const GURL& first_party_for_cookies) { 865 const GURL& url, const GURL& first_party_for_cookies) {
866 // Proxy to IO thread to synchronize w/ network loading 866 // Proxy to IO thread to synchronize w/ network loading
867 867
868 if (!EnsureIOThread()) { 868 if (!EnsureIOThread()) {
869 NOTREACHED(); 869 NOTREACHED();
870 return std::string(); 870 return std::string();
871 } 871 }
872 872
873 scoped_refptr<CookieGetter> getter = new CookieGetter(); 873 scoped_refptr<CookieGetter> getter(new CookieGetter());
874 874
875 g_io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( 875 g_io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
876 getter.get(), &CookieGetter::Get, url)); 876 getter.get(), &CookieGetter::Get, url));
877 877
878 return getter->GetResult(); 878 return getter->GetResult();
879 } 879 }
880 880
881 // static 881 // static
882 bool SimpleResourceLoaderBridge::EnsureIOThread() { 882 bool SimpleResourceLoaderBridge::EnsureIOThread() {
883 if (g_io_thread) 883 if (g_io_thread)
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 926
927 // static 927 // static
928 scoped_refptr<base::MessageLoopProxy> 928 scoped_refptr<base::MessageLoopProxy>
929 SimpleResourceLoaderBridge::GetIoThread() { 929 SimpleResourceLoaderBridge::GetIoThread() {
930 if (!EnsureIOThread()) { 930 if (!EnsureIOThread()) {
931 LOG(DFATAL) << "Failed to create IO thread."; 931 LOG(DFATAL) << "Failed to create IO thread.";
932 return NULL; 932 return NULL;
933 } 933 }
934 return g_io_thread->message_loop_proxy(); 934 return g_io_thread->message_loop_proxy();
935 } 935 }
OLDNEW
« no previous file with comments | « webkit/support/webkit_support.cc ('k') | webkit/tools/test_shell/test_webview_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698