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

Side by Side Diff: chrome/test/chromedriver/net/net_util.cc

Issue 12226045: Linux/ChromeOS Chromium style checker cleanup, chrome/ edition part 1. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 10 months 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 | « chrome/test/base/web_ui_browsertest.cc ('k') | chrome/test/gpu/gpu_feature_browsertest.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "chrome/test/chromedriver/net/url_request_context_getter.h" 7 #include "chrome/test/chromedriver/net/url_request_context_getter.h"
8 #include "googleurl/src/gurl.h" 8 #include "googleurl/src/gurl.h"
9 #include "net/url_request/url_fetcher.h" 9 #include "net/url_request/url_fetcher.h"
10 #include "net/url_request/url_fetcher_delegate.h" 10 #include "net/url_request/url_fetcher_delegate.h"
(...skipping 11 matching lines...) Expand all
22 MessageLoop loop; 22 MessageLoop loop;
23 scoped_ptr<net::URLFetcher> fetcher_( 23 scoped_ptr<net::URLFetcher> fetcher_(
24 net::URLFetcher::Create(url, net::URLFetcher::GET, this)); 24 net::URLFetcher::Create(url, net::URLFetcher::GET, this));
25 fetcher_->SetRequestContext(getter); 25 fetcher_->SetRequestContext(getter);
26 response_ = response; 26 response_ = response;
27 fetcher_->Start(); 27 fetcher_->Start();
28 loop.Run(); 28 loop.Run();
29 return success_; 29 return success_;
30 } 30 }
31 31
32 virtual void OnURLFetchComplete(const net::URLFetcher* source) { 32 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE {
33 success_ = (source->GetResponseCode() == 200); 33 success_ = (source->GetResponseCode() == 200);
34 if (success_) 34 if (success_)
35 success_ = source->GetResponseAsString(response_); 35 success_ = source->GetResponseAsString(response_);
36 MessageLoop::current()->Quit(); 36 MessageLoop::current()->Quit();
37 } 37 }
38 38
39 private: 39 private:
40 bool success_; 40 bool success_;
41 std::string* response_; 41 std::string* response_;
42 }; 42 };
43 43
44 } // namespace 44 } // namespace
45 45
46 bool FetchUrl(const GURL& url, 46 bool FetchUrl(const GURL& url,
47 URLRequestContextGetter* getter, 47 URLRequestContextGetter* getter,
48 std::string* response) { 48 std::string* response) {
49 return SyncUrlFetcher().Fetch(url, getter, response); 49 return SyncUrlFetcher().Fetch(url, getter, response);
50 } 50 }
OLDNEW
« no previous file with comments | « chrome/test/base/web_ui_browsertest.cc ('k') | chrome/test/gpu/gpu_feature_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698