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

Unified Diff: chrome/browser/chromeos/login/string_fetcher.h

Issue 3026006: Fixed problems with initial locale change freezing Chrome OS on the device.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/string_fetcher.h
===================================================================
--- chrome/browser/chromeos/login/string_fetcher.h (revision 0)
+++ chrome/browser/chromeos/login/string_fetcher.h (revision 0)
@@ -0,0 +1,46 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_STRING_FETCHER_H_
+#define CHROME_BROWSER_CHROMEOS_LOGIN_STRING_FETCHER_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/scoped_ptr.h"
+#include "chrome/common/net/url_fetcher.h"
+
+// This class is used to fetch an URL and store result as a string.
+class StringFetcher : public URLFetcher::Delegate {
+ public:
+ // Initiates URL fetch. Optional auth_token could be passed.
Nikita (slow) 2010/07/19 12:31:19 auth_token is not passed.
+ explicit StringFetcher(const std::string& url);
+ virtual ~StringFetcher() {}
+
+ const std::string& result() const { return result_; }
+ int response_code() const { return response_code_; }
+ bool succeeded() const { return response_code_ == 200; }
+
+ private:
+ // Overriden from URLFetcher::Delegate:
+ virtual void OnURLFetchComplete(const URLFetcher* source,
+ const GURL& url,
+ const URLRequestStatus& status,
+ int response_code,
+ const ResponseCookies& cookies,
+ const std::string& data);
+ // Timer notification handler.
+ void OnTimeoutElapsed();
+
+ // URLFetcher instance.
+ scoped_ptr<URLFetcher> url_fetcher_;
+ // Fetch result.
Nikita (slow) 2010/07/19 12:31:19 empty line between definitions.
+ std::string result_;
+ // Received HTTP response code.
+ int response_code_;
+
+ DISALLOW_COPY_AND_ASSIGN(StringFetcher);
+};
+
+#endif // CHROME_BROWSER_CHROMEOS_LOGIN_STRING_FETCHER_H_
Property changes on: chrome/browser/chromeos/login/string_fetcher.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698